main.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:kivy_rpg 作者: spinningD20 项目源码 文件源码
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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号