MaximeC Posted November 1, 2014 Share Posted November 1, 2014 I was using Phaser 2.0.7 but the upgrade to the version 2.1.3 (and dev) causes a black screen when I try to run my game with Cocoonjs. Do you have any idea about what could cause that? I tried AUTO and CANVAS. Thank you for your help. Sam 1 Link to comment Share on other sites More sharing options...
Videlais Posted November 1, 2014 Share Posted November 1, 2014 It could any number of things, unfortunately. To start: Have you tried your game using WebView mode? How about WebView+? Do those work? If so, check the console. Is it reporting any errors at all? If so, where and with which functions? If you are using the Launcher app, try turning off WebGL from the settings. Does that help? Does it still not work? Finally, try disabling all functionality and reverting back to just the most basic creation of a Phaser.Game object. Does that work? How about when you add in states, images, or sprites? Do those work now? You might need to test things one by one to find it. Link to comment Share on other sites More sharing options...
spencerTL Posted November 1, 2014 Share Posted November 1, 2014 Blank screen on mobile after upgrading to a 2.1 version seems to usually be due to not removing the hasResized event from boot.js when basing a project on the templates. Not sure if this is relevant to cocoon though. Check if you use this event then remove if you do. The api changed. Tuan 1 Link to comment Share on other sites More sharing options...
MaximeC Posted November 2, 2014 Author Share Posted November 2, 2014 The project works perfectly in Chrome and Firefox, mobile version or desktop. But it does not work in any of the 3 modes with CocoonJS after upgrade. I don't use hasResized. Link to comment Share on other sites More sharing options...
Mariusz Posted November 2, 2014 Share Posted November 2, 2014 Do you get any errors in cocoonjs console? Link to comment Share on other sites More sharing options...
MaximeC Posted November 2, 2014 Author Share Posted November 2, 2014 No errors. The various JS are loaded and evaluated but after that it behaves as an empty page. I decided to give a try to crosswalk and it works like a charm. Link to comment Share on other sites More sharing options...
Ludei Posted November 3, 2014 Share Posted November 3, 2014 Hello, Could you please provide us with a test case to reproduce the issue? It will be really helpful in order to search for a solution. Regards. Sam 1 Link to comment Share on other sites More sharing options...
Sam Posted November 3, 2014 Share Posted November 3, 2014 The project works perfectly in Chrome and Firefox, mobile version or desktop. But it does not work in any of the 3 modes with CocoonJS after upgrade. I don't use hasResized. Hello, Could you please provide us with a test case to reproduce the issue? It will be really helpful in order to search for a solution. Regards. Same problem here ~ equal to the description above.//Help Center link to Ludeihttp://support.ludei.com/hc/communities/public/questions/200719089-CocoonJS-Launcher-2-1-iOS-Phaser-no-game-running-any-more-in-any-View-Option?locale=en-us//Post:http://www.html5gamedevs.com/topic/10193-cocoonjs-new-launcher-version-game-wont-start-no-errors-in-console/ Link to comment Share on other sites More sharing options...
Sam Posted November 3, 2014 Share Posted November 3, 2014 Hello, Could you please provide us with a test case to reproduce the issue? It will be really helpful in order to search for a solution. Regards. Still this code does not fire..console shows no errors, gameStates are getting not executed :: only newest Launcher V. 2.1 var game = new Phaser.Game(1024,768,Phaser.CANVAS,'',{preload: preload, create: create, update: update});function preload(){ console.log("preloading"); }function create(){ console.log("creating");}function update(){} Link to comment Share on other sites More sharing options...
Mariusz Posted November 4, 2014 Share Posted November 4, 2014 I've just realized that the newest CocoonJS launcher that I had downloaded from Google Play recently gave me the same black screen when I tried to run my game. I can run the game in a compiled launcher for my project though. Link to comment Share on other sites More sharing options...
Sam Posted November 4, 2014 Share Posted November 4, 2014 It themes they have something wrong with their Launcher. I have been searching for a while now and there a few more reports in the last days that the launcher only shows a black screen. On Android and iOS, so the launcher is not useable any more until they throw an update. Link to comment Share on other sites More sharing options...
Ludei Posted November 4, 2014 Share Posted November 4, 2014 Hello, We have received a testcase and we are currently investigating this issue. We will keep you all informed and we will let you know as soon as we get any relevant data. Sorry for the inconvenience. Sam 1 Link to comment Share on other sites More sharing options...
Ludei Posted November 4, 2014 Share Posted November 4, 2014 Hello, We found the root of the problem. We are currently fixing it but it will take some time, so I will try to explain how to use a provisional workaround until we can update the launcher at the stores. Phaser, by default, checks the following code:if (document.readyState === 'complete' || document.readyState === 'interactive') { window.setTimeout(this.onBoot, 0); } else if(typeof window.cordova !== "undefined") { document.addEventListener('deviceready', this.onBoot, false); } else { document.addEventListener('DOMContentLoaded', this.onBoot, false); window.addEventListener('load', this.onBoot, false); }Normally, the default branch for cocoonJS is the third one, but now we have included Cordova in the Launcher, so it takes the second one instead. That is why it is not working as it should, because it recognizes the window.cordova.So, meanwhile we fix this, what you can do is to set window.cordova to null just before the var game:window.cordova = null;var game = new Phaser.Game(....);Sorry for the inconvenience. We will let you know when the launcher is updated. Regards. Sam 1 Link to comment Share on other sites More sharing options...
Sam Posted November 4, 2014 Share Posted November 4, 2014 thanks a lot!really apprecheate the work you have done. Link to comment Share on other sites More sharing options...
zackproser Posted November 5, 2014 Share Posted November 5, 2014 Same issue. Appreciate your responsiveness - I was looking forward to using CocoonJs for a nearly finished game. Link to comment Share on other sites More sharing options...
saibotlive Posted November 5, 2014 Share Posted November 5, 2014 I tried this but still get black screen Link to comment Share on other sites More sharing options...
adamatt Posted November 9, 2014 Share Posted November 9, 2014 I still get a black screen too! Link to comment Share on other sites More sharing options...
Sam Posted November 11, 2014 Share Posted November 11, 2014 Hello, We found the root of the problem. We are currently fixing it but it will take some time, so I will try to explain how to use a provisional workaround until we can update the launcher at the stores. Phaser, by default, checks the following code:if (document.readyState === 'complete' || document.readyState === 'interactive') { window.setTimeout(this.onBoot, 0); } else if(typeof window.cordova !== "undefined") { document.addEventListener('deviceready', this.onBoot, false); } else { document.addEventListener('DOMContentLoaded', this.onBoot, false); window.addEventListener('load', this.onBoot, false); }Normally, the default branch for cocoonJS is the third one, but now we have included Cordova in the Launcher, so it takes the second one instead. That is why it is not working as it should, because it recognizes the window.cordova.So, meanwhile we fix this, what you can do is to set window.cordova to null just before the var game:window.cordova = null;var game = new Phaser.Game(....);Sorry for the inconvenience. We will let you know when the launcher is updated. Regards. The black screen will still appear, as ludei has posted above. there is a workaround until the issue is fixed.The black screen will appear if you do not modify phaser.js / your code Link to comment Share on other sites More sharing options...
adamatt Posted November 11, 2014 Share Posted November 11, 2014 even with "window.cordova = null;" before the var game i get a black screen Link to comment Share on other sites More sharing options...
Sam Posted November 11, 2014 Share Posted November 11, 2014 mee too, you're right.Please subscripe to ludei -> because the issue is since the new launcher version.post here:http://support.ludei.com/hc/communities/public/questions/200719089-CocoonJS-Launcher-2-1-iOS-Phaser-no-game-running-any-more-in-any-View-Option?locale=en-us Link to comment Share on other sites More sharing options...
Sam Posted November 11, 2014 Share Posted November 11, 2014 even with "window.cordova = null;" before the var game i get a black screen I've response to the ludei post, please respond to this post too, so they can see that the problem is getting serious.http://support.ludei.com/hc/communities/public/questions/200719089-CocoonJS-Launcher-2-1-iOS-Phaser-no-game-running-any-more-in-any-View-OptionCocoonJS is not usable since the last update. Link to comment Share on other sites More sharing options...
Sam Posted November 11, 2014 Share Posted November 11, 2014 Rich was so decent and solved the issue in upcoming Phaser 2.2 for canvas+ modesee: http://www.html5gamedevs.com/topic/10345-phaser-220-release-candidate-2-please-test/page-2still webview has the problem. Maybe he could fix this too. I have reported the test-result. Link to comment Share on other sites More sharing options...
adamatt Posted November 11, 2014 Share Posted November 11, 2014 yes with version 2.2 it works in canvas mode but fps has been divided by 3... Link to comment Share on other sites More sharing options...
Sam Posted November 11, 2014 Share Posted November 11, 2014 Tested the FPS. My game works very well at stable 50-60 fps.Note: Phaser.2.2 enables:Time.desiredFps is the new desired frame rate for your game.Time.suggestedFps is the suggested frame rate for the game based on system load.Maybe you should set desiredFPS or you have to improve your code to run faster for mobile devices?There are a posts on it, that fits very well for mobile devices.http://www.html5gamedevs.com/topic/9931-mobile-performance-tips-tricks/http://www.html5gamedevs.com/topic/8624-phaser-improve-mobile-performance/Phaser 2.2 does not affect my fps on any game - till yet, only tested a few seconds, haven't had so much time.Hope that helps? Link to comment Share on other sites More sharing options...
Sam Posted November 13, 2014 Share Posted November 13, 2014 There are news with a response of Marta from CocoonJS:cite: Hello,As the real problem is solved and the only problem that remains is that it takes time to upload the launcher to the store, we have decided to share a provisional link that contains the launcher for Android with the fix. Android: https://www.dropbox.com/s/do4iepidjc8d0am/cocoonjslauncher-beta-release.apk?dl=0For iOS this is more complicated, because we can't provide you anything else than a custom launcher at the moment. But you can compile a custom launcher on your own for testing, so there is no point on doing it.Hope this helps until we can update the launcher.Regards. Ludei 1 Link to comment Share on other sites More sharing options...
Recommended Posts