About Rock Paper and Scissor Scratch Game:

Rock Paper and Scissor is a popular game. Rock, paper scissors is played between two people, both of them choosing one out of the three options- Rock, Paper, Scissor. Then, according to certain rules, one of the two is declared the winner.

Before going to the coding part, analyze and break down the game.

Lets sketch out Rock, Paper, and Scissors game

  • It is a tie when both the player and the computer choices are same.
  • Rock wins over Scissors and loses to Paper
  • Paper wins over Rock and loses to Scissors
  • Scissors wins over Paper and loses to Rock

For this game we need Five Sprites – Rock, Paper, Scissor, Computer, and Referee.

Make the Player to choose

Create a variable called ‘Player Choice’, this will hold the player’s choice – Rock, Paper, Scissor.

Import the three sprite named – Rock, Paper and Scissor from the library. Program these three sprite, so that , when this sprite is clicked, set the Player’s choice to 1, 2 and 3 accordingly.

Player Choice 1 means ‘Rock’, Player Choice 2 means ‘Scissor’ and Player Choice 3 means ‘paper’.

After player made his choice, broadcast message ‘Choice Made’ to the computer.

Make the computer to choose randomly

First import the ‘Computer sprite’ from Library. As the Computer is making its choices randomly in this game, add three costume to it, name it accordingly- Rock, paper Scissor.

Create a variable called ‘Computer Choice’, this will hold the computer’s choice – Rock, Paper, Scissor.

When it receive the message ‘Choice Made’, set the computer responds with a random choice – 1, 2, 3.

Computer Choice 1 means ‘Rock’, Computer Choice 2 means ‘Scissor’ and Computer Choice 3 means ‘paper’.

Then, broadcast the message ‘Check For Winner’ to the Referee.

Rock Paper and Scissor Scratch Game Code

Rock Paper and Scissor – Step by step tutorial on scratch games

Make the referee Decider

It makes the decision as to whether the round is a Tie, or Player win  or Computer win.

  • The first three condition checks whether the choice of both the player and computer is the same. If it is then, no points are awarded to anyone.
    The following six conditions work according to the basic concepts of the game. The winner is decided, and points are awarded accordingly.
  • If the ‘Player choice = Rock’ and ‘Computer choice = Scissor’, it will switch costume to ‘Player win’. Player Score increase by 1.
  • If the ‘Player choice = Rock’ and ‘Computer choice = Paper’, it will switch costume to ‘Computer win’. Computer Score increase by 1.
  • If the ‘Player choice = Scissor’ and ‘Computer choice = Rock’, it will switch costume to ‘Computer win’. Computer Score increase by 1.
  • If the ‘Player choice = Scissor’ and ‘Computer choice = Paper’, it will switch costume to ‘Player win’. Player Score increase by 1.
  • If the ‘Player choice = Paper’ and ‘Computer choice = Rock’, it will switch costume to ‘Player win’. Player Score increase by 1.
  • If the ‘Player choice = Paper’ and ‘Computer choice = Scissor’, it will switch costume to ‘Computer win’. Computer Score increase by 1.

Keep Track of the Score

We also need to keep the count of points scored by both – Player and Computer. Create 2 variables called Player Score and Computer Score. Who won?. Program the  rock, paper, scissors game so that,  who make it a best of 3 or best of 5 games, win the game!

After one character (Player or Computer) gets 5 points, declare the winner and stop the game. The scores should also be zeroed out so the game is ready for the next round.

Rock Paper and Scissor Scratch Game Prject Files:

To download the project files of the Rock Paper and Scissor Scratch Game Click here. Also go through the another interesting scratch 3.0 project of Dodge the ball scratch game and How To Make Brick Breaker Game On Scratch here.