Introduction to Scratch & Coding

Understanding Variables

A variable is like a box that stores information. In this game, it stores the score.

Adding Sprites

Choose your sprites:

  • Good sprite: Balloon
  • Bad sprite: Bomb (painted using circle + brush)

Balloon Movement

  • Events → when green flag clicked
  • Control → forever
  • Motion → go to random position
  • Control → wait (random time)

Use Operators → pick random 0.9 to 2.9

→ Makes the balloon move unpredictably.

Balloon Click Reaction

  • Events → when this sprite clicked
  • Sound → play pop
  • Data → change Score by 1

Resetting Score

Events → when green flag clicked → Data → set Score to 0

Bomb Movement

Same as balloon:

  • Random position
  • Random wait

Bomb Click Reaction

  • Events → when this sprite clicked
  • Sound → oops
  • Data → change Score by -1

What Students Learned

  • What variables are
  • How to create them
  • Increasing and decreasing values
  • Random delays
  • Random movement
  • Basic game logic

Assignment

Create your own clicker game:

  • Good + bad objects
  • Increase points for good
  • Decrease points for bad
  • Add sounds
  • Add special effects

Example ideas:

  • Fruit Ninja
  • Catch the treasure
  • Space clicker