Skip to content

RobertLemmens/daedalus-engine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

57 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Daedalus engine

2D Java game engine

The engine is still in its early stages, but capable of making basic gameloops already. See daedalus-game module for an example. I play around in there during development.

Requirements

  • Java 16+ (we use new features)
  • opengl 4.5+ compatible device

Setup

  1. Create a gameloop by implementing DaedalusLoop:
public class SandboxLoop implements DaedalusLoop {

    private OrthographicCameraController cameraController;
    private Texture checkerboard;

    @Override
    public void onInit() {
        cameraController = new OrthographicCameraController((float)Constants.WINDOW_WIDTH / (float)Constants.WINDOW_HEIGHT, true);
        checkerboard = Texture.create("textures/Checkerboard.png");
    }

    @Override
    public void onUpdate(float dt) {

        cameraController.onUpdate(dt);

        Renderer.begin(cameraController.getCamera());
        Renderer.drawQuad(0.0f, 0.0f, Mat4f.scale(new Vec3f(0.5f)), 45, checkerboard);
        Renderer.end();
    }

    @Override
    public void onEvent() {

    }
}
  1. Initialize the engine in main by extending DaedalusApplication and calling run, passing it your loop class:
public class SandboxApplication extends DaedalusApplication {

    public static void main(String[] args) {
        SandboxApplication sandboxApplication = new SandboxApplication();
        sandboxApplication.run(new SandboxLoop());
    }

}

About

Daedalus 2D game engine

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published