Loop Array Action

Get help using Construct 2

Post » Wed Sep 25, 2013 2:25 pm

Hello,

How can I do a loop in a array when I click on a button ? I can't find a action to make a loop in array.

thanks,

   Jos Roberto.
B
4
Posts: 26
Reputation: 277

Post » Wed Sep 25, 2013 2:37 pm

When you create a new Event, select your array, and For Each element should be in the available condition.

Here is a tutorial about how to use arrays. I just typed "array" in the search field on the Tutorial page. Not so hard to find. It's also in the manualOlivierC2013-09-25 14:40:18
B
12
S
5
G
2
Posts: 132
Reputation: 2,637

Post » Wed Sep 25, 2013 3:50 pm

Thanks for the replay Olivier!

I want the game to execute the loop in the array only when I click in a button that I have in my interface. Is there anyway ?

Thanks,

Jos Roberto.
B
4
Posts: 26
Reputation: 277

Post » Wed Sep 25, 2013 4:44 pm

Yes, create a condition that test if the button is pressed (using the "on click" condition if you are using the actual Button plugin, or testing if the mouse clicked you sprite if you used a sprite as a button)
Then, supposing you already created your loop condition, drag and drop it inside the click condition. This is very basic stuff, you should check out the tutorials
B
12
S
5
G
2
Posts: 132
Reputation: 2,637

Post » Wed Sep 25, 2013 5:29 pm

Thanks a lot!
Your last help solved the issue.

Jos Roberto.
B
4
Posts: 26
Reputation: 277


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 8 guests