O'Reilly logo

Learning Construct 2 by Aryadi Subagio

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Storing data in the player's machine

We know how to store data in an array and dictionary and how to show them onscreen, great! However, there's one thing to keep in mind when working with arrays and dictionaries: they will lose their values when the game is closed. The players might close the web browser window. Whenever they do this, they close the game, and the game will not remember the last value you put inside the array or the dictionary.

In most cases, this is not what we want. If we want to keep a score and then compare it to create a leaderboard, we want the game to remember it even after the game is closed. To do this, we need to store the data in the player's computer. So, when we start the game next time, our game can still remember ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required