-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcli.py
More file actions
26 lines (21 loc) · 836 Bytes
/
Copy pathcli.py
File metadata and controls
26 lines (21 loc) · 836 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
from plumbum import cli
import json
from map_layout import MapLayout
from game_engine import GameEngine
import pyfiglet
class RPGame(cli.Application):
""" The base class handling the initialization of the game and formation of a Game Engine object. """
def print_name(self):
# Uses pyfiglet to print the name of the game
print(pyfiglet.figlet_format("ADVENTURE RPG", font="slant", justify = "right"))
def main(self):
self.print_name()
# Deserializing the json here
with open("map_json.json") as file:
data = json.load(file)
# Handles all deserialization and handles object decomposition for the same
map_layout = MapLayout(data)
game_engine = GameEngine(map_layout)
game_engine.start_game()
if __name__ == "__main__":
RPGame()