client
North()
if(mob.dir == EAST)
if(!mob.inair)
mob.inair = 1
spawn() mob.Jump()
spawn() mob.Gravity()
/* if(!mob.inair) // If ur not in the air
mob.inair = 1 // Now ur in the air
step(mob, NORTH, 3) // pass it the mob
step(mob, NORTH, 3) // pass it the mob
step(mob, NORTH, 3) // pass it the mob
step(mob, NORTH, 3) // pass it the mob
spawn() mob.Gravity()
while(mob.inair)
return*/
South()
return
mob/proc
Gravity()
var/velocity = 8
while(inair && velocity > 0)
if(step_y == 0) // we're at the bottom
if (velocity == 0)
//var/turf/dcheck = locate(x, y-1, z) // ^ one tile south
//if(dcheck.density)
inair = 0
return
step(src,SOUTH, 10)
sleep(1)
Jump()
var/velocity = 8
while(inair && velocity > 0)
step(src,NORTH, 20)
sleep(1)
velocity -= 1
Problem description:
What I want to know here is why the 'mob.Jump()' proc or the one involving Gravity () is necessary. I was given the latter in my last post on this forums, yet I neglected to ask -why- that was needed. Anyone can give me a detailed answer?
Second 'Problem'
The next thing I want to know isn't related to the code yet. But it involves the pressing of keys (as in on the keyboard) and so forth.
Can anyone guide me towards where I should look to figure out how to make keys responsive to how hard or fast you press it.
For example, double-tapping to activate run. Or like in Mario games where you can do a 'light' jump by gently pressing the button.
Misc
Also any comments or tips to make the current code less crappy will be welcomed. Right now, I'm probably going to just erase all the 'steps' proc and have them replaced with like 'move' or something.