npyscreen-adventure-game #8

Manually merged
Kenwood merged 29 commits from npyscreen-adventure-game into adventure-game 2021-02-23 13:43:20 -05:00
1 changed files with 9 additions and 1 deletions
Showing only changes of commit e32e9895e5 - Show all commits

View File

@ -1,5 +1,6 @@
import pathlib import pathlib
import npyscreen import npyscreen
import logging
from npyscreen import NotEnoughSpaceForWidget from npyscreen import NotEnoughSpaceForWidget
from os import system from os import system
@ -19,12 +20,19 @@ class AlphaWarning(npyscreen.Popup):
class AdventureGame(npyscreen.NPSAppManaged): class AdventureGame(npyscreen.NPSAppManaged):
"""
This is the 'root' of the entire game!
"""
# Do on creation # Do on creation
def onStart(self): def onStart(self):
# Setup some important 'global' values we'll need later # Setup some important 'global' values we'll need later
# Set the path all other files will follow # Set the path all other files will follow
self.mainPath = pathlib.Path(__file__).parent self.mainPath = pathlib.Path(__file__).parent
# Setup logging
self.log = logging
self.log.basicConfig(filename=self.mainPath / 'logs/AdventureGame.log', filemode='w', level=logging.DEBUG)
# Parse world # Parse world
self.gamelib = parse( self.gamelib = parse(
self.mainPath / 'gamedata/gamelib.yaml') # parse this data first (since it includes graphics for the main menu self.mainPath / 'gamedata/gamelib.yaml') # parse this data first (since it includes graphics for the main menu