How do I get an enemy to return to its original path?

Get help using Construct 2

Post » Sat Jan 03, 2015 4:40 am

I have an enemy running around in a circle. The enemy will break this circle when the player enters its line of sight. Upon the player leaving the line of sight of the enemy, the enemy will resume its circle at the new point. How would I get the enemy to return to its original position and resume its circle again?

The circle is coded as such:
----------------------------------------------------------------------
Every Tick:
enemy: >Move forward 1.5 pixels
>Set angle to enemy.angle+0.96 degrees
----------------------------------------------------------------------
B
3
Posts: 4
Reputation: 183

Post » Sun Jan 04, 2015 9:04 pm

Just store the starting position and angle. Then do;
----------------------------------------------------------------------
Every Tick:
enemy: >Move forward 1.5 pixels towards starting position
>Set angle to starting angle.
----------------------------------------------------------------------

Then do a comparison to see if the player's position and angle is equal to the starting values. At which point you tell the enemy to resume its original behavior.
ImageImageImageImageImage
B
19
S
5
G
1
Posts: 614
Reputation: 2,542


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 32 guests