Hello I am trying to make a chrater with a lighter, that will only send light to the forward.
something like this:
http://www.ludumdare.com/compo/wp-content/compo2/233892/3661-shot2.jpg
But currently I have this:
How can I do this?
My light point and ray initialization
debug = new Box2DDebugRenderer();
this.texture = new Texture("sprites/water.png");
this.camera = new OrthographicCamera(Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
this.camera.setToOrtho(false);
this.renderer = new SpriteBatch();
this.map = new TileMap(20, 20);
this.map.generateAllSame(new Texture("sprites/sprite.png"));
this.world = new World(new Vector2(), true);
this.createBodies();
RayHandler.setGammaCorrection(true);
RayHandler.useDiffuseLight(true);
this.ray = new RayHandler(this.world);
this.ray.setAmbientLight(0.1f, 0.4f, 0.2f, 0.1f);
this.ray.setCulling(true);
this.ray.setBlurNum(2);
camera.update(true);
this.spriteLight = new PointLight(ray, 1000, Color.CYAN, 5, 1.f, 1.f);
this.spriteLight.attachToBody(this.bodies.get(1), 0, 0);