Guest User

Untitled

a guest
Jan 17th, 2019
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. ` class Canvas extends JPanel {
  2. @Override
  3. public void paint(Graphics g) {
  4. super.paint(g);
  5. for (int x = 0; x < FIELD_WIDTH; x++)
  6. for (int y = 0; y < FIELD_HEIGHT; y++) {
  7. if (mine[y][x] > 0) {
  8. g.setColor(new Color(mine[y][x]));
  9. g.fill3DRect(x*BLOCK_SIZE+1, y*BLOCK_SIZE+1, BLOCK_SIZE-1, BLOCK_SIZE-1, true);
  10. }
  11. }
  12. if (gameOver) {
  13. g.setColor(Color.white);
  14. for (int y = 0; y < GAME_OVER_MSG.length; y++)
  15. for (int x = 0; x < GAME_OVER_MSG[y].length; x++)
  16. if (GAME_OVER_MSG[y][x] == 1) g.fill3DRect(x*11+18, y*11+160, 10, 10, true);
  17. } else
  18. figure.paint(g);
  19. }
  20. }`
Add Comment
Please, Sign In to add comment