A Java 2D game engine, born from the Lionheart Remake project.
๐ Website ยท ๐ฆ Download ยท ๐ Tutorials ยท ๐ Maven Central
The LionEngine is a lightweight, modular 2D game engine for Java, distributed as a simple JAR library. Plug it into any project to get a full-featured foundation for your game โ or use only the parts you need.
It was built for game development, powering Lionheart Remake, and designed to stay out of your way while giving you everything to ship a game.
Targets: Desktop (Java >=17 + AWT) and Android 5.0 (API 21). The game logic is fully portable between both; only input handling differs.
- Machine-speed-independent game loop with frame skipping and hybrid modes
- Windowed & fullscreen support with complete frame rate control
- Image filtering: Bilinear, Blur, HQ2X, HQ3X, Scanline, CRT
- Sequence-based flow (intro โ menu โ game โ creditsโฆ)
- Resource management relative to directories, JARs, or temp
- Sprites, animations, tiles, fonts, parallax layers
- Binary & XML file I/O
- UDP Server/Client networking
- Utility classes: Random, Maths, Conversions, Fileโฆ
- Camera with configurable view and movement
- Cursor โ synced or independent from the system pointer
- Tile-based map with minimap, save/load, A* pathfinding, ray cast collisions, and raster bar effect
- Tile tools: extract tilesheet from a level rip, generate level data files
- Object system driven by XML configuration, factory caching, and a handler for update/render/retrieve
- Composable Feature system โ add characteristics to objects without inheritance complexity:
| Feature | Description |
|---|---|
Transformable |
Size and translation |
Body |
Gravity handling |
Collidable |
Collision detection |
Launchable |
Launcher & projectile system |
Rasterable |
Raster bar visual effect |
Producible |
Object spawning capability |
Networkable |
Synchronized over network |
| Module | Format |
|---|---|
lionengine-audio-wav |
WAV |
lionengine-audio-sc68 |
Sc68 Atari music |
lionengine-audio-adplug |
LDS / AdPlug |
lionengine-audio-adlmidi |
MIDI via AdlMidi |
A standalone Eclipse RCP4 editor to speed up level design and object authoring:
- Map editor โ import/export tile maps
- Object editor โ place, remove, and configure objects on the map
- Animation editor โ frame-by-frame editing with mouse
- Collision editor โ assign collision shapes visually
- Pathfinding editor โ configure pathfinding properties per tile
Prerequisites: Java JDK 17+
Add LionEngine to your Maven project:
<dependency>
<groupId>com.b3dgs.lionengine</groupId>
<artifactId>lionengine-core</artifactId>
<version>10.0.0-SNAPSHOT</version>
</dependency>Or download the JARs manually and add them to your classpath.
Dependency tree โ include only what you need:
lionengine-core โ required
โโโ lionengine-core-awt โ desktop (AWT renderer)
โโโ lionengine-game โ game logic
โโโ lionengine-audio-wav โ WAV audio
โโโ lionengine-audio-sc68 โ Sc68 Atari music
โโโ lionengine-audio-adplug โ LDS music
โโโ lionengine-audio-adlmidi โ MIDI music
public class AppSamplePc
{
public static void main(String[] args)
{
EngineAwt.start("Sample Project", new Version(0, 1, 0), AppSamplePc.class);
Loader.start(Config.windowed(Scene.NATIVE.get2x()), Scene.class);
}
}public class ActivitySample extends ActivityGame
{
@Override
protected void start(Bundle bundle)
{
EngineAndroid.start("Sample Project", new Version(0, 1, 0), this);
Loader.start(Config.fullscreen(Scene.NATIVE), Scene.class);
}
}public class Scene extends Sequence
{
static final Resolution NATIVE = new Resolution(320, 240, 60);
public Scene(Context context)
{
super(context, NATIVE);
}
@Override
public void load()
{
// Load your resources here
}
@Override
public void update(double extrp)
{
// Update game logic
}
@Override
public void render(Graphic g)
{
// Draw your frame
}
}