Can someone help me make a run process? I want to make players move faster when holding a macro or toggle a running process. Can someone help me out with this or direct me in the right way? [Semi-New to coding]
|
Thank you @Solomn Architect.
What do you mean? @Jittai. //How would I make them move even faster? I'm making a naruto game and I want Rock Lee gates to allow them to move faster than anyone. |
Less repeat lines and makes adding cases/instances where the delay would be changed easier to add. For example the current walking delay would be 10 while the running 5, if you wanted to allow people to go even faster you could add another line that checks for "lee gates" and removes 4 from time - making the speeds 6/1 respectively.
mob/player |
Yup. A much cleaner example. Although realistically, the efficiency of either snippet is negligible.
|
Actually, I do have a complaint about both approaches. You are arbitrarily returning 1 without actually seeing whether the movement was successful.
|
This is obviously a really sloppy example, but it shows you basically how this can be achieved. To make it look well, I'd suggest adjusting the glide_size for each run and walk. Obviously running would require a faster glide from one tile to the other. Just muck around with the speeds to get the animation smooth enough.
Even if you're not well versed in programming, you should be able to read this fairly plainly without much more explanation.