Skip to content

About

A Mini 2D Game Engine made with SDL2.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

MiniEngineSDL2

A lightweight 2D game engine built in C++ using SDL2, created as a portfolio project to explore game engine architecture, gameplay systems, and custom development tools.

This project is part of a three-part development pipeline:

  • MiniEngineSDL2 → the core game engine
  • Level Editor Lite → a custom level editor built on top of the engine
  • Top-Down Shooter Demo → a small playable game built using both

The goal is to demonstrate a complete game development workflow from engine → tools → game.


Demo

▶ Current Engine Demo:
(https://github.com/JaswinderJattana-gdev/MiniEngineSDL2/tree/main/media)


Features

Core Engine

  • Custom C++ 2D game engine
  • Built using SDL2
  • Fixed timestep update loop
  • Scene system with push / pop / set transitions
  • Logical resolution support
  • Configurable input mapping
  • Debug-friendly architecture

Rendering

  • SDL2 renderer wrapper
  • Camera system with world-space coordinates
  • Logical resolution scaling
  • Debug rendering helpers
  • Grid-based world visualization

Gameplay Systems

  • Camera follow system
  • Axis-separated collision resolution
  • Static obstacle collision world
  • Particle system (dust effects)
  • Dash mechanic with camera shake
  • Debug overlays for collision visualization

Asset System

  • AssetManager with cached texture loading
  • BMP texture support with color-key transparency
  • Centralized asset access through the engine context

Level System

  • Plain-text level file format

  • Level loading and saving through LevelIO

  • Level data includes:

  • world size

  • player spawn position

  • obstacle rectangles

Example level format:

WORLD 4000 4000
PLAYER_SPAWN 200 200
OBSTACLE 500 300 140 80
OBSTACLE 900 700 220 60
OBSTACLE 1300 1000 100 260

This format will later be generated by the Level Editor Lite tool.


Architecture Overview

The engine is organized into modular systems:

Engine
 ├── Renderer
 ├── Input / InputMap
 ├── SceneManager
 ├── AssetManager
 ├── CollisionWorld2D
 ├── ParticleSystem2D
 ├── Camera2D
 ├── WorldRender2D
 └── LevelIO / LevelData

Scenes receive an EngineContext that provides access to shared engine systems such as:

  • renderer
  • input mapping
  • asset manager
  • window information
  • engine configuration

This keeps systems modular while allowing easy access when needed.


Project Structure

MiniEngineSDL2
│
├─ engine/
│   ├─ Engine
│   ├─ Renderer
│   ├─ SceneManager
│   ├─ AssetManager
│   ├─ CollisionWorld2D
│   ├─ ParticleSystem2D
│   ├─ Camera2D
│   ├─ WorldRender2D
│   ├─ LevelIO / LevelData
│   └─ utilities
│
├─ game/
│   ├─ MenuScene
│   ├─ DemoScene
│   └─ PauseScene
│
├─ assets/
│   ├─ sprites
│   └─ levels
│
└─ CMakeLists.txt

Controls

Key Action
W / A / S / D Move
Arrow Keys Move
Shift Dash
Space Fire
P Pause
ESC Return to Menu
F1 Toggle Debug Overlay

Technologies Used

  • C++17
  • SDL2
  • CMake
  • Visual Studio
  • vcpkg

The engine intentionally avoids heavy frameworks to focus on core engine systems and architecture.


How to Build

Requirements

  • C++17 compatible compiler
  • CMake
  • SDL2
  • vcpkg (recommended)

Build Steps

git clone https://github.com/JaswinderJattana-gdev/MiniEngineSDL2.git
cd MiniEngineSDL2
cmake -B build
cmake --build build

Run the executable produced in the build directory.


Development Roadmap

Current progress:

  • Engine core systems
  • Scene manager
  • Collision world
  • Particle system
  • Level file format
  • Asset manager
  • Camera and rendering helpers

Planned additions:

  • Shooter gameplay systems
  • Bullet system
  • Enemy AI
  • Level editor tool
  • Interactive level creation
  • One fully playable level

Long-Term Goal

Build a complete mini game development pipeline:

MiniEngineSDL2
        ↓
Level Editor Lite
        ↓
Top-Down Shooter Demo

The final project demonstrates:

  • engine architecture
  • custom development tools
  • gameplay implementation
  • asset pipeline integration

Author

Jaswinder Singh
Applied Computer Science Student
Interested in game development, engine architecture, and technical systems.

GitHub:
https://github.com/JaswinderJattana-gdev


About

A Mini 2D Game Engine made with SDL2.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages