ID:261342
 
I am trying to make the player move continuously forward, and when you hit west it rotates the player 90 degrees west and so on for east, then when you hit south it stops the player. But I can't seem to get it to work. Can anyone help?
Himura Kenshin wrote:
I am trying to make the player move continuously forward, and when you hit west it rotates the player 90 degrees west and so on for east, then when you hit south it stops the player. But I can't seem to get it to work. Can anyone help?

get_dir() returns the direction between two objects--if you just want to base something off of a single object's current direction, you'd just go with the .dir variable. step(usr,usr.dir) would move usr in the direction they're currently facing, for instance, and turn(usr.dir,90) would be equal to the direction 90 degrees west of usr's current facing.
In response to Leftley
And note that get_dir() outputs a number and not a text string.