Hello guys !
So I have this problem which I can’t find the way how to fix it.
myTable = {} myTable.musicOn = false myTable.soundOn = true myTable.lv1 = false loadsave.saveTable(myTable, "myTable.json"
You can see that I make and save the table on levelselect.lua.
Here
myTable = loadsave.loadTable("myTable.json") local button1Press = function( event ) if (myTable.lv1 == false) then storyboard.gotoScene("story","fade",200) myTable.lv1 = true loadsave.saveTable(myTable, "myTable.json") elseif (myTable.lv1== true) then storyboard.purgeScene("level1") storyboard.gotoScene("level1","fade",200) end end
I’m telling the app if that myTable.lv1 is = false it will go to story screen(I want that story screen happens only once when player play lv1 for the first time not the second too. So that works but only if I don’t close the app.
If I close it and open it again it will load this code again
myTable = {} myTable.musicOn = false myTable.soundOn = true myTable.lv1 = false loadsave.saveTable(myTable, "myTable.json"
and that will overwrite the myTable.lv1 = true. Basicly same thing will happen as first time.
So my question is - How to avoid that overwriting ?
Thanks!
When I close the app everything resets.