Hundreds of features to explore
Games made in Construct
Your questions answered
Trusted by schools and universities worldwide
Free education resources to use in the classroom
Students do not need accounts with us
What we believe
We are in this together
World class complete documentation
Official and community submitted guides
Learn and share with other game developers
Upload and play games from the Construct community
Game development stories & opinions
Hello,
I have a JSON file(type Dictionary) in Project files.
The JSON will contain all levels that user designed.
How do I write into JSON file in runtime?
Like I press a button, the level will be insert next Key in JSON.
Thanks!
Develop games in your browser. Powerful, performant & highly capable.
You can't overwrite project files in runtime. If you make changes to JSON, you can save it to Local Storage. When game starts, first check if there is updated data in Local Storage, if not - load the default data from the file.
Project files won't work, but external files could.
Ajax can post and get files from web sources and nwjs can do so for local files.
Thanks guys :D
Ajax can post and get files from web sources
Can you write to files directly with AJAX? I thought this is only possible if you send data to a PHP script, which will write it to a file.
Err yes as dop said, ajax post to php, which can write directly or interface with a database on a web server.