本文整理汇总了Python中Level.Level.processEvent方法的典型用法代码示例。如果您正苦于以下问题:Python Level.processEvent方法的具体用法?Python Level.processEvent怎么用?Python Level.processEvent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Level.Level
的用法示例。
在下文中一共展示了Level.processEvent方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: processEvent
# 需要导入模块: from Level import Level [as 别名]
# 或者: from Level.Level import processEvent [as 别名]
def processEvent(self, event):
if event.type == pygame.USEREVENT and event.code == PAGEDEAD:
m = MessageScene(self.director, self, 'Congratulations', "You have completed the game!\nNow you're entitled \nto the 3D version.", "Press to quit")
m.messageBox.button.onMouseDown = lambda: pygame.event.post(pygame.event.Event(pygame.QUIT))
self.director.setScene(m)
Level.processEvent(self, event)
示例2: processEvent
# 需要导入模块: from Level import Level [as 别名]
# 或者: from Level.Level import processEvent [as 别名]
def processEvent(self, event):
if event.type == pygame.KEYDOWN and event.key == pygame.K_RETURN:
nextLevel = LevelFour(self.director, self.player)
self.director.setScene(nextLevel)
if event.type == pygame.USEREVENT and event.code == MRHDEAD:
nextLevel = LevelFour(self.director, self.player)
self.director.setScene(nextLevel)
Level.processEvent(self, event)
示例3: processEvent
# 需要导入模块: from Level import Level [as 别名]
# 或者: from Level.Level import processEvent [as 别名]
def processEvent(self, event):
if event.type == pygame.KEYDOWN and event.key == pygame.K_RETURN:
nextLevel = LevelTwo(self.director, self.player)
self.director.setScene(nextLevel)
if event.type == pygame.KEYDOWN and event.key == pygame.K_F1:
self.door.setActive(True)
# nextLevel = LevelOneB(self.director, self.player)
# self.director.setScene(nextLevel)
Level.processEvent(self, event)
示例4: processEvent
# 需要导入模块: from Level import Level [as 别名]
# 或者: from Level.Level import processEvent [as 别名]
def processEvent(self, event):
if event.type == pygame.KEYDOWN and event.key == pygame.K_RETURN:
nextLevel = LevelTwo(self.director, self.player)
self.director.setScene(nextLevel)
Level.processEvent(self, event)