top of page
F19_V375_P1_SchroersHope_edited.jpg

Tron Light Cycle Game - OpenGL

A recreation of the original Tron Light Cycle Arcade game with a twist!

Both the original Tron and the sequel are two of my favorite movies. I've always wanted to get my hands on the original arcade game to play it. When I took the C++ class at school and learned OpenGL, our final project was an OpenGL assignment. I was encouraged to create a game by my professor. So I thought, why not make the Tron game that I've always wanted to play?

All the code I wrote is from scratch. It took two weeks to make.

Objective: 

  • Two players: user 1 (blue) and user 2 (orange)

  • Traditionally, the objective is to "derezz" the other player using your light trail from the light cycle. In my game, each player can fire their identity disk at the other player to "derezz" the other, and/ or the light trail they are about to hit to escape defeat.

  • Added rule: leaving the grid is considered a violation and results in immediate de-resolution.

Graphics: 

  • The light cycles are very close in matching the original design

  • The grid designed was changed to recall the modern look of the grid in the 2010 Tron: Legacy movie.

Controls: 

  • 't' key begins the game

  • Each player has only three keys: a left turn, right turn and fire disc key

    • User 1: 'a' is left key; 'd' is right key; 'space' is fire key​

    • User 2: on the numpad '1' is left key; '3' is right key; '0' is fire key​

Right-click Menu: 

  • Option 1:  Play with discs

  • Option 2: Light Cycles Only - gives tradition game

  • Option 3: Exit

Classes: 

  • GamePlay

  • graphicsUtils

  • LightCycle

  • Trail

  • Border

  • Discs

GamePlay Functions: 

  • For every light cycle - computePosition and computeIntersection with other light cycle

    • computePosition - calls function to draw light trail behind the light cycle; calculates offset amount to be used when firing disc to avoid self-collision​

    • Rotating angles of cycles are limited to 0, 90, 180, 270 and 360

    • computeIntersection - if the cycles hit, return to previous position and rotate each 90 degrees

  • For every disc - computePosition and computeHitCycle

    • Uses position of cycle to calculate offset​

    • Disc will be deleted if it goes beyond the max firing range.

    • Disc will bounce off the light cycle it hits and subtract a life from that cycle

    • Disc will bounce off it hits a border

  • For every light trail - drawTrail and computeIntersection with discs and light cycles

    • Each trail is a vector of squares that are drawn every time the cycle moves​

      • Makes calculations simpler for collisions and easily deleting sections of the trail when a disc hits it​

      • Uses a bounding box for collisions with light cycles and discs

    • If a disc hits a light trail, that part of the trail will be deleted

    • If a light cycle hits a light trail the game will end

  • For every border - computeIntersection

    • If a disc hits, it will bounce off​

    • If a light cycle hits, it will end the game

Challenges:

The version of the game I have for download below the video of the gameplay does not include functionality for collisions of the light cycles with the trails. The computations are complex and causes significant reduction in FPS. On my own time, I continue to try and rework that code to find a better way that doesn't slow down the game.

Video of Gameplay

Files for Download and Play:

Note: OpenGL and/or FreeGLUT must be installed on system to play 

Grade Calculation Application - Vectors and OOP

An application that can be run in the Linux terminal for calculating grades of students in a class.

Functionality: 

  • Enter grades and their corresponding weights for one or multiple assignments

  • Average for the student(s)

  • Letter grade for the student(s)​

  • Choice to begin again for another class

Code: Grade_Calculator

bottom of page