void GenericTetrix::internalPieceDropped(int dropHeight) { gluePiece(); nPiecesDropped++; if (nPiecesDropped % 25 == 0) { level++; updateLevel(level); } score = score + 7 + dropHeight; removeFullLines(); updateScore(score); pieceDropped(dropHeight); }
//! [22] void TetrixBoard::pieceDropped(int dropHeight) { for (int i = 0; i < 4; ++i) { int x = curX + curPiece.x(i); int y = curY - curPiece.y(i); shapeAt(x, y) = curPiece.shape(); } ++numPiecesDropped; if (numPiecesDropped % 25 == 0) { ++level; timer.start(timeoutTime(), this); emit levelChanged(level); } score += dropHeight + 7; emit scoreChanged(score); removeFullLines(); if (!isWaitingAfterLine) newPiece(); //! [22] //! [23] }