ID:176005
 
Here is my code for jumping. There are no errors or anything but it's not working the way I want it to

usr.Lock(usr)
flick("Jumping",usr)
if(usr.dir == NORTH)
step(usr,NORTH)
else
if(usr.dir == SOUTH)
step(usr,SOUTH)
else
if(usr.dir == EAST)
step(usr,EAST)
else
if(usr.dir == WEST)
step(usr,WEST)
else
return
usr<< "You Jumped!"
usr.Unlock(usr)

What happens is that first he moves the diraction he is facing THEN he does the jumping. What I want him to do is to Jump and while jumping go that direction.

Thank you for your help!
SSChicken wrote:
Here is my code for jumping. There are no errors or anything but it's not working the way I want it to

usr.Lock(usr)
flick("Jumping",usr)
if(usr.dir == NORTH)
step(usr,NORTH)
else
...

This if/else setup is a very very very bad way to move in each direction. Why not just do this instead?
step(usr,usr.dir)

That is of course assuming usr is right to use here. If this is a proc, not a verb, you should be using src.

Lummox JR
In response to Lummox JR
Well, I'm not sure how to catogarize (however you spell that) it. It is a proc, but I'm useing it so it shows up as a verb in the Command panel.