Home Creators Posts Import Register Favorites Logout

Content

I lied I found another thing to do to procrastinate making my upgrades spreadsheet.

Okay, before we get into that, I’m going to backpedal a bit to something I talked about last week: the camera.

As I mentioned and demonstrated, it was having a strange problem with how it would only have a significant motion when you crossed an invisible threshold dividing the screen into four quadrants. I ended up scraping the code I had and went looking for how other people had done similar code, which allowed me to find a new math formula to calculate where it should be, and this new formula worked much better—as you can tell from playing the latest build.

I do however have to figure out what I’m going to do for controller input because this system is based on the location of the mouse. I have some ideas for it—GameMaker Studio has a specific check for if a controller is plugged in which I can use to change the code to something else entirely, but at the moment the camera will not work properly with controller.

I also realized there was a significant oversight in my code, which I mentioned in the Known Issues of that latest build. Namely, that while I have code to remove upgrades from the upgrade list, I don’t have a way to put them back in when the player dies. As a result, with every run, the pool of potential upgrades get smaller and smaller until there’s nothing left but those upgrades that never run out. This, luckily, turned out to be an easy fix.

The upgrade list is created in what’s called a Global Script. A Global Script runs at the start of the game, making it extremely useful for setting up a lot of variables. The Bullet System also uses Global Scripts, actually, so define a bunch of bullet behaviors that I can call remotely.

What I realized is that I can reset all of the upgrades in the upgrade list by running that script again. However, a Global Script cannot be called to run in code like other scripts can, so I turned it into a normal function script, so that when I run the code to reset the player’s bullet behavior on death I can also empty out the upgrade list and completely reset it. The only issue is that I have to have something manually tell the game to run this code before running the dungeons so that there’s actually a list of upgrades for the upgrade system to reference or the game will explode. Not exactly a problem just something I have to keep in mind. Since I can put code into an individual level that runs whenever the player moves to that level, I can easily find a place to run this code.

Now then, that thing I mentioned back at the start. It’s been about six months since I started recording my progress with this game, and there was a feature I had in my earliest builds before I started this DevLog series that I wanted to have but needed some more work that I never got around to. Namely, I wanted drones that can follow the player around and shoot at what the player shoots at. So I did it.

The actual code for the drones was already in place, like I just said, though I had to update a lot of it based on how development had changed various aspects of the code it referenced.

I also added in a way to have multiple drones following the player around, spaced apart so that they don’t all overlap, as you can see them in a line in the GIF.

However, the line only extends to the left. While the Follow Player movement code works, this static line of the drones makes them somewhat uninteresting and also limits their functionality because they’re always on the left so they’ll have an easier time aiming to your left. I’ll have to find a different way to have them follow the player, maybe something like MegaMan’s Leaf weapon thing that orbits him?

I also intend to add more varieties of drones in the future, that is to say, drones that each have their own attack patterns. Like a drone that fires every few seconds but has a powerful attack compared to a weak rapid-fire drone. I can also have the drones automatically shoot enemies instead of shooting where the player is aiming.

But all of that comes later. This time, this time, I am out of things to procrastinate with other than bug fixes, so I must descend into the spreadsheet once more.

Until next Devlog!

-DeusVerve

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

Files

Comments

No comments found for this post.