示例#1
0
        if stopper < 1:
            for ev in pygame.event.get():
                if ev.type == QUIT:
                    pygame.mixer.music.stop()
                    pygame.quit()
                    sys.exit()
                elif ev.type == KEYDOWN:
                    if ev.key == K_LEFT:
                        char.set_left()
                        char.set_go_left(True)
                        char.set_on_wall(False) #Allow logic to figure out whether or not a wall is hit
                        #char.set_on_floor(False)
                    elif ev.key == K_RIGHT:
                        char.set_right()
                        char.set_go_right(True)
                        char.set_on_wall(False) #Allow logic to figure out whether or not a wall is hit
                        #char.set_on_floor(False)
                    elif ev.key in (K_UP, K_DOWN, K_SPACE) and char.on_floor:
                        char.flip()
                        #char.set_on_wall(False)
                        char.set_on_floor(False) #Allow logic to figure out whether or not a floor is hit
                    #elif ev.key==K_f:
                    #   char.set_on_floor(not char.on_floor)
                    #elif ev.key==K_w:
                    #   char.set_on_wall(not char.hitwall)
                    elif ev.key == K_s:
                        char.set_sad(True)
                    elif ev.key == K_h:
                        char.set_sad(False)
                    elif ev.key == K_k: