Root implementation

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.

rootscamera

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.

En reaktion på ”Root implementation

  1. Hello!

    The subject of this blog post is well presented to the reader. I thought it was hard to come up with a subject when most of the game was finished, and more work had to be spent on writing the project report. I think you give clear reasons on why the roots were added to the game, to give the player visual feedback on where the player character are in relation to the top level and to give underground look better. I play tested your game at the beta phase and I believe this sound like a good addition to your game.

    Continuing you give a short but still good explanation on how the roots were implemented in to the code, and how it relates to the linked vegetation on the top. The blog is well written. The language you use is nice to read and I at least think one that has no previous experience with code would have no trouble in understanding the blog post you wrote.

    The picture you used in your blog post makes is well chosen to illustrate the roots in the game, and on another note I like the GUI in your game.

    I hope you succeed in removing that annoying bug, if it is not already gone, and from what I have tested so far I think the game is fun to play. Good luck on the project reports!

    Gilla

Lämna en kommentar