Why is the game does not start with localhost?

0 favourites
  • 4 posts
From the Asset Store
2D fighting template based in the game that defined the fighting games genre.
  • Why is the game does not start with localhost?

    <img src="http://cs5825.userapi.com/u21362907/-7/y_9551e5df.jpg" border="0" />

    But starting with the hosting is excellent.

    Help may be in the code in index.html need to change something?

    Here is the complete code of index.html

    <!DOCTYPE html>

    <html manifest="offline.appcache">

    <head>

        <meta charset="UTF-8" />

    <!-- This ensures the canvas works on IE9+. Don't remove it! -->

    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />

    <title>Modi</title>

    <!-- Note: running this exported project from disk may not work exactly like preview, since browsers block some features on the file:// protocol. Once you've uploaded it to a server, it should work OK. -->

        <!-- This outlines the canvas with a black border and makes the page background black. -->

    <style type="text/css">

        canvas { border: 1px solid black; }

        body { background-color: black; color: white; }

    </style>

    </head>

    <body>

    <div id="fb-root"></div>

    <div style="text-align: center;">

    <script>

    // Issue a warning if trying to preview an exported project on disk.

    (function(){

        // Check for running exported on file protocol

        if (window.location.protocol.substr(0, 4) === "file")

        {

          alert("Note: browsers have very strict security limitations on pages viewed from disk. This means exported projects generally don't work when run from disk. Upload your project to a server, or just preview from inside Construct 2, to check it works.");

        }

    })();

    </script>

            <!-- The canvas the project will render to. If you change its ID, don't forget to change the

            ID the runtime looks for in the jQuery ready event (above). -->

        <canvas id="c2canvas" width="640" height="480" oncontextmenu="return false;" onselectstart="return false;">

                <!-- This text is displayed if the visitor's browser does not support HTML5.

                You can change it, but it is a good idea to link to a description of a browser

                and provide some links to download some popular HTML5-compatible browsers. -->

          Your browser does not appear to support HTML5. Try upgrading your browser to the latest version. <a href="http://www.whatbrowser.org">What is a browser?</a>

          <br/><br/><a href="http://www.microsoft.com/windows/internet-explorer/default.aspx">Microsoft Internet Explorer</a><br/>

          <a href="http://www.mozilla.com/firefox/">Mozilla Firefox</a><br/>

          <a href="http://www.google.com/chrome/">Google Chrome</a><br/>

          <a href="http://www.apple.com/safari/download/">Apple Safari</a><br/>

          <a href="http://www.google.com/chromeframe">Google Chrome Frame for Internet Explorer</a><br/>

        </canvas>

            <br />

        

        <!-- SCIRRA LTD LICENSE AGREEMENT

           FREE EDITION USERS ARE NOT ALLOWED TO REMOVE, MODIFY OR HIDE THE FOLLOWING

           LINES OF HTML5 CODE FROM THEIR EXPORTED GAMES. REMOVAL, MODIFICATION OR

           ATTEMPTS TO HIDE THIS MESSAGE WILL BE IN BREACH OF THE FREE EDITION LICENSE

        -->

        <!-- End of Scirra Ltd. free edition limitation -->

        <a href="http://www.scirra.com" target="_blank" style="font-family:Arial;color:DodgerBlue;" title="Create games">Made with Construct 2 ? the HTML5 game maker</a>

    </div>

    <!-- Pages load faster with scripts at the bottom -->

    <!-- Construct 2 exported games require jQuery. To save bandwidth, by default

    this is set to grab it off the Google content delivery network (CDN). Fall back to local if not available. -->

    <script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>

    <script>window.jQuery || document.write("<script src='jquery-1.7.1.min.js'>\x3C/script>")</script>

        <!-- The runtime script. You can rename it, but don't forget to rename the reference here as well.

        This file will have been minified and obfuscated if you enabled "Minify script" during export. -->

    <script src="c2runtime.js"></script>

        <script>

        // Start the Construct 2 project running on window load.

        jQuery(document).ready(function ()

        {

          // Create new runtime using the c2canvas

          cr.createRuntime("c2canvas");

        });

        </script>

    </body>

    </html>

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • AlbertAkefoul

    But you don't seem to be running your game from localhost.

    Your URL should be localhost (which happens automatically when you click 'Run layout'), not file:///X:/home/localhost/...

    (And this is not a website issue - probably should be in 'How do I....', mods.)

  • I just want my game to make application for ANDROID

    I did everything as they say here: http://wiki.phonegap.com/w/page/30862722/phonegap-android-eclipse-quickstart

    have only exported to PhoneGap

    When exporting to PhoneGap

    <img src="http://www.scirra.com/images/articles/exportforphonegap.png" border="0">

    out

    <img src="http://cs5825.userapi.com/u21362907/-7/y_f5e31033.jpg" border="0">

    I do not understand how to change the project properties?

    Tell me how to make an application under ANDROID?

  • AlbertAkefoul, the first error is nothing to do with localhost, you need to upload your project to a server for it to work. See in the address bar it says "file:///". Projects generally don't work on file:/// - that's what the message is warning you about.

    The second error is because you need to set a description and version in project properties.

    The tutorial you linked to for building with PhoneGap will not work with Construct 2. Use this tutorial instead: How to make native phone apps with Construct 2 and PhoneGap

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