freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

課程設(shè)計(jì)報(bào)告-俄羅斯方塊-嵌入式-qt-資料下載頁(yè)

2025-08-02 22:09本頁(yè)面
  

【正文】 (){ for (int i = 0。 i HTetrisBoardHeight * HTetrisBoardWidth。 ++i) board[i] = HTetrisPieceShapeNone。}void HTetrisBoard::dropDown(){ int dropHeight = 0。 int newY = curY。 while (newY 0) { if (!tryMove(curPiece, curX, newY 1)) break。 newY。 ++dropHeight。 } pieceDropped(dropHeight)。}void HTetrisBoard::oneLineDown(){ if (!tryMove(curPiece, curX, curY 1)) pieceDropped(0)。}void HTetrisBoard::pieceDropped(int dropHeight){ for (int i = 0。 i 4。 ++i) { int x = curX + (i)。 int y = curY (i)。 shapeAt(x, y) = ()。 } exp += 1。 score += dropHeight+1。 emit scoreChanged(score)。 removeFullLines()。 if(exp%50 == 0){ level++。 (timeoutTime(), this)。 emit levelChanged(level)。 } if (!isWaitingAfterLine) newPiece()。}void HTetrisBoard::removeFullLines(){ int numFullLines = 0。 for (int i = HTetrisBoardHeight 1。 i = 0。 i) { bool lineIsFull = true。 for (int j = 0。 j HTetrisBoardWidth。 ++j) { if (shapeAt(j, i) == HTetrisPieceShapeNone) { lineIsFull = false。 break。 } } if (lineIsFull) { ++numFullLines。 for (int k = i。 k HTetrisBoardHeight 1。 ++k) { for (int j = 0。 j HTetrisBoardWidth。 ++j) shapeAt(j, k) = shapeAt(j, k + 1)。 } for (int j = 0。 j HTetrisBoardWidth。 ++j) shapeAt(j, HTetrisBoardHeight 1) = HTetrisPieceShapeNone。 } } if (numFullLines 0) { switch(numFullLines){ case 1: exp += 1。 score += 10。 break。 case 2: exp += 2。 score += 20。 break。 case 3: exp += 3。 score += 30。 break。 case 4: exp += 5。 score += 50。 break。 } emit scoreChanged(score)。 (500, this)。 isWaitingAfterLine = true。 (HTetrisPieceShapeNone)。 update()。 }}void HTetrisBoard::newPiece(){ curPiece = nextPiece。 ()。 ((HTetrisPieceRotate)(qrand()%4))。 showNextPiece()。 curX = HTetrisBoardWidth / 2。 curY = HTetrisBoardHeight 1 + ()。 if (!tryMove(curPiece, curX, curY)) { (HTetrisPieceShapeNone)。 ()。 isStarted = false。 gameOver = true。 update()。 }}void HTetrisBoard::showNextPiece(){ if (!nextPieceLabel) return。 int dx = () () + 1。 int dy = () () + 1。 QPixmap pixmap(dx * squareWidth(), dy * squareHeight())。 QPainter painter(amp。pixmap)。 ((), nextPieceLabelpalette().background())。 for (int i = 0。 i 4。 ++i) { int x = (i) ()。 int y = (i) ()。 drawSquare(painter, x * squareWidth(), y * squareHeight(), ())。 } nextPieceLabelsetPixmap(pixmap)。}bool HTetrisBoard::tryMove(const HTetrisPiece amp。newPiece, int newX, int newY){ for (int i = 0。 i 4。 ++i) { int x = newX + (i)。 int y = newY (i)。 if (x 0 || x = HTetrisBoardWidth || y 0 || y = HTetrisBoardHeight) return false。 if (shapeAt(x, y) != HTetrisPieceShapeNone) return false。 } curPiece = newPiece。 curX = newX。 curY = newY。 update()。 return true。}void HTetrisBoard::drawSquare(QPainter amp。painter, int x, int y, HTetrisPieceShape shape){ QColor color = colorTable[(int)(shape)]。 (x + 1, y + 1, squareWidth() 2, squareHeight() 2, color)。 (())。 (x, y + squareHeight() 1, x, y)。 (x, y, x + squareWidth() 1, y)。 (())。 (x + 1, y + squareHeight() 1, x + squareWidth() 1, y + squareHeight() 1)。 (x + squareWidth() 1, y + squareHeight() 1, x + squareWidth() 1, y + 1)。}void HTetrisBoard::moveLeft(){ tryMove(curPiece, curX 1, curY)。}void HTetrisBoard::moveRight(){ tryMove(curPiece, curX + 1, curY)。}void HTetrisBoard::moveDown(){ oneLineDown()。}void HTetrisBoard::rotateLeft(){ tryMove((), curX, curY)。}void HTetrisBoard::rotateRight(){ tryMove((), curX, curY)
點(diǎn)擊復(fù)制文檔內(nèi)容
公司管理相關(guān)推薦
文庫(kù)吧 www.dybbs8.com
備案圖鄂ICP備17016276號(hào)-1