HTML5 exported game shows black screen only

  • Hello everyone!

    After having uploaded the game to dropbox, index.html shows only a black screen with a link to Scirra at the bottom. The file is there (there is an 800x600 element in the page), but no matter what I try I can't get the game to show.

    I tried both the latest stable and beta releases, exported the project multiple times, and even tried the trick suggested when the same problem surfaced in r81 (at least from what I gather reading the scirra.com/tutorials/42/upload-your-game-to-dropbox comments. Previewing from the program works just fine, but no matter the version/browser all I get is a black screen and the link; I'm inclined to think the problem is my machine, since I could find no mentions of similar problems when searching.

    EDIT: just went through the process with two projects that were posted in the "test" thread. Same result. :(

    Any help is greatly appreciated!

    Christian

  • It's helpful to include a link to the game so we can have a look ourselves. Are you sure you uploaded all the files? What does Chrome's console say (ctrl+shift+J)?

  • Hi Ashley! Thanks for the quick reply :D

    I get some errors from the console:

    Failed to load resource: the server responded with a status of 403 (FORBIDDEN) dl-web.dropbox.com/get/Devastation/c2runtime.js[/li]

    Uncaught ReferenceError: cr_createRuntime is not defined index.html:107

    Uncaught ReferenceError: cr_setSuspended is not defined index.html:113

    Uncaught ReferenceError: cr_setSuspended is not defined index.html:115

    And then it goes on alternating between the the two errors at 113 and 115.

    So, the problems are:

    The function around line 107

    // Start the Construct 2 project running on window load.
              jQuery(document).ready(function ()
              {
                   // Create new runtime using the c2canvas
                   cr_createRuntime("c2canvas"); //107
              });
    

    onVisibilityChanged() for 113 and 115

    // Pause and resume on page becoming visible/invisible
              function onVisibilityChanged() {
                   if (document.hidden || document.mozHidden || document.webkitHidden || document.msHidden)
                        cr_setSuspended(true); //113
                   else
                        cr_setSuspended(false); //115
              };
    
  • I'll say "bump", if only because I tried everything that came to mind, and I feel the only thing left would be throwing the pc out of the window :P

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • The link your provided in your previous post gives a 404 error (so files are missing/the page does not exist).

    You might want to consult the tutorial on how to upload your game to dropbox and make sure all your files are reachable.

  • Yeah, basically the errors are because c2runtime.js is missing or can't be accessed, which implies only index.html was uploaded or it's the only public file. You need all the other files there too.

  • I think it's because your dropbox won't let you access the files , are you sure you did put the files in the public folder ?

    You could always link us a .capx so we can test if it works or no ...

  • Wow. Just...wow. As a pretty savvy guy when it comes to computers (I'm a programmer for crying out loud), I'm astonished by how embarrassingly dumb this was on my part.

    Everything was already in the public folder. What I forgot is that some time ago I deactivated the sharing of that folder on my client. Enabling it again had no immediate benefit though, even after clearing the browsers' caches (which I guess is understandable, since everything was uploaded through a browser).

    Turns out some people were having the same problem regarding other files in the public folder (unrelated to C2), and one answer mentioned the https protocol, which turned out to be the key to this whole thing: everything works if, instead of opening index.html from the public folder (https) I open it through the "public link" (http).

    I am really sorry for the unnecessary trouble. Thank you all for your answers, which proved instrumental in solving the problem :)

    Have a great day!

    --Christian

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)