Create a Racing Game in Scratch
This is my guide to creating a racing game in Scratch. Scratch is a good piece of software because you can create good, fun games as soon as you know the basics.
Steps
- Open Scratch.
- When you open Scratch it should look like this.
- Get rid of the cat. When it has opened, you will notice that it has a cat in the middle of the white part of the screen. We do not want that there, so what we do is look below the white part, and it should have another picture of the cat with the writing "Sprite1" underneath it. Right-click on this, and then click delete.
- This will clear your screen of all sprites. Now it should be a blank Scratch document.
- Start creating your game!
- Create a new 'Sprite'. Sprites are like characters, they are the thing that you will be controlling in your game. However, you can also use sprites for different things, e.g. displaying how many lives you have etc.
- To make a new sprite, click on the button that the arrow is pointing to in this picture:
- When you left click on that it will open up a designing window.
- You should be familiar with these tools that they offer to design your sprite. You can make it look like what ever you want BUT it has to be a race car.
- When you have created your sprite, click 'OK' and this will import your created sprite into the game.
- After you have created the sprite, create the background or the "Stage".
- To do this, click on the stage option, that is marked by the arrow in this picture.
- When you left click on here, it will open the stage section. From here, you will see 3 tabs at the top of the middle section called; 'Scripts', 'Backgrounds' and 'Sounds'. Left click on 'Backgrounds'. Then click 'Edit' on the plain background that is already there.
- Clicking on 'Edit' and it will open up the designing window again, from here, create a racetrack.
- This is my completed sprite version:
- Now that you have created the racetrack and the race car all you need to do now is be able to move it around.
- To move the race car around, enter this in the middle section:
- When you have finished all of the sprites and the stage you want you can now make your game more realistic. For example, I am going to add laps.
- To do this, you must add a new sprite. If you are unsure how to do this, look back at steps 7, 8, 9 and 10.
- This sprite we are going to create now is the start/finish line. (WARNING: Make sure that it is a different colour to a colour that you are not using for other sprites)
- Mine looks like this:
- Another thing that you will have too add now is where to make your cars appear when the green flag is clicked.
- To find the place where you have to make them appear, you have to put your mouse over a position where your sprites (Car) isn't touching the the finish line. Then you have to enter them into a code, the code should look like this:
- Where it says 'Point in direction -90' that is telling me which way my car will point when I click the green flag, because mine is -90, it means it will appear facing left.
- All you have to do now is enter the coding! Make sure that it is the same as this:
- Now that you have entered the way to move around the track, you can now play it!
- You can add some extra things if you wish to make your game look and feel a bit more realistic or challenging! Things like; Timers, collectibles, shortcuts, and many more things!
Related Articles
- Make a Scratch Project