- Home /
Saving coins
Hello,
I am making a android 2d catch game where you have to catch falling objects. Now when you catch one, you'll get one point. What I want now, is that when you are out of lifes, that on the menu is displayed your total of coins. So if you start again, catch some objects and then die again, the coints are added to your total coins. And when you close the app, that it is all stored. I think this is possible with playerprefs but don't know how to do this all.
Answer by PictonicStudio · Oct 17, 2015 at 07:24 PM
Yes, using player prefs would be correct.
//Write
PlayerPrefs.SetInt("Coins", 1);
//Read
int Coins = PlayerPrefs.GetInt("Coins");
Answer by felixfors · Oct 18, 2015 at 09:10 AM
You basicly asking us to make the game for you, this is not a question about a certain problem but you asking us to make the game for you. Make a main script that has the coins value stored. you should look into Sendmessage and OnCollisionEnter functions, do so try it out post your script and than we can help you atleast thats when I will help you.
No, I am asking you for help or some information about playerprefs with adding coins. A system which adds the caught bottles to the coins. I don't know why you see the whole game in there but okay. And I was not able to send a script, because I didn't have anything yet. Now with this information I can start, so thank you for your answer.