ID:157730
 
I having problems with figuring out how to code speed.
i want to code like if you don't have on roller you go 1 step but if you have roller on you go 2 steps per sec. But how do you code the steeps?
After a successful Move(), take another step in the same direction:

mob/Move(var/turf/newloc, var/Dir)
//only apply to steps between adjacent turfs, and when some variable is true:
if(get_dist(loc, newloc) == 1 && some_variable)
//get the direction of movement
var/d = get_dir(src,newloc)
//perform a normal step
.=..()
//if the step was successful, take another step
if(.)
var/turf/T = get_step(src,d)
Move(T, Dir)
//perform a normal movement otherwise
else
return ..()
In response to Garthor
or you can simply change the pixel_step_size.
In response to Gamekrazzy
No.

You can't.

Gamekrazzy, considering that every damn response you make to threads here is completely an utterly wrong, I'm going to request you stop it. You aren't helping.
In response to Garthor
He amuses me, let him :D
Gamekrazzy, change the pixel step size in your game and quickly press random arrow keys, see what happens.
In response to Ruben7
nothing...
whats your point?
Anyways I do see what Garther is saying. See I was messing with pixel_step_size, and I thought I changed the speed, but no instead I just made an illusion of it.
Edit:I tried it again... It causes the player to continue moving for extra time. But honestly, why would someone do that when playing serious. Also remember that all games have their glitches.