Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Aug 10th, 2012  |  syntax: None  |  size: 0.51 KB  |  hits: 8  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Tile based game - intersecting
  2. public void paint(Graphics g) {
  3.         g.setColor(Color.black);
  4.         g.fillRect(0, 0, 800, 600);
  5.         g.setColor(Color.blue);
  6.         {
  7.             for (int i = 0; i < level.length; i++) {
  8.                 for (int j = 0; j < level[0].length; j++) {
  9.                     if (level[i][j] == 1) {
  10. //nothing
  11.                     }else if (level[i][j] == 2) {
  12.                         g.fillRect(j * 32, i * 32, 32, 32);
  13.                     }
  14.                 }
  15.             }
  16.         }