- Tile based game - intersecting
- public void paint(Graphics g) {
- g.setColor(Color.black);
- g.fillRect(0, 0, 800, 600);
- g.setColor(Color.blue);
- {
- for (int i = 0; i < level.length; i++) {
- for (int j = 0; j < level[0].length; j++) {
- if (level[i][j] == 1) {
- //nothing
- }else if (level[i][j] == 2) {
- g.fillRect(j * 32, i * 32, 32, 32);
- }
- }
- }
- }