Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: idiotbox on Fri 28/10/2005 23:46:56

Title: Enemies walking back and forth
Post by: idiotbox on Fri 28/10/2005 23:46:56
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?
Title: Re: Enemies walking back and forth
Post by: monkey0506 on Sat 29/10/2005 00:21:49
Try using something to the effect of:

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


That way it doesn't tell the character to move if they are already walking...
Title: Re: Enemies walking back and forth
Post by: idiotbox on Sat 29/10/2005 00:36:35
Wow, thanks. That worked well!
Title: Re: Enemies walking back and forth
Post by: monkey0506 on Sat 29/10/2005 23:25:46
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. ;)