lab_retro/nav_game.py

16 lines
429 B
Python

# nav_game.py
# ------------
# 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
width = 25
height = 25
board_size = (width,height)
ship = Spaceship(board_size)
spawner = AsteroidSpawner(board_size)
game = Game([ship, spawner], {"score": 0}, board_size = board_size)
game.play()