解決方案
去這個網站:
http://scotty-staging.softgames.de/assets/api/voyager.js
或使用該鏡我創建:只
文件:http://www.mediafire.com/download/4b8uhvm75fbqtwy/voyager.js
全場比賽:http://www.mediafire.com/download/y8ocia4rr5552jx/html5Game.7z
保存在資產和比JavaScript文件你可以玩遊戲。
更新(問題)
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();
的問題是,你沒有提供的資產文件夾中的航行者資源腳本,但它需要加載
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);
},
你看中間「SGC .src ='assets/voyager.js?='+隨機;「 ,那還在加載,我所做的是刪除註釋掉的行,我保留了「sgc.src ='assets/voyager.js? ='+隨機;」取消註釋並下載voyager文件並將其放置在資產文件夾中。
你不能註釋掉loadvoyager,因爲它需要加載。否則你的頁面將被加載所有的時間,沒有迴應
來源
2015-04-14 10:28:55
Jim
任何人請嗎?我確定這裏沒什麼大不了的。它只是我可以省略的東西。 –
有什麼建議嗎? –
很確定你的行爲違背了他們的服務條款:http://www.softgames.de/privacy-terms/ - 如果他們想免費提供這些遊戲下載,他們會。在線和廣告支持是他們的商業模式。如果你想離線玩遊戲,可以購買一些可以離線玩的遊戲。 –