-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGame.py
More file actions
35 lines (24 loc) · 906 Bytes
/
Game.py
File metadata and controls
35 lines (24 loc) · 906 Bytes
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
28
29
30
31
32
33
34
35
from Loader import Loader
from Controller import Controller
gameLoader = Loader('game.xml')
gameLoader.loadStories()
stories = gameLoader.getStories()
for story in stories:
print(story)
for room in story.getRooms():
print('ROOM INFO:' + str(room.name))
for inter in story.getInteractables():
print('INTERACTABLE INFO:' + str(inter))
for action in inter.getActions():
print('ACTION INFO:' + str(action))
for effect in story.getEffects():
print('EFFECT INFO:' + str(effect))
for item in story.getItems():
print('ITEM INFO:' + str(item))
print('PLAYER INFO:' + str(story.getPlayer()))
print('\nEnter the story name or the number of the story you\'d like to play')
for story in stories:
print(str(story))
storyChoice = input()
story = gameLoader.getStories(int(storyChoice))
print(f"You've chosen {story}")