- Home /
How i can add a life for the user if he buy it?
I finished my game and i want to, if the player lose, he can continue the game if he buy life how i can do that please ? (sorry for the english language i'm frensh)
cordialy
You could save how much the player collected already via PlayerPrefs http://docs.unity3d.com/ScriptReference/PlayerPrefs.html.
Then when he loses, he gets asked if he wants to buy a new life. If he chooses yes, then you check if he can afford it. If he can, you remove the money from the PlayerPrefs and return true that he can continue, if he does not have enough money then you return false and prevent the player from continuing.
Your answer
Follow this Question
Related Questions
How do I stop the player from moving offscreen? 2 Answers
Distribute terrain in zones 3 Answers
Changing player's moving direction 0 Answers
2D Sidescroller Issues Please help. 1 Answer
Multiple Cars not working 1 Answer