HELP!!

Just started using Construct 2? Post your questions here

Post » Tue Apr 22, 2014 9:31 pm

Hello I've just made my first game using a score system. I have it like this: When you die/fail the game you get back to the "start" layout what I want to is to make it endless but if you reach 50 points before failing you get another layout to pop-up when you fail instead of the "start" one.
The reason is that I want the game to be finished at 50, but it's much funnier if you can keep going and add a leaderboard.
Appreciate help! / Orvis :)
B
2
Posts: 5
Reputation: 212

Post » Wed Apr 23, 2014 8:46 am

Well, using the same logic and almost the same action from your other thread:
How do I change layout at certain score?

You can do it like this:
System > Compare Variable Value (Score = 50) -- System Go to Layout (name of layout)
System > Compare Variable Value (either create a variable that checks the death of player or have a health variable for example to check that) -- System Go to Layout (the starting layout).

The above will send you to the start if you die or if you get 50 score, you get the next layout on the list

If however you want that the score will keep on loading the next layout automatically without you having to enter the Layout name after the score is 50. I think something along the below would work:

For the sake of the example, I'll assume that you have your levels named as "Level1", "Level2", "Level3", etc... and that you will load "Level5" if the score reaches 50

Create a global variable called LevelNumber (for example) and set the default value to 5.
System > Compare Variable Value (Score = 50) -- System > Go to Layout ("Level" & LevelNumber)
-- System > Add to Variable (LevelNumber) 1

System > Compare Variable Value (Score = 50)
AND
System > Compare Variable Value (LevelNumber > 5) -- System Go to Layout ("Level" & LevelNumber)
-- System > Add to Variable (LevelNumber) 1

Hope the above makes sense.
B
19
S
7
Posts: 161
Reputation: 1,751

Post » Wed Apr 23, 2014 10:50 am

Yea I got it ;) What I did was that I created a global variable "LevelNumber".
-"Game" Layout
System->Set "LevelNumber" 0
System->Set "Score" 0
I kept the "when fail go to "start"
System->Score=50->Add 1 to LevelNumber
-"Start" Layout
System->On start of layout->Add 1 to "LevelNumber"
System->LevelNumber=2 ->Go to "Last Layout"
B
2
Posts: 5
Reputation: 212

Post » Wed Apr 23, 2014 12:52 pm

I hope that works, if so, I am glad it did :D
B
19
S
7
Posts: 161
Reputation: 1,751


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 0 guests