Can Phaser Export Data to Databases for Saves?

I’m making a game, which results in a high score. I’m wondering if there’s a way for Phaser to save this high score to a database with an associated user for future playing. So, if the user stops playing the game, leaves the page, and then comes back to play later, the game recognizes the player via username and can retrieve their high score.

Is this possible?

As far I know : no.

One way : score in JS ==> Ajax ==> php script to save in database (if it’s website).

Well, it’s unfortunate there’s no built in way, but I’ll give your AJAX solution a try! Thanks!

If you only want to recover the player’s highscore and the game haven’t a shared highscores table, you may want to use some option on the client side:

  • Cookies
  • Local storage
  • IndexedDB (persistent database)
1 Like

Do you have code or logic for this? will be really helpful