0 Favourites

How do I create a loop for levels

  • Hey guys,

    I'm working on a little ball drop game and I'm trying to figure out how to create a loop ( i'm guessing a for loop ) so that when the player clicks next level, it adds 1 to level variable and then creates an extra green box per level

    So, level 1 -> 1 green box

    level 2 -> 2 green boxes

    level 3 -> 3 green boxes

    and so on. I know this can be hard coded in but I would like the game to be endless.

    If anyone has an Idea or something better than a loop, please shout

    Here is the link to the game capx if you wanna have a bash :

    Thanks everyone!

  • Oh, how to play,

    The top boxes with lines are your angle selector. Click it once then click on the screen to place it.

    Once placed, you can drop and drag. to destroy the line, drag it to the top of the screen

    The goal is to get the pink ball to hit all the green boxes and then hit the exit door at the bottom with using the least angled lines as possible.

    The on off switch changes the angled lines to become bouncy or not.

  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
  • I figured it out!

    Create a variable for your level

    Create a for loop from index 0 to variable name (Which is "level" for me")

    Add action for creating your object

    Here is a screen shot for anyone who wants the same thing.

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