Professional Documents
Culture Documents
Snap - Berkeley.edu/run: Create A "Whack Alonzo" Game
Snap - Berkeley.edu/run: Create A "Whack Alonzo" Game
snap.berkeley.edu/run
PUBLIC
This course material was developed under the Creative Commons Attribution-ShareAlike 4.0 International License CC BY-SA 4.0.
In this project, you can build a small interactive computer game with Snap!’s mascot
Alonzo.
In the game, you can get points by clicking Alonzo, who is randomly hopping around the
stage. But there’s a small twist. Alonzo will get a little more invisible each time you click
him. You hopefully have a quick eye.
You can start by giving your sprite an Alonzo costume from the costume library.
Now you can teach Alonzo, how to move. When the game starts, Alonzo should
repeatedly go to a random position.
If Alonzo is clicked, the player’s score will change. Create a variable to store your score.
Set this variable to 0 when your game starts (green flag is clicked) and change it,
whenever Alonzo is clicked.
Test your current version of the game. Is Alonzo moving to random positions, when the
green flag is clicked? Does your score change, if you click Alonzo?
2
If your game works, you can now add the transparency (ghost effect). If your sprite is
completely visible, its ghost effect is 0. Is it absolutely transparent, the ghost effect is 100.
Refine the “when I am clicked”-script so that Alonzo gets a little more transparent each
time the script runs. Now, you need to click ten times until Alonzo is invisible (ghost effect
= 100).
Test your game! Unfortunately, you can only play once now, because Alonzo stays
invisible.
Now, you can add different difficulty levels. Alonzo could e.g. become
smaller throughout the game or you could reduce the time he waits
before he moves to another position.
Start tinkering and take your ideas to make it your computer game.