How to save wick game

I'm making a long game how do I make the player automatically save their progress?

After creating a new localStorage() as the first thing on the website shows you, look for setItem() and getItem() below.

2 Likes

Could you explain more properly to me? Like show me a video or something?

Hi @Dol_Boonsomchin, sorry for the late reply but I may be able to help.

Saving progress in code is done through saving variables and setting them to a text value. In order to accomplish this, you’ll need to use the window’s local storage.

The link Baron shared in that reply should be helpful when it comes to explaining how this works, and if you need an example (wick file), then I would recommend using this :)

I used @Revon’s example myself to learn how this worked, so I hope it helps you out as well!

If you want simple code to look at, then here are two lines to focus on:

Create/ Set the Saved Variable
window.localStorage.setItem("variable", "VALUE")
Using/ Referencing the Saved Variable
window.localStorage.getItem("variable name")

If you still need help, feel free to let us know :)

2 Likes