Devlog 2: Collectable Boogaloo



Last week displayed a camera controller, and more so how it worked, and less so why it worked that way. This week, with a much more lenient amount of code to present, I'll talk about collectables, the systems used, and why the systems were used in that way.

To start with, how pretty the collectables looked weren't essential, so I stuck to a basic design that could still be built upon for consistency in aesthetic. I chose a capsule shape, comprised of two segments, to create a pill design. I was given Jak and Daxter as an inspiration for the kind of design for collectables that would be appropriate, and the thought of Junkie and the Pill made me smirk, so I followed through on that idea with pills that enhanced your ability.

The request was to make two separate pills that did two separate things; one would increase the player's speed, and the other would allow them to jump again while in the air. The first design hurdle was making it easy to make multiple power ups, because these two would not be the only power ups added, and collectables share a lot of code. Inheriting from a parent "pickup" was the solution

this code lets me enter custom particles, get the object I'm colliding with, and send it to an overridden function in another script that inherits from this script. The bottom function kills the object It's attached to, after playing an animation.

This script inherits from powerUp and allows the player an extra jump while in the air, indicated by "change". I changed the character controller to check how many jumps they had left, and when they touched the ground their remaining jumps would be equal to maxJumps, which is accessed and changed here. A similar script changes the speed, instead affecting stats.topSpeed, instead of stats.maxJumps.

The animation and Particle effects that play indicate the item was collected. I wanted to give the feel of cracking open the pill and all the powder in it bursting out from the sides. I wasn't sure how to make the pill shell fizzle out, so I elected for making it tiny then deleting it, so that it would be obscured by the pill powder


Here's how it looks when the player walks over it, alongside a particle effect sprouting from the centre of it


When the player picks up the item, and has its upgrade for a limited time, there was a need for a particle effect that specifies what the upgrade is, and how long it lasts. That's where the particle effect on your head comes from. I had a hard time thinking where to put the particles, but I think around the head makes sense for using a pill, as it puts you "under the influence". The particle effect becomes less prominent near the end, with less bubbles appearing around the head. There is a little time after there are no more bubbles where the effect still continues to affect you. This wasn't intentional, but I liked it, and left it in. It is reminiscent of Celeste, where the player can still jump if they just walked off a platform, as if they were on it. Here, the player can still use the powerup, like double jump, even if they just missed the visual timer running out.


Picking up a collectable of the same type as one the player is currently under influence of also resets the timer, and resets the particle effect.

I thought Red(for Mario, who jumps) and Blue(for Sonic, who is fast) would have been suitable indicators for the effects, but some peers did not share the opinion. It was, unfortunately, a rush job to implement visual indication, as I didn't really have the time to work on Materials properties, or else they would be on the top half of the pill capsule. Instead I favoured some very obvious visual signs above each pill, like so:


The red side is modeled after the player character's feet, which can be seen in the gifs above. I didn't have the time to craft a more complex boot, and didn't want to just use a basic double arched arrow. The blue pill has two arrows, similar to what would be seen on a TV remote when you want to double the speed of the video.

That's about it; collectable presented through bright colour contrast, rotation and floating above the world, and produces a nice effect on pickup, with a visual representation of the time left of the effect on your player,  and collecting the same powerup while happening resets the duration.

Leave a comment

Log in with itch.io to leave a comment.