Пример #1
0
def options_animation(forward):
    """
	An to 'forward' einai true tote mia apo tis epiloges pou parexei to menu exei epilextei
	kai ara prepei na fygoun oi epiloges kanontas mia aplh kinhsh (merikes epiloges feygoun pros
	ta de3ia kai alles pros ta aristera). An to 'forward' einai false tote ginetai h anti9eth kinhsh
	(dhladh o xrhsths exei gyrisei sto menu apo kapoia epilogh)
	"""
    global select_level_rect, help_rect, credits_rect, quit_rect

    animation_speed = 0.025

    if (forward):
        #an option has been selected...
        data.MENU_SELECTING_OPTION = False

        counter = 1.0
        while (counter > -1.0):
            select_level_rect.center = (data.WINDOWWIDTH * counter / 2,
                                        data.WINDOWHEIGHT * 7 / 15)
            help_rect.center = (data.WINDOWWIDTH * (1 + (-1) * counter) / 2 +
                                data.WINDOWWIDTH / 2,
                                data.WINDOWHEIGHT * 9 / 15)
            credits_rect.center = (data.WINDOWWIDTH * counter / 2,
                                   data.WINDOWHEIGHT * 11 / 15)
            quit_rect.center = (data.WINDOWWIDTH * (1 + (-1) * counter) / 2 +
                                data.WINDOWWIDTH / 2,
                                data.WINDOWHEIGHT * 13 / 15)
            blit_objects()
            counter -= animation_speed
            game.display.update()
            data.MAINCLOCK.tick(data.FPS)
    else:
        #the back button after an option has been selected has been clicked.
        data.MENU_SELECTING_OPTION = True

        data.play_music("menu")

        counter = -1.0
        while (counter <= 1.0):
            select_level_rect.center = (data.WINDOWWIDTH * counter / 2,
                                        data.WINDOWHEIGHT * 7 / 15)
            help_rect.center = (data.WINDOWWIDTH * (1 + (-1) * counter) / 2 +
                                data.WINDOWWIDTH / 2,
                                data.WINDOWHEIGHT * 9 / 15)
            credits_rect.center = (data.WINDOWWIDTH * counter / 2,
                                   data.WINDOWHEIGHT * 11 / 15)
            quit_rect.center = (data.WINDOWWIDTH * (1 + (-1) * counter) / 2 +
                                data.WINDOWWIDTH / 2,
                                data.WINDOWHEIGHT * 13 / 15)
            blit_objects()
            counter += animation_speed
            game.display.update()
            data.MAINCLOCK.tick(data.FPS)

        wait_for_selection()
Пример #2
0
def show():
    init_variables()
    make_elements()
    data.play_music("help")
    wait_for_back()
Пример #3
0
def start():
	init_variables()
	data.play_music("level2")
	wait_for_level_end()
Пример #4
0
def show():
    init_variables()
    make_elements()
    data.play_music("level_selection")
    wait_for_selection()
Пример #5
0
def show():
    CURRENT_MENU_SELECTION = 0
    data.MENU_SELECTING_OPTION = True
    make_elements()
    data.play_music("menu")
    wait_for_selection()