俄罗斯方块与图形绘制应用开发
俄罗斯方块应用开发
在俄罗斯方块应用开发中,涉及到多种图形的定义与绘制,以及游戏网格的管理。
图形绘制方法
TetrisFigure 类中的 DrawFigure 方法用于绘制图形,代码如下:
void TetrisFigure::DrawFigure(Graphics& graphics,Size offsetSize) const {
gameGridPtr->DrawSquare(graphics, row, col,
Black, color, offsetSize);
{ int relRow = row + figureInfo[direction][0].first,
relCol = col + figureInfo[direction][0].second;
gameGridPtr->DrawSquare(graphics, relRow, relCol,
Black, color, offsetSize);
}
{ int relRow = row + figureInfo[direction][1].first,
relCol = col + figureInfo[direction][1].second;
gameGridPtr->DrawSquare(graphics, relRow, rel
超级会员免费看
订阅专栏 解锁全文

被折叠的 条评论
为什么被折叠?



