/lionengine

Java 2D Game Engine

Primary LanguageJavaGNU General Public License v3.0GPL-3.0


Build
Coverage
Lines of Code
Maven Central
Dev
License

Presentation
General features
Download
Installation
Getting Started
Tutorials

Presentation

The LionEngine is a game engine especially developed during the project Lionheart Remake for an easy Java use. The engine is as a library, in Jar format (including its javadoc), which can be included in any project; for utility class uses, or to directly implement and inherit a game skeleton (including management of frame rate, extrapolation, input output...).

Using Java 17 internal libraries, it is specifically designed for 2D games (no support for 3D at the moment), and proposes a set of functions for 2D resources management (images, sprites, animations, tiles, font...). Inputs and outputs are also available, with an easy keys retrieval, mouse movement... Management of music file are also available (Wav, Midi, and more using plug-ins, such as Sc68, AdPlug and AdlMidi). Windowed, full-screen and applet formats are fully supported, with a complete frame rate control.

It supports Android 5.0 (API 21). The only change to perform is the gameplay part, as the 'mouse' and 'keyboard' concepts are different on Android. Everything else is fully compatible and does not require any changes.

The LionEngine Editor is designed to help game development by providing a set of tool for general object edition and map generation.

General Features

Core

  • lionengine-core

    • Simple initialization and screen configuration (windowed, fullscreen)
    • Advanced game loop (machine speed independent, frame skipping, hybrid)
    • Filtering capability (Bilinear, Blur, HQ2X, HQ3X, Scanline, CRT)
    • Sequence control (intro, menu, game part, credits...)
    • Easy resource management (relative to resource directory, JAR, temp)
    • Advanced image usage (sprite, animation, tile, font, parallax)
    • File I/O (binary & XML reader & writer)
    • Server & Client UDP system
    • Utility classes (Random, Conversions, Maths, File...)
    • Verbosity control
  • lionengine-core-awt

    • Engine implementation using AWT from JDK 17
  • lionengine-core-android

    • Engine implementation using Android 5.0 as graphic renderer, target for smartphones
  • lionengine-game

    • Camera management (view and movement)
    • Cursor (synced or not to system pointer)
    • Background package (for an easy background composition)
    • Tile based map package (with minimap support, native save & load function)
      • Ray cast collision system
      • Compatibility with raster bar effect
      • A Star pathfinding implementation
      • Tile extractor (generate tilesheet from a level rip image)
      • Level rip converter (generate a level data file from a tile sheet and a level rip image)
    • Object package
      • Setup (external XML configuration)
      • Factory (reusable cached object instances)
      • Handler (updating, rendering, and retrieving)
    • Extensible Feature system to compose object characteristics without code complexity
      • Transformable (size and translation)
      • Body (gravity handling)
      • Launchable (launcher and projectile system)
      • Rasterable (object raster bar effect)
      • Producible (ability to produce other objects)
      • Collidable (collision handling)
      • Networkable (synced object over network)
      • and more...
  • lionengine-audio-wav

    • Support for Wav sound
  • lionengine-audio-sc6

    • Support for Sc68 Atari music (Sc68 wrapper)
  • lionengine-audio-adplug

    • Support for Loudness Sound music (AdPlug wrapper)
  • lionengine-audio-adlmidi

    • Support for Midi music (AdlMidi wrapper)

Editor

  • com.b3dgs.lionengine.core.swt

    • Core implementation with SWT, dedicated to an Eclipse RCP4 usage
  • com.b3dgs.lionengine.editor

    • Complete standalone editor which can be used in any project for general level edition
    • Can be extended to perform more specific things
  • com.b3dgs.lionengine.editor.map

    • Full map tile support with import and export function
  • com.b3dgs.lionengine.editor.object

    • Object handling and editing with advanced properties
    • Can be placed and removed on map with mouse
  • com.b3dgs.lionengine.editor.animation

    • Animation editor frame by frame with mouse
  • com.b3dgs.lionengine.editor.collision

    • Collision edition assignment with mouse
  • com.b3dgs.lionengine.editor.pathfinding

    • Pathfinding support with properties edition

Download

Go to website Last version Maven Central

Installation

Steps to include the LionEngine in your project:

  1. Install at least the Java JDK 17
  2. Choose your favourite IDE (Eclipse, Netbeans...)
  3. Download the latest LionEngine
  4. Include all LionEngine libraries you need for your project, following the tree dependency:
    • lionengine-core (minimum requirement)
      • lionengine-core-awt (uses AWT as graphic renderer, target for computer)
      • lionengine-game (base for game development)
      • lionengine-audio-wav (support for Wav sound)
      • lionengine-audio-sc68 (support for Sc68 Atari music)
      • lionengine-audio-adplug (support for LDS music)
      • lionengine-audio-adlmidi (support for Midi music)
  5. You are now ready to use the LionEngine in your project

Getting Started

Once you installed the LionEngine in your project, you may would like to know how to prepare a quick sample as a first try:

Main class

  • Using lionengine-core-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);
    }
}
  • Using lionengine-core-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 sequence

public class Scene extends Sequence
{
    private static final Resolution NATIVE = new Resolution(320, 240, 60);

    public Scene(Context context)
    {
        super(context, NATIVE);
    }

    @Override
    public void load()
    {
        // Load resources
    }

    @Override
    public void update(double extrp)
    {
        // Update game
    }

    @Override
    public void render(Graphic g)
    {
        // Render game
    }
}

Tutorials