当前位置: 首页>>代码示例>>Python>>正文


Python State.pop_screen方法代码示例

本文整理汇总了Python中state.State.pop_screen方法的典型用法代码示例。如果您正苦于以下问题:Python State.pop_screen方法的具体用法?Python State.pop_screen怎么用?Python State.pop_screen使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在state.State的用法示例。


在下文中一共展示了State.pop_screen方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: update

# 需要导入模块: from state import State [as 别名]
# 或者: from state.State import pop_screen [as 别名]
    def update(self, events):
	'''
        Updates the screen when an event happens 

        @param - list of game events
        '''
        for event in events:
            if not hasattr(event, 'key'): 
                continue
            if event.type == KEYDOWN:
                if event.key == K_p:
                    State.pop_screen()
		elif event.key == K_RETURN:
			self.sounds['select'].play()
			if self.currLine == PauseScreenLines.Resume:
				State.pop_screen()
			if self.currLine == PauseScreenLines.Save:
                            self.tileMap.save(self.player)
                            save(USER_SAVES_DIR + State.save_name)
			elif self.currLine == PauseScreenLines.Quit:
				State.pop_screen()
				State.pop_screen()
		elif event.key == K_i:
		    State.push_screen(InventoryScreen(self.player))
		else:
		    super(PauseScreen, self).interact(event)
开发者ID:nhandler,项目名称:cs429,代码行数:28,代码来源:pauseScreen.py

示例2: update

# 需要导入模块: from state import State [as 别名]
# 或者: from state.State import pop_screen [as 别名]
	def update(self, events):
		'''
        Updates the screen when an event happens 

        @param - list of game events
        '''
		for event in events:
			if not hasattr(event, 'key'):
				continue
			if event.type == KEYDOWN:
				if event.key == K_RETURN:
					if self.currLine == LoadGameScreenLine.ReturnToMainMenu:
						State.pop_screen()
						continue
					save_name = self.lines[self.currLine]
					load(USER_SAVES_DIR + save_name)
					State.save_name = save_name
					State.pop_screen()
					State.push_screen(gameScreen.GameScreen(CURRENT_GAME_DIR))
				else:
					super(LoadGameScreen, self).interact(event)
开发者ID:nhandler,项目名称:cs429,代码行数:23,代码来源:loadGameScreen.py


注:本文中的state.State.pop_screen方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。