Home Creators Posts Import Register Favorites Logout

Content

No new weapons this week, but I did work on something adjacent to that. Namely, I made it so that each of the different starting weapons have a different sprite. Sort of. I didn’t actually make different sprites yet so it’s just the same sprite in different colors, but the code to actually give them their own unique sprites is in place and fully functional, which is what I was going for. Giving them actual sprites is going to be this week’s job.

While I was working on that, I spotted a problem with one of the particle effects layering incorrectly—specifically, the particle that plays when you hit an enemy to show that you hit them. I fixed that easily because it was an easy fix. In GameMaker, if something should be in the front, you set its depth to a negative number and keep adding 0s to it until it works.

After that I moved onto fixing something a little more complicated. Knockback stunlocking. The way knockback works is that ‘being knocked back’ is a state in the enemy state machine—you can think of it like the enemy behavior tree, if that means anything to you. Their current ‘state’ is the action they will take. Which means that an enemy in the ‘knockback’ state is an enemy that is not in the ‘move’ or ‘attack’ state. The problem is the latter of those two. While enemies will return to their ‘attack’ state without interruption, if you have a lot of bullets and/or a fast enough fire rate, then they’ll keep entering the ‘knockback’ state before they get to actually attack because they’re only in the ‘attack’ state for a few frames at most.

To fix this, I added a cooldown on the ‘knockback’ state. Once an enemy has been knocked back, they’re now immune to being knocked back again for about half a second. I also made it so that certain enemies are immune to knockback entirely; namely, the stationary enemies. It feels a little weird firing a machine gun and only seeing the first one have a physical impact, but it’s minor enough that I’m satisfied with it.

Until Next Devlog!

-DeusVerve

DevLogs like these are brought to you by Patron(s) like Haelerin!

Comments

No comments found for this post.