wrote code in asteroid.py, asteroid_spawner.py, spaceship.py, and nav_game.py in order to create an interactive game where the spaceship (player) must avoid incoming asteroids

This commit is contained in:
kated
2026-05-12 10:59:35 -04:00
parent b2457e7525
commit 5c5883ec33
9 changed files with 149 additions and 0 deletions

View File

@@ -2,3 +2,13 @@
# ------------
# By MWC Contributors
# This class implements a simple game where a spaceship avoids asteroids.
from retro.game import Game
from spaceship import Spaceship
from asteroid_spawner import AsteroidSpawner
board_size = (25, 25)
ship = Spaceship(board_size)
spawner = AsteroidSpawner()
game = Game([ship,spawner], {"score": 0}, board_size=board_size)
game.play()