8.5.6 - Spaceship class

Instead of creating game logic for every object inside the main loop we can create classes for the objects and inside the classes methods. In this way it is easy to create multiple objects with the same logic. You can see the spaceship class in the following code: