Scratch - Create a jumping game

Tools

Computer or tablet with scratch

Step  1 : Add scenario

  • Launch Scratch or mBlock by double clicking on the icon 
  • Change the background following the illustrations

Step  2 : Add obstacle

We are going to add the obstacle for our player:

  • Choose the pufferfish from the gallery. Click "choose a sprite " and choose the pufferfish from the list of elements                       
  • If it's too big, you can reduce its size by decreasing the number in the field "size" from 100 to whatever you need.

    Step  3 : Make the cat jump

    • Bring the cat to the initial position. Click on the cat and drag it to the position where you want it at the beginning of the scene. Then insert a block "Go to x: .. y: .." from the movement category right below the beginning of the program
    • Add movement to the cat, changing its costume every one second. Insert a loop ("Forever" block from the control category on the left). In the loop, insert a "Next costume" block and then a one second pause.
    • Make it jump when clicking with the mouse: We add the event "when this sprite clicked", so this part is executed when we click on the cat. It will change the vertical position up and after 3 seconds it will go back to the initial position.

    Step  4 : Make the pufferfish move

    • Select the pufferfish
    • Add the "Go to x...: y:" block with the position where you want it at the beginning of the scene (right end of the screen)
    • Add a loop with the "forever" block
    • Add a "Glide ... to x:... y:..."block. The first number of this block will indicate the speed of the pufferfish, the second and third will indicate the left limit of the scene
    • Add an "If...then" block within the loop. The conditions should be: if the pufferfish reaches the left limit of the scene, it will restart from the right of the scene

    Step  5 : Add end of the game

    The game ends when the cat touches the object. We are going to add this to the scene.

    • Click on the cat to activate it
    • Add the following condition: wait until the cat touches the pufferfish and then:
      • start sound
      • say "oh!"