Ejemplo n.º 1
0
    if new_state != State.program_states.STATE_NULL:
        if new_state == State.program_states.STATE_MENU.value:
            current_state = Menu()

        if new_state == State.program_states.STATE_GAME.value:
            current_state = Game()
            current_state.set_display(game_display)
            current_state.create_game_world()


while running:

    clock.tick(60)

    change_state(current_state.get_next_state())

    for event in pygame.event.get():

        if event.type == pygame.QUIT:
            running = False

        elif event.type == pygame.MOUSEMOTION:
            MouseListener.update_pos(event)

        elif event.type == pygame.MOUSEBUTTONUP:
            MouseListener.update_button_up(event)

        elif event.type == pygame.MOUSEBUTTONDOWN:
            MouseListener.update_button_down(event)