BGP Week 3 – Shrivel Shrooms

During the third week, I worked on the shrivel shroom, a relatively simple concept. The idea was for it to be a platform that would shrink whenever a player stepped on it, shriveling in to the center point.

This was relatively easy to make the basics for, simply setting up a a function that turned a bool true if a player collided with the platform, and false if they jumped off, and then have the shroom shrink by a variable amount while the bool was true, down to a predetermined minimum size.

To this, I added a function using deltaTime to see how long had passed since the player left, and then, if the shroom was smaller than the original size, have it grow back until it hit the original value. Thus letting the platforms reset after a moment should the player need to try again.

As a final touch, deltaTime was added to the shrink and grow functions, meaning the speed at which it happens is the same no matter framerate or possible lag.

About Stefan Ekdahl

2014  Programming