How do I create a loop for levels

Get help using Construct 2

Post » Fri Oct 09, 2015 3:58 am

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 : https://onedrive.live.com/redir?resid=E ... file%2crar

Thanks everyone!
B
18
S
2
Posts: 48
Reputation: 896

Post » Fri Oct 09, 2015 4:01 am

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.
B
18
S
2
Posts: 48
Reputation: 896

Post » Fri Oct 09, 2015 1:12 pm

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.

Image
B
18
S
2
Posts: 48
Reputation: 896


Return to How do I....?

Who is online

Users browsing this forum: blackhornet, Hadyurik and 7 guests