Time once again for a blog post, this week I’ve been working mostly on my project report, but I’ve also been looking on some tweaks for the game. I have been working with trying to implement roots while underground which would give the player hints on where the vegetables on the top level is. However, this wasn’t too complicated.
The way it was done was basically to add a texture and a sprite to the constructor of the vegetable class, this is also where we create all our other vegetables. I set the position of the roots to the position of the strawberries. In our draw function in our gamestate we have a for loop which draws all our vegetables on the screen. I did the same for the roots, but for the underground level. So whenever the player takes a vegetable and it gets invisible, the root for that vegetable also gets invisibile.
This is how the roots look like while the player is underground. If i would take a strawberry on the top level, the root for that strawberry would also get invisible. We added the roots to give the underground some ”life” if the roots wouldn’t have been implemented it would basically have been a brownish background with some tunnels in it, which wouldn’t be so satisfying for the player. The roots will help the player to orientate when he is underground.
Other than the roots, we currently have quite an annoying bug that I’ve been working on but haven’t been able to fix just yet. The ones who have seen our game on the beta presentation probably remembers that whenever the player would eat a vegetable, he would gain a minor speed boost for a short period of time. But if the player would dig up on a vegetable, he will start moving backwards. I’m not quite sure why this happens. When the player eats a vegetable we set a bool to tryue and if that bool is true we start a timer. As long as that timer is under 0.5 seconds the player gets a speed increase with +4, and when the timer goes above 0.5 seconds, the players speed will decrease with -4. So the timer keeps on going, which isn’t that strange since we reset it as soon as the player picks up a vegetable, the weird part is that the timer won’t reset if the player would dig up on a vegetable, so I’ll have to take a deeper look on what the issue really is. Hopefully it’s an easy fix.