added collision
This commit is contained in:
parent
f0d7ef7cce
commit
306f282d15
2 changed files with 11 additions and 1 deletions
5
main.py
5
main.py
|
|
@ -45,9 +45,12 @@ def main():
|
|||
|
||||
for drawable in drawables:
|
||||
drawable.draw(screen)
|
||||
|
||||
for updatable in updatables:
|
||||
updatable.update(dt)
|
||||
for asteroid in asteroids:
|
||||
if asteroid.is_colided(p1):
|
||||
print("Game Over!")
|
||||
return
|
||||
|
||||
pygame.display.flip()
|
||||
tick = clock.tick(60)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue