Change variable value based on another one
Hey guys, I'm working on this game project and I need to increase x money based on x customers.
Exemple: if I have 100 customers, I want the money to increase 10/second. If the customer value drops to 50, the money increases only 5/second.
Is that possible? I really don't know how to do that.
Thank you!
Best Answers
-
tatiang Posts: 11,949
Timer every 1 second
.....Change Attribute game.money to game.money+game.customers/10New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
-
tatiang Posts: 11,949
@luccafreitas said:
how do I let the score keep counting if the user changes the sceneIf you have that same Timer in an actor on the scene you change to, it will just keep increasing the money accordingly. Game attributes (as opposed to scene or actor/self attributes) do not reset when you change or reset scenes.
@luccafreitas said:
how do I let the score keep counting if the user closes the app?This is trickier. You have to do some massaging of the device clock attributes. A starting point is to Google gamesalad device clock.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Answers
Thank you!!
I have one more question, how do I let the score keep counting if the user changes the scene or closes the app?
Thank you @tatiang , problem solved