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:
@@ -1,9 +1,9 @@
|
||||
# cursor.py
|
||||
# ------------
|
||||
# By MWC Contributors
|
||||
# This module defines a spaceship agent class.
|
||||
# By Cory
|
||||
# This module defines a cursor agent class.
|
||||
class Cursor:
|
||||
name = "cursos"
|
||||
name = "cursor"
|
||||
character = 'O'
|
||||
|
||||
def __init__(self, board_size):
|
||||
@@ -24,5 +24,4 @@ class Cursor:
|
||||
if game.on_board(new_position):
|
||||
if game.is_empty(new_position):
|
||||
self.position = new_position
|
||||
else:
|
||||
game.end()
|
||||
game.log(self.position)
|
||||
Reference in New Issue
Block a user