University Project - S2D Framework

A pixel corridor shooter built upon a minimal OpenGL 2D Framework.

Gameplay Video


Background

As part of the Fundamentals of Game and Graphical Systems Development (FOGGS) Module at Level 4, we had to create a game using an OpenGL Wrapper Framework provided by university.
It's intended for us to learn at a basic level how to program using a Graphical API in C++.
As someone who has done some work in Unity, I decided to sort of "recreate" some features of Unity, such as the Update() function. This allows me to facilitate to myself a (somewhat) familiar environment.
I spent quite a lot of time working on features that would speed up development time of actual gameplay. Such as:

  • A Texture Manager that gets the file names of all textures in a file and converts it to a key, so that you do not need to remember the file location - also is caps independent. Caveat however, if multiple files have the same name it the last loaded will be the only one loaded.

  • A Render Queue that determines the order of rendering. Objects with a value of 0 will be rendered first -or below- those of higher values. The order of rendering for same value objects is determined by their position in the Queue

  • Collisions - the collision system works somewhat similarly to Unity, when two objects touch, both will run any code either object has for collisions. On top of this, an object can be a Trigger, so that it doesn't block movement but can still run Collision Code

  • Safe Object Deletion - when an object is to be removed from the Game it is first added to a queue that is cleared at the end of every frame. This is to avoid any code that has reference to the object from attempting to run when the memory has been freed.

  • Time-based Animations - the frame time is used to calculate animations, for example an animation that updates 4 times a second needs to wait 250ms before it can be changed, the time between frames is added to a counter that when the counter goes equal to, or above the time requirement, will update the animation.