Let’s build a game on Scratch!

Building games on Scratch can be a fun way to practice our coding skills whilst having fun. Follow this guide to code your own Jumping Chick Game on Scratch!

  • Go to the Scratch website: https://scratch.mit.edu/
  • Sign in or register for Scratch
    If you already have a Scratch account, click ‘Sign in’ and enter your login details. Otherwise click ‘Join Scratch’ and create your free Scratch account.
  • Open this starter file: https://scratch.mit.edu/projects/943144013/. This is starter code for the game we’re going to build.
  • Click the “Remix” button to make your own copy of the code
  • Start by clicking on the “Egg” sprite to make sure it’s selected.
  • The Egg’s starting position has been set up for you. We want to make the Egg glide across the screen continuously. To do this, add the following code:

    The forever block will repeat the code that’s inside it forever. In this case, the Egg will glide for 3 seconds to the left, then it will go back to the starting position and repeat.
  • Now let’s switch over to coding the “Chick” by clicking on it.
  • We want the Chick to make a ‘Chirp’ sound and jump and when we click it. To do this, add the following code:

    When the Chick sprite is clicked, a ‘Chirp’ sound will be played. Then we’ll change y by 10 (go up) and repeat that 10 times. Then we’ll change y by -10 (go down) and repeat that 10 times. This simulates a jumping motion. Go ahead and try it by clicking on the Chick!
  • Next we want the game to stop if the Chick touches the Egg. To do this, add the following code beside the previous block of code:

    This code will start running when the Green Flag is clicked. It will wait until the Chick is touched by the Egg, and once that happens it will stop all the sprites.
  • Great, our game should work now! But there’s just one step remaining and that is to keep score so you know how well you’ve done! To do that, click on the orange blocks and ‘Make a Variable’ called Score as follows:
  • Next, we want to increase the score by 1 every time the Chick jumps over the Egg. To do this, add the following block to the Chick’s “when this sprite clicked” block:
  • Lastly, we need to reset the score every time we start a new game. To do this, add the following code:

    This will reset the score to 0 when we click the green flag.
  • And that’s it, awesome work! Click the green flag to play the game.