Skip to content

Learning Python Day: 56

Piloting the Ship

  • grant the ability to move left and right

Responding to a Keypress

  • pygame.event.get() method registers each press of the key, which is interpreted as a KEYDOWN event, which should trigger a certain action
  • for example, we want a right arrow key press to increase the ship’s rect.x value to move to the right
  • for each press of the right arrow key, the ship moves one pixel to the right
  • we need to make this more efficient
Tags:

Leave a Reply

Your email address will not be published. Required fields are marked *