Doha Racing by Scratch - SCOPES Digital Fabrication

Lesson Details

Age Ranges
5-8
Standards
Fab-Programming.2, Fab-Design.2
Author
Additional Contributors

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

Author

Sarah Boussaa
Sarah Boussaa
Informal educator
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

ΒΆ