Cloning sprites

Someone asked me about duplicating a ball, that would drop down for the game character to dodge..

One of the concepts we looked at last year in Code Club, was creating lots of instances of one sprite. In the simple zombie game I made, this was an easy way to spawn a ton of zombies as the game progresses.

At first, the obvious way to do that is by creating lots of sprites. But that’s probably a bit too much work. Boooo!!

An easier way would be:

  1. If something happens, clone a sprite.

  2. When a clone is created, do things (like make balls move downwards until they hit something).

An activity I looked at for Code Club last year uses clones. It’s called Catch the Dots. The game itself is pretty good fun to play too!

As for doing gravity to make things fall, Al Sweigart explains it really well in his series, InventWithScratch:

Oh, and did you notice that he has a cool tip for running certain parts really fast?