ID:175491
 
Iv'e been stuck on this forawhile..

How can you make a mob move in one direction and have it keep going in that direction until you chage directions?
Texter wrote:
Iv'e been stuck on this forawhile..

How can you make a mob move in one direction and have it keep going in that direction until you chage directions?

It's just a matter of using the walk() proc. Check it out in the reference. :)

mob/Move()
..()
walk(src,0)
walk(src,src.dir,2)
In response to Malver
Malver wrote:
Texter wrote:
Iv'e been stuck on this forawhile..

How can you make a mob move in one direction and have it keep going in that direction until you chage directions?

It's just a matter of using the walk() proc. Check it out in the reference. :)

Often when you need continuous movement, you want to create an event loop, where each tick you figure out what to do next.

There's a tutorial and a library showing how you can do this at:

http://developer.byond.com/hub/Deadron/SimpleLoop
In response to Malver
Malver wrote:
> mob/Move()
> ..()
> walk(src,0)
> walk(src,src.dir,2)
>
Wouldn't that create an infinite loop? =)
http://developer.byond.com/hub/Nadrew/ConstantMovement


Little known demo of mine, I just updated it too, hope it helps!