var
jumping=0
landed=1
verb
Jump()
set hidden=1
usr.icon_state="jump"
var/PreviousDirection=dir
jumping=1
landed=0
step(src,NORTH)
dir=PreviousDirection
sleep(2)
step(src,NORTH)
dir=PreviousDirection
sleep(2)
src.jumping=0
if(src.jumping==0)
var/turf/T=locate(src.x,src.y-1,src.z)
if(T.density==0)
Decend
src.landed=0
step(src,SOUTH)
dir=PreviousDirection
sleep(2)
if(src.landed==0)
goto(Decend)
if(T.density==1)
src.landed=1
src.icon_state="normal"
proc
Gravity()
Start
sleep(1)
var/turf/T=locate(src.x,src.y-1,src.z)
if(T.density==0)
src.landed=0
if(T.density==1)
src.landed=1
if(src.landed==1)
src.icon_state="normal"
goto(Start)
if(src.landed==0)
var/PreviousDirection=dir
src.icon_state="jump"
step(src,SOUTH)
dir=PreviousDirection
sleep(2)
if(src.jumping)
goto(Start)
Problem description:
K the problem is that there are alot of bugs in this code and I would like to know what they are. From what I can see, there shouldn't be anything in here causing a problem. But you guys are the experts and I'm sure that you can find something wrong with my gravity and jump. The main thing that happens is really actually unpredictable. Normally my guy will jump once but will not go to normal when he hits the ground. Then he will not be able to jump as high. But SOMETIMES he will jump onto a higher platform and go back to normal state. Its quite weird and would be a nice thing to fix.
Thanks in advance!
-Moocow