Skip to content Skip to sidebar Skip to footer

How To Play Html5 Game Offline?

I wanted to save some html5 games on the laptop for my little brother to play when he's out of wifi range. I downloaded all the files and changed the paths so that no erros appear.

Solution 1:

Solution

Go to this site:

http://scotty-staging.softgames.de/assets/api/voyager.js

or use this mirror i created:

File only : http://www.mediafire.com/download/4b8uhvm75fbqtwy/voyager.js Full game: http://www.mediafire.com/download/y8ocia4rr5552jx/html5Game.7z

Save the javascript file in assets and than you can play the game.

update ( problem )

var displayLoadScrn = function(){
        var body = SG.d.getElementsByTagName('body')[0];
        if( typeof body != "undefined" ){
            if( SG.d.getElementById('sg-loadscrn') == null ){
                SG.debug && console.log('show load-screen: complete');
                body.appendChild(loadScrn);
            }
            SG.loadVoyager();  //<---- This is where it goes wrong //
        }
        else{
            if(SG.debug) console.log('show load-screen: body-tag not ready. retrying in '+SG.loadScrnTimer+'ms');
            setTimeout(displayLoadScrn,SG.loadScrnTimer);
        }
    };
    
    displayLoadScrn();

 var displayImage = function(){
        var body = SG.d.getElementsByTagName('body')[0];
        if( typeof body != "undefined" ){
            body.appendChild(loadScrn);
            SG.loadVoyager();  //<---- This is where it also goes wrong //

        }
        else{
            if(SG.debug) console.log('show load-screen: body-tag not ready. retrying in '+SG.loadScrnTimer+'ms');
            setTimeout(displayImage,SG.loadScrnTimer);
        }
    };

    displayImage();

The problem is that you didnt provide the voyager resource script in the assets folder, but it needs to be loaded

loadVoyager : function(){
    var sgc = document.createElement('script'); sgc.type = 'text/javascript'; sgc.async = true;
    var random = Math.floor((Math.random()*100000000)+1);
    //sgc.src = 'http://scotty-staging.softgames.de/assets/api/voyager.js';
    sgc.src = 'assets/voyager.js?_='+random; //<-- this line ////sgc.src = '//localhost:3000/assets/api/voyager.js';
    sgc.onload = SG.boot;
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(sgc, s);
},

You see the middle "sgc.src = 'assets/voyager.js?='+random;" , that is still trying to load, what I did is removing the commented out lines, I kept the "sgc.src = 'assets/voyager.js?='+random;" uncommented and downloaded the voyager file and placed it in the assets folder.

You cannot comment out the loadvoyager, because it needs to be loaded. Otherwise your page will be loading all the time, with not response

Solution 2:

Looks like a file named voyager.js is missing from the assets folder. Open the console in the browser for this detail(F12 in Chrome).

And just to be on the safer side try opening this game through a local-server this way you don't have to worry about all the things the browser is concerned about when running the game.

Post a Comment for "How To Play Html5 Game Offline?"