How do I use a for loop

Just started using Construct 2? Post your questions here

Post » Sat May 02, 2015 7:08 pm

Where can I find nice examples of for loops? :)
Thanks.
B
27
S
6
G
7
Posts: 678
Reputation: 5,651

Post » Sat May 02, 2015 8:26 pm

variable = "apple;orange;banana;strawberry"

on start of layout
for 1 to tokencount(variable, ";"):
set text's text to text.text & newline & tokenat(variable, loopindex-1, ";")
Visual Novel 'Engine' in 100 Events
if you ever have to choose between buying Construct 2 on scirra.com or on Steam, read this: Review
B
22
S
9
G
1
Posts: 787
Reputation: 3,786

Post » Thu May 07, 2015 10:44 am

To create an array of grid:
download/file.php?id=6822

or counting numbers:
viewtopic.php?f=178&t=122281&p=871630#p871630
ImageImage
B
105
S
46
G
23
Posts: 778
Reputation: 22,226


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 2 guests