Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Saving Worlds #28

Open
andrewgrider opened this issue Apr 6, 2018 · 3 comments
Open

Saving Worlds #28

andrewgrider opened this issue Apr 6, 2018 · 3 comments

Comments

@andrewgrider
Copy link

Is there any way you could save these worlds using the built-in localStorage object in javascript?

@pkipjames
Copy link

It may be better to use IndexedDB or WebSQL because localStorage has a 2MB limit ):

@pkipjames
Copy link

pkipjames commented Apr 12, 2019

I use a type of thing I call "File-Based Programming" when I write web apps most of the time nowadays. I declare a variable without a value at the beginning of the code. It can be set to a JSON object by opening a new file, or be set to a parsed JSON string file. Save it with JSON.stringify and an "a" element with download attribute and dataURL of the JSON variable. It may be helpful here.

@warengonzaga
Copy link

I use a type of thing I call "File-Based Programming" when I write web apps most of the time nowadays. I declare a variable without a value at the beginning of the code. It can be set to a JSON object by opening a new file, or be set to a parsed JSON string file. Save it with JSON.stringify and an "a" element with download attribute and dataURL of the JSON variable. It may be helpful here.

Good idea... it is same web tech used by Grav a flat-file CMS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants