Skip to content

Commit

Permalink
fixed bug where shooting was still possible after ship explosion by c…
Browse files Browse the repository at this point in the history
…hecking on the collided variable before creating a shot
  • Loading branch information
nagoli104 committed Oct 10, 2017
1 parent dba10d8 commit 4c6ed62
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion asteroides.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ def main():
elif pressed_keys[pygame.K_RIGHT]:
ship['speed']['x'] = 10

if pressed_keys[pygame.K_SPACE] and ticks_to_shot <= 0:
if pressed_keys[pygame.K_SPACE] and ticks_to_shot <= 0 and not collided:
# play sound
fire_sound.play()
shots.append(create_shot(ship))
Expand Down

0 comments on commit 4c6ed62

Please sign in to comment.