I am currently trying to make a connect4 game by HTML,CSS and JS. In that game , I want to make a system such that if the player unexpectedly close the browser , the game won't be break out and if he again click the 'Play' button , the game restarts from the current position. What kind of languages , frameworks or database types I can use? and a sample code is somewhat expected to understand. Thank You
Asked
Active
Viewed 19 times
0
-
1Maybe you are looking for cookies or local storage or session storage which stores the current position of players values and fetch later if player comes again due to any reason like unexpected closing of browser – Rana Nov 05 '21 at 09:22
-
@Rana `localStorage` is definetly the way to go as it allows more values and data then cookies. `sessionStorage` won't be helpfull as your example of closing the browser accidently will remove it. As you proberly know, `sessionStorage` only saves values temporarily until the browser is closed. Making it a bad sue for game saving. – tacoshy Nov 05 '21 at 09:31
-
**Voting to close for following reasons**: Question is to broad and unspecific for SO. Seeking for recommendations for languages, frameworks or database types is not allowed at SO. The question mostlikely will be answered by opinion-based answer rather then fact-based answers. – tacoshy Nov 05 '21 at 09:34