Final Week
Our deadline was pushed back a week due to timetabling errors, so this is the last week we have to work on the game. Currently the game is mostly complete with a few bugs and minor tweaks we want to make over the next couple of days. Since last post I have implemented the collision on the rooms so that the Player and the Enemies can no longer walk through the walls.
This week I have implemented:
- Coin Collision
- Heart Collision
- Win Game State
- Resizing the Game Screen
- Bug Fixing
One of the features none of us were completely happy with was the shooting. Our previous system took the last direction of the player in a slightly buggy way and fired a shot in this direction. This was the best implementation for keyboard however it could be greatly improved for controller.
I kept the shooting with a keyboard to fire in the last direction the player moved, this is really the best way to do this, but fixed the diagonal bugs that we were having. For the controller we decided we would use the right analog stick for the direction and the right bumber to fire.
This was quite simply added by using an array of 2 floats to store the last shoot direction and changing it on a move on the analog stick.
// X-Axis Movement
if (data.axis[2] > 0.2f)
{
last_shoot_dir[0] = 1;
}
else if (data.axis[2] < -0.2f)
{
last_shoot_dir[0] = -1;
}
else
{
last_shoot_dir[0] = 0;
}
// Y-Axis Movement
if (data.axis[3] > 0.2f)
{
last_shoot_dir[1] = -1;
}
else if (data.axis[3] < -0.2f)
{
last_shoot_dir[1] = 1;
}
else
{
last_shoot_dir[1] = 0;
}
This created a problem though; when there was no input (the last_shoor_dir was 0) the projectile wouldn’t move, since the inputted direction was 0,0. I fixed this by only allowing the player to shoot if at least one of the elements in last_shoot_dir wasn’t 0.
This gave us a much better shooting system which was more intuitive to use. With a little time to spare we have implemented audio into our game and have started to play test for bugs, which we are fixing as we go. I’m going to read through the TDD and GDD as well as continuing to fix bugs until the submission date.