silversteez Posted March 3, 2014 Share Posted March 3, 2014 Hey, I was wondering if anyone has any experience trying to serialize the data of a Phaser game/state in order to create a game save. Wondering, for example, if it would be difficult/possible to accurately recreate a scene with a bunch of physics enabled sprites sitting on top of one-another, for example? I was planning on giving it a shot, but figured I'd ask around for tips first. Thanks! - Matt Link to comment Share on other sites More sharing options...
Zaidar Posted March 4, 2014 Share Posted March 4, 2014 You could use localStorage and JSON, it's really easy to use, and there's lot of articles on how to save data with that. I don't know how your game work, but you could just serialize position and reference to the name of objects and stock them thanks to JSON.stringify(). Link to comment Share on other sites More sharing options...
silversteez Posted March 4, 2014 Author Share Posted March 4, 2014 Thanks, Zaidar! I should clarify, actually - I'm not as worried about the actual serialization aspect (JSON for sure!), but more so the best approach to collecting the states of every sprite/group/etc and then using that data to rebuild the scene later. There's bound to be some tricky aspects to getting that right. I'll probably do some experiments later and report back with my findings. Link to comment Share on other sites More sharing options...
Zaidar Posted March 4, 2014 Share Posted March 4, 2014 Ok, I'm interested in it, so don't hesitate to share if you think something useful. Link to comment Share on other sites More sharing options...
Recommended Posts