def play(): AssetManager.clearScreen() if not PD: Keys.unhookAll() saveManipulation() return areaSelection()
def event(down): if not down: return Keys.unhookAll() AssetManager.clearScreen() print('Thank you for playing') if PD: PlayerData.saveToJson(PD, PD.filename) for num in range(0, 3): print('.') time.sleep(1) print('closing') os.abort()
def event(down): if not down: return Keys.unhookAll() Input.Input.flushInput() newSaveLocation = './saves/{}.json'.format(input('save name: ')) f = open(newSaveLocation, 'w+') f.write('{}') f.close() print('Created! Press enter to continue.') input() Keys.unhookAll() saveManipulation()
def event(down): global PD if not down: return if len(saves) == 0: return PD = PlayerData.generateFromJson('./saves/{}'.format(saves[selection])) Keys.unhookAll() Input.Input.flushInput() print(PD.__dict__) print('data loaded') input('enter to continue') play()
def main(): AssetManager.clearScreen() Keys.start() for folder in os.listdir('./Mods'): print(folder) Mod = importlib.import_module('.{}'.format(folder), package='Mods') ModRegistry.registerItem(folder, Mod) for asset in os.listdir('./Mods/{}/assets'.format(folder)): f = open('./assets/{}'.format(asset), 'w+') f.writelines( open('./Mods/{}/assets/{}'.format(folder, asset)).readlines()) f.close() Mod.Mod.Load(game) Input.Input.genAliveThread() mainMenu()
def event(down): if not down: return Keys.unhookAll() saveManipulation()
def event(down): if not down: return Keys.unhookAll() settings()
def event(down): if not down: return Keys.unhookAll() play()
def event(down): if not down: return Keys.unhookAll() ModPage()
def event(down): if not down: return Keys.unhookAll() mainMenu()
def event(down): if not down: return Keys.unhookAll() createSave()
def event(down): if not down: return Keys.unhookAll() loadSave()