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
25
S
5
G
3
Posts: 446
Reputation: 5,633

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
200
S
51
G
30
Posts: 896
Reputation: 36,494

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
25
S
5
G
3
Posts: 446
Reputation: 5,633


Return to How do I....?

Who is online

Users browsing this forum: mercuryus, Yahoo [Bot] and 15 guests