As I talked about in my latest post, the Light plant is one of the Enemies/Puzzle mechanics in our game. It’s projectiles provide light, but are also dangerous to the player on touch, so they have to be avoided.
This week, I’ve added two new behaviours to the plant, “angry” and “activation”. These two are the main mechanics that this plant will have to create interesting puzzles.
The angry behaviour
When the player hits the plant with a projectile, the plant will mark the players current position as of being hit, and will then shoot towards that spot with a higher fire rate for a short amount of time.
This was done by having the player variable as public in the script, so that a reference to the player GameObject can be added through the editor. When an object tagged with “projectile” enters the plants hitbox, it will destroy that object and set the plant in “angry” mode. I use the WaitForSeconds coroutine method described in my earlier post to stay in this mode for a set amount of time. When the coroutine ends, it resets the angry flag, making the flower return to it’s normal passive mode.
The activation behaviour
An inactive Light Plant will currently just wait to have an object tagged “LightProjectile” enter it’s trigger-collider, and will then set itself to be active, behaving as any other plant.
Using this mechanic of “aggroing” the plant, together with the “activation” mechanic will be one of the core dynamics in our game where the player uses light in different kinds of puzzles.
An example of such a puzzle is what we are working towards in our current prototype, where the player first needs to navigate past a Light Plants default shot pattern. After they’ve done this, they will proceed into the next area only to notice that it’s too dark to proceed. Using the taunt mechanic to make the plant shoot into that dark area will reveal another plant in that area which will react by activating itself, providing further light.
After this, there is not too much to do on the actual plant. Moving further we will focus more on interactions with the projectiles, and also with other enemies. There is also some work needed in making sure the level design is correct. We need to have good pacing, while making sure that the player understands a mechanic on a basic level before building more complex puzzles involving several different mechanics.