How do I Unlock Levels with Coins

Get help using Construct 2

Post » Thu Sep 15, 2016 3:10 pm

Hey all, for my new game i would make levels. And this levels should be unlockable with coins.
But i have no ideas how i do this =)

any1 can help me with this?
B
21
S
5
G
3
Posts: 44
Reputation: 2,777

Post » Thu Sep 15, 2016 4:36 pm

Use a global variable for number of coins. If number of coins is greater than or equal to a certain value then unlock the level.
B
46
S
16
G
74
Posts: 2,089
Reputation: 44,187

Post » Thu Sep 15, 2016 5:31 pm

B
11
S
6
G
15
Posts: 256
Reputation: 9,207

Post » Thu Sep 15, 2016 5:57 pm

Thanks @Gmoney but how do i save it? For example if reach 5 coins next level would be unlocked but this data must stored but who?
B
21
S
5
G
3
Posts: 44
Reputation: 2,777

Post » Thu Sep 15, 2016 6:56 pm

You're welcome, Cub3D. :mrgreen:

Since the coin variable declared was a global one, it will be automatically saved for the Level 2.

Just in case, if you need to reset the coin variable, then you need to use 'On start of layout' event on Level 2's event sheet and set the coin amount.
B
11
S
6
G
15
Posts: 256
Reputation: 9,207


Return to How do I....?

Who is online

Users browsing this forum: lukewasthefish, marc254, Mayfly, tarek2 and 19 guests