public void paint(Graphics g) {
		Image offscreen = null;
		Graphics offgc;
		offscreen = createImage(getWidth(),getHeight());
		offgc = offscreen.getGraphics();
		int tileSize=32;
		
		int playerPosX=(GameModel.getLocalPlayer().getPosX()/tileSize);
		int playerPosY=(GameModel.getLocalPlayer().getPosY()/tileSize);
		
		for(int x=playerPosX-30;x<playerPosX+30;x++){
			for(int y=playerPosY-15;y<playerPosY+15;y++){
				SortedTileList tileArr=GameModel.GetWorldMap().getPoint(x, y);
				
				
				if(tileArr!=null){
					/*for(Tile tile:map.getPoint(x, y)){
						/if(tile.getZValue()>100){
							break;
						}
					//	tile.drawItSelf(offgc,this,x*(int)(64*zoom)-leftCornerX,y*(int)(64*zoom)-leftCornerY,zoom);

					}*/
				//	System.out.println("mitten"+centerX+" "+centerY);
					tileArr.drawUnderIT(offgc, null,(int)( x*(tileSize*zoom))-leftCornerX,(int) (y*(tileSize*zoom))-leftCornerY, zoom);
				}
			}
		}
		

		
		
		
		for(Moveable animal:GameModel.getAnimals()){
			offgc.drawImage(animal.getImg(),animal.getPosX()-leftCornerX, animal.getPosY()-leftCornerY, animal.getPosX()-leftCornerX + (int) (32 * zoom), animal.getPosY()-leftCornerY
					+ (int) (32 * zoom), 0, 0,  32,  32, this);
			//offgc.drawImage(animal.getImg(), animal.getPosX(), animal.getPosY(), animal.getPosX() + (int) (64 * zoom), animal.getPosY()
			//		+ (int) (64 * zoom), 0, 0,  64,  64,this);
			
		}
		
		for(int x=playerPosX-30;x<playerPosX+30;x++){
			for(int y=playerPosY-15;y<playerPosY+15;y++){
				SortedTileList tileArr=GameModel.GetWorldMap().getPoint(x, y);
				
				
				if(tileArr!=null){
					
					
					
					
					tileArr.drawOverIT(offgc, null,(int)( x*(tileSize*zoom))-leftCornerX,(int) (y*(tileSize*zoom))-leftCornerY, zoom);
				}
				if(playerPosX==x&&playerPosY==y){
					GameModel.getLocalPlayer().drawItSelf(offgc,this,(int)getWidth()/2,(int)getHeight()/2,zoom);
				}
			}
			
		}
		g.drawImage(offscreen, 0, 0, this);
	}