Drawing and animating a Hungry Cat Racer

Ending the Game

The game ends when the dog eats the cat or, in this context, when the dog and the cat touch. I won't show the scripts for the dog, because positioning and moving the dog along the road can be very similar to the cat's movement already discussed. You can find the scripts if you download the project [1].

Customizing Game Play

As the game stands, there is one reward and one obstacle. One way to create challenging game play is to add more rewards and obstacles. In Scratch 1.4, the way to do that is to duplicate the sprites, which will duplicate the scripts for each sprite, too. Thus, it makes sense to create, play, troubleshoot, and update your scripts before you duplicate them.

I drew inspiration from a Scratch 2.0 project that handles the generation of the sprites using a clone feature, which is not available in Scratch 1.4. If you have access to a non-Pi computer using Flash, you can check out the project online [2].

Speeding up the rate of the rewards and obstacles based on either time or score will also create a more challenging environment. If the animations are running more slowly than you might like on the Raspberry Pi, you can try increasing the number of steps a sprite moves.

Of course, drawing the individual frames of an animation opens the opportunity for an infinite amount of customizations and personality. Happy Scratchin'.

The Author

Michael Badger is author of Scratch 1.4: Beginner's Guide and Scratch 2.0: Beginner's Guide from Packt Publishing. Learn more at http://scratchguide.com.

Buy this article as PDF

Express-Checkout as PDF

Pages: 4

Price $2.95
(incl. VAT)

Buy Raspberry Pi Geek

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content