Protogame2D is a starter template for building 2D games on the custom Daemon Engine. It provides a clean, minimal scaffold with an application lifecycle, a two-state game state machine (Attract → Game), an orthographic camera, event-driven state transitions with audio feedback, and built-in debug tools (FPS counter, pause, slow-mo, single-frame step).
Designed as a boilerplate that can be cloned and extended into a full game project. The V8 scripting subsystem is disabled by default via EngineBuildPreferences.hpp to keep the build lightweight.
- Game state machine — Event-driven Attract ↔ Game transitions with
OnGameStateChangedcallbacks and audio cues - 2D orthographic rendering — Screen-space camera with
VertexList_PCUimmediate-mode drawing (disc, line segments) - Debug tools — Real-time FPS/time/scale HUD, pause (P), single-frame step (O), slow-mo at 0.1× (T hold)
- Window management — Fullscreen stretch toggle (R), dynamic client dimension tracking
- Structured logging —
DAEMON_LOGmacro with verbosity levels for lifecycle tracing
- Visual Studio 2022 (or 2019) with C++ desktop development workload
- Windows 10/11 (x64)
- DirectX 11 compatible GPU
- Daemon Engine cloned as a sibling directory
# Clone both repos side by side
git clone https://github.com/dadavidtseng/Engine.git
git clone https://github.com/dadavidtseng/Protogame2D.git
# Directory layout should be:
# ├── Engine/
# └── Protogame2D/- Open
Protogame2D.slnin Visual Studio - Set configuration to
Debug | x64 - Build the solution (the Engine project is referenced automatically)
- The executable is deployed to
Run/via post-build event
| Action | Key |
|---|---|
| Start game | Space |
| Return to attract / Quit | ESC |
| Fullscreen toggle | R |
| Restart game | F8 |
| Action | Key |
|---|---|
| Pause / Unpause | P |
| Step single frame | O |
| Slow-mo (0.1×) | T (hold) |
Launch Run/Protogame2D_Debug_x64.exe from the Run/ directory (working directory must be Run/ for asset loading).
Protogame2D/
├── Code/Game/
│ ├── Framework/ # Application framework
│ │ ├── Main_Windows.cpp # WinMain entry point
│ │ ├── App # Application lifecycle (Startup → RunMainLoop → Shutdown)
│ │ └── GameCommon # Global pointers, debug draw helpers, GAME_SAFE_RELEASE
│ ├── Gameplay/ # Game logic
│ │ └── Game # State machine (Attract ↔ Game), rendering, time controls
│ └── EngineBuildPreferences.hpp # Engine feature toggles (V8 scripting disabled)
├── Run/ # Runtime directory
│ ├── Data/Audio/ # Sound effects (TestSound.mp3)
│ ├── Data/Fonts/ # Bitmap fonts
│ └── Data/Shaders/ # HLSL shaders (Default)
├── Docs/ # Documentation
└── Protogame2D.sln # Visual Studio solution
Copyright 2025 Yu-Wei Tseng
Licensed under the Apache License, Version 2.0.
Yu-Wei Tseng
- Portfolio: dadavidtseng.info
- GitHub: @dadavidtseng
- LinkedIn: dadavidtseng
- Email: dadavidtseng@gmail.com