WeiWeiXinNet/Games/game7/word_poppers_data/gameFN.js

(完整代码) 6KB

function VectorlightGame(){this.browser="";this.deviceName="Web";this.pageID=-1;this.appID=-1;this.gameWidth=320;this.gameHeight=460;this.userID="";this.userIDDisplay="";this.instanceID="";this.useTouch=false;this.baseURL="";this.rootID="";this.tick=0;this.splashTimer=30;this.splashOpacity=0;this.serviceURL;this.loadScrollY=0;this.masUrl;this.wkTransPre="translate3d(";this.wkTransPost=",0)";this.useTimeout=false;this.interval=0;this.intervalRef=null;this.gameInit=function(e,t,n,r,i){this.gameInit2(e,t,n,r,i,false)};this.gameInit2=function(e,t,n,r,i,s){this.useTimeout=s;this.interval=i;if(i<20){this.splashTimer=2*60}else{this.splashTimer=2*30}if(navigator.userAgent.match(/FireFox/i)!=null){this.browser="FF"}else{switch(navigator.appName){case"Microsoft Internet Explorer":this.browser="IE";break;default:this.browser="WK";break}}this.pageID=t;this.deviceName=this.getDevice();this.rootID=e;this.gameWidth=n;this.gameHeight=r;if(this.deviceName!="Web"&&this.deviceName!="IEMobile"){this.useTouch=true}this.userID=this.dg("hidun").value;this.userIDDisplay=this.userID;if(this.userID==""){this.userIDDisplay="Guest"}this.setUrl();if(!this.useTimeout){setInterval(this.gameTick,i)}else{setTimeout(this.gameTick,i)}};this.gameInit3=function(e,t,n){this.root=$("#"+e);this.interval=n;if(navigator.userAgent.match(/FireFox/i)!=null){this.browser="FF"}else{switch(navigator.appName){case"Microsoft Internet Explorer":this.browser="IE";break;default:this.browser="WK";break}}this.pageID=t;this.deviceName=this.getDevice();this.rootID=e;this.setSize();if(this.deviceName!="Web"&&this.deviceName!="IEMobile"){this.useTouch=true}this.userID="";if(this.userID==""){this.userIDDisplay="Guest"}this.setUrl();this.intervalRef=setInterval(this.gameTick3,n)};this.cleanup=function(){clearInterval(this.intervalRef)};this.setSize=function(){this.gameWidth=$(window).width();this.gameHeight=$(window).height();this.root.attr("width",this.gameWidth);this.root.attr("height",this.gameHeight);$(".fullscreen").css("width",this.gameWidth+"px");$(".fullscreen").css("height",this.gameHeight+"px");$(".fullwidth").css("width",this.gameWidth+"px")};this.setUrl=function(){this.baseURL="";if(window.location.hostname=="localhost"){this.baseURL="http://localhost/snappy/"}else{this.baseURL="http://www.snappygames.com/"}this.serviceURL=this.baseURL+"solid.ashx";this.masUrl=this.baseURL+"magic.ashx"};this.gameTick=function(){var e=true;thisObj=vlx;if(thisObj.splashTimer>0){if(thisObj.useTouch){window.scrollTo(0,thisObj.loadScrollY)}thisObj.splashTimer--;if(thisObj.splashTimer==0){thisObj.hd("splashContainer")}else{thisObj.dg("loadingProgress").innerHTML="Loading 100%";thisObj.dg("splash").style.opacity=thisObj.splashOpacity;thisObj.splashOpacity+=.05;if(thisObj.splashOpacity>1){thisObj.splashOpacity=1;thisObj.sh(thisObj.rootID)}e=false}}if(e){gameLoop()}if(thisObj.useTimeout){setTimeout(thisObj.gameTick,thisObj.interval)}this.tick++};this.gameTick3=function(){gameLoop();this.tick++};this.pad=function(e,t){var n=""+e;while(n.length<t){n="0"+n}return n};this.dce=function(e,t){var n=document.createElement(e);n.className=t;return n};this.dg=function(e){return document.getElementById(e)};this.hd=function(e){this.dg(e).style.display="none"};this.sh=function(e){this.dg(e).style.display="block"};this.aTS=function(e,t){this.dg(e).addEventListener("touchstart",t,false)};this.aTE=function(e,t){this.dg(e).addEventListener("touchend",t,false)};this.uIP=function(e){var t=(e.x|0)+"px,"+(e.y|0)+"px";e.style.webkitTransform=this.wkTransPre+t+this.wkTransPost;e.style.MozTransform="translate("+t+")";e.style.msTransform=e.style.MozTransform};this.getDevice=function(){var e="Web";if(navigator.userAgent.match(/iPad/i)!=null){e="iPad"}else if(navigator.userAgent.match(/iPod/i)!=null){e="iPod"}else if(navigator.userAgent.match(/iPhone/i)!=null){e="iPhone"}else if(navigator.userAgent.match(/Android/i)!=null){e="Android";this.wkTransPre="translate(";this.wkTransPost=")"}else if(navigator.userAgent.match(/IEMobile/i)!=null){e="IEMobile"}return e};this.ArrayRemove=function(e,t){var n=this.ArrayIndexOf(e,t);if(n>=0){e.splice(n,1)}};this.ArrayContains=function(e,t){if(this.ArrayIndexOf(e,t)>=0){return true}else{return false}};this.ArrayIndexOf=function(e,t){var n=-1;var r;for(r=0;r<e.length;r++){if(e[r]==t){n=r;break}}return n};this.recordHighscore=function(e,t){try{if(this.userID!=""&&e>0){var n=e;var r=Math.floor(e*this.userID.length*5/8);var i=this.serviceURL+"?ph=1&gid="+this.pageID+"&u="+encodeURIComponent(this.userID)+"&s="+e+"&k="+r+"&l="+t;$.get(i,function(e,t){this.readHighscores(e)},"html")}}catch(s){}};this.recordBestTime=function(e,t){try{if(this.userID!=""&&e>0){var n=Math.floor(e*this.userID.length*5/8);var r=this.serviceURL+"?pt=1&gid="+this.pageID+"&u="+encodeURIComponent(this.userID)+"&s="+e+"&k="+n+"&l="+t;$.get(r,function(e,t){this.readHighscores(e)},"html")}}catch(i){}};this.rG=function(){this.recordGamePlay()};this.recordGamePlay=function(){var t=this.getUserId();if(t!=null){var n=_aid<<3;$.ajax({type:"POST",url:this.masUrl,data:"c=g&uid="+t+"&aid="+n,success:function(t){e=$(t).find("act").text()}})}};var e=0;this.readHighscores=function(e){try{highscores=new Array;$(e).find("s").each(function(){var e=new Highscore($(this).attr("user"),$(this).attr("score"),$(this).attr("level"));highscores.push(e)});drawHighscores()}catch(t){}};this.readBestLevelHighscores=function(e){try{bestLevelScores=new Array;$(e).find("s").each(function(){var e=new Highscore($(this).attr("user"),$(this).attr("score"),$(this).attr("level"));bestLevelScores[e.level]=e})}catch(t){}};this.readBestUserHighscores=function(e){try{bestUserScores=new Array;$(e).find("s").each(function(){var e=new Highscore($(this).attr("user"),$(this).attr("score"),$(this).attr("level"));bestUserScores[e.level]=e})}catch(t){}};this.sA=function(e,t){this.saveAchievement(e,t)};this.saveAchievement=function(t,n){var r=this.getUserId();var i=this.getUsername();if(i==null){i=""}if(r!=null){var s=Math.floor(n*r.length*5/8);$.ajax({type:"POST",url:this.masUrl,data:"c=b&uid="+r+"&tid="+t+"&v="+n+"&k="+s+"&un="+encodeURIComponent(i)+"&a="+e})}};this.getUserId=function(){return window.localStorage["mas-uid"]};this.getUsername=function(){return window.localStorage["mas-un"]};this.getUserPic=function(){return window.localStorage["mas-up"]};this.setUsername=function(e){window.localStorage["mas-un"]=e};this.isUserGuest=function(e){if(window.localStorage["mas-t"]!=null){if(window.localStorage["mas-t"]>>0!=1){return true}}return false};this.gA=function(e,t,n){this.getBestAchievement(e,t,n)};this.getBestAchievement=function(e,t,n){$.ajax({type:"POST",url:"Magic.ashx",data:"c=z&tid="+e,success:function(e){var r=$(e).find("un").text();var i=$(e).find("sc").text();if(t!=null){document.getElementById(t).innerHTML=r}if(n!=null){document.getElementById(n).innerHTML=i}}})}}function Highscore(e,t,n){this.user=e;this.score=t;this.level=n}

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。