Allow to start both on cordova and web

This commit is contained in:
Thomas Forgione 2018-08-23 10:20:21 +02:00
parent 93fedd38cc
commit 1850464154
No known key found for this signature in database
GPG Key ID: 203DAEA747F48F41
1 changed files with 7 additions and 3 deletions

View File

@ -1,15 +1,19 @@
let game, context; let game, context;
document.addEventListener("deviceready", () => { if (window.cordova) {
document.addEventListener("deviceready", start, false);
} else {
start();
}
function start() {
if (typeof StatusBar !== 'undefined') { if (typeof StatusBar !== 'undefined') {
StatusBar.hide(); StatusBar.hide();
} }
init(); init();
loop(); loop();
}
}, false);
function init() { function init() {