Enemy Mayhem is a grid-based, turn-based C++ combat game where the player must survive 10 escalating waves of enemies on a constrained battlefield. Tactical lane selection, enemy positioning, and smart upgrades are key to victory.
- Gameplay Overview
- Enemy Types
- Player Progression & Skills
- Visual Interface
- Screenshots
- Implementation Overview
- Build & Run
- Notes
- License
- The battlefield is a fixed 3 × 8 grid
- Enemies spawn on the rightmost column and advance left
- The player selects a lane (row) to attack each round
- Gameplay progresses in turn-based rounds:
- Player attacks
- Enemies move and/or attack
- The goal is to defeat all enemies across 10 waves
- The game ends when the hero is defeated or all waves are cleared
Enemies behave differently based on class:
- Melee Enemies
- Move one tile per round toward the player
- Can only attack when they reach the player’s column
- Archer Enemies
- Attack from range without moving
- Mage Enemies
- Perform ranged, magic-enhanced attacks Enemy composition changes with progression—early waves favor melee enemies, while later waves introduce more ranged threats.
- Defeating enemies rewards coins
- Coins are spent in a shop between waves
- Upgrade paths include:
- Health and max health
- Damage and critical damage
- Critical hit chance
- Evasion (chance to dodge attacks)
- Lifesteal (heal on hit)
- Defence (damage reduction)
- Looting (bonus coins)
- All skills have hard caps to maintain balance
- A bulk combo upgrade improves multiple stats at once
- The player can switch hero class mid-game (Archer ↔ Mage)
- The battlefield is rendered as a text-based grid
- Enemy types are represented symbolically:
R– MeleeA– ArcherM– Mage
- Each round displays:
- Player stats
- Enemy stats
- Enemy positions
- Combat logs clearly show attacks, movement, and effects
- Built using object-oriented C++
- A shared
Characterbase class defines core combat behavior - Polymorphism is enforced through a pure virtual
attack()method - Behavior is composed using:
Character(combat stats)Skills(passive abilities)Magic(resource management)
- The battlefield is modeled as an explicit 2D grid
- Enemies track their own spatial position and movement
- Difficulty scales per level using mathematical progression
- Enemy spawning uses weighted randomness based on level
- A centralized game loop manages combat rounds and progression
- A reusable table-rendering utility is used for terminal UI
The current version is Windows-specific due to terminal handling
(e.g. use of cls to clear the console).
To build from source on Windows:
g++ main.cpp -o enemy-mayhem
enemy-mayhem.exeLinux compatibility is planned, and a .out binary will be provided once
cross-platform terminal handling is implemented.
TextTable.his an AI-generated helper utility used solely for formatting terminal output.- All core gameplay logic, systems, and architecture were designed and implemented manually.
This project is licensed under the MIT License.

