I successfuly managed to write script that allows player to instantly load game from designated slot file directly from title screen, something like "continue last session" or game is picked where player left game, however this script contains a major flaw - of course it's save and load game on user's demand, but it is missing a feature to save game on closing game (closing game means:
- pressing alt+f4
- quitting by default means (esc menu -> exit game)
- closing by pressing [x] in to right corner of window.
So my question is how to handle it? I can only guess it has to do something with window.onclose method, but I'm not quite sure how to handle it with node.js
- pressing alt+f4
- quitting by default means (esc menu -> exit game)
- closing by pressing [x] in to right corner of window.
So my question is how to handle it? I can only guess it has to do something with window.onclose method, but I'm not quite sure how to handle it with node.js