Velos relies on a highly decoupled architecture. Below is an overview of the core sub-systems.
The Engine class is the central orchestrator. It manages the game loop, enforces the target framerate , and processes internal timers.
Actions are the core abstraction for input. Each action binds a key to a named callback with a trigger type:
- Press — fires once when the key is pressed
- Hold — fires every frame while held, after an optional threshold
- Release — fires once when the key is released
- HoldCompleted — fires once after the hold threshold is met and the key is released
A custom 2D physics solver that handles both collision detection and resolution.
- Broad/Narrow Phase: Checks bounding boxes and calculates intersection depth and normal vectors (Minimum Translation Vector).
- Colliders: Supports
AABBCollider(Axis-Aligned Bounding Box) andCircleCollider. - Resolution: Automatically pushes dynamic entities apart based on collision manifolds, while respecting
isStatic()flags.
- Entities act as spatial nodes.
- Memory is strictly managed. Entities flagged via
destroy()are safely swept from memory at the end of the frame, preventing dangling pointers during physics updates.
Transformations (Position, Rotation, Scale) are applied hierarchically. Moving an entity automatically updates the world matrices of all attached shapes and colliders.
The Camera acts as a viewport transformation matrix.
- It supports direct coordinate mapping:
screenToWorldandworldToScreen. - Features built-in interpolation for smooth tracking (
CameraFollowMode::Smooth).