@Override
	public void render(float delta) {
		//TICK
		fps.log();
		cameraScroller.update();
		world.step(1f/60f, 6, 2);
		Array<Body> bodies = new Array<Body>(); world.getBodies(bodies);
		obstacles.clear();
		for(Body body : bodies){
			if(body.getUserData() instanceof BodyData){
				BodyData data = (BodyData) body.getUserData();
				if(!data.obstacle)
					continue;
				for(int x = (int) (body.getPosition().x-data.width*8); x < (body.getPosition().x+data.width*8); x++){
					for(int y = (int) (body.getPosition().y-data.height*8); y < (body.getPosition().y+data.height*8); y++){
						
						obstacles.add(new Vector2((float)x/(float)Constants.pathFindingStep,(float)y/(float)Constants.pathFindingStep));
					}
				}
			}
		}
		
		player.update(delta);
		if(Gdx.input.isKeyJustPressed(Keys.X)){
			BodyDef d = new BodyDef();
			d.type = BodyType.StaticBody;
			  
			Body body = world.createBody(d);
			
			PolygonShape s = new PolygonShape();
			s.setAsBox(10,10);
			
			
			FixtureDef f = new FixtureDef();
			f.shape = s;
			f.density = 0.4f;
			f.friction = 50f;
			
			body.createFixture(f);
			body.setTransform(0, 80, 0);
			
			BodyData data = new BodyData();
			data.width = 10;
			data.height = 10;
			body.setUserData(data);
		}
		//RENDER
		Gdx.gl.glClearColor(0, 0, 0, 1);
		Gdx.gl.glClear(Gdx.gl.GL_COLOR_BUFFER_BIT);
		
		box2dRenderer.render(world, camera.combined);
		
		player.render();
		
			}