generated from mwc/project_game
Got it to end if the enter (return) key is used.
This commit is contained in:
Binary file not shown.
3
mine.py
3
mine.py
@@ -8,7 +8,8 @@ class Mine:
|
|||||||
def __init__(self, position):
|
def __init__(self, position):
|
||||||
self.position = position
|
self.position = position
|
||||||
|
|
||||||
def play_turn(self, game):
|
def handle_keystroke(self, keystroke, game):
|
||||||
|
if keystroke.name in ("KEY_ENTER"):
|
||||||
if not game.is_empty(self.position):
|
if not game.is_empty(self.position):
|
||||||
game.log("You hit a mine at " + str(self.position) + ".")
|
game.log("You hit a mine at " + str(self.position) + ".")
|
||||||
game.end()
|
game.end()
|
||||||
Reference in New Issue
Block a user