Irrelevant Objects

This brings us to a fundamental element of game development. One thing that is absolutely essential to any game is the definition of what makes an object "irrelevant." An object is considered irrelevant when it can no longer affect anything in the game.

Irrelevancy is handled differently in each game. Some games allow objects to leave the screen and then ultimately return. Other games destroy objects before they ever leave the screen. An example of the latter is seen in most renditions of the game Asteroids. In most versions of Asteroids, when shooting from one side of the screen to the other, a ship's bullet actually disappears before it leaves the screen. This is because the shot has a maximum distance that it can travel before it is deleted from the game. While I'm not a huge fan of that functionality (yeah, I like guns that can shoot as far as I can see), the developers made the call that a bullet wouldn't be able to reach from one side of the screen to the other. You can argue the merits of that choice, but that's not the point. The point is that the developers decided what constituted irrelevancy for those bullets, and when they reached that point, they deleted them.

It's interesting to look at the Asteroids game further, because while its developers decided to remove bullets before they hit the edge of the screen, they did the opposite with the asteroids themselves: the asteroids are recycled immediately when they leave the screen, and they pop into view ...

Get Learning XNA 3.0 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.