Since about July of 2019, I’ve been making a 2D game engine entirely in the Java Programming language and it’s native libraries. You may think why I would use Java of all languages. I chose Java mainly because of it’s simplicity. This game engine is also not meant for “top of the line” 2D game making. It was mainly designed for simple 8 or 16 bit graphics. This whole project was mainly for fun and to teach myself a little more about game programming. If you would like to see the source, it’s linked here
// A basic Example
import net.judgeglass.tilegame.player.Player;
import net.judgeglass.tilegame.player.PlayerMovement;
import net.judgeglass.tilegame.ui.HUD;
import net.judgeglass.tilegame.world.TestBlock;
import net.judgeglass.jgameengine.core.io.SpriteSheet;
import net.judgeglass.jgameengine.gfx.Screen;
public class Main{
private static SpriteSheet spriteSheet = new SpriteSheet("file.png");
public static Main(String args[]){
Screen gameScreen = new Screen(600, 480, "Tile Game v0.0.1 (Hunter Wilcox)"); // Makes the main window with renderer
gameScreen.setClearColor(0x0000FF); // Sets the Background color to blue
TestBlock testBlock = new TestBlock(20, 20); // A custom GameObject that renders a block
PlayerMovement playerMovement = new PlayerMovement(new Player(0, 0)); // A custom GameObject that spawns a player
gameScreen.getRenderer().setKeyListener(playerMovement); // Adds a KeyListener to the renderer
gameScreen.getRenderer().setThreadSleep(28); // Locks the frame rate to 30 FPS
}
}