1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586 |
- 'use strict';
- import PhaserEngine from './controller/phaser-engine';
- function startGame() {
- console.log('start Game');
- let phaserEngine = new PhaserEngine();
- phaserEngine.start();
- }
- let app = {
-
- initialize: function () {
- console.log('app initialize');
- document.addEventListener('deviceready', this.onDeviceReady.bind(this), false);
- },
-
-
-
-
- onDeviceReady: function () {
- this.receivedEvent('deviceready');
- startGame();
- },
-
- receivedEvent: function (id) {
- var parentElement = document.getElementById(id);
- var listeningElement = parentElement.querySelector('.listening');
- var receivedElement = parentElement.querySelector('.received');
- listeningElement.setAttribute('style', 'display:none;');
- receivedElement.setAttribute('style', 'display:block;');
- console.log('Received Event: ' + id);
- }
- };
- console.log('cordova :', process.env.CORDOVA );
- if (process.env.CORDOVA) {
- app.initialize();
- } else {
- startGame();
- }
|