python类MOUSEBUTTONUP的实例源码

game047.py 文件源码 项目:eduActiv8 作者: imiolek-ireneusz 项目源码 文件源码 阅读 24 收藏 0 点赞 0 评论 0
def handle(self, event):
        gd.BoardGame.handle(self, event)  # send event handling up
        if event.type == pygame.MOUSEBUTTONUP:
            for each in self.board.units:
                if each.is_door is True:
                    self.board.all_sprites_list.move_to_front(each)
            if True:  # self.data[5] == 1:
                self.auto_check()
            self.check_result()
game040.py 文件源码 项目:eduActiv8 作者: imiolek-ireneusz 项目源码 文件源码 阅读 22 收藏 0 点赞 0 评论 0
def handle(self, event):
        gd.BoardGame.handle(self, event)  # send event handling up

        if event.type == pygame.MOUSEBUTTONUP and event.button == 1:
            self.draw_lines()
            self.mainloop.redraw_needed[0] = True
game044.py 文件源码 项目:eduActiv8 作者: imiolek-ireneusz 项目源码 文件源码 阅读 29 收藏 0 点赞 0 评论 0
def handle(self, event):
        gd.BoardGame.handle(self, event)  # send event handling up
        if event.type == pygame.MOUSEBUTTONUP:
            self.check_result()
game076.py 文件源码 项目:eduActiv8 作者: imiolek-ireneusz 项目源码 文件源码 阅读 23 收藏 0 点赞 0 评论 0
def handle(self, event):
        gd.BoardGame.handle(self, event)  # send event handling up
        if self.show_msg == False:
            if event.type == pygame.KEYDOWN and (event.key == pygame.K_RIGHT or event.key == pygame.K_LEFT):
                self.next_step()
            elif event.type == pygame.MOUSEBUTTONUP:
                if self.board.active_ship == self.next_step_btn.unit_id:
                    if self.current_pos + 1 > self.all_a_count:
                        self.level.next_board_load()
                    else:
                        self.next_step()
game075.py 文件源码 项目:eduActiv8 作者: imiolek-ireneusz 项目源码 文件源码 阅读 38 收藏 0 点赞 0 评论 0
def handle(self, event):
        gd.BoardGame.handle(self, event)  # send event handling up
        if self.show_msg == False:
            if event.type == pygame.KEYDOWN and (event.key == pygame.K_RIGHT or event.key == pygame.K_LEFT):
                self.next_step()
            elif event.type == pygame.MOUSEBUTTONUP:
                if self.board.active_ship == self.next_step_btn.unit_id:
                    if self.current_pos + 1 > self.all_a_count:  # if self.cursor_pos == self.sumn1n2sl+1:
                        self.level.next_board_load()
                    else:
                        self.next_step()
game020.py 文件源码 项目:eduActiv8 作者: imiolek-ireneusz 项目源码 文件源码 阅读 27 收藏 0 点赞 0 评论 0
def handle(self, event):
        gd.BoardGame.handle(self, event)  # send event handling up
        if event.type == pygame.MOUSEBUTTONUP:
            for each in self.board.units:
                if each.is_door is True:
                    self.board.all_sprites_list.move_to_front(each)
            self.check_result()

        if event.type == pygame.KEYDOWN or event.type == pygame.MOUSEBUTTONDOWN:
            self.auto_check_reset()
        elif event.type == pygame.KEYUP:
            self.check_result()
game050.py 文件源码 项目:eduActiv8 作者: imiolek-ireneusz 项目源码 文件源码 阅读 35 收藏 0 点赞 0 评论 0
def handle(self, event):
        gd.BoardGame.handle(self, event)  # send event handling up
        if event.type == pygame.KEYDOWN or event.type == pygame.MOUSEBUTTONDOWN:
            self.auto_check_reset()
        elif event.type == pygame.MOUSEBUTTONUP and event.button == 1:
            self.draw_lines()
            self.mainloop.redraw_needed[0] = True
            self.check_result()
game013.py 文件源码 项目:eduActiv8 作者: imiolek-ireneusz 项目源码 文件源码 阅读 27 收藏 0 点赞 0 评论 0
def handle(self, event):
        gd.BoardGame.handle(self, event)  # send event handling up
        if event.type == pygame.MOUSEBUTTONUP:
            for each in self.board.units:
                if each.is_door is True:
                    self.board.all_sprites_list.move_to_front(each)
            self.check_result(auto=True)
game041.py 文件源码 项目:eduActiv8 作者: imiolek-ireneusz 项目源码 文件源码 阅读 39 收藏 0 点赞 0 评论 0
def handle(self, event):
        gd.BoardGame.handle(self, event)  # send event handling up

        if event.type == pygame.KEYDOWN or event.type == pygame.MOUSEBUTTONDOWN:
            self.auto_check_reset()
        elif event.type == pygame.MOUSEBUTTONUP and event.button == 1:
            self.draw_lines()
            self.mainloop.redraw_needed[0] = True
            self.check_result()
game008.py 文件源码 项目:eduActiv8 作者: imiolek-ireneusz 项目源码 文件源码 阅读 23 收藏 0 点赞 0 评论 0
def handle(self, event):
        gd.BoardGame.handle(self, event)  # send event handling up
        if event.type == pygame.KEYDOWN or event.type == pygame.MOUSEBUTTONDOWN:
            self.auto_check_reset()
        if event.type == pygame.MOUSEBUTTONDOWN:
            if self.board.active_ship >= 0:
                active = self.board.ships[self.board.active_ship]
                active.image.set_alpha(150)
        elif event.type == pygame.MOUSEBUTTONUP:
            if self.board.active_ship >= 0:
                active = self.board.ships[self.board.active_ship]
                active.image.set_alpha(255)
            self.check_result()
game042.py 文件源码 项目:eduActiv8 作者: imiolek-ireneusz 项目源码 文件源码 阅读 20 收藏 0 点赞 0 评论 0
def handle(self, event):
        gd.BoardGame.handle(self, event)  # send event handling up
        if event.type == pygame.KEYDOWN or event.type == pygame.MOUSEBUTTONDOWN:
            self.auto_check_reset()
        if event.type == pygame.MOUSEMOTION:
            if self.drag:
                self.swap_font_color()
            #  if self.drag and self.mouse_entered_new:
            #  self.swap_font_color()
        elif event.type == pygame.MOUSEBUTTONUP:
            self.swap_font_color()
            self.check_result()
            #  if self.drag and self.mouse_entered_new:
            #  self.swap_font_color()
game012.py 文件源码 项目:eduActiv8 作者: imiolek-ireneusz 项目源码 文件源码 阅读 21 收藏 0 点赞 0 评论 0
def handle(self, event):
        gd.BoardGame.handle(self, event)  # send event handling up
        if self.ship_id < 0 and event.type == pygame.MOUSEBUTTONDOWN:
            # make it impossible to deselect the main character
            self.board.active_ship = 0
            self.ship_id = 0
            if self.moveable == True:
                pos = event.pos
                column = (pos[0] - self.layout.menu_w) // (self.layout.width)
                row = (pos[1] - self.layout.top_margin) // (self.layout.height)
                self.direction = [0, 0]
                arrow_clicked = False
                if column == self.owl_pos[0] - 1 and row == self.owl_pos[1]:
                    self.direction[0] = -1
                    arrow_clicked = True
                elif column == self.owl_pos[0] + 1 and row == self.owl_pos[1]:
                    self.direction[0] = 1
                    arrow_clicked = True
                elif column == self.owl_pos[0] and row == self.owl_pos[1] - 1:
                    self.direction[1] = -1
                    arrow_clicked = True
                elif column == self.owl_pos[0] and row == self.owl_pos[1] + 1:
                    self.direction[1] = 1
                    arrow_clicked = True

                if arrow_clicked:
                    self.check_direction_kdown()
        if (event.type == pygame.KEYDOWN or event.type == pygame.MOUSEBUTTONDOWN) and self.moveable == False:
            self.move = False
        elif event.type == pygame.KEYUP or event.type == pygame.MOUSEBUTTONUP:
            self.highlight_color(-1)
            self.mainloop.redraw_needed[0] = True
            self.move = False
game026.py 文件源码 项目:eduActiv8 作者: imiolek-ireneusz 项目源码 文件源码 阅读 24 收藏 0 点赞 0 评论 0
def handle(self, event):
        gd.BoardGame.handle(self, event)  # send event handling up
        if event.type == pygame.MOUSEBUTTONUP:
            for each in self.board.units:
                if each.is_door is True:
                    self.board.all_sprites_list.move_to_front(each)
            self.check_result()

        if event.type == pygame.KEYDOWN or event.type == pygame.MOUSEBUTTONDOWN:
            self.auto_check_reset()
        elif event.type == pygame.KEYUP:
            self.check_result()
game039.py 文件源码 项目:eduActiv8 作者: imiolek-ireneusz 项目源码 文件源码 阅读 34 收藏 0 点赞 0 评论 0
def handle(self, event):
        gd.BoardGame.handle(self, event)  # send event handling up
        if event.type == pygame.MOUSEBUTTONUP:
            for each in self.board.units:
                if each.is_door is True:
                    self.board.all_sprites_list.move_to_front(each)
            self.auto_check()
game049.py 文件源码 项目:eduActiv8 作者: imiolek-ireneusz 项目源码 文件源码 阅读 36 收藏 0 点赞 0 评论 0
def handle(self, event):
        gd.BoardGame.handle(self, event)  # send event handling up
        if event.type == pygame.MOUSEBUTTONUP:
            for each in self.board.units:
                if each.is_door is True:
                    self.board.all_sprites_list.move_to_front(each)
            if self.data[5] == 1:
                self.auto_check()
            self.check_result()
game072.py 文件源码 项目:eduActiv8 作者: imiolek-ireneusz 项目源码 文件源码 阅读 21 收藏 0 点赞 0 评论 0
def handle(self, event):
        gd.BoardGame.handle(self, event)  # send event handling up
        if self.show_msg == False:
            if event.type == pygame.KEYDOWN or event.type == pygame.MOUSEBUTTONDOWN:
                self.auto_check_reset()
            if event.type == pygame.KEYDOWN and event.key == pygame.K_LEFT:
                self.home_sqare_switch(self.board.active_ship + 1)
            elif event.type == pygame.KEYDOWN and event.key == pygame.K_RIGHT:
                self.home_sqare_switch(self.board.active_ship - 1)
            elif event.type == pygame.KEYDOWN and event.key == pygame.K_UP:
                self.home_sqare_switch(self.board.active_ship - self.sumn1n2sl + 1)
            elif event.type == pygame.KEYDOWN and event.key == pygame.K_DOWN:
                self.home_sqare_switch(self.board.active_ship + self.sumn1n2sl)
            elif event.type == pygame.KEYDOWN and event.key != pygame.K_RETURN and not self.correct:
                lhv = len(self.home_square.value)
                self.changed_since_check = True
                if event.key == pygame.K_BACKSPACE:
                    if lhv > 0:
                        self.home_square.value = self.home_square.value[0:lhv - 1]
                else:
                    char = event.unicode
                    if (len(char) > 0 and lhv < 2 and char in self.digits):
                        self.home_square.value = char
                        if self.auto_select:
                            self.home_sqare_switch(self.board.active_ship + 1)
                    else:
                        self.home_square.value = ""

                self.home_square.update_me = True
                self.mainloop.redraw_needed[0] = True

            elif event.type == pygame.MOUSEBUTTONUP:
                self.home_sqare_switch(self.board.active_ship)
game019.py 文件源码 项目:eduActiv8 作者: imiolek-ireneusz 项目源码 文件源码 阅读 30 收藏 0 点赞 0 评论 0
def handle(self, event):
        gd.BoardGame.handle(self, event)  # send event handling up
        if event.type == pygame.MOUSEBUTTONUP:
            for each in self.board.units:
                if each.is_door is True:
                    self.board.all_sprites_list.move_to_front(each)
            self.auto_check()
game046.py 文件源码 项目:eduActiv8 作者: imiolek-ireneusz 项目源码 文件源码 阅读 19 收藏 0 点赞 0 评论 0
def handle(self, event):
        gd.BoardGame.handle(self, event)  # send event handling up
        if event.type == pygame.MOUSEBUTTONUP:
            pass
            #self.check_result(auto=True)
            #self.auto_check_reset()
game082.py 文件源码 项目:eduActiv8 作者: imiolek-ireneusz 项目源码 文件源码 阅读 33 收藏 0 点赞 0 评论 0
def handle(self, event):
        gd.BoardGame.handle(self, event)  # send event handling up
        if event.type == pygame.MOUSEBUTTONUP:
            for each in self.board.units:
                if each.is_door is True:
                    self.board.all_sprites_list.move_to_front(each)
            self.check_result(auto=True)
game056.py 文件源码 项目:eduActiv8 作者: imiolek-ireneusz 项目源码 文件源码 阅读 37 收藏 0 点赞 0 评论 0
def handle(self, event):
        gd.BoardGame.handle(self, event)  # send event handling up
        if event.type == pygame.MOUSEBUTTONUP:
            for each in self.board.units:
                if each.is_door is True:
                    self.board.all_sprites_list.move_to_front(each)

        if event.type == pygame.KEYDOWN or event.type == pygame.MOUSEBUTTONDOWN:
            self.auto_check_reset()
        elif event.type == pygame.KEYUP or event.type == pygame.MOUSEBUTTONUP:
            self.check_result()


问题


面经


文章

微信
公众号

扫码关注公众号