Problem with sounds!

Get help using Construct 2

Post » Sat Oct 07, 2017 9:31 am

Thanks again, you are a true hero :)

I do have a problem though (surprise, surprise!). At the end of the layout, 1 is added to LevelProgress and the next level is unlocked.

LevelProgress = 1 = Unlock Level2

LevelProgress = 2 = Unlock Level3

The problem is if you play the first level twice, you'll also get LevelProgress = 2 and then the third level is unlocked.
B
21
S
6
G
3
Posts: 93
Reputation: 2,977

Post » Sat Oct 07, 2017 10:31 am

Then don't do "Add 1 to LevelProgress" at the end of each level.
Instead do something like this:

Code: Select all
If LevelName="Level1"  -> set LevelProgress to Max(1, LevelProgress)
If LevelName="Level2"  -> set LevelProgress to Max(2, LevelProgress)
If LevelName="Level3"  -> set LevelProgress to Max(3, LevelProgress)


So if user reached level 3 and then decided to replay level 1, LevelProgress will remain 3 (because of the Max function).
Image

Did I help to fix a problem in your game? You can buy me a cup of coffee :) If you'd like to hire me, please see this post
B
17
S
9
G
127
Posts: 1,765
Reputation: 67,851

Post » Sat Oct 07, 2017 10:52 am

I just solved it with the solution below (and it works) but maybe yours is better?

System / LevelProgress = 1
................System / LayoutName = "Level1" / System / Set LevelProgress to 0
B
21
S
6
G
3
Posts: 93
Reputation: 2,977

Post » Sat Oct 07, 2017 10:54 am

I don't know how to set to Max :p
B
21
S
6
G
3
Posts: 93
Reputation: 2,977

Post » Sat Oct 07, 2017 11:08 am

Just type it in the "Value" line :)

While you are there, look for a semi-transparent window called "Objects with expressions", click it and select System - you'll find lots of interesting expressions and properties, including that Max function.
Image

Did I help to fix a problem in your game? You can buy me a cup of coffee :) If you'd like to hire me, please see this post
B
17
S
9
G
127
Posts: 1,765
Reputation: 67,851

Post » Sat Oct 07, 2017 11:38 am

This doesn't work (what I have done, not what you say I should do) so could you tell me what I have done wrong?

Image
B
21
S
6
G
3
Posts: 93
Reputation: 2,977

Post » Sat Oct 07, 2017 11:42 am

It works now when I also added min(1, LevelProgress) :)
B
21
S
6
G
3
Posts: 93
Reputation: 2,977

Post » Sat Oct 07, 2017 11:52 am

Nope, I thought it worked but it didn't :(
B
21
S
6
G
3
Posts: 93
Reputation: 2,977

Post » Sat Oct 07, 2017 11:57 am

It works now when I got rid of "Add I to LevelProgress" :)
B
21
S
6
G
3
Posts: 93
Reputation: 2,977

Previous

Return to How do I....?

Who is online

Users browsing this forum: khill92 and 7 guests