I'm making turn based game. There is a game field where player move objects every turn.
Every turn I save whole game field as json in local storage.
How to use local storage properly for saving game?
I've noticed that loading field with chain "on exist"->"load array from JSON" works with bugs. So I've added signal after "load from JSON". And before starting old game I've added waiting for that signal.
Now it works without any bugs.
Should I use same "signal"-"wait signal" mechanism for saving game? So player won't be able to leave game before game field is recorded in local storage? If yes then what is the best way to do it?