Okay, so I had already asked a question about this same subject days ago, and I got a very helpful answer that helped me to solve the first part - making a working self-charging stamina bar!
This is working exactly as intended. (credit to @Agent_Y for the help!)
Also, my basic movements are currently working exactly as intended.
Sorry, I know it’s a little clunky and could be simplified, but I’m afraid to mess with it for fear of breaking anything.
Now here is the part I’m still having trouble with. I created this:
Which is supposed to activate the speed boost only when the shift key is held down and there is enough available stamina. The speed boost is supposed to work in every direction, when both shift + a directional key are pressed simultaneously…
Um. Something like this.
Looks like it should be “simple enough” right?
Problem is, when I try to connect one thing, it breaks another thing. My sprite ends up either moving indefinitely, or moving backward, or ignoring the speed boost, or not moving at all.
I really wanted to figure this out on my own, but I don’t want to spend the next week banging my head against the wall trying a million different combinations. So I’m breaking down and humbling myself and asking for help.
Basically what I want the sprite to do is…
When I am holding down left, I want it to move left at the default speed.
When I am holding down left + shift (speed boost), I want it to move left at fast speed, but only until the stamina bar is empty. Once the stamina runs out, it should return to default speed.
If I am not holding down left, I want the sprite to come to a complete stop.
Same with every other direction - up, down, and right.
I want the sprite to not move when no direction keys are pressed.
I want it to move at default speed when directional key is pressed without shift boost.
I want it to move faster in every direction when both a directional key + shift key are pressed at the same time until the stamina bar is depleted.
I hope that makes sense.
My question is, what do I need to add in between functions to make this work properly without breaking my currently functional movements? Switches, logic gates, filters, something else?
EDIT: oh and yeah, sorry for blurring out the background. I don’t want to give away the rest of the game until it’s finished.
And I also realize the up/down numbers are backward… for some reason, on my PC at least, the negative Y function is moving me up and the positive Y moves me down… must be set to inverse as default.