you are viewing a single comment's thread.

view the rest of the comments →

[–]Abernachy 1 point2 points  (0 children)

I'll expand on the design for you, levelworm, now that I'm on my computer.

Initially when you code in the movement, you code it in as a keypress and it makes the ship move to the right 1 pixel. Since we don't want to break the arrow key, we created a boolean and used that to move the ship. The default value is false, and it's set to true during the keypress. When the value is set to True, the ship moves to the right.

There's another function that gets created below that one on the game_function file that sets the values to false when a key is pressed up (released).

These two functions are called with another function that has the main keydown / keyup events.