Skip to content

Sanil-Sth/Node-Runner-Computer-Graphics-Project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

6 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ•น๏ธ Node Runner

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.

๐Ÿš€ Features

  • 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.

๐Ÿ“š Syllabus Mapping (CSC209)

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 glutTimerFunc for real-time enemy animation loops independent of the rendering frame rate.

๐Ÿ› ๏ธ Tech Stack

  • Language: C++
  • Graphics Library: OpenGL / FreeGLUT
  • IDE: Dev-C++ (TDM-GCC 64-bit)

โš™๏ธ How to Compile (Dev-C++)

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

  1. Clone the Repo:
    git clone https://github.com/YOUR_USERNAME/Node-Runner.git
  2. Open Node Runner.dev (The project file) in Dev-C++.
  3. Linker Configuration: Go to Project -> Project Options -> Parameters -> Linker and paste:
    -lfreeglut -lglu32 -lopengl32 -lwinmm -lgdi32
    
  4. DLL Setup: Ensure freeglut.dll is present in the same folder as the compiled .exe.
  5. Compile & Run: Press F11.

๐ŸŽฎ Controls

  • 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).

๐Ÿงฉ Code Structure

  • 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 on gameState.
    • moveEnemies(): The AI logic calculation (Timer Callback).
    • keyboard(): Handles player input and collision checks.

๐Ÿ“œ License

This project is open-source and created for educational purposes.

About

Node Runner: A C++/OpenGL Survival Maze Game. Implements 2D geometric transformations, raster scan conversion, and greedy pathfinding AI. Built for the Computer Graphics (CSC209) syllabus using Dev-C++ and FreeGLUT

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages