Skip to content

A 2D game engine crafted for seamless development, combining modern rendering with Lua scripting to deliver dynamic and fluid workflows

License

Notifications You must be signed in to change notification settings

BenMcAvoy/LunaticEngine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Lunatic Engine

Modern 2D engine and editor focused on fast iteration - OpenGL 4.6, ImGui docking, LuaJIT scripting, and RTTR‑based scenes.

C++20 OpenGL 4.6 ImGui Docking LuaJIT Cross‑platform

Editor screenshot

TL;DR

  • Open LunaticEngine.sln in Visual Studio 2022 (x64) and build. vcpkg manifest pulls deps automatically.
  • Run LunaticEditor (viewport, Hierarchy, Inspector) or LunaticRuntime (loads LunaticRuntime/scene.json).

Note

Cross-platform: the engine code is portable (GLFW/GLAD/ImGui/GLM/LuaJIT/RTTR). The provided solution targets Windows/Visual Studio today; Linux/macOS builds require generating project files (e.g., CMake) and integrating vcpkg. A first‑class cross‑platform build method (e.g., CMake presets) will be added in a future update.

Important

vcpkg is required and must be integrated with MSBuild for dependencies to resolve.

TODO

  • Scene graph
  • Basic renderer
  • Lua coroutines
  • Reflection based API
  • JSON serialization/deserialization
  • Audio support
  • Physics integration
  • std::vector usage reviewed (where can be std::span?)
  • Reflection codegen

Features

  • 2D rendering (Camera, Sprite, Texture, Framebuffer) with an embedded default shader.
  • Scene graph with reflection: Instance, Renderable, Updateable (auto-registered with the Engine).
  • JSON save/load driven by RTTR properties; construct(name) factory for typed deserialization.
  • Lua scripting via coroutines; access Engine, scene, and reflected properties/methods from Lua.

Layout

  • LunaticEngine/ core library: core/, model/ (incl. primitives/), render/, vendor/stb.cpp.
  • LunaticEditor/ app (ImGui dockspace, viewport/HUD, save & play/stop).
  • LunaticRuntime/ app, assets, and scene.json.

How it works (short)

  • Instance tree: Sprite, Camera, Script, NativeScript extend Instance (+ mixins).
  • Renderer uses a single main Camera (registered on construction). Sprites share GL buffers.
  • Editor renders to a Framebuffer shown as an ImGui image; property UI is RTTR-driven.
  • Scripting: Lua gets engine, root, script, plus vec2/vec4; call into reflected props/methods; yield() to step frames.

License

No license at this time. All rights reserved. Do not use, redistribute, or modify without prior written permission.

About

A 2D game engine crafted for seamless development, combining modern rendering with Lua scripting to deliver dynamic and fluid workflows

Resources

License

Stars

Watchers

Forks

Languages