-
Notifications
You must be signed in to change notification settings - Fork 0
/
AdventureGameLaunch.py
27 lines (25 loc) · 983 Bytes
/
AdventureGameLaunch.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import world
from player import Player
def play():
print ("Welcome to Josh's Dungeon Crawler! Currently this is a little game, but it is being worked on as time allows! The game begins below!")
world.load_tiles()
player = Player()
#These lines load the starting room and display the text
room = world.tile_exists(player.location_x, player.location_y)
print(room.intro_text())
while player.is_alive() and not player.victory:
room = world.tile_exists(player.location_x, player.location_y)
room.modify_player(player)
#Check again since the room could have changed the player's state
if player.is_alive() and not player.victory:
print("Choose an action:\n")
available_actions = room.available_actions()
for action in available_actions:
print(action)
action_input = input('Action: ')
for action in available_actions:
if action_input == action.hotkey:
player.do_action(action, **action.kwargs)
break
if __name__ == "__main__":
play()