Skip to content

mxcaoalina/TunnelMan

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TunnelMan Game

A 2D mining adventure game built in C++ where players dig through earth, collect resources, and face off against AI-driven protestors.

Game Overview

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

Resources & Items

  • 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

Technical Features

AI System

  • 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

Physics Engine

  • Boulder stability system with three states:
    • Stable
    • Waiting
    • Falling
  • Collision detection for 4x4 block hitboxes
  • Cascading boulder effects

Performance Optimizations

  • Efficient grid-based collision detection
  • Memory-optimized terrain representation
  • Smart actor update scheduling
  • Spatial partitioning for collision checks

Game Mechanics

Player Controls

  • Arrow Keys: Move in four directions
  • Space: Shoot water
  • Z: Use sonar
  • Tab: Drop gold
  • Esc: Exit game

Scoring System

  • Gold Nugget: 50 points
  • Oil Barrel: 1000 points
  • Regular Protestor Neutralized: 100 points
  • Hardcore Protestor Neutralized: 250 points
  • Level completion bonuses

Building and Running

Prerequisites

  • C++ compiler with C++11 support
  • irrKlang library for sound effects
  • OpenGL/FreeGLUT for graphics

Build Instructions

  1. Clone the repository
  2. Open TunnelMan.sln in Visual Studio
  3. Build the solution
  4. Run TunnelMan.exe

Project Structure

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

Gameplay Tips

  1. Use sonar strategically to find hidden resources
  2. Watch for boulder stability - they can fall and cause damage
  3. Manage your water supply for protestor defense
  4. Use gold nuggets to distract hardcore protestors
  5. Create escape routes in case of emergency

Level Progression

  • Each level increases in difficulty
  • More protestors appear
  • Higher ratio of hardcore protestors
  • Reduced item spawns
  • Faster AI response times

Technical Implementation Details

  • 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

Audio System

  • Integrated irrKlang sound engine
  • Dynamic sound effects for:
    • Digging
    • Water squirts
    • Boulder falls
    • Protestor interactions
    • Item collection

Known Issues

  • None currently reported

License

This project was created as part of a programming course and is for educational purposes only.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors