Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Chapter 9. Creating the Asteroid Avoidan... > Faking the side-scrolling effect

9.6. Faking the side-scrolling effect

Did I say faking? So I did! Yes, although this game will look like a side-scroller, you're not actually traveling through the game world. Instead, you're going to recycle all the objects that fall off of the screen and make them reappear on the other side. This gives the effect that you're travelling through an endless game world. A bit of a trick, but it's still a side-scroller.

9.6.1. Recycling the asteroids

Making the game look like your flying through a field of endless asteroids is actually not all that hard. In fact, it's easy! Jump into the animate function and add the following code just above where you draw out each asteroid:


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial