carrotcake Blog 🍃


official devlog for carrotcake written by Louis Durrant

Thursday Report: Digging Yourself a Hole

Posted on Sep 20, 2018

This week I was able to make a quick start on the landscaping that the player will do throughout the garden.

Although it’s only small, it’s great to see the systems for how the player might affect the garden after its generation. I decided to start with the trowel — it’s the only tool I’m absolutely sure on including, so it was a safe choice. It has a small form factor, and a many handy uses that the player might find themselves taking advantage of.

Maybe the traditional gaming shovel will make an appearance for those larger, deeper holes — although in a game where most gardening is planting seeds, would such a hole be necessary? Maybe a shovel would be used to remove a tree stump from the ground, but in the real world this would be arduous work. I like the idea of a tree having a real presence and sense of place, planting a tree shouldn’t be done frivolously, and neither should taking one down.

I haven’t yet figured out the best way to obscure the tip of the trowel to give the illusion it’s digging into the ground. I’m happy with the animation for the most part, it has rhythm and a good sense of weight and snappiness.

An easy way to establish a rhythm is to simply make sure each part of the animation plays out for the same time interval — or a division thereof. Watch the animation above, and you can count a consistent beat: 1, 2, 3!, as each motion lasts for exactly 0.2 seconds.

I would prefer if the player got on the knees — for the promotion of good posture! — , but that’s something I might have to figure out down the road, as it might involve swapping out sprites.

I still need to add the hands, and I’m still torn whether arms are a necessary inclusion — it would certainly make life a lot easier without having to flail those meat sticks around in animation.

While I originally had in mind to animate the dirt being dug up myself, it occurred to me that setting up a particle would be easier and offer many benefits. Some acceleration is added to the sprites and then a large amount of gravity is applied so they fall toward the ground. I randomized the size, the rotation, and the position of each piece. Now, every time the player will dig up the ground, the effect will look different with each dig.

The game creates a node with the image of the hole just below the player, and plays the particles as it appears. Just how many nodes can the player create before the engine collapses in on itself? Who knows! I’ll likely have to start removing holes when they’re off camera to keep things from spiraling out of control.

Next on the list to continue this will be for the player to fill in the hole after pressing the same button, or — of course — planting a seed.

Follow me on Twitter.