Today's addition to Until Dinner is…
~ CABBAGES ~
Cabbages who runs around aimlessly while farting out poisonous gas.
Chapter 1 - The Cabbage
Visuals
Just the placeholder green godot for now.
Behaviour
Two states:
- Standing around doing nothing
- Running in a certain direction while tooting
Standing State
Does only one thing and that's to set a timer with a random duration. The cabbage switches to the running state when it times out.
Running State
Has a similar timer with a random duration range to switch back to standing state when it runs out. It also has a second recurring timer with 600 millisecond duration to spawn in the green clouds.
Chapter 2 - The Naive Fart
- The root node is an Area2D
- A recurring timer with a 500 millisecond duration starts when the player enters it
- The timer stops and resets if the player exits it.
- If the timer runs out without the player leaving the area, the player takes damage.
The problem with the naive fart is that...
They stack! When two running cabbages cross, they are likely to spawn gas clouds on top of each other which results in the player taking double the damage. The problem is even worse when a cabbage decides to fart up the same corner of the room for a while. Taking a step into “the dozen fart trap” results in immediate death.
Chapter 3 - The Refined Fart
Scrap that entire thing with the fart clouds keeping track of whether the player is inside of them or not. The player's going to be the one keeping track.
-
The player holds an integer
var cloud_count - It gets incremented when the player enters a cloud. A recurring timer with a 500 millisecond duration starts.
-
cloud_countgets decremented if the player exits a cloud. If it hits zero, the timer resets and stops. -
If the
cloud_countis higher than 0 when the timer runs out, the player takes damage.
Closing Thoughts
"The Naive Fart" section might seem like an unnecessary, useless effort sink, which has occurred due to short-sightedness on the dev's part. I believe going down paths like this, however orthogonal they might turn out to be, is intrinsic in the nature of engineering. They are not outside of the journey to the top, they're in it. or maybe that's how I cope with being bad.
Good Night!