Computer Graphics Project: Platformer Game
Half of the Computer Graphics exam grade was determined by this project, which consisted of creating a simple 3D game with platforms on which a character could jump, and a simple editor for creating a level.
Once again, I and @aleasto teamed up to tackle this project.
In short, instead of hacking together various pieces of code, we planned a clean file structure, separating engine components from the actual game implementation.
In less than a month, we had working (point, spot and directional) lights, a rough but functional collision detection/physics and raycast/mouse detection, and even a (fake) shadow which was created reusing the implementation of the spotlight.
Here’s a couple of screenshots that show the final result:
In particular, I worked mostly on:
- the development environment setup, made with Webpack and with some loader to make it really simple to import GLSL shaders and OBJ files. I’ve also setup Typescript in order to avoid most of the type errors when working with the WebGL2 API.
- the UI, because I always end up doing UIs. I should have studied design at university.
- the raycast (for those familiar with Unity3D terminology) or simply a way to convert the screen space coordinates to world space coordinates. It was super-cool when it finally worked. To keep thing relatively simple, and given the relative short time to make this project work, I ended up using the AABB (Axis Aligned Bounding Boxes) method.
- And also finding the models (that are totally NOT ripped from a certain Nintendo game; anyway, it’s for didactic purposes) and fixing UV maps in Blender, ugh. Never again please.
At the end I now have a deeper understanding of how low-level things work in a 3D engine.
Repo
Source code and some more details are available on the GitHub repo.