What You Just Did

Stop right here and give yourself a nice, hefty pat on the back. Solid software design is hard to master. Far too many developers dive into code without thinking ahead, and the result is a mass of spaghetti code that quickly becomes unmanageable. Let's review what you've done here:

  • You created an inheritance hierarchy for sprites, including a base class handling animation and two derived classes handling user input and automated movement.

  • You learned about GameComponents, which can be used to create a modular design of interchangeable components.

  • You created a SpriteManager class that handles updating and drawing of sprites as well as checking for collisions.

  • You cleaned up the Game1 class to facilitate future development in coming chapters.

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.