Horizontal zigzag

Get help using Construct 2

Post » Fri Sep 14, 2012 7:53 pm

Hello everybody ,

I'm developing a game that enemies must traverse a predefined path (horizontal zigzag crossing the screen), but I can not configure this movement.
Besides the movement, the enemy will appear in random locations.
Could someone please help me?

Thank you!
Posts: 1
Reputation: 327

Post » Fri Sep 14, 2012 9:16 pm

Use Sine behavior and Triangle option, or, a easiest way, use destination points with IDs.

When the enemy overlap the destination point with ID 0, and his ID is 0 too, make him follow the next destination point with ID 1, then, change the enemy ID for 1 and ahead.

To make your enemy go to the destination point is simple, and have many ways:

Setup your enemy to have the instance variable ID, the first valor is 0;
The same for the points, each point with a different and crescent ID number;

>>Enemy.posX < Destination_point.posX;
>>Enemy.ID = Destination_point.ID;
< Enemy.posX = Enemy.posX +1;

>>Enemy.posY < Destination_point.posY;
>>Enemy.ID = Destination_point.ID;
< Enemy.posY = Enemy.posY +1;

>>Enemy is overlapping Destination_point;
< Enemy.ID add +1;

Got it?

If you still needing help I'll do a sample for you.
Posts: 1,361
Reputation: 22,770

Return to How do I....?

Who is online

Users browsing this forum: jorgmaquoi and 16 guests