I am experimenting with Construct to teach some kids in my school about game making.I have followed a few of the threads on here to get to where I am now.
I want the game to generate a 10 by 10 grid of 60px square boxes. The boxes are randomly picked from a choice of 3.
I have coded this using nested loops. The top loop however doesnt stop at 10 rows like it is set, it just keeps going. If someone could tell me what I have done wrong I would appreciate it.
Project link: docs.google.com/file/d/0Bzt0PtP2tXTYNVNGZXU4S3R5YkE/edit
I havent looked at your file, but you can just put the different blocks into a family to pick randomly.
Then the event (fake code)
start of layout -
+ for loop "y" 1 to 10
+ for loop "x" 1 to 10
create family sprite
+set position x to 60*loopcountx
+set position y to 60*loopcounty
Thanks for the information, unfortunatley I have the free version not the full one.
Well you could either use the same block but set it's animation frame at random, or keep the same conditions and create a series of sub events like
set local variable to random(3)
sub event condition
+local variable = 0
create sprite type 1
+local variable = 1
create sprite type 2
It would seem your loop is re-running every tick.
Select all of event two, and drag it into "On start of Layout" and you see it works.
Develop games in your browser. Powerful, performant & highly capable.
All sorted with a combination of the above thanks alot.