0 Favourites

Horizontal zigzag

  • 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!<img src="smileys/smiley17.gif" border="0" align="middle" />

  • Construct 3

    Buy Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Buy Now Construct 3 users don't see these ads
  • 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.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)