Enemies walking back and forth

Started by idiotbox, Fri 28/10/2005 23:46:56

Previous topic - Next topic

idiotbox

I'm simply trying to make an enemy walk back and forth on the screen, but if I put character.Walk in rep_ex, the enemy won't move, which I guess makes sense. I know what the coding is, but I don't know where to put it so it is repeated. Any help?

monkey0506

Try using something to the effect of:

Code: ags
// rep_ex
if (!cNpcnamehere.Moving) cNpcnamehere.Walk(x, y);


That way it doesn't tell the character to move if they are already walking...

idiotbox


monkey0506

Of course you want them to walk between two points, so you would have to check which one they were at and send them to the other, but you said you already had that part worked out.

Glad I could help. ;)

SMF spam blocked by CleanTalk