23 Feb Aurora Saturday 13:00 Python Practice 02.20.
Question:
Modify the program we made in the class to:
switch the weapon between missile and laser by press 1 or 2
Hint:
we tried using keyboard to control the fighter using the following code:
# keyboard control
elif event.type == pygame.KEYDOWN:
if event.key == pygame.K_w:
fighter.rect.top -= 20
if event.key == pygame.K_s:
fighter.rect.top += 20
if event.key == pygame.K_a:
fighter.rect.left -= 20
if event.key == pygame.K_d:
fighter.rect.left += 20
Sorry, the comment form is closed at this time.