
8 Bit Princess
8-Bit Princess is a 2D game developed in C++ using a custom OpenGL-based framework. The project focuses on building a complete gameplay system from the ground up, including player control, combat mechanics, enemy AI, particle effects, audio integration, and scene management.
​
The goal of this project was to explore real-time rendering, game architecture, and interactive system design while developing a fully playable game experience.
What This Project Demonstrates
-
Real-time input handling and update-loop driven gameplay
-
Modular gameplay system design with clear separation of concerns
-
Tile-based collision detection and environment interaction
-
Enemy AI behaviours ranging from simple patrols to dynamic pathfinding
-
Scene-based state management and clean gameplay flow transitions
01
Player Movement, Direction Handling, Attack Animation, and Collision Detection
Player movement in 8-Bit Princess is driven by real-time input processed within the game update loop. Each frame updates the character’s position based on input direction, resulting in smooth and responsive control.
​
For directional visuals, the character uses front-facing and back-facing sprites for vertical movement. Horizontal movement is handled by flipping the sprite, allowing left and right directions without duplicating assets while maintaining visual consistency.
​
The attack system is represented using an animated sprite explosion. When an attack is triggered, the animation is spawned relative to the character’s position, providing immediate visual feedback while allowing player movement to continue uninterrupted.
​
Environmental interaction is handled through axis-aligned bounding box (AABB) collision detection against wall tiles. Movement is only applied when no collision is detected, preventing the player from passing through walls and ensuring accurate boundary handling.
​
Together, these systems create responsive controls, clear directional feedback, and reliable interaction with the environment.
02
Enemy Movement, Wall Interaction, and Direction Handling
Regular enemies move autonomously using a continuous patrol behavior. Their positions are updated each frame, allowing smooth automatic movement without player input.
​
Enemy interaction with the environment is handled using the same AABB collision detection approach as the player. When a collision with a wall tile is detected, the enemy’s movement direction is reversed, producing a simple back-and-forth patrol pattern within the map.
​
Both the ghost enemy and the elite monster use this collision-driven logic. When a direction change occurs, the enemy sprite is horizontally flipped to face the new movement direction, ensuring consistent visual feedback without requiring additional sprite assets.
​
This approach results in predictable enemy behavior that is easy for players to read, while remaining efficient and straightforward to implement.
03
Slime Chase Movement and Route Calculation
The slime enemy uses a chasing behaviour designed to navigate the tile-based map while pursuing the player. Rather than moving directly toward the player and becoming stuck on walls, the slime calculates a walkable route using the map grid.
​
Both the slime’s position and the player’s position are converted into tile coordinates. A shortest-path search is then performed across neighbouring walkable tiles (up, down, left, and right), treating wall tiles as blocked. During the search, each tile records its parent, allowing the final path to be reconstructed once the target is reached.
​
After a path is built, the slime moves toward the next tile along the route. This process is repeated as the player moves, enabling the slime to continuously update its path and chase around obstacles.
​
This logic produces reliable chasing behavior and allows the enemy to navigate corners and walls effectively.
04
Key Collection, Door Interaction, and Victory Screen Logic
Game progression in 8-Bit Princess is controlled through a simple sequence involving key collection, door interaction, and a victory screen.
​
When the player collides with the key, it is marked as collected and removed from the scene. A Boolean state flag records this condition and is later checked during door interaction.
​
The door can only be opened when the player is near it and the key has been collected. Once activated, a short opening animation plays and player movement is temporarily restricted to ensure the interaction completes correctly.
​
After the door interaction finishes, the game transitions to a victory screen using the scene management system. This clean separation between gameplay and end-state presentation ensures a clear and controlled conclusion to the game.