Animated game objects

The basis for all of our game objects apart from the tile-based map (the player, enemies, and gemstones) will be a class called GameObject. This class will provide support for playing animations and collision detection with the tile map.

In many ways, the GameObject class is similar to the Sprite class we built for our other games. Because the GameObject class does not hold texture information like the Sprite class did, we have given it a new name to better describe its functionality.

Just as we did in Robot Rampage, we will track the position of all of our game objects in world coordinates, translating those to screen coordinates as necessary with the Camera class.

Get XNA 4.0 Game Development by Example Beginner's Guide 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.