Devlog 2026-11-09

Not entirely sure how far work will go today, but let’s start regardless.

First thing in my mind is any extra prep that I might need to do alongside the task of making buttons. I’m doing my best to not get overwhelmed/trapped by the idea of getting too ahead of myself, but at the same time it would irresponsible to NOT do some prep or cleanup where needed.

In this current case specifically, my thoughts go to how it’d be prudent to have a proper start from a hypothetical main menu into the game itself so that the state machine code is cleaner moving forwards and I have to do less uncluttering.

For those that don’t know, a “state machine” is a general term used for the part of the code where the interactions are stored. It’s not specifically a machine and it’s not even necessarily a singular chunk of code, though.

If we take the OG Super Mario, it’s the hypothetical bit of code that says “if Mario’s hitbox collides with enemy hitbox do this” which then has conditionals like “is big Mario” “is small Mario” or “starman powerup is active”.

Anyway, we make a new scene that will be our hypothetical title screen but for now will be half setup half debug.

Then we add a button to be filled later.

But wait, there should be a second screen, actually. While I haven’t discarded the possibility of a single-screen setup, that is loooooong in the future and not nearly a priority right now.

First let’s make a quick detour to add a small bit of code.

The other variables in Global have also been commented for the sake of clarity.

Now, the next question we’re contending with here is how to change from one scene to another which… is a good question in general, to be fair.

Let’s do a quick test. Before we clean up what goes where let’s see if we can make the stuff we’ve done so far kick in from the title screen.

On a script attached to titlescreen we add this to load all the stuff we’ve been working on so far (I’ve also moved where the files are to save myself minor headaches later).

Then, from the Chapter 1 button we send a signal.

In theory this changes to the preloaded scene, but will it?

It did not, but the error is clearly indicating how it’s looking for a string and I’m feeding it an object.

There is an actual version for packed files, so let’s try that one.

That one’s on me because I changed the file locations, but it lets me go straight to where the errors are so that’s fine.

ONE MORE TRY.

Perfect, that’s exactly what I needed.

Now, until I have the actual single screen mode up and running, the game should have two screens from the get-go. Because picture this: the game starts in windowed mode. Without the context there that the game is meant to be played with two screens, I can see players being frustrated and confused that they can’t switch to full screen for whatever reason.

It doesn’t matter if the second screen closes and reopens for that purpose, really. But for now, I’m leaving myself a simple reminder:

Doesn’t roll off the tongue as nicely as “Everyone’s Detective!” admittedly.

Now we move all the other stuff that was being set up on startup into something here.

A function that takes a single argument, a number. When it matches the number it sets up all the other variables right before it changes scenes.

I also added a separator for the bit of code in Global.

The consequences here are basically “Otherwise you will have to manually check all the cases of the switch statement and you can feel in your bones what kind of pain in the ass that’s gonna be”.

Now, if we were to run the game right now we’d get an error because the dictionary it tries to create would be empty, but that’s fine. Also, I can’t really fill the list until I have all the locations made into scenes.

That’s the next step anyways.

In case you lost track of why we were doing all this to begin with and what the end result was: We’re currently working on making the Move buttons, these will need to change elements of the state machine. And so, we organized some of said state machine AND moved bits around so everything initializes properly instead of haphazardly.

Next time I will make three locations. I’ve already taken the photos and as of this writing I’m sending them to Nashira to start working on them, though if I decide to work on programming again tomorrow, I can start with the photos without any editing. Worth noting that this includes images that will be used on the top screen also.

Once those locations are done I can make the buttons that change the location both in code and visually, that way they’re function-first rather than existence-first.



Posted

in

by

Tags: