suzy19 Posted June 5, 2018 Share Posted June 5, 2018 Hi guys, first my English is not very good. I want to create a game like https://play.google.com/store/apps/details?id=com.etermax.questions.lite.If you have that game, it's a game where you can answer multiple questions by selecting options. I need a way to store multiple questions and download json files (with the questions) and store them in the game. I made some simple Android applications, if I made an Android application I would use sqllite to store the questions and synchronize with the server if there are new questions. but in phaser / html5, how could I do something like that? Quote Link to comment Share on other sites More sharing options...
SeelenGeier Posted June 12, 2018 Share Posted June 12, 2018 How about using a repository of your questions on a server which is used to initially download those questions. You simply make an http request and download the json from your question server and save it locally. All files that are saved locally can then be used for the game (to be able to play offline). There is no need for a database if you already have the files in a readable format. Phaser has a simple function for that: let myText = this.load.json('text123', 'assets/json/text123.json'); Docu: https://photonstorm.github.io/phaser3-docs/Phaser.Loader.LoaderPlugin.html#json Otherwise Javascript can read files too but it is a bit more complicated: https://www.html5rocks.com/en/tutorials/file/dndfiles/ Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.