Posts

Showing posts from June, 2021
Image
 GameObject Sequencer. Bosses made simple. For every general enemy type in the game I simply code up its actions, at the same time building a library of commonly used functions, for instance animation, path following, or wall collision. Getting on to bosses though, it makes sense to expand the system a bit to allow for (slightly) more complex behaviours. So what does a boss do in this game? Generally they all follow the same sort of pattern.. follow a sequence of mini-actions, attacking the player, moving around, becoming vulnerable or invulnerable to attack, etc. This needs to be easily editable at a high level, too. so iterating on gameplay is efficient. Cheese Boss Here's the Cheese Boss, and below is his sequence in 'code' BossCheese_Sequence1: .loop:     SEQ_IMMEDIATE BossCheeseSeq_StartScreenShake,0     SEQ_IMMEDIATE BossCheeseSeq_SetInvisible,0     SEQ_PAUSE 100     SEQ_STATE BossCheeseSeq_ScaleIn,0     SEQ_IMMEDIATE BossCheeseSeq_StopScreenShake,0          SEQ_BULLE
Image
The GameObject System The heart of this Genesis game / engine is the GameObject system. And it doesn't really get much simpler than this. (These aren't Unity GameObjects!) I have a single list of GOs - each being an area of memory - effectively in a list. They are (sort of) structures. (there are not really any structs or classes in assembler) These contain the basics which every kind of GO needs. Data like position, velocity, animation frame, flags, etc. Alongside that they have some space which can contain different data for different types of GOs. There is no concept of a class hierarchy, each GO is the same from the code's point of view. Having a fixed size structure is an enormous advantage. It keeps things simple, and removes the need to have different sorts of lists for different objects. For speed when adding / deleting objects I keep lists of pointers. One for GameObjects which are in use, and one for those which are inactive, so this operation always takes a fixed