Search the Community
Showing results for tags 'save JSON like tiled editor'.
-
Hello everyone, Using Phaser for about 2 year, my old account seems to be deactivated-so this is a new one, I'm not new to Phaser. I started to create a kind of "strategy" game, it's more a "build" game. So I want to save my data which is generated at runtime. After 2 Nights of no sleep I've got a nice solution using nwjs which enables me to use nodejs modules at frontend usage. So I can create files at clicking "s" for example. And this by running a Phaser game, loading a file works fine too. Now the issue I am running in: I edit a map like in the Phaser example by changing tiles etc.> http://phaser.io/examples/v2/tilemaps/blank-tilemap < Those tiles have different collide options and events and I need to save all those data, so that a player can save a generated "map" and load it. Saving the whole map object doesn't work and I think it is not the right way: (map = game.add.tilemap() since I only need something like a JSON-File similar to something that tiled (editor) exports? First of all you can not create a file and writing the map object in it, ...that would be too easy. And forget to use JSON.stringify / parse on it, I've got this to work but it hold references to the game etc, that need to be re-run on "load". So I need another solution, maybe someone knows a better point to start? If I am right I don't need to save all those objects, if I can save the tilemap data (JSON like tile editor does) it would work. So on load I can attach all those events to the map generated from the JSON like file. But I do not know any way to generate such a file from a PhaserJS tilemap.. So were we are: - I can load / save files in my phasergame (native OS process) - I run the game as a desktop application with complete support of OS UI and behavior - need to save tilemaps (or if you have a better solution for maps, JSON like tile editor does) that can be created, edited and loaded in PhaserJS.
- 1 reply
-
- Phaser strategy game
- save tilemap
- (and 2 more)