ID:150665
 
okay, i'm doing my project in an overhead view, and i need to get my guy to be able to jump over a obstacle no more than 1 square in length. I also want to know how to get the user's direction, please help!
unimatrix wrote:
okay, i'm doing my project in an overhead view, and i need to get my guy to be able to jump over a obstacle no more than 1 square in length. I also want to know how to get the user's direction, please help!

What's the code you have for this, and what problems are you having with that code?
In response to Air Mapster
What's the code you have for this, and what problems are you having with that code?

i have an IDEA of how to do it but basically all i need help with is getting the users direction. Cause once i have that i can just do plus or minus to the usr.x or usr.y!
In response to unimatrix
unimatrix wrote:
i have an IDEA of how to do it but basically all i need help with is getting the users direction. Cause once i have that i can just do plus or minus to the usr.x or usr.y!

Ah, ok. Well, the direction is easy: all mobs have a dir variable. To get the turf next to someone in the direction he's facing, you could switch(dir) and go through the 8 possible cases:

var/turf/jumpturf
switch(src.dir)
if (NORTH)
jumpturf = locate(src.x, src.y+1, src.z)
if (NORTHEAST)
jumpturf = locate(src.x+1, src.y+1, src.z)


And so on and so forth.
In response to Air Mapster
I hate to point out the obvious, but.. uhh..

var/turf/jumpturf=get_step(src,src.dir)

Is much neater :-)

-AbyssDragon