Making a Light Plant

This week I started work on a new enemy, and a new mechanic for the game. This enemy is a flower that will sit on a wall and shoot projectiles that provide light, but are also dangerous to the player. The projectiles will also be used later in different puzzles that will interact with them in different ways, opening pathways or providing more light.

The plants themselves will also interact in different ways with other projectiles and the player, but these mechanics still needs design work.

Making the plant, I started out with drawing a quick sketch of how the code layout should look, and then proceeded to implement it in steps. I first created a prefab for the projectile, testing different lights and collisionboxes to see which would work best. Then I created the actual plant, which really is not much more than a sprite with a trigger collider and a script. The plants script was interesting to implement, to begin with I just instantiated a projetile, adding some force to it, which worked nicely. But then, I had to make it shoot on a timer, which took a good while to figure out. I used the inbuilt function WaitForSeconds(), which works using coroutines, which I did not know how they worked in Unity (well, technically, in C#). I learned a lot about how to use Coroutines with timers, and while I think the final solution I came up with is a bit brittle, I think it will hold well through the development of the game.

This plant will be a part of our main core mechanic, so making sure that it works well is imperative.

Author: weakman54

I make games.

2 thoughts on “Making a Light Plant”

  1. Hi Erik
    I can get quite a clear overview of what you have done this week from this blog post, although it would have been better if you would have stated the function of the plant, maybe tell how it will be used in different puzzles, I get the extra light but is that all that it will do, will you be able to move the plant?

    You also mentioned that you made a new enemy and a new mechanic, I get that the plant is the enemy, but what is the mechanic, is the shooting of the light bullets? Some clarification in this area is needed.

    The use of tools is a nice addition, how you described the code that you used, but might have been a bit more interesting if you would have added your thought process to come up with using the WaitForSeconds() command, like for example did you try any other command before that.

    Also one last thing, it would have been nice if you added why the plant will be a part of your main core mechanic, so that the readers know why it’s imperative.

    Good luck with your production in the future.
    Alex Östermark


  2. I like the way you explain what the purpose of your work is, and how you implemented it step by step. It is very clear how everything is done and why it is done. One thing that could be clarified better is what your plans are for the light plant. You explain that it will be used to “open pathways and provide light,” however, it would be nice to know if you code is written in a way that it is easy to change how it works. Since you seem not to have finalized what the plants will do, you might have made the code modular, so it could change to new game design ideas.

    Your blog post is using language and terminology that is difficult to understand for someone who hasn’t programmed before. However, it’s possible that that wasn’t the purpose of the blog post. The instructions for writing blog posts are a bit unclear, especially in terms of what the assumed knowledge level of the reader should be.


Leave a Reply to olwiblog Cancel reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s