game_scene.py 文件源码

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

项目:PyCut 作者: FOSSRIT 项目源码 文件源码
def ProcessInput(self, events, pressed_keys):
        """
        Process input from user
        Inherits from SceneBase
                Args:   self
                        events - pygame events
                        pressed_keys
        """

        for event in events:
            if event.type == pygame.KEYDOWN and event.key == pygame.K_RETURN:
                # Move to the next scene when the user pressed Enter
                pass

            if event.type == pygame.MOUSEBUTTONDOWN:
                for button in self.buttons:
                    button.isClicked(event)
                if self.leveling_up:
                    self.continue_button.isClicked(event)

            if event.type == pygame.MOUSEBUTTONUP:
                for button in self.buttons:
                    button.isClicked(event)
                if self.leveling_up:
                    self.continue_button.isClicked(event)

            if event.type == pygame.MOUSEMOTION:
                #for button in self.buttons:
                #    button.isHovered(event)
                if self.leveling_up:
                    self.continue_button.isHovered(event)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号