# โœ… Game Engine Core Checklist (Linux, SFML, Solo Dev โ€“ 2D) ## ๐Ÿ“ฆ Dependencies - rapidjson (for JSON parsing) - SFML (for SFML) ## ๐Ÿ—๏ธ Phase 1: Foundation & Tooling โœ… Initialize GitHub repo and push initial commit โœ… Set up CMake with targets for engine and tests โœ… Define directory structure: - โœ… /engine/include for headers - โœ… /engine/src for source files - โœ… /tests for test code โœ… Install SFML via package manager or build from source โœ… Configure CMake to find SFML libraries correctly โœ… Write code to open a resizable 800ร—600 window โœ… Handle window close and resize events โœ… Implement fixed timestep game loop skeleton โœ… Add basic logging system: - โœ… Support INFO, WARN, ERROR levels - โœ… Log window creation and shutdown events โœ… Load engine settings from a JSON config file: - โœ… Parse window width, height, and title - โœ… Handle missing or invalid config with fallbacks - [ ] Add reloadable config feature (optional) --- ## ๐ŸŽฎ Phase 2: Input & 2D Rendering ### ๐ŸŽฎ Input - โœ… Poll keyboard state each frame - โœ… Detect key press and release events - โœ… Poll mouse position and button states - โœ… Fire callbacks or push internal input events - โœ… Track key state per frame (for "just pressed", "just released") - โœ… Add simple input map or key binding abstraction - [ ] Optional: Gamepad detection and button polling --- ### ๐ŸŽจ 2D Rendering - โœ… Render colored rectangles using `sf::RectangleShape` - โœ… Load `.png` textures using `sf::Texture::loadFromFile` - โœ… Create a basic `SpriteComponent` class: - โœ… Holds a texture reference - โœ… Position, scale, and rotation in 2D space - โœ… Draw sprites using SFML's `sf::RenderWindow::draw()` - โœ… Sort by layer/z-index to control render order #### Camera (`sf::View`) - โœ… Center view on a target (e.g. player position) - โœ… Implement view panning (keyboard/mouse) - โœ… Support view zoom in/out (mouse wheel or key) - โœ… Draw text using `sf::Text` (HUDs, debugging) --- ## ๐Ÿงฑ Phase 3: 2D Physics & Collision - โœ… Create `TransformComponent` with position and velocity - โœ… Create `PhysicsBodyComponent` with size, flags, and mass (if needed) - โœ… Integrate simple gravity into motion - โœ… Apply movement using Euler integration (`pos += vel * dt`) - [ ] Implement AABB (axis-aligned bounding box) vs AABB checks - [ ] Broad-phase culling: - [ ] Simple spatial grid or coarse pass --- ## ๐Ÿ”Š Phase 4: Audio, ECS, and Scripting ### ๐Ÿ”Š Audio (2D) - [ ] Load short SFX (`sf::SoundBuffer` + `sf::Sound`) - [ ] Load and stream background music (`sf::Music`) - [ ] Set per-channel or global volume levels - [ ] Add basic audio manager to queue or stop sounds - [ ] Optional: Add 2D positional audio with stereo panning --- ## ๐Ÿงฑ Entity Structure (Simplified, No ECS) - [ ] Represent entities as plain structs or classes containing: - [ ] `Transform`: position, velocity, scale - [ ] `Sprite`: texture, z-index - [ ] `Physics`: size, static/dynamic flag, optional collider info - [ ] `Input`: movement direction or input flags - [ ] Store entities in a single container (e.g. `std::vector`) - [ ] Implement modular systems as functions or modules: - [ ] `InputSystem`: updates input-related fields on player entities - [ ] `MovementSystem`: applies velocity to position using deltaTime - [ ] `CollisionSystem`: checks and resolves overlaps between entities - [ ] `RenderSystem`: draws sprites using current transform data - [ ] Run systems in a fixed order each frame: - [ ] Input - [ ] Physics/Movement - [ ] Collision - [ ] Rendering - [ ] Use simple flags, enums, or type fields to categorize or tag entities (e.g. "Player", "Obstacle", "Enemy") --- ### ๐Ÿ“œ Lua Scripting - [ ] Embed Lua interpreter (`sol2` or `LuaBridge`) - [ ] Expose key engine functions: - [ ] Create/destroy entities - [ ] Set position or velocity - [ ] Play sound or music - [ ] Allow `.lua` scripts per scene or entity - [ ] Call script-defined `onUpdate()` or `onCollision()` functions - [ ] Expose basic math utilities and component access to scripts --- ## ๐Ÿงช Sample Game: "Boxworld" - [ ] Create player box entity - [ ] Uses keyboard input to move - [ ] Has a visible sprite - [ ] Create wall/obstacle boxes - [ ] Collisions prevent movement through walls - [ ] Camera smoothly follows the player - [ ] Play jump SFX when spacebar is pressed - [ ] Loop background music - [ ] Add text showing current FPS (use `sf::Text`) - [ ] Add pause menu and resume functionality (esc key) --- ## ๐Ÿš€ Stretch Goals - [ ] Scene saving/loading from JSON - [ ] Editor mode toggle for entity placement (in-engine) - [ ] Tilemap support with sprite atlas (Tiled map loader or own format) - [ ] Particle system: - [ ] Emit on collisions or explosions - [ ] Fade out and die over time - [ ] Multithreading (load textures/audio in background) - [ ] GUI overlay with ImGui: - [ ] Inspect and edit entities/components live - [ ] Toggle debug flags and camera view