generated from mwc/lab_retro
This is completely different than anything we did in unit 1. When creating the nav game all the code feels connected as the code was broken up into asteroid, asteroid spawner, game, and spaceship. I think this is so much easier to follow as it was easy to figure out what each thing did. Also, this uses classes which we did not use in unit 1.
This commit is contained in:
@@ -2,3 +2,12 @@
|
||||
# ------------
|
||||
# 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,"lives":5}, board_size=board_size)
|
||||
game.play()
|
||||
Reference in New Issue
Block a user