java俄罗斯方块怎么设置方块到底的时候消除方法
1个回答
展开全部
/*
* 判断是否能消去整行 */
public void checkFullLine()
{
for (int i = 0; i < canvas.getRows(); i++) {
int row = -1;
boolean fullLineColorBox = true;
for (int j = 0; j < canvas.getCols(); j++) {
if (!canvas.getBox(i, j).isColorBox()) {
fullLineColorBox = false;
break;
}
}
if (fullLineColorBox) {
curLevelScore += PER_LINE_SCORE;
score += PER_LINE_SCORE;
row = i--;
canvas.removeLine(row);
}
}
}
* 判断是否能消去整行 */
public void checkFullLine()
{
for (int i = 0; i < canvas.getRows(); i++) {
int row = -1;
boolean fullLineColorBox = true;
for (int j = 0; j < canvas.getCols(); j++) {
if (!canvas.getBox(i, j).isColorBox()) {
fullLineColorBox = false;
break;
}
}
if (fullLineColorBox) {
curLevelScore += PER_LINE_SCORE;
score += PER_LINE_SCORE;
row = i--;
canvas.removeLine(row);
}
}
}
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询