This wikiHow teaches you how to create a basic racing game using MIT's free Scratch program. The main point of this racing game is to complete the track in as little time as possible without crashing. Open Scratch. Go to...
Part 1 of 4:
Setting up Your Track
Open Scratch. Go to https://scratch.mit.edu/ in your computer's web browser.
Click Create. It's a tab at the top of the page. Doing so opens the Scratch interface.

Close the "All Tips" sidebar. Click the X in the list of tips on the right side of the page. While not completely necessary, doing this will make it easier to work in Scratch's interface.
Enter a title. In the text box with "Untitled" written in it that's in the upper-left corner of the page, enter your game's title (e.g., "My Racing Game").
Delete the cat-shaped sprite. Right-click the cat in the "Sprites" window that's in the lower-left side of the page, then click delete in the resulting drop-down menu.
Click the Backdrops tab. It's at the top of the Scratch page.
Fill in the background. Before you can draw your track, you'll need to create the background on which the track resides:
Draw your track. You can make your track as uniform or irregular as you like:
Add a finish/start line. Select a color that's different than the one you used for the background and the track, then decrease the brush's width and draw a line across the place in which you want the race to finish.Part 2 of 4:
Creating a Racer

Click the "Paint new sprite" icon. It's a brush-shaped line in the upper-right side of the "Sprites" pane, which is in the lower-left side of the page.
Zoom in. Click the "Zoom in" icon, which resembles a magnifying glass icon with a + in it, at least four times. You should see the large + icon in the middle of the right-hand pane grow larger.
Draw your racer. Using the brush, draw your racer however you like.
Draw a crashed racer. Click the brush shaped "Paint new costume" icon below the "New costume" heading, then draw a crashed (or otherwise different) version of your racer. This is the version which will display if your racer touches the grass or any other obstacles you define later.
Select your first racer. On the left side of the pane in which you were drawing your racers, click the first one you drew.
Drag your racer to the starting position in front of the finish line. You'll do this in the left-hand pane. Doing so will ensure that your racer is in the correct starting position when you go to create your script.Part 3 of 4:
Creating a Starting Position

Click the Scripts tab. You'll find this at the top of the Scratch page.

Click Events. It's an option just below the Scripts tab. Doing so brings up a list of event-based code brackets.

Add the "when flag clicked" event to the pane. Click and drag the "when [green flag] clicked" icon onto the right-hand pane, then release it there.

Click Motion. This blue link is in the Scripts section.
Add your racer's starting location. This will determine where your racer starts whenever you begin a new game:
Change the starting position. Drag the "point in direction 90" event from the "Motion" menu to fit under the "go to x y" box. This will ensure that your car is facing the correct direction when the flag is clicked.

Indicate which costume to use. Click Looks, then drag "switch costume to costume2" to fit below the starting position, click the "costume2" box, and select costume1. This causes your racer to revert to its non-crashed costume when you reset the game.
Part 4 of 4:
Creating Movement Rules
Add a movement script. This is the script which your racer will use to move forward:[1]
Create controls. You'll use the following script to assign turning controls to your racer:
Add motions to the controls. This is how you'll use the arrow keys to turn your racer:
Create an out-of-bounds rule. Using this rule will ensure that, should your racer touch the background color (not the track), it will "crash":
Make a finish line reaction. The following script will create a victory message once your racer crosses the finish line:
Test your game. Zoom out by clicking the - icon in the bottom-right side of the backdrop area, click the green flag above the left-hand pane, and then use the arrow keys to maneuver around your track. You should be able to reach the finish line without crashing.Update 05 March 2020
ncG1vNJzZmismaXArq3KnmWcp51ktbDDjK2mZpuimq61sYyaZKuZk567qHnGmqSeZZmjerSv0ZqrnKA%3D