generated from mwc/lab_retro
17 lines
414 B
Python
17 lines
414 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 import Asteroid
|
|
|
|
HEIGHT = 25
|
|
WIDTH = 25
|
|
|
|
board_size = (WIDTH, HEIGHT)
|
|
ship = Spaceship(board_size)
|
|
asteroid = Asteroid((WIDTH // 2, 0))
|
|
game = Game([ship, asteroid], {"score": 0}, board_size=board_size)
|
|
game.play() |