Exemplo n.º 1
0
                shape.moveLeft()
            elif event.key == pygame.K_RIGHT:
                shape.moveRight()
            elif event.key == pygame.K_DOWN:
                shape.moveDown()
            elif event.key == pygame.K_UP:
                shape.rotateClockWise()
            elif event.key == pygame.K_s:
                gameBoard.score += (gameBoardHeight -
                                    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)