Hello all! I am soon going to start teaching a friend java, and he asked to teach him how to make games. So, I started coding a ‘library’ which uses slick2d and lwjgl. It’s basically just a base, so people can make 2d games.
Library: http://www.infinitecoder.net/games/simpleGL.jar
Example ‘Game’:
-Main Class:
package net.infinitecoder.simpleGL2D.testGame;
import org.lwjgl.opengl.Display;
import org.lwjgl.opengl.DisplayMode;
import net.infinitecoder.simpleGL2D.GameBase;
public class TestGame extends GameBase{
static {
setInformation("Game", 800, 600);
func = new GameFunctions(new TestGame());
}
public static void main(String[] args) throws Exception{
if(title == null) {
title = "A SimpleGL2D Game";
}
if(width == -1 && height == -1) {
width = 800;
height = 600;
}
Display.setDisplayMode(new DisplayMode(width, height));
Display.setTitle(title);
Display.create();
func.init();
}
}
-Functions Class:
package net.infinitecoder.simpleGL2D.testGame;
import net.infinitecoder.simpleGL2D.FunctionsBase;
import net.infinitecoder.simpleGL2D.GameBase;
import org.lwjgl.input.Keyboard;
import org.lwjgl.opengl.GL11;
public class GameFunctions extends FunctionsBase{
public GameFunctions(GameBase game) {
super(game);
}
@Override
public void update() {
startUpdate();
endUpdate();
}
}