Click game: points and time
Medium · A full game: the sprite runs away when clicked, you score points and time runs out in 20 seconds.
Interactive tutorial: the editor checks each step by itself.
- Choose a sprite. It will run away from you!
- Open Variables and click "Make a variable". Name it "points".
- Drag "when green flag clicked" (Events) and snap "set points to 0" below.
- In Sensing, also snap "reset timer" below the flag.
- Make another script: "when this sprite clicked" (Events).
- Below it, snap "change points by 1" (Variables).
- Also snap "go to random position" (Motion): it runs away!
- In the flag script, add a "forever" (Control) and an "if … then" inside it.
- In the "if" slot, put "… > 50" (Operators) with "timer" (Sensing) on the left and 20 on the right.
- Inside the "if", snap "say Hello! for 2 seconds" and then "stop all" (Control).
- Click the flag and try to score many points in 20 seconds!
- Challenge: show the points at the end by replacing "Hello!" with "join Points: with points" (Operators). (challenge)