A 2D mining adventure game built in C++ where players dig through earth, collect resources, and face off against AI-driven protestors.
TunnelMan is a grid-based mining game where players navigate a 64x60 mine shaft environment. As the TunnelMan, players must:
- Dig through earth to create paths
- Collect valuable resources (oil barrels, gold nuggets)
- Use tools (water squirts, sonar) strategically
- Avoid or confront protestors
- Watch out for falling boulders
- Oil Barrels: Required to complete levels
- Gold Nuggets: Collect for points or use to bribe protestors
- Sonar Kits: Reveal hidden items within a 12-unit radius
- Water: Used for defense against protestors
- Advanced pathfinding using dual heat maps:
- Player tracking heat map
- Exit tracking heat map
- Line-of-sight detection in four directions
- State-based AI behavior for protestors
- Real-time path optimization
- Boulder stability system with three states:
- Stable
- Waiting
- Falling
- Collision detection for 4x4 block hitboxes
- Cascading boulder effects
- Efficient grid-based collision detection
- Memory-optimized terrain representation
- Smart actor update scheduling
- Spatial partitioning for collision checks
- Arrow Keys: Move in four directions
- Space: Shoot water
- Z: Use sonar
- Tab: Drop gold
- Esc: Exit game
- Gold Nugget: 50 points
- Oil Barrel: 1000 points
- Regular Protestor Neutralized: 100 points
- Hardcore Protestor Neutralized: 250 points
- Level completion bonuses
- C++ compiler with C++11 support
- irrKlang library for sound effects
- OpenGL/FreeGLUT for graphics
- Clone the repository
- Open TunnelMan.sln in Visual Studio
- Build the solution
- Run TunnelMan.exe
TunnelMan/
├── Actor.h/cpp # Base and derived actor classes
├── StudentWorld.h/cpp # Game world management
├── GameConstants.h # Game configuration
├── GameController.h/cpp # Game loop and control
└── Assets/ # Game resources
- Use sonar strategically to find hidden resources
- Watch for boulder stability - they can fall and cause damage
- Manage your water supply for protestor defense
- Use gold nuggets to distract hardcore protestors
- Create escape routes in case of emergency
- Each level increases in difficulty
- More protestors appear
- Higher ratio of hardcore protestors
- Reduced item spawns
- Faster AI response times
- Object-oriented design with inheritance hierarchy
- Real-time pathfinding using flood-fill algorithm
- State-based AI behavior system
- Efficient collision detection using spatial partitioning
- Memory-optimized terrain representation
- Smart pointer management for dynamic actors
- Integrated irrKlang sound engine
- Dynamic sound effects for:
- Digging
- Water squirts
- Boulder falls
- Protestor interactions
- Item collection
- None currently reported
This project was created as part of a programming course and is for educational purposes only.