Back to Projects
C++ · Windows API · Game Dev

Nim (Disk Game)

A Nim-style disk game built in C++. One of my favourite games to develop — built near the end of the series, it drew on all the game-engine and programming knowledge I had accumulated.

View Source Code
Nim Disk Game
C++ & Object-Oriented Programming
Applied advanced OOP patterns learned across the previous games to structure disks, game board, and AI logic cleanly.
Windows API
Managed the window, device context, and Windows message loop for rendering and user interaction.
Game Loop & Frame Rate Management
Maintained a stable game loop handling rendering and state updates for both the player and AI turns.
Graphics & Rendering
Rendered disk bitmaps with varying sizes, managing layered drawing for the stacked disk visual.
Game Engine Utilization
Leveraged the shared custom game engine with confidence, having built upon it through multiple previous projects.
Input Handling
Handled mouse input for disk selection and placement.
Collision Detection & Game Logic
Detected invalid moves (placing a larger disk on a smaller one) and implemented Nim win-condition logic.
Game State Management
Managed player vs. AI turns, win/loss detection, and game reset states.