Project RBH Devlog 0059 (Patreon)
Content
The problem has been fixed! The game is working again!
What weird is that I don’t know for certain why this code interaction caused the problem.
What was happening is that I set the player’s depth to change dynamically. What’s depth? That’s the order that GameMaker draws sprites on screen. So if you wanted to stand behind an object and have its sprite obscure the player, that’s what depth does. For some reason, this was preventing the bullets from spawning. Then the code would try to set the bullet’s parameters—things like its speed and damage—at which point, because no bullet spawned, the game couldn’t run that code, and crash. But the reason this happened is because in the function that spawned the bullets, I spawned them using the built-in ‘layer’ variable, meaning there were on the same ‘layer’ as the thing that spawned them—the player or the enemy. But I guess messing with depth on the fly makes that not work? For some reason? Because replacing that variable with the name of the layer that the player/enemies are on fixes the issue? Even though that’s the same layer it should’ve been calling anyway? It’s very strange.
So I celebrated by replacing my most hated placeholder sprite. I bet you didn’t know that there was one placeholder sprite I hated more than any other. Can you guess what it is?
It’s the door. Stupid thin empty doorframe with nothing interesting going on.
So I replaced it with this.
This is heavily inspired by the entrance to Dark Space from the Illusion of Gaia, much like the appearance of Nexus. However, I felt that this might be a little too inspired by Illusion of Gaia, so I reworked it.
Honestly I could watch this thing loop all day.
It’s not perfect yet; I could touch up the animation a little, and there’s a bug where sometimes when you walk away from the door, it skips the closing animation and jumps straight to the closed state. There’s another problem as well. While the animation is fast enough that walking up to the door isn’t a problem, you can dash into the door before the animation has finished. That’s not a big problem though, I’ll probably slap a white fade screen transition on the door anyway which will largely resolve the dashing issue. It’s a purely visual thing.
I also decided to implement a new bullet behavior because I hadn’t in a while despite thinking of this one ages ago.
Bullet acceleration!
Though, I also have a bullet deceleration behavior. Sadly they don’t cause the bullet to start slow, speed up, and then end slow again, they simply cancel each other out. I could probably fix that by giving bullets a maximum speed at which point the acceleration stops applying. It’d probably be a good idea anyway because objects moving very fast don’t play nice with collisions.
Until next Devlog!
-DeusVerve
DevLogs like these are brought to you by Patron(s) like Haelerin!