ID:261663
 
It's a side scroller and I want to know how to make an enemy walk right until it hits something then walk left, and when it hits a player it takes life off them.
That's all that needs said I think

--Ray
i dont know the actual coding, but as i too am making a side scroller and so have thought about it.
Anyhow, you would need to make a looping proc that would first check if there is a turf that is dense infront of it, or one that is not dense to the front and down one, if neither then you would move it forwards one tile. if there is a dense block infront of it you need to set the direction to the other way, and do the same thing for that.
In response to Maz
thanks loads, Maz. Unfortunately I have no idea how to do that :)

--Ray
In response to R.J.T
Well, i would love to help you and try make the code now, but off my head i doubt i could doit at the moment..
At least now you have the idea, you could try pursuade or hope that someone comes along and writes one.
Sorry
Maz
In response to Maz
Thanks for all your help ^__^

--Ray
In response to R.J.T
mob
Walker
dir = EAST
New()
while(src)
step(src,src.dir)
sleep(5)
Bump(atom/A)
if(ismob(A))
var/mob/M = A
M.hp -= sqrt(2)
src.dir = turn(src.dir,180)
In response to Garthor
Woweeeeee! Garthor that is amazing! THANKS!

--Ray