In this chapter we’re going to introduce some critical structure into our code. The previous few chapters introduced the requirement to store data tied to our game elements. This chapter introduces the use of objects as a solution to the explosion in complexity this brings. Objects are a great solution because they enable data and code to be intimately connected.
Now that we can animate, we can start to build out the main parts of the game. We’ll start by getting some asteroids on the screen, floating about. Asteroids float in space, and they keep going ...