Home Creators Posts Import Register Favorites Logout

Content

You know, this game has a lot of bullets in it. Like, a lot. And explosions. And those rings of bullets. What I’m saying is, there’s a lot of things that can hurt you moving across the entire screen at once and that’s only going to get worse as development continues. The player has zero defensive options besides physically moving, and no way to recover health except for a single powerup based on random chance.

So I added in a way to dodge.

Dodging itself is actually pretty simple: it takes the direction you’re currently moving and moves you that direction at four times your base movement speed. The trick is making sure that you’re invincible while doing this action. Luckily, the easiest way to implement the dodge input solved this issue for me. I turned the player code into a state machine.

A state machine is very straightforward, really. Instead of having all of the player movement and damage handling and attacking code in the player object itself, I turned that all into a function that the player object calls. The dodge input switches over to a different function instead, the one that makes you go fast. Doing this also means that the player movement controls and attack code stop working during the dodge. More importantly, so does the code that makes the player take damage. End result is a functional dodge action.

The particle effect is a little trickier. It’s not technically a particle system that GameMaker has built into the engine, much like the damage numbers that I discussed in the previous DevLog. It’s an object that I repeatedly create during the dodge action. The object itself decreases in opacity, fading away quickly and deleting itself once it’s entirely invisible. The color also shifts over time, rapidly changing from that reddish-purple to a sky blue as it fades. While the code itself was simple enough, the specific numbers that I needed in order to achieve the effect that I wanted took some trial and error.

Oh and then I found another game breaking bug that I wasn’t aware of, because my work is never finished. You might recall the status effects that I added a while back? It turns out that if an enemy has multiple status effects applied to them, when one of those statuses runs out, the game crashes. It turns out the fix for this was as easy as a single line of code once I realized what the problem was. The For loop that runs to make the effects of each status work sets its size by how many status effects currently apply to the enemy. This number, the ‘length’ of the array, is never changed, even if the actual length of the array does. As a result, when a status runs out, the For loop attempts to run code that no longer exists and freaks out. So all I had to do was reset the ‘length’ variable within the For loop and the problem was resolved.

I’ve still got so much ahead of me, and I’m not totally sure what I want to tackle next. I need way more powerups, but to get more powerups I need to expand the current placeholder powerup section system so that it can display the description of each upgrade. I also need a few more status effects. I’m pretty sure there’s a bug in the code that limits how many times any given upgrade appears, and I need to make sure that’s resetting correctly when the player dies. The enemies spawn in pretty much every room with no regards for the player. There’s nothing to find in the dungeon except the exit. And the enemy AI is about as simplistic as it’s possible to be.

Ah well. My work is never finished.

Until next Devlog!

-DeusVerve

Special thanks to my Tier 3 Patrons, Haelerin and Christos Kempf!

Files

Comments

No comments found for this post.