I just need to know how to save my mobile AIR game levels on local machine. Like all the details should be get save eg. how much level i finished or opened once and played, those levels should be in unlocked state. If the level which was never open before will be in locked state. This is my concept and this is the concept used in all mobile games nowadays. kindly please go through any mobile game level type and please let me know the coding for my concept its very urgent. And Thanks in advance. Any help will be kindly appreciatable.
The code which i used is below: Flash AS3
var file = File.applicationStorageDirectory.resolvePath("test.txt");
var str = "Locked Levels : Level 1,Level 2,Level 3,Level 4";
file.addEventListener(Event.COMPLETE, fileSaved);
file.save(str);
function fileSaved(event)
{
trace("Done.");
}
In the above code the text document is getting write to my local machine. But i don't know how to check the levels which are locked are unlocked using this . i kept my level buttons on stage itself by using frames for lock and unlock position. Thanks in advance.
OR
Personally, I would go for encrypted SQLite so you can get out of "hacking" scores by the "bad" guys :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With