Package tests

Source Code of tests.SimpleTest

package tests;

import box2dLight.PointLight;
import box2dLight.RayHandler;

import com.badlogic.gdx.ApplicationAdapter;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.OrthographicCamera;
import com.badlogic.gdx.math.Vector2;
import com.badlogic.gdx.physics.box2d.World;

public class SimpleTest extends ApplicationAdapter {
  /** the camera **/
  OrthographicCamera camera;
  RayHandler rayHandler;
  World world;

  @Override
  public void create() {
    camera = new OrthographicCamera(48, 32);
    camera.update();
    world = new World(new Vector2(0, -10), true);
    rayHandler = new RayHandler(world);
    new PointLight(rayHandler, 32);

  }

  @Override
  public void render() {
    Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
    world.step(Gdx.graphics.getDeltaTime(), 8, 3);
    rayHandler.setCombinedMatrix(camera.combined);
    rayHandler.updateAndRender();
  }
}
TOP

Related Classes of tests.SimpleTest

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.