ID:177720
 
Ive tried to make a movement system like this but I cant. A system where you turn and go foreward and backward. I just cant figure out how to do it, im feelin a little stupid today. Can anyone point me in the right direction for this? Or give me just a little hint, I would rather make the code by myself then have it handed to me.
Shadowdarke wrote a free byondscape article on this.
Jotdaniel wrote:
Ive tried to make a movement system like this but I cant. A system where you turn and go foreward and backward. I just cant figure out how to do it, im feelin a little stupid today. Can anyone point me in the right direction for this? Or give me just a little hint, I would rather make the code by myself then have it handed to me.

I read the start of your post, and I was readying my CTRL+V fingers to paste my code, but I will hold back. :)

Try using the turn() proc. It can turn your direction/icon for you.

And for the directional keys, just override the existing client procs

client
North()
// Whatever..


If you need a few more hints, just reply, and I'll be a bit more detailed.
In response to Malver
Yes ive gotten that far, I found the turn() proc and i was using

client
North()

But everything i came up with didnt work, maybe just a little bit more help. Thanks.
In response to Jotdaniel
Jotdaniel wrote:
Yes ive gotten that far, I found the turn() proc and i was using

client
North()

But everything i came up with didnt work, maybe just a little bit more help. Thanks.

I was referring to the turn() proc for usage in turning, not forward/backward movement

client/East()
src.mob.dir = turn(src.mob.dir, -45)

That help?
In response to Malver
Thanks that probably would have worked. I just found Shadowdarke's article on it. Thanks anyway.