top of page

Filler Content

Updated: Aug 22, 2019

I've been taking it a little easy in the wake of Alpha; just one more game mode and some playtest-feedback-driven bug fixes over the whole last week. I figure now is as good a time as any to catch up on some blogging.

One requested feature was an indicator to show whether you're currently carrying a cow or not, since you're only allowed one at a time and pressing the "abduct" button again will cause you to drop any cow you do have. As I implemented that, I decided to also add gauges for the drone and lure. I was already wrestling with the fact that they were both very powerful abilities, and not really limited at all in their use. I mitigated this by adding recharge timers to them, and felt no qualms about doing so since I now had a system to visually display that.

So how does it work? Sprite images in Unity have a setting called Image Type, which can be set to "Filled". If they are, they gain a set of corresponding properties, controlling the fill amount and direction. In the simplest case, you could use these to easily create a health bar, filling to a percentage of its total length from one side or the other. In my case, I used silhouettes of the relevant objects, but the concept was the same.

To determine the fill amount, I set up a ratio between the time since last gadget deployment and the recharge time, longer for the lure than the drone. This is recalculated and displayed every frame, for a smooth fill (smoother than in the gif, anyway). The hardest part was making the components talk to each other; since the players are no longer directly linked to the canvas, a new set of methods were needed to UpdateIndicator() with arguments representing which of the three gauges for which of the four players to target.

Now, the cow indicator works just a little bit differently. It's either fully on or fully off, depending on whether the player in question is currently carrying a cow. Because of some edge cases, this isn't as straightforward as you would think. In fact, I just yesterday fixed a bug where a cow knew it only had one owner, but multiple players thought they had abducted the same cow (and the display showed as such!). Most of the time, you want to adhere to best coding practices with class relationships and leveraging variables you already have, but sometimes it's clearer to read and just plain safer to make a new isAbducted variable and use that for exactly what you need.

Here's what it looks like all put together:

4 views0 comments

Recent Posts

See All


bottom of page