Ejemplo n.º 1
0
    game = Tetris(Menu1.height, Menu1.width, speed, Menu1.width // 2 - 2)
    screen = pygame.display.set_mode(size)

    if MainState == "load":
        x, y, s, z = game.load()
        size = (x * 20 + 200, y * 20 + 100)
        gamesize = (x * 20, y * 20)
        game1 = Tetris(y, x, speed, x // 2 - 2)
        game1.field = z
        screen = pygame.display.set_mode(size)
        MainState = "start"
        game1.score = s

        game = game1
    if speed == 2:
        gameBackground = Menu.Background("game_background_main.jpg",
                                         [0, -660 + size[1]])
    else:
        gameBackground = Menu.Background("game_background_Dark.jpg",
                                         [0, -660 + size[1]])

    try:
        while MainState == "start":

            if game.figure is None:
                game.new_block()
            counter += 1
            if counter > 100000:
                counter = 0

            if counter % (fps // game.level // 2) == 0 or pressing_down:
                if game.gameState == "start":