row and col

This commit is contained in:
zhe 2021-11-12 17:40:58 +01:00
parent 23c795a2e7
commit 2215dc0ba7
2 changed files with 6 additions and 5 deletions

View File

@ -41,11 +41,12 @@ public class Board extends JPanel
g.setColor(Color.DARK_GRAY);
//shape mit 2-Forschleife
for(int i=0;i< shape.length;i++){
for(int j = 0;j< shape[0].length;j++){
if(shape[i][j] !=null){
g.setColor(shape[i][j]);
g.fillRect(i*BLOCK_SIZE,j*BLOCK_SIZE,BLOCK_SIZE,BLOCK_SIZE);
for(int row=0;row< shape.length;row++){
for(int col = 0;col< shape[0].length;col++){
if(shape[row][col] !=null){
g.setColor(shape[row][col]);
//
g.fillRect(col*BLOCK_SIZE,row*BLOCK_SIZE,BLOCK_SIZE,BLOCK_SIZE);
}
}