Jump()
var/D=20//How high you will appear to jump
var/D2=1//How long you will appear to jump
var/D3=1//How high you will become in the air
var/D4=6//How long you will be airborne
//var/D3=10//H
if(src.Jumping==0)
src.Jumping=1
src.icon_state="Jump"
if(src.CS>=2)
D=20
D2=4
D3=3
D4=20
src.Height=D3
spawn(D4)
src.Height=0
src.pixel_y+=D
sleep(D2)
src.pixel_y+=D
sleep(D2)
src.underlays+=new/obj/Shadow
src.pixel_y+=D
spawn(D2)
src.pixel_y+=D
sleep(D2)
src.pixel_y+=D
sleep(D2)
src.pixel_y-=D
sleep(D2)
src.pixel_y-=D
sleep(D2)
src.pixel_y-=D
sleep(D2)
src.pixel_y-=D
sleep(D2)
src.pixel_y-=D
src.underlays-=/obj/Shadow
src.pixel_y=0
src.Jumping=0
src.icon_state=""
else
usr<<"You are already jumping"
return
The problem is that the shadow moves down as the player is landing. Is there a way that I can make it so the shadow stays locked under the player so the player has a nice idea where he's going to land?
below:
You might be able to reduce the number of checks with the same result you will just have to test it and see what happens ;)