In 6 months time, recreating a level from a 2D-arcade style game.
This was an exam assignment.
Finding the right sprites in time.
Not overcomplicating code.
Improving older pieces of code since we'll be learning more as we are working on it already.
My 4th favorite game is "Castlevania: Lords of Shadow - Mirror of Fate".
My uncle gifted it to me on Christmas, as I was constantly saying how I loved the demo of it.
Since this is a 2.5D platformer, I had to pick something else, but wanted to keep it related to Castlevania.
After looking at the different 2D games, Bloodlines was the one that looked the best to me.
Even though it had different names in different regions and it was pretty much unknown to everyone, I wanted to give it a shot.
The base concept of my code works as follows: most managers have vectors of vectors of vectors of [blank]*.
To break it down, they have a vector of levels that has a vector of stages that has a vector of [blank]*, be it enemies, objects, ...
The Game has a variable that tracks the current level and stage the player is on.
The reason I added levels when we only needed 1 is so there is room to add multiple levels.
If I had spare time, I could've done something with this.
Every Level (stage) has a variable of Transitions. These store the info of where triggers are, what kind of transition has to play when triggered, where the player should respawn and in what stage.
So when the player reaches a trigger, either a door will open and they will automatically move through it or a fade to black will happen.
When the screen is black or the player has passed the door, the player will teleport to the given position and stage.
When the player is sent to the next stage, they will be checking if it is a safe-spot.
They will store the info if it is. A safe-spot is where the player last touched solid ground, basically anything but stairs.
When the player dies, they will respawn at this spot.
Enemies and Bosses are controlled by their managers. There is a base class for both and derived classes are done with polymorphism.
Other then containing info about their movement, damage, hitboxes, what kind of states they are in, ... ; I am proud of the variable "m_PointOfContact".
When the player is hit, we will store what vertex is responsible for the hit. If this point is to the left of the player, they will jump to the right and vice-versa.
A Boss also has a trigger, this will lock the camera of the player and spawn invisible walls.
Only after defeating the Boss, the player will be able to move forward.
Triggering the Boss will also change the background music.
Every manager is updated in the Level manager. This could've been done in the Game Update aswell, but we needed to access the Levels to handle all collisions, so this was optimal in my opinion.
A very important class is the Sprite class.
Everything needs a texture and nearly everything is animated. So making a Sprite class that uses spritesheets was the obvious thing to do.
You can specify and change the duration of an animation and ask which frame is currently active for fun death animations and triggers (defeating a boss, ...).
The code is made using a framework that we got from school, which uses SDL and is mostly written in C++.
You can check the code on GitHub here.
This is the base concept of my code. There are still a lot of small things that influence each other, but writing those things out will take up too much space and time.
If you really want to know more, feel free to contact me.
Overall, I really enjoyed this assignment.
I could've chosen a game that was a lot easier to make and have scored a lot more, but I'm glad I didn't.
During the semester, I really struggled at times to make my code good enough and keep it clean.
Thanks to the feedback from teachers, I got where I am now although I'm really not happy with the grades I received from this assignment.
I am happy with the playable result.
It feels like the original game and is pretty fun.
A lot of sprites are taken from spriters-resource
, but for most, I extracted them myself.
All credits for the sprites/sounds go to Konami.
If you want to play the game yourself, feel free to download it below.
Upon launching the game, the controls should be displayed in the console.
This one has music, so make sure your ears aren't blown out at launch. You can change the volume, yet this will be reset after restarting.
Keep in mind, do not touch anything and just run the .exe titled "Castlevania_Bloodlines", deleting anything or moving something might break the game.