|
Turbo Engine 0.3
A C++ game engine using Allegro 5
|
Turbo Engine is a small, self-contained C++17 2D game engine built on Allegro 5**, organised around a classic Scene → GameObject → Component model. When built with Dear ImGui it ships a full editor (hierarchy, inspector, gizmos), a material / shader system and Lua scripting.
Requirements: CMake ≥ 3.21, a C++17 compiler and Git. Every dependency (Allegro 5, Dear ImGui, Lua, sol2 and their transitive deps) is fetched and built automatically through vcpkg in manifest mode — no manual setup.
The first configure compiles Allegro 5 and the rest from source through vcpkg, so it takes a while; later builds reuse vcpkg's binary cache.
Run demo from the build's bin/ directory — assets and the dependency libraries are deployed next to the executable, so it launches from anywhere.
A game is a turbo::Scene that builds a tree of turbo::GameObject. Each object has a turbo::Transform and, optionally, a turbo::Drawable (turbo::Sprite, turbo::RectangleShape, turbo::CircleShape) and turbo::Component behaviours. The turbo::Engine drives the window and the main loop; turbo::SceneManager owns the registered scenes.
Behaviour lives in turbo::Component subclasses — override load(), update(int), on_enable(), on_disable(), unload() — and is attached with turbo::GameObject::add_component. The built-in turbo::component::SimpleControl moves an object with the arrow keys, for example.
Built with the editor, behaviour can also be written in Lua. Drop a file in assets/scripts/ that returns a table with optional lifecycle methods; self.gameObject is the owning GameObject:
Attach it from the inspector (+ Add Script) and press Play. The bound API (spawn / find / destroy, transform, input, materials, …) is provided by turbo::script::ScriptEngine; the component wrapper is turbo::LuaComponent.