MZuex Posted January 5, 2019 Share Posted January 5, 2019 I created a simple app quiz app using phaser3 and cordova, throughout development and testing (using cordova android emulator, browser, my phone, and other phones) I never had any issues with scenes. But once I deployed it, a number of people complained about having blank screens, I tried running it on bluestacks android emulator and had the same issue. I couldn't figure out why it was happening so I started rearranging and rewriting the code, and I realized whenever I load scene like the code below, I get the issue. It doesn't matter if I declared the scene in the same file or load it from an external file. scene: [preload,about,mainmenu] But if create a preload function and create the content of my "about" scene in a create function and add scene like below, it works fine scene: { preload: preload, create: create } Does anyone know why this is happening or what's causing it, I don't get how it works fine on some phones and not on others. Even when I uploaded the phaser app to a web server, the phones that had the issue still had it when they accessed it via a browser, so i don't think its a cordova issue. Any help, tip, hint, advice will be most appreciated, thanks. P.s I have a whole bunch of scenes, which is I why am not eager to convert them all into functions like i did the 'about' scene. Link to comment Share on other sites More sharing options...
MZuex Posted January 6, 2019 Author Share Posted January 6, 2019 (edited) So I figure out what was wrong, I started by creating scenes as shown here instead of as objects. Problem still existed, so I continued messing with the code till I found the real issue, it was the way I was handling mouse input event. This is how I was handling it this.btn.on('pointerdown', () => {//some code}); For some reason this caused errors on a lot of devices, I can't remember how I came about using this approach in the first place, is it wrong? Once I changed it to the below, app was running on all devices. this.btn.on('pointerdown', function (event) {//some code}, this); Anyone knows why this happened? Edited January 6, 2019 by MZuex Link to comment Share on other sites More sharing options...
sirlink98 Posted January 8, 2019 Share Posted January 8, 2019 That's because you are using arrow functions () => which are only compatible with modern browsers that support ES6 MZuex 1 Link to comment Share on other sites More sharing options...
Recommended Posts