mob
KEYDOWN(k) //Receives 'GamepadLeftAnalog XxY'
if(findtext(k,"GamepadLeftAnalog"))
var/a = findtext(k,"Analog")+6
var/b = findtext(k,"x")
var/X = text2num(copytext(k,a,b))
var/Y = text2num(copytext(k,b+1))
//world.log << "[a] :: [b] :: [X],[Y]"
if(X>0)step(src,EAST,round(X*step_size))
if(X<0)step(src,WEST,round(abs(X)*step_size))
if(Y>0)step(src,NORTH,round(Y*step_size))
if(Y<0)step(src,SOUTH,round(abs(Y)*step_size))
Problem description:
This movement is designed for the left gamepad analog stick. It works, but when values near 0, it gets really unexpected results like random super speed. Any suggestions?