简体   繁体   中英

Corona SDK: Saving Scores

I am making a game in Corona SDK in which I want to be able to save the player's high score to the device that they are using's disk, just so that it will stay saved even if the user restarts the app.

Problem is, everywhere I go online for help on this sort of thing I am told I should be using JSON, but I am not sure if there is a simpler way of doing things or even if JSON is the right approach.

heres a neat thought that may work. make a new scene that contains the high score variable but dont erase the variable when exiting. then everytime they want to check their high score they just have to go to the scene.

option 2 - this one is a bit more tricky and im not exactly sure if you need permissions aka administrator rights (and if you are submitting your app on googleplay you may need to ask for permission. so review the rules before doing it), write a batch file that copies the highscore into a new file.

option 1 is better because you are not necessarily adding anything.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM