Backwards loops

Get help using Construct 2

Post » Thu Jan 31, 2013 8:23 pm

Is it possible to loop backwards in a For Loop? i.e Step -1 from other languages? I can't see anything in the manual.
B
26
S
6
G
4
Posts: 456
Reputation: 5,853

Post » Thu Jan 31, 2013 8:27 pm

I usually subtract the loopindex from the max value.

for 1 to max
a=max-loopindex

would that work?

B
241
S
63
G
33
Posts: 903
Reputation: 40,729

Post » Thu Jan 31, 2013 9:43 pm

Yeah, that'd do the trick, better than my plan to have a local variable just count down. C2 could use a 'step' counter though in my opinion.

Thanks :)
B
26
S
6
G
4
Posts: 456
Reputation: 5,853


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 7 guests