Node Runner is a survival maze game built from scratch using C++ and OpenGL (GLUT). The project demonstrates core Computer Graphics concepts including rasterization, 2D transformations, and collision detection without the use of a game engine.
- Dynamic Player Movement: Smooth 2D translation controlled by user input.
- Smart Enemy AI: "Devils" that use greedy pathfinding logic to actively chase the player.
- Trap System: Static "Bomb" tiles hidden in the grid that trigger an instant game over.
- State Management: Finite State Machine handling (Playing, Win, Game Over).
- Grid-Based Rendering: Utilizing Raster Scan Conversion principles to render the map from a 2D array.
This project was designed to meet the requirements of the B.Sc.CSIT 3rd Semester Computer Graphics syllabus:
-
Unit 2 (Scan Conversion): The map is rendered by rasterizing geometric primitives (
GL_QUADS) based on a grid array. -
Unit 3 (2D Transformations): Player and Enemy movements are implemented via 2D Translation logic (
$x' = x + t_x$ ). - Unit 3 (Clipping/Windowing): Collision detection acts as a logical "clipping" method, preventing entities from entering Wall nodes.
-
Unit 10 (OpenGL & Animation): Utilizes
glutTimerFuncfor real-time enemy animation loops independent of the rendering frame rate.
- Language: C++
- Graphics Library: OpenGL / FreeGLUT
- IDE: Dev-C++ (TDM-GCC 64-bit)
This project requires Dev-C++ with the GLUT/FreeGLUT packages installed. Tutorial on how to install Dev-C++ 5.11 and GLUT/FreeGLUT : https://youtu.be/f6ijyf6WJ4s?si=4xq4AC8YNYPQbtgH
- Clone the Repo:
git clone https://github.com/YOUR_USERNAME/Node-Runner.git
- Open
Node Runner.dev(The project file) in Dev-C++. - Linker Configuration:
Go to
Project->Project Options->Parameters->Linkerand paste:-lfreeglut -lglu32 -lopengl32 -lwinmm -lgdi32 - DLL Setup:
Ensure
freeglut.dllis present in the same folder as the compiled.exe. - Compile & Run: Press
F11.
- W: Move Up
- A: Move Left
- S: Move Down
- D: Move Right
- Goal: Reach the Green Tile.
- Avoid: Red Squares (Enemies) and Dark Red Tiles (Bombs).
main.cpp: Contains the game loop, rendering logic, and input handling.init(): Sets up the OpenGL environment and Orthographic projection.display(): Renders the grid, player, and enemies based ongameState.moveEnemies(): The AI logic calculation (Timer Callback).keyboard(): Handles player input and collision checks.
This project is open-source and created for educational purposes.