This was a solo C++ project built over four labs for a game programming course. Implemented in a custom engine using SDL and OpenGL, the game replicates core mechanics from Portal, including recursive portal rendering, energy pellet puzzles, turret AI, and a VO system with subtitles. It features first-person movement, physics-based platforming, portal teleportation, and environment interaction via raycasting and collision detection.
Implementing quaternion-based portal orientation, player teleportation with forward vector transforms, and dynamic portal view matrices required a strong grasp of linear algebra and careful debugging of edge cases. While it followed the specs, executing every system offered valuable hands-on experience with real-time rendering and gameplay programming.
The game featured first-person navigation with gravity, platforming, and 3D collision handling. Players could place blue and orange portals on valid surfaces using raycasting and segment casts, enabling teleportation of both the player and interactable objects. Quaternion transforms ensured proper orientation and velocity transfer through portals, maintaining a seamless experience.
Recursive portal rendering was achieved by transforming the player's camera through the portal's matrix and rendering the view from that perspective. Energy pellet mechanics included timed launchers, catchers, and doors that unlocked when a pellet was caught in the corresponding catccher. Turrets were stateful AI actors capable of detecting, targeting, and damaging the player using laser beams via raycasting.
Audio and UI systems included distance-based volume fall-off, an HUD with voiceover subtitles, and directional damage indicators. VO triggers loaded sequences of audio lines with associated subtitles, optionally opening doors or loading new levels after playback.