generated from mwc/project_game
Got it to end if the enter (return) key is used.
This commit is contained in:
parent
3334db0c8b
commit
cb8b28b68c
Binary file not shown.
9
mine.py
9
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 not game.is_empty(self.position):
|
if keystroke.name in ("KEY_ENTER"):
|
||||||
game.log("You hit a mine at " + str(self.position) + ".")
|
if not game.is_empty(self.position):
|
||||||
game.end()
|
game.log("You hit a mine at " + str(self.position) + ".")
|
||||||
|
game.end()
|
Loading…
Reference in New Issue