top of page

Scratch Football tutorial

First two parts of the projects are described by McGuy in YouTube videos

https://www.youtube.com/watch?v=qOBG-yMCPAo

Part 3

Add country flags

football1.PNG
  • Now add code to select a default flag and change the flag whenever user clicks on it

football2.PNG
  • Duplicate the flag sprite and move it to the other goal. You can change the default flag.

Let’s end the game after 90 seconds passed

  • We will use the timer under Sensing but we also need a new variable to display stop the timer after end of the game

football3.PNG
  • Now, within the Ball sprite context add initial setup of the timers and an “if else” statement at the bottom of forever loop. This will end the game after timer passed the limit (90sec)

football4.PNG

The timer starts now before users can choose their flags. Let’s fix it by introducing additional step at the beginning of the game

  • Find a sprite which could work as a button and place the following code behind it

football5.PNG
  • Now we will broadcast a new message whenever user clicks the button. Add the following code within context of the button

football6.PNG
  • The players will have to intercept the message and . Modify the code for both of them so that forever loop starts only after the new message is received

football7.PNG

Now add some sounds effects for kick off (a whistle), goal scored (cheering) and end of the game.

© 2021 by OhSnapCoders & Pawel Wasilewski. Proudly created with Wix.com

  • Facebook Social Icon
  • Twitter Social Icon
  • Google+ Social Icon
bottom of page