Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ` class Canvas extends JPanel {
- @Override
- public void paint(Graphics g) {
- super.paint(g);
- for (int x = 0; x < FIELD_WIDTH; x++)
- for (int y = 0; y < FIELD_HEIGHT; y++) {
- if (mine[y][x] > 0) {
- g.setColor(new Color(mine[y][x]));
- g.fill3DRect(x*BLOCK_SIZE+1, y*BLOCK_SIZE+1, BLOCK_SIZE-1, BLOCK_SIZE-1, true);
- }
- }
- if (gameOver) {
- g.setColor(Color.white);
- for (int y = 0; y < GAME_OVER_MSG.length; y++)
- for (int x = 0; x < GAME_OVER_MSG[y].length; x++)
- if (GAME_OVER_MSG[y][x] == 1) g.fill3DRect(x*11+18, y*11+160, 10, 10, true);
- } else
- figure.paint(g);
- }
- }`
Add Comment
Please, Sign In to add comment