Today I spent a lot of my time creating a state machine framework, then working on basic Survivors-like functionality. I've always had problems in past game jams trying to manage state via large lists of if statements. My worst offender was my first game jam game, Unveil, which had a scripting engine for cutscenes, but it handled scripted actions with dozens of statements like:
else if (!isFadingIn && !isBlackingOut && !isDisappating && !isPaused && !isMoving && !Dialog.GetDialog().IsDialogOpen() && scriptStepParts[0] == "move")
Since I had read about the state pattern in Game Programming Patterns a while back, I decided to take some time during this game jam to invest in a state machine framework to simplify this. It took more time than I expected, but it was immediately useful for a variety of other situations.
After this, I created a basic enemy that would spawn, then seek out the player. Once that was working, I investigated how to create an elliptical spawning system where enemies would spawn randomly along the edge of an ellipse that was larger than the camera view. My hope was to get a shape similar to what is seen in Vampire Survivors, like this:
I got the math working for this ellipse spawning system, and it was fun to see the enemy triangles coming on screen and pursuing the player!
Next up was adding a health system to the player, where the player would take damage when an enemy touches them and will continue to take damage while in collision with enemies. Then came the reverse: being able to damage enemies. For now, I implemented a rudimentary "garlic" attack, destroying any enemies within range every second:
I had hoped to get the "strength through weakness" mechanic in place today, but that'll be my focus for tomorrow!