Skip to content

rpriyanshu/RPSLS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rock Paper Scissors Lizard Spock

Single-player Android game built in Unity.

Game Rules

Hand Beats
Rock Scissors, Lizard
Paper Rock, Spock
Scissors Paper, Lizard
Lizard Paper, Spock
Spock Rock, Scissors

Gameplay

  1. Tap PLAY
  2. Select a hand within 1 second
  3. Win → Score +1, next round
  4. Tie → Next round (no change)
  5. Lose/Timeout → Game Over

Project Structure

Assets/Scripts/
├── Core/
│   └── GameManager.cs       # Singleton, state management
├── Data/
│   ├── GameEnums.cs         # Hand, RoundResult, GameState
│   └── GameConfig.cs        # ScriptableObject settings
├── Gameplay/
│   └── RoundController.cs   # Round logic, AI, scoring
└── UI/
    └── UIController.cs      # All UI handling

5 scripts, ~350 lines total

Design Patterns

  • Singleton - GameManager.Instance
  • State Pattern - Enum-based state machine

Unity Setup

1. Create GameConfig

Right-click Assets/Resources → Create → RPSLS → GameConfig

2. Scene Hierarchy

├── GameManager (empty GO + GameManager.cs)
├── Canvas
│   ├── MainMenuPanel
│   │   ├── HighScoreText (TMP)
│   │   └── PlayButton
│   ├── GameplayPanel
│   │   ├── ScoreText (TMP)
│   │   ├── TimerFill (Image, Filled Horizontal)
│   │   ├── TimerText (TMP)
│   │   ├── AIHandText (TMP): "?"
│   │   └── HandButtons [5] (Rock, Paper, Scissors, Lizard, Spock)
│   ├── ResultOverlay
│   │   ├── ResultBackground (Image)
│   │   └── ResultText (TMP)
│   └── GameOverPanel
│       ├── FinalScoreText (TMP)
│       ├── HighScoreText (TMP)
│       ├── PlayAgainButton
│       └── MenuButton
├── UIController (empty GO + UIController.cs)
└── EventSystem

3. Important Settings

  • Canvas Scaler: Scale With Screen Size (1080x1920, Match 0.5)
  • TimerFill: Image Type = Filled, Fill Method = Horizontal
  • Hand buttons must be in order: Rock(0), Paper(1), Scissors(2), Lizard(3), Spock(4)

Build

  1. File → Build Settings → Android
  2. Player Settings: Package name, Min API 22, Portrait
  3. Build APK

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors