C++
MyGame/
Source/
MyGame/
MyGameModule.h
MyGameModule.cpp
Gameplay/
Components/
Assets/
Content/
Config/
.lumenproject
add_library(MyGameModule SHARED
Source/MyGame/MyGameModule.cpp
)
target_include_directories(MyGameModule PRIVATE
${LUMEN_ENGINE_INCLUDE_DIR}
)
target_link_libraries(MyGameModule PRIVATE
LumenEngine
)
// Conceptual API example — adapt names to the real engine API.
class GameModule /* : public Lumen::IModule */
{
public:
void OnLoad();
void OnStart();
void OnUpdate(float deltaTime);
void OnStop();
void OnUnload();
};
// Conceptual example
auto player = world.CreateObject("Player");
player.SetPosition({ 0.0f, 1.0f, 0.0f });
// Prefer stable handles/IDs over owning raw pointers.
auto playerId = player.GetId();
// Conceptual example
struct RotatorComponent
{
float Speed = 90.0f;
void Update(Transform& transform, float dt)
{
transform.RotateY(Speed * dt);
}
};
// Conceptual example
const float moveX = Input::Axis("MoveX");
const float moveY = Input::Axis("MoveY");
if (Input::Pressed("Jump"))
{
// gameplay action
}
position += velocity * deltaTime;
rotation += angularVelocity * deltaTime;
#include <iostream>
std::cout << "[Game] Module loaded\n";
std::cerr << "[Game] Failed to load asset\n";
// Preferred design direction
AssetId meshId = AssetId::FromString("mesh/player");
// Resolve through the engine asset system, not an absolute C:\... path.
// Conceptual example
struct PlayerDiedEvent
{
ObjectId Player;
};
// EventBus::Publish(PlayerDiedEvent{ playerId });
// Example layout only. Replace engine-facing names with the real API.
class PlayerController
{
public:
float MoveSpeed = 6.0f;
void OnUpdate(float dt)
{
const float x = Input::Axis("MoveX");
const float z = Input::Axis("MoveY");
Vec3 move { x, 0.0f, z };
transform.Translate(move * MoveSpeed * dt);
}
private:
Transform transform;
};
CONCEPTUAL