How do I Nest loops

0 favourites
  • 3 posts
From the Asset Store
SynthWave Loop Pack includes 68 seamless loops, founded on 11 original melodies.
  • I am experimenting with laying out a playfield programmatically instead of by hand. I wish to create a nested for loop that allows me to place blocks in a row with an attached scale and transform as they come into the playfield. Here is pseudocode

    for x = 0 to 20

    Create Instance Of Object and place

    scale and rotate instance to larger than view port

    for x = 1 to number of steps.

    Scale = Scale - (scale/number of steps)

    rotate instance 360 as it is coming in

    next

    play sound "Crash"

    next

    For the life of me I cant figure out how to nest loops.

  • Use sub-events to nest loops (you can create a sub-event by right-mouse clicking on an event and clicking Add > Subevent). Name each loop and then use the expression "loopindex([loopname])" to get the loop index for a given loop.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Thank you sir, this is exactly what I wanted. Is it fair to say that a sub-event can be placed almost anywhere?

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)