* Draw the current whereabouts of the square
* @param g 画笔
*/
public void paintBrick(Graphics g){
for(int row = 0;row < 4;row++){
for(int col = 0;col < 4;col++){
//判断是否绘制
if(brick[brickType][index][row][col] == 1){
int cx = (cCol + col) * CELLWIDTH;
int cy = (cRow + row) * CELLWIDTH;
paintCell(g,cx,cy);
}
}
}
}
/**下一个方块左上角的x坐标*/
int nextBrickX = 110;
/**下一个方块左上角的y坐标*/
int nextBrickY = 30;
/**下一个方块文字*/
String str = "下一个方块";
/**
* Draw the next square
* @param g 画笔
*/
public void paintNextBrick(Graphics g){
//绘制文字
g.drawString(str, nextBrickX, nextBrickY,
Graphics.LEFT | Graphics.TOP);
//绘制方块
for(int row = 0;row < 4;row++){
for(int col = 0;col < 4;col++){
//判断是否绘制
if(brick[nextBrickType][0][row][col] == 1){
int cx =nextBrickX+ col * CELLWIDTH;
int cy =nextBrickY + 20 + row * CELLWIDTH;
paintCell(g,cx,cy);
}
}
}
}
String scoreStr = "当前得分:";
/**