User Tools

Site Tools


a_2048_gui

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
a_2048_gui [2026/02/12 16:03] frchrisa_2048_gui [2026/02/12 16:36] (current) frchris
Line 119: Line 119:
  }  }
  g.setColor(Color.BLACK);  g.setColor(Color.BLACK);
 +                int thickness = 3; // of the grid lines
  for(int r = 0; r <= boardSize; r++) {  for(int r = 0; r <= boardSize; r++) {
- g.drawLine(left, top + size*r, left + boardSize*size, top +size*r);+     for(int i = 0; i < thickness ; i++) 
 +                      g.drawLine(left, top + size*r+i, left + boardSize*size, top +size*r+i);
  }  }
  
  for(int c = 0; c <= boardSize; c++){  for(int c = 0; c <= boardSize; c++){
- g.drawLine(left+c*size, top ,left+c*size, top + boardSize* size);+                    for(int i = 0; i < thickness ; i++) 
 + g.drawLine(left+c*size+i, top ,left+c*size+i, top + boardSize* size);
  }  }
  }  }
Line 173: Line 176:
  myGame.add2ToBoard();  myGame.add2ToBoard();
  if (myGame.gameOver())  if (myGame.gameOver())
- message = "Game Over - You reached "+ myGame.max();+ message = "Game Over - You reached "+ myGame.getMax();
  repaint();  repaint();
  }  }
a_2048_gui.1770930235.txt.gz · Last modified: by frchris

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki