BGP Week 2 – Venus Slimetrap
|
During the second week, I started on the game’s main challenges, the special platforms that the player has to work with or around to move ahead in the game. The first one I ended up finishing up was the Venus Slimetrap, a platform inspired by the infamous Venus flytrap plant. The Venus shroom is a simple construction, working by detecting if the player collides with it, and if so triggering a bool that starts a count taking in deltaTime. Once it reaches a set value, the player is teleported to the location of another invisible gameObject, the Exit Spot. Once the player is no longer touching the fly trap, be it through jumping off the object, or being teleported by it, the time count resets, allowing the player to repeat it. The main challenge of this was figuring out how to formulate the code, with using the unity function OnTriggerStay/OnColliderStay tanking the framerate. To get around this enter just triggered a bool that made the counting happen in the update of the script instead. The end result turned out better than expected, doing what was intended while easy for the designer to work with. All in all a positive end result. |