Doha Racing by Scratch – SCOPES Digital Fabrication

You need to login or register to bookmark/favorite this content.

Author

Sarah Boussaa
Sarah Boussaa
Informal educator
[10:48 AM] Sarah Busaaa Sarah Boussaa, an Edu-Tech engineer assistant in Studio 56 Fablab, Computer science graduate, passionate about teaching Technology and Digital fabrication to the coming generations, love outdoor activities with family and friends. Read More

Summary

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. 

What You'll Need

-Computer.

-Internet access.

-Scratch platform.

The Instructions

Presentation

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. 

 

Design the race track

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.

Add cars

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.

 

Coding the first 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”.

 

 

 

 

 

 

 

Coding the second car

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”.

 

 

 

 

 

 

 

Test the game

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.

 

Standards

  • (Fab-Programming.2): I can create a program with more than one instruction.
  • (Fab-Design.2): I can participate in design reviews with prepared presentation materials as well as give and receive feedback from peers.

Lesson Feedback