Timed loop iteration

Get help using Construct 2

Post » Fri Sep 07, 2012 10:40 am

Hello guys,

Is it possible to iterate the for loop with set time interval, e.g. one iteration per second.

Thanks in advance.
B
42
S
11
G
4
Posts: 505
Reputation: 7,267

Post » Fri Sep 07, 2012 5:22 pm

Or something like this:

repeat 10 times
-each 0.5 Seconds
-> create Object

So each 0.5 seconds one out of 10 objects is created.
B
42
S
11
G
4
Posts: 505
Reputation: 7,267

Post » Fri Sep 07, 2012 5:54 pm

> Every 0.5 seconds & object.count < 10
-> Create object

Hopes this would help~
B
13
S
5
G
3
Posts: 63
Reputation: 3,989

Post » Fri Sep 07, 2012 5:55 pm

Use a variable:

Global number repeat_count=10

-repeat_count=10
-every 0.5 Seconds
-> create Object
-> subtract 1 from repeat_count
B
79
S
24
G
54
Posts: 4,746
Reputation: 40,755

Post » Fri Sep 07, 2012 9:26 pm

OK, thank you, guys - "object count" solution is clever.

I considered using a for loop, because I wanted to avoid creating global variables for this kind of tasks. It's a pitty, that you can't use local variables as an iterator, because they are reseted every tick.
B
42
S
11
G
4
Posts: 505
Reputation: 7,267


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 20 guests