- Notifications
You must be signed in to change notification settings - Fork 49
Expand file tree
/
Copy pathmain.py
More file actions
Latest commit
31 lines (22 loc) · 913 Bytes
/
Copy pathmain.py
File metadata and controls
31 lines (22 loc) · 913 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
importGame.inventory
importGame.mobiles
importGame.map
importGame.engine
defsetup():
inventory=Game.inventory.Inventory()
#makes an instance of the Inventory class to use as player's inventory
main_map=Game.map.Map()
main_map.setup()
#makes an instance of the Map class and passes it the item dictionary
player=Game.mobiles.Mobile(inventory, main_map.all_rooms['tube_room'])
#makes an instance of the the Mobile class for the player and puts it in the first room
main_engine=Game.engine.Engine(main_map, player)
#starts the engine with the map instance
main_engine.move_into(player.location.label)
#sets the player's location to the first room and moves into it
returnmain_engine
main_engine=setup()
whilemain_engine.player.victory!=True:
action=main_engine.prompt()
main_engine.parse(action)
main_engine.victory()