Skip to content

Engine built with LWJGL 3 for making 2D and 3D games. Highly inspired from libGDX

License

Notifications You must be signed in to change notification settings

ArthurLumertz/orinengine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 

Repository files navigation

Orin Engine (Java 1.8 and above)

Java game engine made in LWJGL 3.

Similar to LibGDX, RayLib and MonoGame.


Setup

To setup, download the compiled JAR file and add them to the build path in Eclipse IDE.

After this, create a Main.java file and add the following example code to get you started:


public class Demonstration implements Game {
private Batch batch;
private Camera camera;

private Texture tex;

@Override
public void init() {
	this.batch = new Batch();
	this.camera = new Camera(Orin.graphics.getWidth(), Orin.graphics.getHeight());
}

// "tick" means update but in a fancier way
@Override
public void tick(float deltaTime) {
  // Nothing to tick!
  // You could add key detection via
  // if (Orin.input.isKeyPressed(Keys.W) {
  // }
}

@Override
public void render() {
	Orin.gl.clear(GL.COLOR);
	Orin.gl.clearColor(Color.CORNFLOWER_BLUE);
	
	this.batch.begin();
	this.batch.setCamera(this.camera);
	this.batch.drawTexture(this.tex, 0.0F, 0.0F, 32.0F, 32.0F);
	this.batch.end();
}

@Override
public void dispose() {
   this.batch.dispose();
}

public static void main(String[] args) {
	LWJGL3 app = new LWJGL3();
	app.setFPS(60);
	app.create(new Demonstration());
}

}