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
213
S
56
G
30
Posts: 897
Reputation: 37,556

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: 20170217, Baidu [Spider], Bobbyneal100, Robinours17, Taluigi, Underdog and 7 guests

cron