How do I create an in-game store

  • So I actually have the mechanics down but there is one thing that I am having an issue with. So when I purchase a character and click the buy button on said character the buy button disappears as it is supposed to but when I go back into the store the buy button is back and it will allow me to buy that character again when I shouldn't be able to. I tried using the save and load options which works but not how I want it to. It will load the game back to the store rather than the beginning of the game. Also the buy button is back if I go into the game and then go back to the store. I hope this makes sense, any help is appreciated.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I think you need to have a variable called Purchased attached to the character you wish to buy, and have the code read

    If Purchased = false >>> Make Buy Button Clickable/Usable/Visable

    else >>> Destroy Buy Button

  • the solution of is good but you might need to make an "array" not just a "variable", depending on how you made the layout/store.

    also if you want Save/Load to Load you to the beginning of the game, you have to use "Webstorage" instead of Construct2's Save/Load... using it is a lot harder (even to test/debug) but I recommend to learn it especially if you want to make a big game.

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