Implementing the Core Mechanic: Laying, Breaking, Chaining, and Stamina

Blog post description.

Daniel Barnhurst

6/13/20262 min read

a man riding a skateboard down the side of a ramp
a man riding a skateboard down the side of a ramp

This week I've been focusing on implementing the core egg-laying mechanic.

We need to add some constraints, otherwise the player will just be able to lay an infinite number of eggs all over the place. Not good for gameplay. Not good for performance. And also, they could just continuously project themselves upwards and never have to hit the ground.

First, we add a simple limitation. The player only has three eggs at their disposal, and the eggs stay in the environment. In order to lay more eggs, they must first break an old egg. This immediately strengthens the core mechanic again, because now we've added resource management.

Although this helps to an extent, mainly in terms of stopping an incessant swarm of eggs flooding the screen, the player is still able to break an egg immediately after laying it, whilst midair. This is something that adds a decent level of skill to the game though. So, I really don't want to remove that capability because it rewards mastering the mechanic. But it does mean the player could still in theory jump forever.

I figured the obvious solution to this would be a simple stamina system.

I implemented a stamina system and allocated a 25% cost to laying an egg. This meant that the player would be able to lay 4 eggs before running out of stamina. I did this intentionally to help the player towards figuring out that although the on-screen egg limitation is three, they had enough energy left for a fourth, so maybe breaking one early would allow them to chain together another egg lay for those extra hard to reach places.

Not only was I really happy with how this super simple system did the trick fairly painlessly, it also gave me ideas for future development, to add power-ups and boosts, such as timed infinite stamina or reduced egg cost. Once again, strengthening our main mechanic by adding in-game modifiers to it. Also, power-ups and boosters like the ones I just mentioned are pretty common-place in platformers, so it just helps the games identity even more and I figure the more like a run-of-the-mill platformer the game is in every other way, the more the “no jumping” sticks out, whilst there not being too much new stuff for the player to get their head around.