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.2 - Move with the Keyboard
Study the following lines:
In these lines pygame checks if arrow keys LEFT, RIGHT, UP, DOWN or keys d, a , s, w are pressed down (KEYDOWN) or released (KEYUP) and moves spaceship accordingly.
In these lines pygame checks if arrow keys LEFT, RIGHT, UP, DOWN or keys d, a , s, w are pressed down (KEYDOWN) or released (KEYUP) and moves spaceship accordingly.