package com.ready.rain.level;
import com.ready.rain.level.tile.Tile;
import com.ready.rain.graphics.Screen;
public class Level {

		protected int width, height;
		protected int[] tiles;	
		public Level(int width, int height) {
		this.width = width;	
		this.height = height;
		tiles = new int[width * height];
		generateLevel();
		}
		
		public Level (String path) {
		loadLevel (path);	
		}
		
		
		protected void generateLevel() {
			
		}
		
		private void loadLevel (String path) {
			
		}
		
		public void update(){
			
		}
		
		private void time() {
			
		}
		private int a = 16;
		public void render(int xScroll, int yScroll, Screen screen) {
		screen.setOffset(xScroll, yScroll);
		int x0 = xScroll >> 4; 
		int x1 = (xScroll + screen.width + 16) >> 4;
		int y0 = yScroll >> 4;
		int y1 = (yScroll + screen.height - 48) >> 4;

		
		
		for (int y = y0; y < y1;y++){
			for (int x = x0; x < x1;x++){
				getTile(x, y).render(x, y, screen);
			}
		}
		}
		public Tile getTile(int x, int y) {
			if (x < 0 || y < 0 || x >= width || y >= height) return Tile.voidTile;

			if (tiles[x + y * width] == 0) return Tile.grass2;
			if (tiles[x + y * width] == 1) return Tile.grass3;
			if (tiles[x + y * width] == 2) return Tile.grass4;
			if (tiles[x + y * width] == 3) return Tile.grass5;
			if (tiles[x + y * width] == 4) return Tile.tree;
			
			return Tile.grass;
		}
		
}


@@ -824,20 +824,16 @@
 8) %3E%3E 4;
-%0A%0A%09%09
 %0A%09%09%0A%09%09fo
@@ -843,24 +843,24 @@
 int 
-y = y0; y %3C y1;y
+x = x0; x %3C x1;x
 ++)%7B
@@ -872,32 +872,32 @@
 or (int 
-x = x0; x %3C x1;x
+y = y0; y %3C y1;y
 ++)%7B%0A%09%09%09
@@ -1363,8 +1363,9 @@
 %7D%0A%09%09%0A%7D%0A%0A
+%0A

Update Level.java