Giving the Player Feedback

Now the game is challenging, but players can't tell how well they're doing because Alonzo jumps around whether the player clicks him or not. On this page, you will create a way for the player of your game to know how well they are doing.

Confirming Whether Alonzo Was Clicked

First, the person playing your game wants to know right away whether they succeeded at clicking Alonzo before he moved out of the way.

: Sprites and Costumes

The Alonzo character is named after Alonzo Church, a major contributor to early computer science. In this project, there are three objects related to Alonzo:

Program Alonzo to face the other way when clicked. Alonzo character Alonzo character flipped to face the other way
  1. The project you loaded has two Alonzo costumes—one facing right and the other facing left—so you can use the next costume block to make the sprite face the other way. Add the next costume block to the place in your program where the user has just clicked on Alonzo.
  2. Test your program. Make sure Alonzo faces the other way when he is clicked but not when he jumps without being clicked.

Keeping Score

The player will also want to know how much progress they have made in the game. The command change (ghost) effect by () can control Alonzo's transparency.

The transparency of an image is how much you can see what's behind it. For example, here is the Alonzo sprite shown with three different transparencies (which have been set using the ghost effect block).
three pictures of Alonzo, with ghost effect 0%, 25%, and 50%, on a background of a brick wall

Use transparency to tell the user how close they are to winning: every time they click, Alonzo gets more invisible, and when he disappears completely, they win the game.

  1. Drag the change (ghost) effect block into the center scripting area, and experiment with different input numbers (clicking it repeatedly after each change) to see exactly what it does. At what ghost effect value does Alonzo become completely invisible? You can use the command clear graphic effects to make Alonzo fully opaque again.
  2. Then, modify your script so that every time Alonzo is clicked, he gets a little more ghostly. Think about how the input you use affects the length of the game. Try out your game.

Making the Game More Challenging

So far, even a bad player will eventually make Alonzo disappear. The game will be much more interesting if the player is penalized for missing a click.

  1. Figure out where to add a change (ghost) effect by (-5) block to your script to make Alonzo get less transparent any time he moves without being clicked.
  2. Play your game a few times, and adjust your code to get a level of difficulty that you like.
  3. You can change the change effect input number (for either instance of the block) and/or the wait time to make the game easier or harder.

Ending the Game

When Alonzo is completely transparent, the game should stop.

  1. Add this code to the right place in your script to end the game.
    if ((ghost effect) = 100) {clear graphic effects, stop all}
  2. Save your work