JS Compiler

0 favourites
  • 4 posts
  • Is the c2 runtime compiled by googles closure compiler? (it looks like it is, just asking out of curiosity!)

    Is there any downside to not compiling it apart from obvious bandwidth and slight speed improvement? I only ask, because if a game throws a JS error, isn't it going to be really difficult to debug it? Is having it obfuscated important? would it be good if developer mode is on to non compile it?

  • It's not compiled by closure. It's something you can do yourself easily by pasting c2runtime.js in to the Google closure compiler web service. However, it doesn't seem to survive 'advanced optimizations', only use 'simple optimizations' - working out why advanced kills it is something on my todo list.

  • Ah sorry, I looked at the ghost hunter one and it seems to be compiled so thought they all were.

    In regards to advanced killing, let me know what you find out because I have scripts that don't survive it either.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • One thing that may help in advanced mode is putting all your compiled code in any anonymous function wrapper:

    $(function() {


    Change the last line to:


    if it needs to execute the code block as soon as it's loaded.

    This stops conflicts with any other scripts apparently in the global scope which can cause issues. For example if the Jquery.min is in the global namespace there will be conflicts between minified variable names as the closure compiler declares things such as:

    var s = true, x = null, v = false;

    These might conflict with Jquery minified code.

    You probably know all this but just incase it's the issue.

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