About Dodge the Ball Game:

 

The aim of the Dodge the Ball Game is to control the Giga and dodge the ball coming his way for as long as possible. Basically this is a game of survival and the challenge essentially is to stay in the game for as long as possible.

Game Scratch Code

Scratch 3.0 Game Tutorial

Dodge the Ball Game Scratch 3.0 Tutorial

Time needed: 1 hour.

Step by step Dodge the Ball Game Tutorial

  1. Moving sprites around the Stage

     

  2. Falling Ball Continuously

     

  3. Add Score to the game

     

  4. Add lives to the Game

     

  5. Add Game Over Screen

     

1: Moving sprites around the Stage

Add code blocks to your character sprite Giga so that the player can use the arrow keys to move the character around.

When the player presses the right arrow, the character should point right, move a few steps, and change to the next costume.

When the player presses the right arrow, the character should point right, move a few steps, and change to the next costume.

2: Falling Ball Continuously

In Scratch, choose a new sprite to fall. In this project we used ball. Make your sprite start from a random spot at the top. Then, make it fall down repeatedly.

3: Add Score to the game

Let’s make things more interesting by keeping score.

  • To keep the player’s score, you’ll need to create a variable. Click the bright orange Data category in the blocks palette and then click Make a Variable.
  • Type score as the name of the variable, make sure that it is available for all sprites, and click OK to create it.
  • You’ll also see the score in the top-left of the stage.
  • When a new game is started (by clicking the flag), you should set the player’s score to 0. Add this code to the Stage in order to set the score at the start of the game.
  • Whenever a ball touches ground, you need to add 1 to the player’s score. Add this code to your Giga sprite.

4: Add lives to the Game

  • Make game even more interesting by adding lives to the game.
  • Create one more variable, name it lives, make sure that it is available for all sprites, and click OK to create it.
  • when a green flag clicked, set the lives to 3. The number of lives, the game should start with.
  • When Giga touches the ball, the lives should decrease by 1.
  • To make game even more exciting, You can also add sound effects for loosing lives.

5: Add Game Over Screen

End the game when Giga runs out of lives. This happens when lives=0.

Create a new background, name it Game Over screen

Download Project Files

You can download the project files of Dodge the Ball Game here and find the one more interesting scratch 3.0 Tutorial of Animate your name here.