Garrett Nix

JFlatGL

See it on GitHub! arrow_outward

JFlatGL is a 2D game library written in Java I've developed on-and-off since mid-2019.

Built atop the LWJGL library, JFlatGL aims to make programming 2D games easier by providing a framework for managing assets, updating game states, and rendering sprites. JFlatGL implements all of the OpenGL code necessary for displaying your game via RenderElements of various types. Developers define their own GameStates and game logic, then let JFlatGL handle all the drawing by simply calling render() on their RenderElements.

JFlatGL also handles audio, font rendering, and more out of the box. More advanced users can implement custom splash screens for their games using the built-in splash screen feature.

A* Pathfinding Implementation

See it on GitHub! arrow_outward

The A* pathfinding algorithm is commonly used in games for navigating interactive spaces. A* is a populat choice due to its greedy nature and guarantee of an optimal solution.

This implementation of A* in Java implements a slightly modified version of A* which forgoes the guarantee of optimality in favor of a slight performance boost. This is achieved by simply returning as soon as any valid solution is found, regardless of whether other solutions may exist.

This implementation uses mazes generated via an algorithm I found online (it's been a while, so I don't remember exactly where). I used Java's AWT graphics API to provide a real-time rendering of the algorithm as it computes the solution to each maze. (On the smaller mazes, it will generally solve them so quickly that you don't see much).

The starting space is marked in yellow, with the end space in magenta. Spaces currently open for exploring are marked green, while spaces already visited are marked red.