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

正文內(nèi)容

課程設(shè)計(jì)報(bào)告-俄羅斯方塊-嵌入式-其他專(zhuān)業(yè)-資料下載頁(yè)

2025-01-19 01:58本頁(yè)面

【導(dǎo)讀】Qt是一個(gè)跨平臺(tái)的C++圖形用戶(hù)界面應(yīng)用程序框架。本程序利用Qt提供的相關(guān)類(lèi),實(shí)?,F(xiàn)了俄羅斯方塊的基本功能。它包括跨平臺(tái)類(lèi)庫(kù)、集成開(kāi)發(fā)工具和跨平臺(tái)IDE。系統(tǒng)部署這些應(yīng)用程序。QObject是所有Qt類(lèi)的基類(lèi)。QObject組織成為對(duì)象樹(shù)。

  

【正文】 , curY)。 break。 default: QFrame::keyPressEvent(event)。 } } void HTetrisBoard::timerEvent(QTimerEvent *event) { if (eventtimerId() == ()) { if (isWaitingAfterLine) { isWaitingAfterLine = false。 newPiece()。 (timeoutTime(), this)。 16 } else { oneLineDown()。 } } else { QFrame::timerEvent(event)。 } } void HTetrisBoard::clearBoard() { 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。 17 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。 18 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)。 19 (())。 (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)容
環(huán)評(píng)公示相關(guān)推薦
文庫(kù)吧 www.dybbs8.com
備案圖鄂ICP備17016276號(hào)-1