Book
Module 8 - Section 5 - spaceship
Module 8 - Section 5 - spaceship
Completion requirements
View
After the completion of this module the students will be able to:
- identify various classes inside Python code game
- describe the parts of the class and it's use
- identify the objects of a class
- recognize the characteristics and the values of the objects
- modify the code of the game to make it easier or harder
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: