This week, I focused on fixing the bug I left for myself from last week. After that, I moved onto creating and implementing the catching fish minigame.
Fixing last week's bug was fairly simple. I programmed a Boolean and if statement that will prevent fish from being hooked when another fish was already hooked.
I moved onto creating and implementing a minigame to catch fish. I was unsure what I wanted to do at first, but then I decided on having two minigames.
Creating the minigame went surprisingly smoothly for the most part. However, the biggest issue I had was the inputs for the diagonals were not working 100% of the time. After a little googling, I discovered why.
When I learnt C# programming for Unity, I learnt that for keys I should use GetKeyDown. GetKeyDown, as it turns out, is only true while the button is being pressed down, and not held down. What was happening was that my code would only be true when both keys were pressed down at the exact same time, which meant that there was a small window of a few milliseconds where both would register as pressed.
How I fixed this was changing GetKeyDown to GetKey. GetKey would register as true while the button is being held down as well, allowing for correct inputs to actually be made on the first try. This does mean that if the player wanted to, constantly spamming all four buttons would still count as correct. I'm not too bothered by this, as I will fix this later.
I finished off the day by adding stage 2 (mashing minigame I had made days prior), and implementing the minigame into the main game. Surprisingly went with no major errors, i'm impressed.