文档下载 文档下载导航
设为首页 | 加入收藏
搜索 请输入内容:  
 导航当前位置: 文档下载 > 所有分类 > 工程科技 > 机械/仪表 > 关于俄罗斯方块的嵌入式设计报告
侵权投诉

关于俄罗斯方块的嵌入式设计报告

{{0, 0}, {0, 0}, {0, 0}, {0, 0}},

{{0, -1}, {0, 0}, {0, 1}, {0, 2}},

{{-1, 0}, {0, 0}, {1, 0}, {0, 1}},

{{0, -1}, {0, 0}, {0, 1}, {-1, 1}},

{{0, -1}, {0, 0}, {0, 1}, {1, 1}},

{{0, 0}, {1, 0}, {1, 1}, {0, 1}},

{{-1, -1}, {0, -1}, {0, 0}, {1, 0}},

{{1, -1}, {0, -1}, {0, 0}, {-1, 0}}

};

void HTetrisPiece::setRandomShape()

{

setShape((HTetrisPieceShape)(qrand() % 7 + 1));

}

void HTetrisPiece::setShape(HTetrisPieceShape shape)

{

for (int i=0; i<4; i++){

coords[i][0] = coordsTable[shape][i][0];

coords[i][1] = coordsTable[shape][i][1];

}

pieceShape = shape;

}

int HTetrisPiece::minX()const

{

int min = coords[0][0];

for (int i = 1; i < 4; ++i)

min = qMin(min, coords[i][0]);

return min;

}

int HTetrisPiece::maxX()const

{

int max = coords[0][0];

for (int i = 1; i < 4; ++i)

max = qMax(max, coords[i][0]);

return max;

}

int HTetrisPiece::minY()const

{

int min = coords[0][1];

for (int i = 1; i < 4; ++i)

min = qMin(min, coords[i][1]);

return min;

}

int HTetrisPiece::maxY()const

{

int max = coords[0][1];

for (int i = 1; i < 4; ++i)

max = qMax(max, coords[i][1]);

return max;

}

void HTetrisPiece::setRotate(HTetrisPieceRotate rotate)

{

switch(rotate){

上一页第10页

TOP相关主题

热门文档

站点地图 | 文档上传 | 侵权投诉 | 手机版
本站所有资源均来自互联网,本站只负责收集和整理,均不承担任何法律责任,如有侵权等其它行为请联系我们.
文档下载 Copyright 2013 doc.guandang.net All Rights Reserved.  -  email