How do I unlock object only once

Get help using Construct 2

Post » Thu May 19, 2016 7:09 am

Hi all,

I am making game and right now I stopped at unlocking characters with ingame money.

I unlock new character let's say spending 500 coins. It is selected and everything is ok. Then I unlock another and use it for awhile, but when I want to change back to previous I have to spend again 500 coins.

I need the game to remember that I unlocked that character and I don't have to spend again coins just to use it again.

Have any ideas how to do that?
B
9
S
1
Posts: 11
Reputation: 449

Post » Thu May 19, 2016 7:30 am

yes but it would take some tedious work

1) Make a global variable for each character with its own localstorage key.

2) When you buy the character, make sure to update the global variable and the key so it saves you buying the character.

3) Update your code if your global variable is the right value, then you don't get charged for the charater.
Check out my awesome Android Game releases https://play.google.com/store/apps/deve ... ames&hl=en
B
38
S
18
G
24
Posts: 681
Reputation: 16,613

Post » Thu May 19, 2016 7:33 am

1 bolean or variable on the item

tripple condition :
Trigger once
is bolean X inverted/variable=0
cash =>500

action --> subtract 500 from cash
------------> set bolean true /set variable to 1

this should solve it.

i placed bolean and variable with a / so you can choose the way you want it... it doesnt require both just one of the solutions.

here is a capx example using mouse and instance bolean
B
76
S
22
G
69
Posts: 1,353
Reputation: 43,833


Return to How do I....?

Who is online

Users browsing this forum: Ashley, uzumiapps and 26 guests