Star Student Builder logoStar Student BuilderA Learnerโ€™s Guide
โ† Real Games Std 6โ€“8Project 1 of 4

Pong, Properly

๐ŸŽฏ A ball bounces, a paddle follows the mouse, the score rises and the game ends when you miss.

๐Ÿ’ก The idea behind it

Bouncing is just reversing a direction โ€” and a game needs a clear beginning, middle and end.

๐Ÿงฑ Blocks you will need

foreverif on edge, bouncepoint in directiontouching?set score to 0stop all

๐Ÿ”จ Build it

  1. Paddle: forever โ†’ set x to (mouse x). One block, and it feels perfect.
  2. Ball: point in direction (pick random โˆ’45 to 45) โ†’ forever โ†’ move 10 steps โ†’ if on edge, bounce.
  3. Add: if touching paddle โ†’ point in direction (direction ร— โˆ’1) โ†’ move 10 steps. That last move stops it sticking.
  4. Draw a red line along the bottom. If touching red โ†’ say 'Game over' โ†’ stop all.
  5. Add a score that rises on each paddle hit, and speed that rises with it.

๐Ÿš€ Make it harder

  • Add bricks to break, using clones.
  • Add a second player on the keyboard for the top paddle.

๐Ÿž Bugs you will hit

  • The ball sticks to the paddle and vibrates: it is still touching when the direction flips. Add a 'move 10 steps' immediately after the bounce.
  • The ball goes straight up and down and the game is boring: your starting direction has no sideways component โ€” use a random direction that is not near 0 or 180.

โฌ‡ 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