A console-based hexagonal grid puzzle game developed as a C++ course assignment.
HiveGame is a puzzle game that runs in the Windows console, providing an interactive GUI-like experience through character rendering. It captures mouse and keyboard events to allow for dynamic gameplay, level selection, and editing.
This game is designed specifically for the Windows console environment. It relies on the Windows API for console manipulation.
- Best experienced in: Legacy Windows Console (cmd.exe or powershell.exe).
- Current Issues: There are minor compatibility issues with the latest Windows Terminal regarding event handling and rendering.
Snapshot showing the three main windows: Level Selection, Gameplay, and Editor.
The Puzzle Book interface for browsing and selecting challenges.
The application consists of three primary modules:
- PuzzleBook: A level browser where you can view and launch different puzzle challenges.
- HiveBoard: The main gameplay interface where you solve hexagonal puzzles by toggling cell states to satisfy numerical constraints.
- HiveBoardEdit: A built-in level editor to design and test custom hexagonal maps.
The game primarily uses mouse interactions, supplemented by keyboard shortcuts.
- Alt + Left Click + Drag: Pan the view.
- Alt + Mouse Wheel: Zoom in and out.
- Right Click: Open the context menu for most components.
- PuzzleBook: Use the mouse wheel to scroll through pages; middle-click to reset view.
- HiveBoard:
s: Find the next "strict" solution.p: Find the next "partial" solution.a: Show a normal answer.e: Clear all current lines/states.
- Editor: Single-click to add a cell, double-click to remove, and scroll to change a cell's number.
The codebase is split into three distinct layers:
A custom-built GUI framework for the Windows console. It handles:
- Event Loop: 30ms refresh rate with asynchronous keyboard/mouse event processing.
- Widget System: A hierarchical component system (Buttons, Windows, Scrollables) with localized coordinate spaces.
- Timer: A task scheduler for periodic operations like UI updates.
Contains the mathematical and algorithmic foundation of the game:
- HID: A specialized coordinate system for hexagonal elements (Cells, Lines, Nodes).
- MagicBee: A backtracking solver designed to find valid solutions for a given hexagonal configuration.
Integrates the CW framework with Hive logic to build the actual game windows and user interactions.
Developed by Hanlin Wu (curnext)