SevillaJam – coin machine

This weekend I met with some old and new friends to make a game. So, in that rainy weekend that clashed with the Spanish national day, we joined with other 70ish game-jammers to do what actually fuels us all year round.

The theme of the jam was “Credit”. After discarding some ideas about movies credits and bank loans, we decided to just make any game which would accommodate the mechanic idea we had: reloading by real-life inserting coins (or credits) in a machine. And this is what I want to focus on telling you about here.

Because of my previous experience in Malagajam 18 – Bernochyl, I was no longer scared of making physical devices to interact with games. Also, Javi already had some experience using his new 3D printer. So I designed a box with a coin slot that would also hold a pc mouse. The coin would activate the mouse’s laser, and that’s how the game would know a coin was inserted.

The original idea was to put the mouse on top and, when inserting the coin, it would slide just under it, activating the mouse’s sensor through a hole. However, because I had to eyeball all the measures, the gap between the sensor and the coin’s path was too large for it to detect it at all.

Despite this drawback, we were lucky to find another solution that didn’t require to change the already printed design. We dismantled our old mouse and attached its internals to the inside of the box (it wouldn’t have fit otherwise). The coin would trigger the mouse with its face, instead of the edge, while passing right along the sensor.

With this solved, I joined the rest of the devs to continue making the actual game. The idea that came up was a tower defense game in which the player, a cook, would move around the field and build traps for the critters, that would try to eat his cake. The player would also need to get close to the defense towers to reload each with magic, by inserting coins into the coin machine.

Here’s the trailer we made for the game, where hopefully you can better appreciate the mechanics:

Props to our artists Belu and Alberto, who created the fantastic artwork and worked seamlessly despite having met for the first time in the event.

In the technical side, we didn’t do anything (else) too crazy. I just want to highlight a couple of things. First, that we used Unity’s pool system package, that allowed us to create object pools for enemies, projectiles and traps very easily. And second, the use of DoTween to make lots of stretch, squish and bounce animations, which added a lot of quality to the game and didn’t require almost any effort to set up. Just with a couple of lines of code, we made some simple yet effective animations for the characters, here’s an example:

        float phase = 0.15f;

        spritePivot.DOScaleY(1.2f, phase)
            .SetLoops(-1, LoopType.Yoyo)
            .SetEase(Ease.OutSine)
            .Play();

        yield return new WaitForSeconds(phase/2);

        spritePivot.DOScaleX(1.1f, phase)
            .SetLoops(-1, LoopType.Yoyo)
            .SetEase(Ease.OutSine)
            .Play();

        float rotationAmount = 15;
        spritePivot.localRotation = Quaternion.Euler(0, 0, rotationAmount);
        spritePivot.DOLocalRotate(new Vector3(0,0,-rotationAmount), phase)
            .SetLoops(-1, LoopType.Yoyo)
            .SetEase(Ease.InOutSine)
            .Play();

Overall, it was such a great experience working with the team, and I’m super happy with the result. They were just excellent to hang around with, and I think you will be able to feel this with the vibes of the game. We even won a mention to the most original game of the jam!

You can give the game a try, even though it’s not the same experience as if you played in the jam with the coin machine.


Subscribe to get my blog directly in your inbox