Ejemplo n.º 1
0
    frames+=1
    if (pygame.time.get_ticks() - startTime >= 1000):
        actualFPS = frames
        frames=0
        startTime = pygame.time.get_ticks()
        fps_image = font15.render(str(actualFPS), 1, (255,255,255))

    #UPDATE===============================================
    #MENU STATE======================================
    if (current_state == GameState.MENU):
        Menu.update(milliseconds)

        if (InputHandler.rotate_button != 0):
            Menu.cursor_pos_up()
        if (InputHandler.down_button):
            Menu.cursor_pos_down()
        if (InputHandler.accept_button or InputHandler.drop_button):
            current_state = Menu.items[Menu.cursor_pos].attribute

    elif (current_state == GameState.PLAYING):
    #PLAYING STATE====================================
    
        if board.active == None:
            board.create()
            switched = False
            sinceYUpdate = 0

        ##Switching with Stored
        if (InputHandler.store_button and not switched):
            board.store()
            switched = True