generated from mwc/project_game
18 lines
524 B
Python
18 lines
524 B
Python
# free_space.py
|
|
# ------------
|
|
# By Cory
|
|
# This module defines a free space agent class. It displays if enter is pressed while the cursor is on it.
|
|
class FreeSpace:
|
|
character = '*'
|
|
display = True
|
|
|
|
def __init__(self, position):
|
|
self.position = position
|
|
|
|
def handle_keystroke(self, keystroke, game):
|
|
if keystroke.name in ("KEY_ENTER"):
|
|
if not game.is_empty(self.position):
|
|
game.log(str(self.position) + " is clear!")
|
|
|
|
def hide(self):
|
|
self.display = False |