Kiaak is a lightweight, modern 2D game engine written in C++17 designed for rapid prototyping and game development. It features an integrated visual editor, component-based architecture, and Lua scripting support, making it ideal for indie developers and educational purposes.
Kiaak is a complete 2D game development solution that provides:
- Visual Scene Editor - Drag-and-drop interface for building game scenes
- Component System - Flexible entity-component architecture
- Real-time Rendering - OpenGL-based 2D graphics pipeline
- Physics Simulation - Built-in 2D physics with collision detection
- Scripting Support - Lua integration for gameplay logic
- Asset Management - Project-based workflow with organized asset handling
- Cross-platform - Runs on Windows, macOS, and Linux
- Scene Hierarchy - Tree view of all game objects in your scene
- Inspector Panel - Edit component properties in real-time
- Asset Browser - Manage textures, scripts, and other resources
- Play/Edit Modes - Test your game without leaving the editor
- Camera Controls - Pan, zoom, and navigate your scenes with ease
- Gizmo Tools - Visual transform handles for moving objects
- Transform Component - Position, rotation, and scale
- Sprite Renderer - 2D texture rendering with transparency support
- Camera Component - Orthographic cameras with zoom control
- Rigidbody2D - Physics simulation for dynamic objects
- Collider2D - Collision detection and response
- Script Component - Lua scripting for custom behavior
- Tilemap System - Efficient tile-based level creation
- Animator - Animation system for sprites and objects
- Scene Management - Multiple scenes with seamless switching
- Project System - Organized folder structure (assets/, scenes/)
- Serialization - Save/load scenes and project data
- Input Handling - Keyboard and mouse input processing
- Timer System - Fixed timestep and variable timestep updates
- 2D Physics - Collision detection and rigid body dynamics
- Shader System - Custom GLSL shader support
- Lua Integration - Write gameplay logic in Lua
- Hot Reloading - Modify scripts without restarting
- Component Scripting - Attach custom behaviors to game objects
- Engine API Access - Full access to engine systems from scripts
Kiaak Engine
โโโ Core/
โ โโโ Engine.cpp # Main engine loop and initialization
โ โโโ Scene.cpp # Scene management and object containers
โ โโโ GameObject.cpp # Entity system with components
โ โโโ Transform.cpp # Position, rotation, scale handling
โ โโโ Camera.cpp # Orthographic camera system
โ โโโ Timer.cpp # Frame timing and delta time
โ โโโ Project.cpp # Project and asset path management
โโโ Graphics/
โ โโโ Renderer.cpp # OpenGL rendering pipeline
โ โโโ Shader.cpp # GLSL shader loading and management
โ โโโ Texture.cpp # Texture loading and binding
โ โโโ SpriteRenderer.cpp # 2D sprite rendering component
โ โโโ VertexArray.cpp # OpenGL vertex array abstraction
โโโ Editor/
โ โโโ EditorCore.cpp # Editor initialization and management
โ โโโ EditorUI.cpp # ImGui-based user interface
โโโ Physics/
โโโ Physics2D.cpp # 2D physics world simulation
โโโ Rigidbody2D.cpp # Dynamic physics bodies
โโโ Collider2D.cpp # Collision shapes and detection
- GLFW - Cross-platform windowing and input
- OpenGL - Hardware-accelerated 2D/3D graphics
- ImGui - Immediate mode GUI for the editor
- GLM - Mathematics library for graphics
- Lua 5.4 - Embedded scripting language
- Sol2 - Modern C++ to Lua binding
- GLAD - OpenGL function loading
- CMake 3.10 or higher
- C++17 compatible compiler (GCC 7+, Clang 5+, MSVC 2017+)
- OpenGL 3.3+ support
- Git for cloning dependencies
# Clone the repository
git clone https://github.com/Aakarsh911/kiaak-game-engine.git
cd kiaak-game-engine
# Install dependencies (Ubuntu/Debian)
sudo apt-get install cmake build-essential libglfw3-dev libgl1-mesa-dev
# Install dependencies (macOS with Homebrew)
brew install cmake glfw glm
# Build the engine
mkdir build && cd build
cmake ..
make -j4
# Run the engine
./KiaakEngine# Clone the repository
git clone https://github.com/Aakarsh911/kiaak-game-engine.git
cd kiaak-game-engine
# Install dependencies using vcpkg (recommended)
vcpkg install glfw3 glm
# Build with CMake
mkdir build && cd build
cmake .. -DCMAKE_TOOLCHAIN_FILE=[vcpkg root]/scripts/buildsystems/vcpkg.cmake
cmake --build . --config Release
# Run the engine
Release\KiaakEngine.exe- Launch the Engine: Run the KiaakEngine executable
- Create Project Structure: The engine automatically creates:
assets/- Store textures, sounds, and other resourcesscenes/- Scene files (.scene format)
- Scene Editor: Use the visual editor to build your game world
// Example: Creating a game object with components
auto* gameObject = scene->CreateGameObject("Player");
// Add transform component (automatically added)
auto* transform = gameObject->GetTransform();
transform->SetPosition(0.0f, 0.0f, 0.0f);
// Add sprite renderer
auto* sprite = gameObject->AddComponent<SpriteRenderer>();
sprite->SetTexture("assets/player.png");
// Add physics
auto* rigidbody = gameObject->AddComponent<Rigidbody2D>();
rigidbody->SetMass(1.0f);
auto* collider = gameObject->AddComponent<Collider2D>();
collider->SetSize(1.0f, 1.0f);-- player_controller.lua
local Player = {}
function Player:Start()
self.speed = 5.0
self.transform = self.gameObject:GetTransform()
end
function Player:Update(deltaTime)
local input = Engine.GetInput()
local x, y = 0, 0
if input:IsKeyPressed("A") then x = x - 1 end
if input:IsKeyPressed("D") then x = x + 1 end
if input:IsKeyPressed("W") then y = y + 1 end
if input:IsKeyPressed("S") then y = y - 1 end
local currentPos = self.transform:GetPosition()
self.transform:SetPosition(
currentPos.x + x * self.speed * deltaTime,
currentPos.y + y * self.speed * deltaTime,
currentPos.z
)
end
return Player- Middle Mouse + Drag: Pan camera
- Mouse Wheel: Zoom in/out
- Space: Reset camera to origin
- Left Click: Select objects
- G + Drag: Move selected object
- R + Drag: Rotate selected object
- S + Drag: Scale selected object
- Tab: Toggle between Edit and Play mode
- Ctrl+S: Save current scene
- Ctrl+N: Create new scene
When you create a project, Kiaak organizes files as follows:
MyGame/
โโโ assets/ # Game resources
โ โโโ textures/ # Image files (.png, .jpg)
โ โโโ scripts/ # Lua script files (.lua)
โ โโโ shaders/ # GLSL shader files (.vert, .frag)
โโโ scenes/ # Scene files
โ โโโ MainScene.scene # Scene data in text format
โ โโโ Level1.scene # Additional game scenes
โโโ last_project.txt # Project path persistence
// Custom component example
class HealthComponent : public Kiaak::Core::Component {
public:
HealthComponent(int maxHealth) : maxHP(maxHealth), currentHP(maxHealth) {}
void TakeDamage(int damage) {
currentHP = std::max(0, currentHP - damage);
if (currentHP <= 0) {
// Handle death
}
}
bool IsAlive() const { return currentHP > 0; }
private:
int maxHP;
int currentHP;
};// custom_shader.vert
#version 330 core
layout (location = 0) in vec2 aPos;
layout (location = 1) in vec2 aUV;
uniform mat4 transform;
uniform float time;
out vec2 vUV;
void main() {
vec2 pos = aPos;
pos.y += sin(pos.x * 10.0 + time) * 0.1; // Wave effect
vUV = aUV;
gl_Position = transform * vec4(pos, 0.0, 1.0);
}We welcome contributions! Please follow these guidelines:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
# Clone your fork
git clone https://github.com/yourusername/kiaak-game-engine.git
cd kiaak-game-engine
# Add upstream remote
git remote add upstream https://github.com/Aakarsh911/kiaak-game-engine.git
# Create development build
mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Debug
make -j4- 3D Support: Currently only supports 2D rendering
- Audio System: Audio playback not yet implemented
- Networking: No multiplayer or networking features
- Mobile Platforms: Desktop platforms only (Windows, macOS, Linux)
- Asset Pipeline: Limited asset import/export capabilities
Happy Game Development! ๐ฎ