prof.kerfuffle Posted August 23, 2016 Share Posted August 23, 2016 I come from java land, and am making a game which includes a level editor, so the data needs to be stored somewhere (json files), and I am curious about my options. The level editor is for my use, so I could have a separate version of the game for creating the data, using something like node.js or similar, but ideally there would only be one version. So, any ideas would be very welcome, the easier to implement for a phaser/html5 noob the better Edit: Forgot to mention that I'd prefer a permanent storage solution that ideally isn't reliant on a particular computer, since the levels will be developed over longer periods, and on multiple devices. But any ideas are welcome! Link to comment Share on other sites More sharing options...
Cybercell Posted August 23, 2016 Share Posted August 23, 2016 For saving data I use localstorage. (http://www.w3schools.com/html/html5_webstorage.asp) If only you will be using it is a easy approach, just make sure you do not delete your cache. Often i create simple text box that will output the data. this can be copied into any text editor to save onto hard-drive some where. Hope this helps! Link to comment Share on other sites More sharing options...
prof.kerfuffle Posted August 24, 2016 Author Share Posted August 24, 2016 10 hours ago, Cybercell said: For saving data I use localstorage. (http://www.w3schools.com/html/html5_webstorage.asp) If only you will be using it is a easy approach, just make sure you do not delete your cache. Hope this helps! Thanks for your tip! I should have mentioned that I'd prefer some kind of permanent storage solution, so a level can be designed over longer periods of time, and not be computer dependent, since I switch between computers a lot. But it's nice to have it as an option! Link to comment Share on other sites More sharing options...
drhayes Posted August 24, 2016 Share Posted August 24, 2016 If you're running the level editor from a server you could POST the representation of the level (probably JSON?) back to the server for it to write to the file system. If you packaged up your editor in Electron or nwjs they expose native APIs for writing to the file system as well. If you don't have a server and don't want to wrap anything, you could use something like Firebase or, heck, Amazon's S3 service to sync/store/load the levels as well. Link to comment Share on other sites More sharing options...
Recommended Posts