Skip to content

hazeliscoding/terminal-roguelike

Repository files navigation

🧱 TermRogue (working title)

CMake (Windows only)

A tiny terminal-based roguelike written in modern C++ (C++20) using the Win32 Console API.
The goal is to relearn C++ by building up a classic roguelike step by step: map, monsters, items, FOV, and more.

💻 Platform: Windows (Win32 console).
🧪 Style: modern C++ with RAII, std::vector, enum class, and Doxygen comments.


🛠 Tech Stack

  • C++20
  • CMake
  • Win32 Console API (WriteConsoleOutputA, etc.)

🚀 Building & Running

From a terminal (PowerShell / CMD) in the project root:

# 1. Configure
cmake -S . -B build

# 2. Build
cmake --build build --config Release

# 3. Run (path may vary slightly)
./build/TermRogue.exe

📝 Make sure CMake is in your PATH, and you’re using a generator with a C++20-capable compiler (e.g., MSVC from Visual Studio).


🎮 Controls

  • ⬅️➡️⬆️⬇️ – Move the player @
  • Q – Quit the game

🗺 Roadmap

High-level roadmap for the project. We’ll tick these off as they get implemented and stable.

✅ Phase 0 – Foundations & Setup

  • Choose C++20 and set up CMake
  • Decide on rendering (Win32 Console API)
  • Basic project structure (src/, headers, source files)

✅ Phase 1 – Minimal Playable Loop

  • Game loop (run() with input → update → render)
  • Console abstraction (Console class with back buffer)
  • Player @ that can move around the screen
  • Simple input handling (arrow keys + quit key)

🧱 Phase 2 – Map & Tiles

  • Tile and TileType (Floor, Wall)
  • Map class with 2D grid backed by std::vector<Tile>
  • Simple test room (walls on border, floor inside)
  • Movement blocked by walls
  • Random dungeon generation (rooms & corridors)
  • Player spawn in a valid floor tile of a generated dungeon

⏳ Phase 3 – Entities & Turn System

  • Basic Entity struct (player + monsters)
  • Turn-based step system (player turn → monsters turn)
  • Simple monster placement on the map

⏳ Phase 4 – Field of View (FOV) & Fog of War

  • Compute FOV around player (e.g., shadowcasting or ray-based)
  • visible / explored flags on tiles
  • Dim rendering for explored-but-not-visible tiles

⏳ Phase 5 – Combat & Message Log

  • Bump-to-attack melee combat
  • HP, attack, defense stats
  • Death handling for monsters & player
  • Message log at bottom of screen (e.g., last N messages)

⏳ Phase 6 – Items & Inventory

  • Item representation & glyphs
  • Items on the ground (potions, weapons, etc.)
  • Basic inventory system
  • Using items (e.g., healing potions)

⏳ Phase 7 – Monster AI & Pathfinding

  • Simple AI (chase player if in range)
  • Basic pathfinding (BFS or A*)
  • Behavior variety (patrolling, fleeing, ranged attacks)

⏳ Phase 8 – Progression & Difficulty

  • Experience & leveling system
  • Deeper dungeon levels (stairs up/down)
  • Stronger monsters & loot on lower levels

⏳ Phase 9 – UI & Polish

  • Title screen & game over screen
  • Help overlay / controls reference
  • Color polishing and minor effects

⏳ Phase 10 – Save / Load

  • Serialize game state (map, entities, items, etc.)
  • Load & continue runs

⏳ Phase 11 – Refactors & Cleanup

  • Split logic into subsystems (Input, Render, Combat, AI, etc.)
  • Add tests for key systems (FOV, pathfinding, level generation)
  • General architecture polish

📚 Documentation

  • Doxygen-style comments are included in headers and implementations.
  • You can generate documentation with Doxygen if you add a config file later.

💡 Goals

  • Relearn and practice modern C++ in a fun, hands-on way.
  • Build a small but complete roguelike that runs 100% in the terminal.
  • Keep the code clean, commented, and easy to iterate on.

About

A classic console Roguelike game made with the Win32 API.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published