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
SpriteManagerclass that handles updating and drawing of sprites as well as checking for collisions.You cleaned up the
Game1class to facilitate future development in coming chapters.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access