Animated sprites – asteroids

The asteroids we create for Asteroid Belt Assault are included on the SpriteSheet.png texture as the top row of 50 by 50 pixel images. There are 20 individual animation frames of the asteroid spinning through space:

Animated sprites – asteroids

Much like we did with the StarField class, we will create a class that will automatically manage the game's asteroids for us, including their initial positioning, handling what happens when they collide with each other, and repositioning them when they have moved off the screen.

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.