reload page to restart the game

This commit is contained in:
LabyStudio
2022-05-13 21:51:55 +02:00
parent aed8c401ac
commit 8d8fdcd3ac
+7 -2
View File
@@ -50,8 +50,13 @@ class Start {
// Listen on history back
window.addEventListener('pageshow', function (event) {
// Launch game
if (!window.app || !window.app.running) {
if (window.app) {
// Reload page to restart the game
if (!window.app.running) {
window.location.reload();
}
} else {
// Launch game
new Start().launch("canvas-container");
}
});