def load_game(self, filename=os.path.join(runpath, 'seed.db')):
print('hitting load game')
# set the db here, get current map player object was last at, and load that map
engine = create_engine('sqlite:///' + filename)
Session = sessionmaker(bind=engine) # configure session object
self.db = Session()
# until the other characters are in the db, trying to load a game with anyone but clyde will crash
player_character_flag = self.db.query(GameFlag).filter(GameFlag.name == 'player_character').first()
self.player_object = self.db.query(MapObject).filter(MapObject.name == player_character_flag.value).first()
tilemap = self.db.query(TileMap).filter(TileMap.id == self.player_object.map_id).first()
self.manager.current = 'Game'
self.load_map(tilemap.file_name)
评论列表
文章目录