This week I have been doing some work on expanding the enemy waves, adding in a trail effect on the 3rd enemy’s bullets so that they are easier to see and an animation for the chest that we are now using for the power-up to spawn in.
The work I did in trail effect was to do some research into what would be the easiest way to do something like this. As I have been coding a fair bit the last weeks that was the first thing that I considered but did not find a good and easy way to do this. After some more googling I found that there was a good way to do this built into Unity. This was a renderer that is called “Trail Renderer”. After finding this the work was easy to implement for a test run.
The work I did on the animation for the chest was a bit harder as I do not have any experience on animation or the way animation works in Unity. Again, I found help in the Unity forums and with google. Fist I took the sprite frames that one of my artists had provided me with to build a animation controller and an animation. You do this by creating an empty GameObject in Unity and just dragging on the sprites there as one object.
When this is done, you can open a window called animation and tweak the rate of the frames and how long the animation is going to be. As I already had a set time for when the power-up would spawn this was just a problem of doing a timed animation for the set time that I needed.
I wanted the chest to open a short time before the power-up spawned. So, that it would look like it was coming out of the chest itself then close after that. The animation itself works well now but the problem that is now left it that we need two new sprites so that I can layer them in Unity. This is so that it will look even better as now it looks like the power-up comes from the back of the chest. So, breaking the chest sprite into two different sprites is something that still needs to be done so that the lid and the chest are separate. To help the visuals of the animation.