Fun fact, this entry means November has had more gamedev work so far in the month than all other months which is a nice thing to see.
Anyway, session today starts simple. While Nashira works on the backgrounds and such proper, I will use the reference photos as placeholders to work on the rest of the code.
This means no clickables on the Look screens (not that they’re needed for the code to work, mind you), but it also means something I’ve kinda forgotten until now: The Top Screen’s backgrounds.
I’ve not done aaaaaaaaanything related to the top screen so far since that was gonna come up with the novel parts we haven’t even started.
One step at a time, though.
First we import the Look images.

Then we make packed scenes with each.

It’s reassuring to see that all I need to do is un-tick the “centered” box and it positions itself in the right place by default.
Since we’re already at it, let’s make the list to test if it all integrates as intended.

Disregard the one new variable in that list, it’s self-evident what it’s there for.
Now we te-WE DON’T. The game has cur_loc blank meaning it would’ve caused Problems.

Okay, NOW we test.

Oh, it’s a typo.

That should have an extra f.

Now it does, let’s try again.

Hopefully I don’t need to explain how satisfying it is to see the code work as intended. Especially after so many stumbles earlier.
So now we need to add the background on the top screen.
First we import all the relevant files.

Then…
…actually, you know what we should do? We should do the thing we did where the game reads from the Look Scenes folder, but like, for loading the background images.
The main thing here is that the backgrounds aren’t really complex in nature, they’re just static images, so making a bunch of objects for each background feels excessive, and besides, loops are flexible enough that if for some reason backgrounds DO become more complex later it can all be adjusted.

So first we change the file names.

Then we add a new variable and initialize things.

Then we repeat the AssignLocation function but with the backgrounds.

The function takes place where it needs to… let’s run the game real quick just to make sure nothing crashes so far.
It didn’t. So now we need to Do Something with the backgrounds we loaded

If we look at the resource tree, it should be happening before second_screen (since that’s the… second screen) as a direct child of startupnode.

So we make a Sprite 2D child called background. It is empty and not centered (just like me frfr).

This is very cool. Not too long ago I spent a whole month agonizing over how the FUCK parent-children structures worked and that knowledge immediately because handy here. The code will find the “background” child and change its texture to the one relevant for the current location.
So we test…

AI will never give you the satisfaction of all the struggles from before paying off as lessons. It will in fact rob you of the sheer joy like the one I just felt overcoming this.
Now, there’s one more thing I want to try, and that is changing the location. Basically a rough micro version of what the buttons will do later.

First I add this code. It’s a rough copy of the one in the Godot documentation. I’m sure there’s more elegant choices if I want to add keyboard inputs, but that’s not the focus right now.
Interesting thing to note about this experiment: The print only shows in console when the upper screen is in focus. Again, I’m sure there’s more elegant solutions but still an interesting detail to point out.

We modify things so it changes the location variable AND the texture.
Then we test.

LET’S GOOOOOOOOOOOOOOOOOOOOOOOOOO
You might’ve noticed that the Look window didn’t change until I reopened it. This is expected behavior. I COULD make more code to make sure it changes the moment location changes, but it’s not a scenario that’s needed nor one that should be accounted for since the player will change locations from a different menu meaning it’s gonna be closed by default.
Now the next step is to grab that thing we just did and make a button do it.
But let’s stop here today, it’s a good stopping point.
