0 Favourites

Make instances do tasks consequently in For Each

  • Hi I have several instances and I want to manipulate all of them using For Each. The point is, although all the tasks are the same, I want to make each instance do them consequently, not simultaneously. I tried to put a System pause action in the end of the loop but it did not work.

    Thank you in advance

  • A program doesn't run multiple codes at once, it simply starts in the same frame, processing one at a time.

    You need another variable to determine how many times the loop has started, and use that to make the other loops wait longer. Something like:

    Add 1 to Loop

    Wait (Loop * 5) seconds

    Then run the rest of the loop code here.

  • Actually, if your main/top event is a "For Each", it will pick each instances one by one and apply the actions to it, one by one.

    Maybe you should post a capx of your current implementation and a full detailed explanation of what you're trying to do.

  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
  • Here is my game's script

    1. Players are asked to put an aircraft carrier (AC). They can press A or D to change the shape of the AC

    2. They select 6 targets for the AC to attack

    3. The airplanes take off, one by one, fly to the target

    I am trying to make things become more realistic, the aircrafts should fly consequently, turn to the target, shoot missiles and turn back to the AC.

    Here is the link to my capx

    This is my first game by Construct 2, so I would love to hear any comments from you.

    Thank you very much.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)
Similar Topics Posts Views Last Post
Unread hot topic
167 14,513
DMT2005's avatar
DMT2005
Unread sticky
1 Favourites
C2 Games made with CocoonIO
136 89,838
minhcuong's avatar
minhcuong
Unread hot topic
99 10,153
karshinkoff's avatar
karshinkoff