I am currently working on a 0-21 solitaire game with multiple levels. When the player completes a level, I need to reset everything to their initial state, so I use window.location.reload()
. But this method causes some inconveniences in the game like exiting fullscreen window.
So what I need is a method that resets everything to their initial state, just like refreshing the page, but without refreshing the page. Is that possible? (With pure javascript.)
Or alternatively, a way to refresh the page without exiting fullscreen window would also do the job.
Thanks in advance for all the answers.