Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import json
- #from combat import mob
- #open json and load into 'data'
- with open('rooms.json', 'r') as f:
- data = json.load(f)
- current_room = "1" #check its assigned
- print(data[current_room]["description"])#check its assigned
- current_room = "40" #change current room to 40
- print(data[current_room]["mob"]) #check its assigned
- def mob(data,current_room): # run function with data and room number attributes
- mobname = data[current_room]["mob"]
- mobskill = data[current_room]["skill"]
- mobstamina = data[current_room]["stamina"]
- print(mobname)
- print(mobskill)
- print(mobstamina)
- mob(data,current_room)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement