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 + 1) >> 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.grass;
			if (tiles[x + y * width] == 1) return Tile.grass;
			return Tile.voidTile;
		}
		
}


@@ -817,19 +817,20 @@
 ght 
-+ 1
+- 48
 ) %3E%3E 4;%0A
 %09%09%0A%09
@@ -825,16 +825,17 @@
 ) %3E%3E 4;%0A
+%0A
 %09%09%0A%09%09%0A%09%09
@@ -1062,16 +1062,17 @@
 idTile;%0A
+%0A
 %09%09%09if (t
@@ -1110,24 +1110,25 @@
 n Tile.grass
+2
 ;%0A%09%09%09if (til
@@ -1172,33 +1172,195 @@
 rass
+3
 ;%0A%09%09%09
-return Tile.voidTile
+if (tiles%5Bx + y * width%5D == 2) return Tile.grass4;%0A%09%09%09if (tiles%5Bx + y * width%5D == 3) return Tile.grass5;%0A%09%09%09if (tiles%5Bx + y * width%5D == 4) return Tile.tree;%0A%09%09%09%0A%09%09%09return Tile.grass
 ;%0A%09%09

Update Level.java