How do I make an actor clickable only once?
nati22
Member Posts: 11
Hi there,
I have a store in my game, where the player can purchase stuff with the points earned in the game. Some items are only available on a certain level.
So far I have an actor next to the item with a basic image of a lock. When the player reaches the level on which the item becomes available, the lock image changes to a "buy" image.
When the player buys the item, the image changes to a check, and I want it to stay this way, but if I change the scene and come back, the "buy" image will be displayed again, and it's clickable again.
How could I make it stay on the check image and be clickable/purchaseable only once?
Thanks
(I accidentally posted in the Mac forum first, but I work on Windows)
Comments
Hi @nati22
preferably use a table to store information about items purchased. You can also use the table for settings, like quantity or availability per level.
You can then save the table when purchases were made, and also load the table when the game starts, thus keeping track of purchases.
Tables are accessible from any actor/scene, are flexible, and do not clutter up your code like game level attributes.
MESSAGING, X-PLATFORM LEADERBOARDS, OFFLINE-TIMER, ANALYTICS and BACK-END CONTROL for your GameSalad projects
www.APPFORMATIVE.com