Skip to content

Latest commit

 

History

History
executable file
·
38 lines (28 loc) · 1.26 KB

README.md

File metadata and controls

executable file
·
38 lines (28 loc) · 1.26 KB

PanJohnny's Game Library

A game library for making simple games in java

Example with java desktop (awt + swing)

public class Example {
    public static void main(String[] args) {
        PJGL.init(new JDInitializer("Apple!"));
        PJGL pjgl = PJGL.getInstance();
        pjgl.start();

        SpriteRegistry.registerSprite("apple", "/apple.png");

        GameObject apple = new GameObject() {
            public final Position position = addComponent(new Position(this, 10, 10));
            public final Size size = addComponent(new Size(this, 100, 100));
            public final SpriteRenderer renderer = addComponent(new SpriteRenderer(this, "apple"));
        };

        pjgl.getManager().queueAddition(apple);
    }
}

Adaptability

This project is free to be adapted by anyone.

Currently you can use these two:

  • Java Desktop - awt, swing
  • LWJGL

You can read more information at the wiki, or ask me directly.