Loop Questions

Get help using Construct 2

Post » Tue May 01, 2012 2:56 pm

I don't think I really understand how the "repeat" loop works. The idea is simple enough, but when it comes to practice, it doesn't work like I think it should. For example, if I put a "repeat" as a sub event, it doesn't seem to end. A sample capx is at: http://dl.dropbox.com/u/12722403/arrayProblem.capx

Thanks for the help
B
12
S
3
G
4
Posts: 55
Reputation: 3,186

Post » Tue May 01, 2012 5:55 pm

I cannot look at your capx at the moment, but just remember that a loop executes all of its contents within one tick!
B
90
S
30
G
24
Posts: 3,189
Reputation: 32,400

Post » Wed May 02, 2012 9:47 am

Events are run once a tick (about 60 times a second normally). So as long as your variable equals 1, its actions and subevents run about 60 times a second. If you only want to run once the first time the event becomes true, add the "Trigger once" condition after it. More information in this tutorial.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,600

Post » Wed May 02, 2012 10:37 am

@Ashley - thanks for the tip! That was the solution :) This is a great program - keep up the great work, and God bless
B
12
S
3
G
4
Posts: 55
Reputation: 3,186


Return to How do I....?

Who is online

Users browsing this forum: jeffige and 16 guests