generated from mwc/project_game
Figured out how to spawn a mine and end the game
if the cursor is over the mine. We now have to not end the game until the user SELECTS the space the mine is at. I hadn't realized that is_empty only works if display is True? So I moved the game.end() to the mine class.
This commit is contained in:
@@ -4,9 +4,11 @@
|
||||
# This class implements a simple minesweeper game on a 9x9 gird.
|
||||
from retro.game import Game
|
||||
from cursor import Cursor
|
||||
from mine_spawner import MineSpawner
|
||||
|
||||
board_size = (9, 9)
|
||||
cursor = Cursor(board_size)
|
||||
spawner = MineSpawner(board_size)
|
||||
# spawner = AsteroidSpawner(board_size)
|
||||
game = Game([cursor], {"score": 0}, board_size=board_size)
|
||||
game = Game([cursor,spawner], {"score": 0}, board_size=board_size,debug=True)
|
||||
game.play()
|
||||
Reference in New Issue
Block a user