Skip to content

b3dgs/lionengine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

3,301 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

LionEngine

A Java 2D game engine, born from the Lionheart Remake project.

Build Coverage Lines of Code Maven Central Dev License

๐ŸŒ Website ยท ๐Ÿ“ฆ Download ยท ๐Ÿ“š Tutorials ยท ๐Ÿ” Maven Central


What is it?

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.


Features

๐ŸŽฎ Core (lionengine-core)

  • 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โ€ฆ

๐Ÿ•น๏ธ Game (lionengine-game)

  • 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

๐Ÿ”Š Audio (lionengine-audio-*)

Module Format
lionengine-audio-wav WAV
lionengine-audio-sc68 Sc68 Atari music
lionengine-audio-adplug LDS / AdPlug
lionengine-audio-adlmidi MIDI via AdlMidi

๐Ÿ› ๏ธ LionEngine Editor

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

Installation

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

Quick Start

Desktop (AWT)

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);
    }
}

Android

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);
    }
}

Minimal Scene

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
    }
}

Contributors

Languages