Esempio n. 1
0
def main():

    global score, seconds_first, seconds_second, minutes_first, minutes_second, screen, mute

    while True:
        init()  # used to initialise the pygame module
        choice, color_choice, mute = menu_screen(screen, clock)

        # if the player presses "Let's Escape"
        if choice == 0:
            end_choice = gameloop(striker_colors[color_choice])
            # As long as player presses restart
            first = True
            while end_choice == 2 or first:
                if not first:
                    init()
                    end_choice = gameloop(striker_colors[color_choice])

                # if the player looses
                if end_choice == 0:
                    end_choice = end_screen(screen, False, score,
                                            seconds_first, seconds_second,
                                            minutes_first, minutes_second,
                                            clock, busts, escapes, mute)

                # if the player wins
                elif end_choice == 1:
                    end_choice = end_screen(screen, True, score, seconds_first,
                                            seconds_second, minutes_first,
                                            minutes_second, clock, busts,
                                            escapes, mute)

                first = False

            # if the player presses "Main Menu", loop goes on!

        # if the player presses "I m scared"
        elif choice == 1:
            credits_screen(screen, clock)
Esempio n. 2
0
        choice, color_choice = menu_screen(screen, clock)

        # if the player presses "Let's Escape"
        if choice == 0:
            end_choice = gameloop(striker_colors[color_choice])
            # As long as player presses restart
            first = True
            while end_choice == 2 or first:
                if not first:
                    init()
                    end_choice = gameloop(striker_colors[color_choice])

                # if the player looses
                if end_choice == 0:
                    end_choice = end_screen(screen, False, score,
                                            seconds_first, seconds_second,
                                            minutes_first, minutes_second,
                                            clock)

                # if the player wins
                elif end_choice == 1:
                    end_choice = end_screen(screen, True, score, seconds_first,
                                            seconds_second, minutes_first,
                                            minutes_second, clock)

                first = False

            # if the player presses "Main Menu", loop goes on!

        # if the player presses "I m scared"
        elif choice == 1:
            credits_screen(screen, clock)
Esempio n. 3
0
"""

# ===== Inicialização =====
# ----- Importa e inicia pacotes
import pygame
from config import SW, SH, INIT, GAME, QUIT, END
from init_screen import init_screen
from game_screen import game_screen
from end_screen import end_screen

pygame.init()
pygame.mixer.init()

# ----- Gera tela principal
window = pygame.display.set_mode((SW, SH))
pygame.display.set_caption('Breakout')


state = INIT
while state != QUIT:
    if state == INIT:
        state = init_screen(window)
    elif state == GAME:
        state = game_screen(window)
    elif state == END:
        state = end_screen(window)

# ===== Finalização =====
pygame.quit()