In this session, students will learn how to develop a multiplayer racing game using block programming in Scratch. Scratch is an online platform that allow users to use visual programming to create a wide range of programs.
-Computer.
-Internet access.
-Scratch platform.
Participants will be introduced to the concept of game development, types of games, and block coding.
1- Introduce a client letter explaining the purpose of this workshop.
2- Explain the meaning of Game Development and the steps of it.
3- Explain the meaning of multiplayer games, and the difference between multi and single player games.
4- Explain what is Block coding and the difference between block-based and text-based coding.
5- Introduce the platform we will be using to develop the prototype.
6- Explain the final prototype and how it will be developed.
The participants will design the racing track using the paint tool in Scratch
1- Add a new sprite of the type βPaintβ.
2- Use the βLineβ brush to draw two lines defining the racing path.
3- Use the same brush to draw a dashed line in the path and choose a different color for it.
4- Use the same brush to draw the ending line, where the race ends, and choose the Red color for it.
Participants will add two cars to the environment and change their size and position.
1- Add a new sprite by searching for the purple car object in the collection of objects.
2- Repeat the same step to add another car object, the green car from the collection of objects.
3- Select the purple car from the added sprites panel, then change the size to be 50 instead of 100.
4- Repeat the same step for the green car.
5- Select the purple car and drag it to the start point of the racing track.
6- Repeat the same step for the green car.
Participants will use block coding to program the first car to move separately using different keys.
1- Select the purple car.
2- Open the code section of the platform.
3- Add the two compositions of blocks.
First composition of Blocks:
1- Drag the βWhen Space Key Pressedβ block from the Event category.
2- Drag the βGo to X: Y:β block from the Motion category.
Second composition of Blocks:
1- Drag the βWhen Space Key Pressedβ block from the Event category.
2- Drag the βForeverβ block from the Control category.
3- Drag the βIfβ block from Control category and place it inside the βForeverβ Block.
4- Drag the condition βTouching colorβ from the Sensing, change the color to Red, and connect it to the if statement block.
5- Drag the βSay β¦ for 1 secondβ block from Looks category and change the text to βWinnerβ.
6- Drag the βStop allβ from Control and connect it to the If block.
7- Drag the βIfβ block from Control category and place it inside the βForeverβ Block.
8- Drag the condition βKey β¦ Pressedβ from the Sensing, change the Key to Right arrow, and place it inside the second if statement block.
9- Drag the βPoint in direction β¦.β block from the Motion category and change the value to β90β.
10- Drag the βChange X by β¦β block from the Motion category and change the value to β2β.
11- Drag the βIfβ block from Control category and place it inside the βForeverβ Block.
12- Drag the condition βKey β¦ Pressedβ from the Sensing, change the Key to Left arrow, and place it under the third if statement block.
13- Drag the βPoint in direction β¦.β block from the Motion category and change the value to β90β.
14- Drag the βChange X by β¦β block from the Motion category and change the value to β-2β.
Participants will use block coding to program the first car to move separately using different keys.
1- Select the green car.
2- Open the code section of the platform.
3- Add the two compositions of blocks.
First composition of Blocks:
1- Drag the βWhen Space Key Pressedβ block from the Event category.
2- Drag the βGo to X: Y:β block from the Motion category.
Second composition of Blocks:
1- Drag the βWhen Space Key Pressedβ block from the Event category.
2- Drag the βForeverβ block from the Control category.
3- Drag the βIfβ block from Control category and place it inside the βForeverβ Block.
4- Drag the condition βTouching colorβ from the Sensing, change the color to Red, and connect it to the if statement block.
5- Drag the βSay β¦ for 1 secondβ block from Looks category and change the text to βWinnerβ.
6- Drag the βStop allβ from Control and connect it to the If block.
7- Drag the βIfβ block from Control category and place it inside the βForeverβ Block.
8- Drag the condition βKey β¦ Pressedβ from the Sensing, change the Key to D letter, and place it inside the second if statement block.
9- Drag the βPoint in direction β¦.β block from the Motion category and change the value to β90β.
10- Drag the βChange X by β¦β block from the Motion category and change the value to β2β.
11- Drag the βIfβ block from Control category and place it inside the βForeverβ Block.
12- Drag the condition βKey β¦ Pressedβ from the Sensing, change the Key to S letter, and place it under the third if statement block.
13- Drag the βPoint in direction β¦.β block from the Motion category and change the value to β90β.
14- Drag the βChange X by β¦β block from the Motion category and change the value to β-2β.
Participants will test the final prototype, fix any issues, and share their projects.
1- Play the game and check if the cars are moving separately.
2- Play the game and check if it stops when a car reaches the end line.
3- Fix any issues found.
4- Share the final prototype with other participants.
Having trouble? Let us know by completing the form below. We'll do our best to get your issues resolved quickly.
"*" indicates required fields