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
  • PrintPrint
Share this Page URL

Chapter 10: Advanced Object And Characte... > Case study: Killer Bee Pandemonium!

Case study: Killer Bee Pandemonium!

We've made a lot of fun little toys in this chapter, and it doesn't take much work to turn them into a real game. What would happen if we put Button Fairy in the same environment as Killer Bee? We'd get an all-out power shootout between two arch enemies in Killer Bee Pandemonium!, which you'll find in the source files. Run the SWF file and play the game, which you can see in Figure 10-11.


Figure 10-11. Can Button Fairy save the woodland creatures from the grumpy Killer Bee?

Button Fairy can fly around the screen and shoot the bee. The Killer Bee flies toward her and fires bullets if she's within range. The scoreboards at the top of the stage keep track of the number of hits each has achieved.

All the objects in the game are made using the general GameObject class, so there are no custom classes to keep track of. That keeps the game structure and code really simple, and you can find out everything you need to know about how the game works just by looking at the application class. The application class doesn't contain any new code at all; it's just an everything-but-the-kitchen-sink example using most of the code we've already covered in this chapter. The one thing to keep an eye on, however, is the loops that move the star and bullet projectiles and check them for collisions. The loops have to make sure that they don't check for collisions with projectiles that they've already removed. We'll take a closer look at how this works ahead.


You are currently reading a PREVIEW of this book.


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


Start a Free 10-Day Trial

  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint