Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -111,7 +111,7 @@ def update_game(action):
|
|
| 111 |
|
| 112 |
# Collision with player
|
| 113 |
if (abs(asteroid[0] - player_x) < (ASTEROID_SIZE + PLAYER_SIZE)//2 and \
|
| 114 |
-
|
| 115 |
game_over = True
|
| 116 |
explosions.append([asteroid[0], asteroid[1]])
|
| 117 |
|
|
@@ -119,7 +119,7 @@ def update_game(action):
|
|
| 119 |
for bullet in bullets[:]:
|
| 120 |
for asteroid in asteroids[:]:
|
| 121 |
if (abs(bullet[0] - asteroid[0]) < (BULLET_SIZE + ASTEROID_SIZE)//2 and \
|
| 122 |
-
abs(bullet[1] - asteroid[1]) < (BULLET_SIZE + ASTEROID_SIZE)//2
|
| 123 |
bullets.remove(bullet)
|
| 124 |
asteroids.remove(asteroid)
|
| 125 |
explosions.append([asteroid[0], asteroid[1]])
|
|
|
|
| 111 |
|
| 112 |
# Collision with player
|
| 113 |
if (abs(asteroid[0] - player_x) < (ASTEROID_SIZE + PLAYER_SIZE)//2 and \
|
| 114 |
+
abs(asteroid[1] - player_y) < (ASTEROID_SIZE + PLAYER_SIZE)//2:
|
| 115 |
game_over = True
|
| 116 |
explosions.append([asteroid[0], asteroid[1]])
|
| 117 |
|
|
|
|
| 119 |
for bullet in bullets[:]:
|
| 120 |
for asteroid in asteroids[:]:
|
| 121 |
if (abs(bullet[0] - asteroid[0]) < (BULLET_SIZE + ASTEROID_SIZE)//2 and \
|
| 122 |
+
abs(bullet[1] - asteroid[1]) < (BULLET_SIZE + ASTEROID_SIZE)//2:
|
| 123 |
bullets.remove(bullet)
|
| 124 |
asteroids.remove(asteroid)
|
| 125 |
explosions.append([asteroid[0], asteroid[1]])
|