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!
B
2
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;

>Everythick:
>>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.
ImageImageImageImageImageImage
B
93
S
20
G
12
Posts: 1,211
Reputation: 18,480


Return to How do I....?

Who is online

Users browsing this forum: Yahoo [Bot] and 16 guests