Home > Articles > Programming

Programming Animated Backgrounds and Explosion Sprites

  • PrintPrint
  • Share ThisShare This
  • DiscussDiscuss
Close Window

Michael Morrison

Learn more…

Sorry, this author hasn't posted any blogs.

This lesson guides you through the design and development of a game called Meteor Defense that is loosely based upon the classic Missile Command arcade game. Along with demonstrating a variety of different game programming techniques, the Meteor Defense game shows how to take advantage of animated backgrounds and explosion sprites.

See all Sams Teach Yourself on InformIT Programming Tutorials.

This hour guides you through the design and development of another complete game. You've spent the past couple of hours learning how to animate the appearance of sprites and spruce up the background of games, and it's now time to put this knowledge to work in an entirely new game. The game is called Meteor Defense, and it is loosely based on the classic Missile Command arcade game. Seeing as how there have been several news reports in the past few years about the potential of a significant meteor collision with the Earth, I thought it might make a neat premise for a game. It wouldn't necessarily be a bad idea to have a missile-based system for stopping incoming meteors, which is the premise behind the game Meteor Defense.

In this hour, you'll learn:

  • About the conceptual overview of the Meteor Defense game

  • How to design the Meteor Defense game

  • How to add a few new sprite features to the game engine

  • What it takes to build the Meteor Defense game

  • How much fun it can be testing a new game

How Does the Game Play?

One of the classic arcade games that many people remember is Missile Command, which involves the defense of a group of cities against a nuclear attack. The nuclear attack involves missiles that travel down from the top of the screen toward the cities at the bottom. Your job is to fire upon the missiles and destroy them before they reach the cities. Although Missile Command made for an interesting game in the era of the hit movie War Games, the threat of nuclear attack is somewhat diminished these days, at least in terms of what most of us perceive as a realistic threat. However, there has been increasing talk in the past few years of the possibility of a meteor striking the Earth and causing major damage.

The premise of the game you develop in this hour is similar to Missile Command in that you're defending helpless cities against an incoming threat. In this case, however, the threat is giant meteors, not nuclear warheads. The Meteor Defense game employs a game play strategy similar to Missile Command in that you fire missiles at the incoming meteors to stop them from destroying the cities below. As you'll find out, the critical skill to becoming a good player at Meteor Defense (and Missile Command as well) is learning how to target a meteor and give a missile time to get there. In other words, you often have to lead a meteor by a certain distance to give the missile time to get there and make contact.

The object of Meteor Defense is to simply protect the cities against the incoming meteors for as long as possible. One interesting aspect of the game is that you lose points whenever you fire a missile, which makes it important to be efficient when you fire on the meteors. In other words, if you unleash missiles indiscriminately, you will no doubt protect the cities but your score will suffer. This is a subtle way to discourage sloppy game play. Small touches like this can often make a game much more appealing to serious game players.

  • Share ThisShare This
  • Your Account

Discussions

Make a New Comment

You must log in in order to post a comment.

Related Resources

Jennifer  BortelWin FREE iPhone Developer Books and Videos- Introducing @InformIT Giveaways
By Jennifer Bortel on February 5, 2010 No Comments

Apples’s recent iPad announcement made our hearts flutter so we couldn’t resist making an announcement of our own!

Today marks the first ever @InformIT Giveaway!

We’ll regularly post a video like this one profiling spectacular prizes we’re giving away—from books and videos to T-shirts and other exciting stuff. Check out the video below to see the giveaways for today, and then scroll down for more prize details and instructions on how to win them!

Dustin Sullivan"Every OSX developer should have this book on their desk."
By Dustin Sullivan on February 1, 2010 No Comments

That was the sentence Mike Riley ended his recent Dr Dobb's CodeTalk review of Cocoa Programming Developer's Handbook with.

David ChisnallCocoa Tip of the Day, 1/29/10
By David Chisnall on January 29, 2010 No Comments

Don't ignore old versions of OS X.

See All Related Blogs

Informit Network