How do I Add specific condition to a Level Select

Get help using Construct 2

Post » Tue Jul 25, 2017 2:55 pm

Message: PreacH can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
Hello guys,

I made a level Select like this one :

https://www.scirra.com/tutorials/311/level-select

And everything worked perfect. But I want to know how can I add a condition in witch you can unlock a new level only if you make 3 stars previous level.

Thank You!
B
11
S
1
Posts: 35
Reputation: 533

Post » Tue Jul 25, 2017 3:26 pm

You will need to keep an array with all the stars collected in local storage or on an sql server. On start of main many layout load the array from the local storage. Lets say cell 0 keeps level 1 stars, cell 1 keeps level 2 stars etc. Then you check each cell value and if cell is equal to 3 then unlock the level. Locking unlocking can be done using different object one clickable the other not, so when level is unlock you make the none clickable object to spawn the clickable one to its position and destroy the none clickable one.

Its pretty hard to get it right on a first try, took me 2-3 days to get it right on my game. Here is a screenshot from my game that might help you.

https://s17.postimg.org/8e17jz1i7/Screenshot_1.jpg
https://s18.postimg.org/epgx2ra8p/Screenshot_2.jpg
https://s22.postimg.org/9fwn1bh0h/Screenshot_3.jpg

Edit: here is the link of the game in the arcade, if you are curious how the menu looks like.
https://www.scirra.com/arcade/puzzle-ga ... sion-18913
Like my work? Fallow me on social media, and see my games on the arcade.
B
7
S
5
G
9
Posts: 298
Reputation: 5,367

Post » Wed Jul 26, 2017 7:23 am

Hello @imhotep22 and thank you for the quick response. So basically I have to change all the level select system I did ? I like this system but if there is no way on adding that condition I think I will change it. thank you again
B
11
S
1
Posts: 35
Reputation: 533

Post » Wed Jul 26, 2017 11:47 am

There is no need to change the look of the menu, you just need to tweak the events a bit, the look can stay the same as it is in the tutorial.
Like my work? Fallow me on social media, and see my games on the arcade.
B
7
S
5
G
9
Posts: 298
Reputation: 5,367

Post » Mon Jul 31, 2017 6:42 am

Hello!

I tried your method but somehow it does not work. Maybe it's because of my level Select Method.

This is the method I used:

Image

So, is there any way to make what I said using this method shown above.


Thank You!
B
11
S
1
Posts: 35
Reputation: 533

Post » Mon Jul 31, 2017 8:58 am

Hello all ,

I managed to do wat i wanted, it was quite simple. if anyone needs help just PM me.


Cheers
B
11
S
1
Posts: 35
Reputation: 533

Post » Thu Aug 03, 2017 8:53 am

Hello,

@imhotep22 Do you have any Ideea how can I save the level sprite animation using Local Storage ? I managed to save the currentlevel and it works perfect but it does not save the levelsprite frame.
B
11
S
1
Posts: 35
Reputation: 533

Post » Thu Aug 03, 2017 6:12 pm

You cannot save current sprite animation directly, instead you can save its state in a variable that you keep in local storage.


Lets say you have global variable called animation_state its 0 on start, in the event where you change the animation, set the variable to 1 and save it in local storage, later on start of layout load the variable using local storage, and if its value is 1 add a event to change the sprite animation.
Like my work? Fallow me on social media, and see my games on the arcade.
B
7
S
5
G
9
Posts: 298
Reputation: 5,367


Return to How do I....?

Who is online

Users browsing this forum: Kyatric, Yahoo [Bot] and 49 guests