Allow to start both on cordova and web
This commit is contained in:
parent
93fedd38cc
commit
1850464154
10
src/main.js
10
src/main.js
|
@ -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() {
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue