Exemplo n.º 1
0
                                    shape.blocklist[0].gridYpos)
                shape.drop()

    screen.fill(BLACK)
    shape.draw(screen)

    if gameBoard.checkloss():
        gameBoard = GameBoard(WHITE, shape.blocklist[0].size)

        shape = Shape()
        nextshape = Shape()
    if shape.active == False:
        shape = nextshape
        nextshape = Shape()

    gameBoard.clearFullRows()
    gameBoard.draw(screen)
    nextshape.drawNextShape(screen)

    time.sleep(0.11 - gameBoard.level * 0.01)
    scoreText = myFont.render("score: " + str(gameBoard.score), 1, WHITE)
    levelText = myFont.render("level: " + str(gameBoard.level), 1, WHITE)
    linesText = myFont.render("lines: " + str(gameBoard.lines), 1, WHITE)
    nextText = myFont.render("next: ", 1, WHITE)
    screen.blit(linesText, (400, 310))
    screen.blit(scoreText, (400, 400))
    screen.blit(levelText, (400, 360))
    screen.blit(nextText, (400, 100))
    pygame.draw.rect(screen, WHITE, [500, 100, 6 * 25, 6 * 25], 1)
    pygame.display.flip()