I'm currently in the midst of remaking the NES Super Mario Brothers, and although I have found answers to nearly everything I needed, this one I seem to be stuck on.
When I make Mario sprint, I want his speed to increase gradually, and when a key is lifted I'd like the speed to decrease gradually. Decreasing is my problem because I couldn't make a make-shift trigger for when a key is lifted.
I'm doing as a passion project, and I want it to be as a accurate as possible, thank you for any help you'd be able to provide
Side note: I'd need the "when key lifted" type block directly under the "When key pressed"
I may have not accounted for certain things. I need them to trigger for a short period of time only to slow down the player, and I also need them not to interfere with the other inputs, like jumping. Any other ideas?
Update for everyone here! I did eventually find a solution! (also I didn't have any increasing, at the time I thought it was necessary, but honestly it looked bad otherwise.) It won't let me include an image for whatever reason, but for controlling Mario I used 3 main variables; Xv is Velocity on the X axis, walk speed it how fast it increases speed, and max walk speed is the fastest it'll go.
At the top of your script set your walk speed and maximum walk speed. Make it so if a certain button is pressed, in my case right arrow/D, it'll run an if statement seeing if Xv is less than the max walk speed, and if it is have it "Change Xv by Walk speed" (if you wanna have a moving sprite animation, put the animation chain under another if statement that is inside directly under the other one checking if Xv is not equal to 0. For left just copy the same thing, but make the less than a greater than comparison.