Day 2: I can make spaghetti

Previously, in LD36…Event queue and debug statements

The design is simple. The mule creature in the center is basically a bio-mechanical caravan housing a family of post-apocalyptic pilgrims. (Mmm, bio-mechanical. What a sweet word, Mr. Giger.) Things happen to your people along the way — think FTL without real-time elements. The main challenge for the player will be resource management.

I made an events queue system. The game will be divided into days, and each day will be divided into time periods. Each of these time periods will constitute a turn. On each turn, an Event will take place. Events can be added to the queue as needed (e.g. if a trader appears, queue up a Trade event) but only one event will be played on each turn. If there are no events in the queue, a NoOp event is created, and the game renders that as “Nothing happens”.

Events can be flagged as “major”; major events are immediately moved to the top of the queue. This is essential for critical events such as character deaths — after all, if you’ve got a bunch of minor events queued up and a character falls into the furnace, you’d want to get notified for their death as soon as possible rather than watch them burn for multiple turns as the queue empties out.

As is typical of game jam entries, this is all driven by a GameManager god class. It looks deceptively clean for now, but I know what’s coming. The bugs are out there, waiting to sneak into my haphazardly written, tightly coupled, singleton-oriented spaghetti code. And I shall let them in, in the name of progress and speed, and in the hope that a few of them manage to transcend their cursed nature and reveal themselves as… features.