Advertisement
Guest User

Untitled

a guest
Oct 30th, 2014
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. import java.awt.Color;
  2. import java.awt.Graphics;
  3.  
  4. public class Board {
  5.  
  6.  
  7. public static final int UP = 1, RIGHT = 2, DOWN = 3, LEFT = 4;
  8. public static final int NORTHEAST = 1, SOUTHEAST = 2, SOUTHWEST = 3,
  9. NORTHWEST = 4;
  10. public static final int CLOCKWISE = 1, COUNTERCLOCKWISE = 2;
  11.  
  12. public static boolean isClear[][];
  13.  
  14. public static void newBoard(Graphics page) {
  15.  
  16. isClear = new boolean[Play.DIMENSION_Y][];
  17.  
  18.  
  19. page.setColor(Color.white);
  20. page.fillRect(0, 0, Play.DIMENSION_X, Play.DIMENSION_Y);
  21.  
  22. page.setColor(Color.black);
  23. for (int i = 0; i <= Play.DIMENSION_Y; i++) {
  24. isClear[i] = new boolean[5];
  25. for (int j = 0; j <= Play.DIMENSION_X - 1; j += 2) {
  26. //isClear[i][j]=true;
  27. if (i % 2 == 0)
  28. page.fillRect(j * 100, i * 100, 100, 100);
  29. else
  30. page.fillRect(j * 100 + 100, i * 100, 100, 100);
  31.  
  32. }
  33. }
  34. }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement