A multi-window action game that turns the Windows desktop into a shrinking battlefield
- Overview
- Features
- How to Install
- How to Use
- Project Structure
- Future Roadmap
- Acknowledgements
- License
- Contact
Daemon Windows is an experimental action game that breaks out of the traditional single-window paradigm. Instead of rendering everything inside one viewport, the game spawns real OS windows — the player lives inside one, enemies can each have their own, and the shop opens as a separate window. The player's window continuously shrinks, creating mounting pressure to eliminate enemies and collect coins before running out of space.
The core loop is a wave-based survival shooter: triangle-shaped enemies chase the player across the desktop, bullets fly between windows, defeated enemies drop coins, and between waves the player spends coins in a shop to upgrade fire rate, damage, projectile count, piercing, homing, and more. Boss waves arrive every 5 rounds with scaled difficulty.
Built as a personal project exploring unconventional game design, the game runs on a custom Daemon Engine providing DirectX 11 rendering, FMOD audio, and a widget UI system — extended here with a WindowSubsystem that manages the creation, animation, positioning, and destruction of native Win32 windows as first-class game objects.
- Multi-Window Gameplay
- Wave-Based Survival with Shop Upgrades
- Window Shrinking Mechanic
- Event-Driven Architecture
The WindowSubsystem creates and manages real Win32 child windows at runtime. Each entity can optionally own a window — the player always has one, and enemies spawn with or without windows randomly. Windows track their owning entities, follow entity positions on screen, and support smooth animated resizing and repositioning via interpolation.
Key capabilities:
CreateChildWindow/DestroyWindow— spawn and tear down OS windows tied to entity IDsAnimateWindowPositionAndDimensions— smooth lerp-based window transitions- Entity-to-window mapping with
WindowID↔EntityIDbidirectional lookup - Transparent main window setup for desktop-as-battlefield rendering
The WaveManager drives progressive difficulty: each wave spawns base × 1.2^(wave-1) enemies, with boss waves every 5 rounds. Between waves, the player opens the Shop (a separate window) to spend collected coins on 7 upgrade types managed by the UpgradeManager:
| Upgrade | Effect |
|---|---|
| Fire Rate | Faster bullet cooldown |
| Damage | Higher bullet damage |
| Projectile Count | More bullets per shot |
| Bullet Spread | Wider shot pattern |
| Bullet Size | Larger hit area |
| Piercing | Bullets pass through enemies |
| Homing | Bullets track nearest enemy |
Each upgrade has 5 levels with 1.5× cost scaling per level.
The player's window continuously shrinks frame-by-frame via AnimateWindowPositionAndDimensions, compressing the playable area. The shrink stops when the client dimensions reach 2.5× the player's physics radius, preventing a zero-size window. Enemy windows with the hasChildWindow flag also shrink. This creates a ticking clock — the player must clear enemies and progress before their window becomes too small to maneuver.
All game state transitions, collisions, wave progression, and upgrades flow through a centralized EventSystem with named events and typed arguments:
OnGameStateChanged— triggers BGM switches, entity cleanup, shop visibilityOnCollisionEnter— dispatches per-entity collision responses (bullet→triangle, player→coin, player→triangle)OnWaveStart/OnWaveComplete— wave lifecycle with enemy count and boss flagOnBossSpawn— boss wave notificationOnUpgradePurchased— upgrade confirmation with type and new levelOnEntityDestroyed— triggers coin drops from killed enemies
This decoupled design allows entities to subscribe/unsubscribe independently without direct references to each other.
- Visual Studio 2022 (or 2019) with C++ desktop development workload
- Windows 10 SDK (10.0.19041.0+)
- Windows 10/11 (x64) — required for advanced window management
- 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/DaemonWindows.git
# Directory layout should be:
# ├── Engine/
# └── DaemonWindows/- Open
DaemonWindows.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
| Mode | Action | Key |
|---|---|---|
| Attract | Start game | Space |
| Attract | Quit | ESC |
| Game | Move | W / A / S / D |
| Game | Shoot | Left Mouse Button (hold for auto-fire) |
| Game | Open shop | Space |
| Game | Return to title | ESC |
| Shop | Buy upgrades | 1 / 2 / 3 |
| Shop | Return to game | ESC |
| Action | Key |
|---|---|
| Pause / Unpause | P |
| Step single frame | O |
| Slow-mo (0.1×) | T (hold) |
- Attract Mode — Title screen with player window visible; press Space to begin
- Game Mode — Survive waves of triangle enemies, collect coins from kills, window shrinks over time
- Shop Mode — Spend coins on upgrades between waves (speed, health, max health)
- Death — Player health reaches 0, returns to Attract Mode
Launch Run/DaemonWindows_Debug_x64.exe from the Run/ directory (working directory must be Run/ for asset loading).
DaemonWindows/
├── Code/Game/
│ ├── Framework/ # Application framework
│ │ ├── Main_Windows.cpp # WinMain entry point
│ │ ├── App # Application lifecycle
│ │ └── GameCommon # Global pointers (g_game, g_windowSubsystem, etc.)
│ ├── Gameplay/ # Core game logic
│ │ ├── Game # State machine (Attract → Game → Shop), spawning, collision
│ │ ├── Entity # Base class: position, health, physics/cosmetic radius, window ownership
│ │ ├── Player # Disc-shaped player (10 HP), WASD + mouse, auto-fire bullets
│ │ ├── Triangle # Enemy: chases player, 1–5 HP, optional child window
│ │ ├── Bullet # Projectile fired toward cursor position
│ │ ├── Coin # Dropped by killed enemies, collected on contact
│ │ ├── Shop # Upgrade purchase UI in its own window
│ │ ├── WaveManager # Wave progression, difficulty scaling, boss waves
│ │ ├── UpgradeManager # 7 upgrade types × 5 levels with cost scaling
│ │ ├── EnemyUtils # Stateless AI helpers (chase, spawn position)
│ │ ├── Debris # Environmental particle
│ │ ├── Circle # Enemy type (stub)
│ │ └── Octagon # Enemy type (stub)
│ └── Subsystem/
│ ├── Widget/ # UI widget framework
│ │ └── ButtonWidget # Text label rendered on child windows
│ └── Window/ # Multi-window engine
│ └── WindowSubsystem # Win32 window lifecycle, animation, entity mapping
├── Run/ # Runtime directory
│ ├── Data/Audio/ # BGM + SFX (MP3)
│ ├── Data/Images/ # Backgrounds, title, icons
│ ├── Data/Fonts/ # Bitmap fonts (DaemonFont)
│ └── Data/Shaders/ # HLSL shaders (Default)
├── Docs/ # Documentation
└── DaemonWindows.sln # Visual Studio solution
| Module | Description |
|---|---|
| Framework | WinMain entry, App lifecycle, global subsystem pointers |
| Gameplay | Game state machine, entity system, wave/upgrade managers, collision |
| Widget Subsystem | ButtonWidget UI rendered on child windows via WidgetSubsystem |
| Window Subsystem | Win32 window creation, animation, entity↔window mapping, focus management |
- Core multi-window system with entity ownership
- Player movement, shooting, and window-bounded physics
- Triangle enemy AI with chase behavior
- Coin drop and collection economy
- Shop system with speed, health, max health upgrades
- WaveManager with progressive difficulty and boss waves
- UpgradeManager with 7 upgrade types and cost scaling
- Implement Circle and Octagon enemy types with unique behaviors
- Advanced enemy spawn patterns driven by WaveManager
- Visual effects and particle systems for kills and upgrades
- Multi-monitor support and window-to-window teleportation
- Performance optimization for high entity counts across windows
See the open issues for a full list of proposed features and known issues.
- Daemon Engine — Custom C++ engine providing DirectX 11 rendering, FMOD audio, input, and widget systems
- Microsoft Windows API documentation — Foundation for multi-window management
- SMU Guildhall — Academic environment and engine development curriculum
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
Project Link: github.com/dadavidtseng/DaemonWindows