Home > Articles > Programming

  • Print
  • + Share This
This chapter is from the book


Okay, here is a fun project for you to try out. This challenge gives you some more experience using graphical effects, implementing broadcasts, and responding to the player’s keyboard input.

Here are the design goals for this project:

  • Have the Scratch Cat instruct the player to press the spacebar (or another key of your choosing) to transform the sprite into a butterfly.

  • Use graphical effects to pixelate the Cat and have it “become” a butterfly.

  • Have the butterfly “tell” the gamer that he or she can use the arrow keys to move the butterfly around the Stage.

  • Code the butterfly for player control.

Figure 5.8 shows a screenshot of my version of this game, and you can also examine the solution file Hour05d.sb2.


FIGURE 5.8 A screen capture from the Hour 5 Challenge project (Hour05d.sb2).

Remember that you need to download and install the free Scratch Offline Editor (http://is.gd/sB2h1k) to view the solution files. You’ll learn everything there is to know about the Offline Editor in Hour 18, “Using the Scratch Offline Editor.”

Before finishing this hour, though, it’s only fair to discuss the pixelate graphic effect just a little because you didn’t use it at all earlier in this hour.

As you can see in Figure 5.9, all you have to do is to wrap a change pixelate effect by block inside of a repeat C block. Test out this sample code block on one of your sprites and experiment with different pixelate intensities.


FIGURE 5.9 Pixelating a sprite has a cool retro effect that is useful for transitions.

Also, please understand that there is no shame at all in turning to the Scratch project gallery (http://is.gd/tsr9gM) for help when you get stuck. For example, you can search for projects that include the word pixelate in their title or description, or you can do a tag search for the same term.

Most Scratchers are actually complimented when other Scratchers remix their projects. That’s what the community effort of Scratch is all about, after all.

  • + Share This
  • 🔖 Save To Your Account