Exit on exit

This commit is contained in:
Thomas Forgione 2018-08-22 16:34:14 +02:00
parent 52ec8dc37e
commit 27157710b4
No known key found for this signature in database
GPG Key ID: 203DAEA747F48F41
2 changed files with 4 additions and 1 deletions

View File

@ -28,7 +28,9 @@ class Game {
if (this.mainScreen.after === AfterMenu.Start) {
this.changeScreen(this.scene);
} else if (this.mainScreen.after === AfterMenu.Exit) {
alert("I don't know how to exit");
if (navigator.app !== undefined && typeof navigator.app.exitApp === 'function') {
navigator.app.exitApp();
}
}
}
}

View File

@ -14,6 +14,7 @@
</head>
<body>
<canvas id="canvas"></canvas>
<script src="cordova.js"></script>
<script src="js/escalator.js"></script>
</body>
</html>