Rowan's+Catch+The+Scratch+Game+Tutorial

Rowan McAllister Lower school game Catch The Scratch Lab

First we need to choose the “sprites” to work with. I chose a bird and a bat, but you can choose any sprite you want. I also chose to use the scratch symbol as the object we are trying to catch.

Next we have to set up controls for each sprite. This involves making “if statements” for each direction. To start, we will use a “wait until” block to only let the sprite start moving when one of the arrow keys is pressed. To allow for the left and right directions, we want to use the “point in direction” block to make the sprite look to the right or left. Then we need to use the “change x by” block to make the sprite move. For the up and down directions, we need to use the “change y by” block to make the sprite move up and down, which also causes the sprite to fall slowly unless the up arrow is clicked. These “if statements” will all be put in a “forever” block. In the end, it should look like this.



Next we will animate the sprite while it moves. To do this, we will make an “if else” block where the sprite changes costumes if the arrow keys are clicked. In the end it should look like this.

Now we have the motion and the animation for the sprite. Next we have to make the game challenging by introducing obstacles and challenges. The first obstacle will be the course the sprite has to navigate. In this piece of script, you will use the “if touching X color then” block, and you must choose the color. The script says that if your character is touching that color of wall, the player will gain damage. In order to do this, you have to draw a set of walls on your stage which the sprite will have to navigate. Then you have to make a variable called “damage”. This variable will count how many times the sprite touches the wall. In order to do this, you will need to make an “if statement” that says if the sprite is touching a certain color, change damage by 1. Then we will include a short pause to prevent the damage counter from counting too fast. In the end, it should look like this.

The first challenge is the objective of the game, to catch the scratch. To do this, we will make a sprite which moves to different random places around the stage. The script for this sprite will require an “if” block which says, if this sprite touches the other sprite, it will move to a random place. It should look like this.

The next part of this games script will be the damage cap. This piece of script will be added to all of the sprites’ scripts to end the game when the damage is above a certain value.

For this stage, we will use a variation of this code to change the background. In order to do this, we have to make two stages for the game: a playing screen, and an end screen. The code will start the game with the playing screen and switch to the end screen when the player has a certain amount of damage.

Finally, to make the game look finished, we will add some pieces of code to reset the variables when the green flag is clicked.

At this point, the game should be finished.

Challenge: Try to make two players. Solution: