Dodge the Ball Game | Scratch Game Codes

Dodge The Ball Game on Scratch

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.

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

DODGE THE BALL GAME SCRATCH CODE

Dodge the Ball Game Tutorial
Scratch 3.0 Game Tutorial

Download Project Files

You can download the project files of Dodge the Ball Game here and find the other interesting scratch 3.0 Tutorial of Animate your name and Tic Tac Toe Scratch Game here.

1 thought on “Dodge the Ball Game | Scratch Game Codes”

  1. I’ve been surfing online more than 3 hours today, yet I never found any interesting article like yours. It’s pretty worth enough for me. Personally, if all site owners and bloggers made good content as you did, the web will be much more useful than ever before.

    Reply

Leave a Comment