Star Student Builder logoStar Student BuilderA Learnerโ€™s Guide
โ† Animation and First Games Std 3โ€“5Project 2 of 4

Catch the Falling Apples

๐ŸŽฏ Apples fall from the top; move the basket with the arrow keys to catch them. Each catch scores a point.

๐Ÿ’ก The idea behind it

A game is a loop that checks for things happening โ€” and a variable that remembers what happened.

๐Ÿงฑ Blocks you will need

foreverif touching?go to x: y:pick randomset score to 0change score by 1key pressed?

๐Ÿ”จ Build it

  1. Make a variable called score. Set it to 0 when the flag is clicked โ€” this matters more than it looks.
  2. The basket: forever โ†’ if key right arrow pressed, change x by 10; if left arrow pressed, change x by โˆ’10.
  3. The apple: go to x (pick random โˆ’220 to 220) y 180, then forever โ†’ change y by โˆ’5.
  4. Inside that loop: if touching basket โ†’ change score by 1 โ†’ go back to the top at a new random x.
  5. Also: if y position < โˆ’170, go back to the top without scoring โ€” a missed apple.

๐Ÿš€ Make it harder

  • Add a lives variable that goes down when an apple is missed, and stop the game at zero.
  • Make the apples speed up as the score rises.

๐Ÿž Bugs you will hit

  • The score keeps growing from the last game: you forgot 'set score to 0' at the start.
  • One apple scores many points: it must move away immediately after touching, in the same if block.
  • The basket moves in jerks: use 'change x by' inside a forever loop rather than the 'when key pressed' event.

โฌ‡ Need Scratch itself?

Free from MIT, in a browser or as an offline app that needs no connection at all.

Get it โ†’
Ask GuruAcharya Samayeshwar