ID:150665
![]() Aug 14 2001, 9:09 am
|
|
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? 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! |
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. |
What's the code you have for this, and what problems are you having with that code?