paulmo Posted January 20, 2015 Share Posted January 20, 2015 Want to get this Chrome/Chromium Game to work locally. So I put contents of offline.js in body of an HTML file, with no divs etc. since it's making its own with createElement. First, getting unexpected ( token syntax error on this: <script>function () {'use strict'; So I commented it and closing } (); out, which prevents errors, but game is not rendering in Chromium window when I open HTML file. Suggestions how to get this game working locally? Link to comment Share on other sites More sharing options...
justsomeguy Posted January 20, 2015 Share Posted January 20, 2015 The code as posted should run, it's just running everything inside an anonymous function: (function() { ...})(); Link to comment Share on other sites More sharing options...
paulmo Posted January 20, 2015 Author Share Posted January 20, 2015 Thanks, (function() { prevents errors but game still not rendering. Further advice appreciated. Link to comment Share on other sites More sharing options...
Ingolme Posted January 20, 2015 Share Posted January 20, 2015 Certain security features might be preventing Google Chrome from using some image resources. When a canvas is drawn on by an image loaded from another website it is considered tainted and its image data cannot be used to draw on another canvas. Chrome possibly applies this restriction to files loaded locally from the computer as well. Are you sure no error messages are showing up on the console? Link to comment Share on other sites More sharing options...
paulmo Posted January 21, 2015 Author Share Posted January 21, 2015 Thanks, no errors in console. I'm guessing some dependencies missing. If you have a minute please take a look at source. Link to comment Share on other sites More sharing options...
justsomeguy Posted January 21, 2015 Share Posted January 21, 2015 If you want to find out if things are missing then use your browser's developer tools to check the Network tab, look for any requests that are failing.If nothing is failing, and there are no error messages, then you need to use the debugger to set some breakpoints and just step through the code to see exactly what it's doing, and where it stops (any why). Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now