Journal Entry #2


Date: 09.04.2024


Activity:

- Implemented manual reset to last checkpoint.

- Created the double jump gem and the bouncing critter.

- Constructed the level.

Note:

I bound the manual reset to the P key so it is further away from the more commonly used WASD keys, so it is more difficult for the player to accidentally reset their progress.  Since the goal of the manual reset is to avoid softlocks, whenever the player respawns the positions of the boxes that have been moved since the player passed the checkpoint are restored as well. To signify the location of the checkpoints to the player (so they know where they will respawn) I added a plant with a simple animation  (it gets less transparent) when that checkpoint is the last one the player passed.

I struggled for a bit to figure out how jumps are implemented so I could modify them for the double jump and the bounce. By observing the animator I learned that the states have State Machine Behavior scripts which handled the jumps and other movements of the player. I didn't know that such a thing existed in Unity, but with some experimenting, I managed to figure out how it works and implement the bouncing and the double jump. The more difficult part was fine-tuning the height of the bounce. The height of a jump in the game is determined by how long the space bar is pressed, so when the player bounced, holding the space bar made them bounce too high. At first I tried just disabling jump input while the player is bouncing, but wouldn't work because of the part where the player must hit a double jump gem after bouncing up to it. After some experimenting, I ended up fixing it by not disabling the input, but disabling the ability for extra height to be added by holding the space bar while the player is bouncing, and enabling it when the CheckForGrounded method detected that the player was grounded on a surface that is not the critter.

While constructing the level, I realized some mistakes I made while writing the game design document. Mainly, in the construction of the corridor under the first section of the level. I did not specify how the player should traverse through it and how high it should be. I ended up making it so the player must crouch walk under the platforms, however I should have specified that before. Also, the jump from the bouncing critter onto the double jump gem and then onto the moving platform is quite difficult, it might have been a better decision to just have the player bounce up to the platform. But to make the design work, I opted to make the double jump gems a bit bigger and give them a more generous hit box, therefore making jumping out of a bounce and onto the gem a bit easier. I also let the gem give the player a little bit of a boost after being hit so the jumps are smoother. Another problem with my GDD was that I didn't mention what happens when a box lands on a critter. There were multiple options, either the box lands in front/behind it, the box squishes the critter, or the box bounces. Currently, I have opted for the box to squish the critter, but I may change that so the box bounces. An issue I ran into was in the part right before the final door where the box must be brought down to the pressure plate. The box was sticking to the sides of the platforms and wasn't able to be pushed off. Setting the physics material to no-friction and increasing the size of the collider a bit makes this problem less common, but it still happens. I suspect it may not be related to the colliders but the fact that the box is being moved along with the platform, but I have not tried to implement this yet. Lastly for the level, I added some camera switching in areas where seeing what's below the player is important.

I also trimmed down  the length of the death animation, since the player is expected to die quite a bit during the platforming (I just kept the DeathLanding part). However, while doing that I ended up accidentally removing the Hurt animation as well, which I only later realized when the player would fly off after getting hit while jumping. After fixing that, I also made sure that if the player dies on a platform, they will fall off.

Next I will work on fixing the problem of the box sticking to the sides of the moving platforms, adding a start menu, an opening and ending cinematic, and camera movement so when doors and barriers are toggled open the camera pans over to them opening. I also have to figure out why the game is dropping frames.

Duration: 10 hours

Get Project B

Leave a comment

Log in with itch.io to leave a comment.