-
Notifications
You must be signed in to change notification settings - Fork 0
/
Game.py
23 lines (20 loc) · 825 Bytes
/
Game.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import World
from Player import Player
def play():
World.load_tiles()
gamePlayer = Player()
while gamePlayer.is_alive() and not gamePlayer.victory:
room = World.tile_exists(gamePlayer.location_x, gamePlayer.location_y)
room.modify_Player(gamePlayer)
if gamePlayer.is_alive() and not gamePlayer.victory:
print ("What will you do?:\n")
available_actions = room.available_Actions()
for action in available_actions:
print (action)
Action_input = raw_input('Action: ')
for checkAction in available_actions:
if Action_input == checkAction.hotkey:
gamePlayer.do_action(checkAction, **checkAction.kwargs)
break
if __name__ == "__main__":
play()