How do I unlock object only once

0 favourites
  • 3 posts
From the Asset Store
Change the size and position of everything without calculating anything!
  • 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?

  • 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.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)