added shot collision
This commit is contained in:
parent
63c8fcbca6
commit
82882bab74
1 changed files with 5 additions and 1 deletions
6
main.py
6
main.py
|
|
@ -55,7 +55,11 @@ def main():
|
|||
if p1.is_colided(asteroid):
|
||||
print("Game Over!")
|
||||
sys.exit()
|
||||
|
||||
for asteroid in asteroids:
|
||||
for shot in shots:
|
||||
if shot.is_colided(asteroid):
|
||||
asteroid.kill()
|
||||
shot.kill()
|
||||
pygame.display.flip()
|
||||
tick = clock.tick(60)
|
||||
dt = tick/1000
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue