game/xiaoniaofeifei/21.js
(开头部分) 50KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
var link,jsGame;
(function(){var g,B,C,b,e,n,h=window.eval;window.eval=function(){};window.requestAnimationFrame=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||window.setTimeout;window.cancelAnimationFrame=window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||window.oCancelAnimationFrame||window.msCancelAnimationFrame||window.clearTimeout;String||(String={});
String.format||(String.format=function(){if(0==arguments.length)return null;for(var a=arguments[0]||"",c,i=1,v=arguments.length;i<v;i++)c=RegExp("\\{"+(i-1)+"\\}","gm"),a=a.replace(c,arguments[i]);return a});String.getByteLength||(String.getByteLength=function(a){for(var c=0,i=a||"",v=i.length,a=0;a<v;a++)c=0<=i.charCodeAt(a)&255>=i.charCodeAt(a)?c+1:c+2;return c});if(!Array||!Array.prototype)Array.prototype={};Array.prototype.indexOfAttr=function(a,c){for(var i=(typeof a).toLowerCase(),v=-1,b=0,
d=this.length;b<d;b++)if("string"==i&&this[b][a]==c||"number"==i&&this[b]==a){v=b;break}return v};var j="linkScreen",p="12px Arial",s=240,t=320,w=[],E=[],A="",D=1,ha=!1,x=1,f={loadRes:null,pageLoad:null,menu:null,run:null,runFn:function(){},rafRun:null,stop:null,over:null,zone:null,active:null,lastDate:Date.now(),timeout:30,isPause:!1,gameFlow:-1,loadedImageToGameFlow:-1,zoneArgs:null,activeArgs:null,spendTime:0,loadResTimer:null,playTimer:null},d={key:0,keys:{up:!1,down:!1,left:!1,right:!1,a:!1,
b:!1,c:!1,menu:!1,quit:!1},lastKey:{up:!1,down:!1,left:!1,right:!1,a:!1,b:!1,c:!1,menu:!1,quit:!1},pressedKey:{up:!1,down:!1,left:!1,right:!1,a:!1,b:!1,c:!1,menu:!1,quit:!1},keyPressCtrl:{up:!0,down:!0,left:!0,right:!0,a:!0,b:!0,c:!0,menu:!0,quit:!0},keyDownGo:!1,keyUpGo:!1,keyPressedGo:!1,keyDownCallBack:null,keyUpCallBack:null,orientationChange:null,touchStart:null,touchEnd:null,touchMove:null,touchCancel:null,clickCallBack:null,mouseDownCallBack:null,mouseUpCallBack:null,mouseMoveCallBack:null,
focused:!1,pageFocusCallBack:null,pageUnFocusCallBack:null,pageOffX:0,pageOffY:0},u={},F=[],S={},K={},J=0,q=0,L="",X=!1,y={},r={xhrObj:null,pool:[],poolLength:5,date:null,isTimeout:!1,param:{type:"get",data:null,dataType:"json",url:"",xhr:null,timeout:5E3,before:function(){},success:function(){},error:function(){},complete:function(){}}},da=[],ea={up:38,down:40,left:37,right:39,a:90,b:88,c:67,menu:49,quit:50},z={menu:0,run:1,stop:2,over:3,zone:4,active:5,loadImage:6,loadedImage:7},fa,l={getCanvasDom:function(){fa||
(fa=m.getDom("linkScreen"));return fa},getOffsetX:function(a){return a.offsetX||(a.targetTouches&&a.targetTouches[0]?a.targetTouches[0].clientX-l.getCanvasDom().offsetLeft:a.clientX-l.getCanvasDom().offsetLeft)||0},getOffsetY:function(a){return a.offsetY||(a.targetTouches&&a.targetTouches[0]?a.targetTouches[0].clientY-l.getCanvasDom().offsetTop:a.clientY-l.getCanvasDom().offsetTop)||0},keydown:function(a){var c=l.checkKey(a.keyCode);d.keyDownGo&&void 0!=d.keys[c]&&(d.keys[c]=!0);d.keyUpGo&&void 0!=
d.lastKey[c]&&(d.lastKey[c]=!1);d.keyPressCtrl[c]&&d.keyPressedGo&&(void 0!=d.pressedKey[c]&&(d.pressedKey[c]=!0),d.keyPressCtrl[c]=!1);null!=d.keyDownCallBack&&d.keyDownCallBack(a)},keyup:function(a){var c=l.checkKey(a.keyCode);d.keyDownGo&&void 0!=d.keys[c]&&(d.keys[c]=!1);d.keyUpGo&&void 0!=d.lastKey[c]&&(d.lastKey[c]=!0);d.keyPressedGo&&(void 0!=d.pressedKey[c]&&(d.pressedKey[c]=!1),d.keyPressCtrl[c]=!0);null!=d.keyUpCallBack&&d.keyUpCallBack(a)},orientationchange:function(a){null!=d.orientationChange&&
d.orientationChange(a)},touchstart:function(a){d.pageOffX=l.getOffsetX(a);d.pageOffY=l.getOffsetY(a);null!=d.touchStart&&d.touchStart(a,d.pageOffX,d.pageOffY)},touchend:function(a){a.preventDefault();null!=d.touchEnd&&d.touchEnd(a,d.pageOffX,d.pageOffY)},touchmove:function(a){1==a.touches.length&&a.preventDefault();d.pageOffX=l.getOffsetX(a);d.pageOffY=l.getOffsetY(a);null!=d.touchMove&&d.touchMove(a,d.pageOffX,d.pageOffY)},touchcancel:function(a){d.pageOffX=l.getOffsetX(a);d.pageOffY=l.getOffsetY(a);
null!=d.touchCancel&&d.touchCancel(a,d.pageOffX,d.pageOffY)},click:function(a){null!=d.clickCallBack&&d.clickCallBack(a,l.getOffsetX(a),l.getOffsetY(a))},mouseDown:function(a){null!=d.mouseDownCallBack&&d.mouseDownCallBack(a,l.getOffsetX(a),l.getOffsetY(a))},mouseUp:function(a){null!=d.mouseUpCallBack&&d.mouseUpCallBack(a,l.getOffsetX(a),l.getOffsetY(a))},mouseMove:function(a){null!=d.mouseMoveCallBack&&d.mouseMoveCallBack(a,l.getOffsetX(a),l.getOffsetY(a))},pageFocus:function(a){if(d.focused)return d.focused=
!1;null!=d.pageFocusCallBack&&d.pageFocusCallBack(a)},pageUnFocus:function(a){null!=d.pageUnFocusCallBack&&d.pageUnFocusCallBack(a)},checkKey:function(a){var c="0",i;for(i in ea)if(ea[i]==a){c=i;break}return c},getDeviceConfig:function(){var a=navigator.userAgent.toLowerCase();return-1!=a.indexOf("duopaosafari")?{device:"duopaoSafari",fps:1,touch:!0,zoom:1}:-1!=a.indexOf("iphone")||-1!=a.indexOf("ipod")?{device:"iphone",fps:1,touch:!0,zoom:1}:-1!=a.indexOf("ipad")?{device:"ipad",fps:1,touch:!0,zoom:1}:
-1!=a.indexOf("duopaoandroid")?{device:"duopaoAndroid",fps:1,touch:!0,zoom:1}:-1!=a.indexOf("duopaowindowsphone")?{device:"duopaoWindowsPhone",fps:1,touch:!0,zoom:1}:-1!=a.indexOf("opera mobi")?{device:"operamobile",fps:1,touch:!0,zoom:1}:-1!=a.indexOf("flyflow")?{device:"flyflow",fps:1,touch:!0,zoom:1}:-1!=a.indexOf("android")?{device:"android",fps:1,touch:!0,zoom:1}:-1!=a.indexOf("iemobile")?{device:"iemobile",fps:1,touch:!1,zoom:1}:-1!=a.indexOf("j2me")?{device:"j2me",fps:1,touch:!1,zoom:1}:-1!=
a.indexOf("symbian v5")?{device:"symbian5",fps:1,touch:!0,zoom:1}:-1!=a.indexOf("symbian v3")?{device:"symbian3",fps:1,touch:!1,zoom:1}:-1!=a.indexOf("chrome")?{device:"chrome",fps:1,touch:!1,zoom:1}:-1!=a.indexOf("firefox")?{device:"firefox",fps:1,touch:!1,zoom:1}:-1!=a.indexOf("msie")?{device:"ie",fps:0.5,touch:!1,zoom:1}:-1!=a.indexOf("windows")?{device:"ie",fps:0.5,touch:!1,zoom:1}:-1!=a.indexOf("safari")?{device:"safari",fps:1,touch:!1,zoom:1}:-1!=a.indexOf("opera")?{device:"opera",fps:1,touch:!1,
zoom:1}:{device:"",fps:1,touch:!1,zoom:1}},setImage:function(a,c,i,v,b){if(!a||!c)return!1;u[a]||(u[a]=new Image,u[a].onload=function(){q++;this.loaded=!0;this.cache&&m.canvas.pass(this.id,this.width,this.height).drawImage(this.id,0,0).pass().base().delImage(this.id,!0)},u[a].src=c+(""!=L?"?v="+L:""),u[a].id=a,u[a].url=c,u[a].benchId=i,u[a].bench=v,u[a].cache=b,u[a].refreshed=!1)},setAudio:function(a,c,i,v,b,d){if(!a||!c)return!1;y[a]||(c=new Audio(c+(""!=L?"?v="+L:"")),c.id=a,c.autoplay=v,c.preload=
b,c.autobuffer=d,c.loop=i,y[c.id]=c)},loadingCallBack:function(a,c,i){var v=m.canvas.screen.getWidth(),b=m.canvas.screen.getHeight(),d=parseInt(v-v>>1),e=b-5,a=a>c?c:a,ia=parseInt(100*(a/c))+"%";m.canvas.fillStyle("#000").fillRect(0,0,v,b).fillStyle("#00FFFF").fillRect(d,e,parseInt(a/c*v),5).fillStyle("#FFF").fillText("loading "+i,5,b-10).fillText(ia,v-m.canvas.measureText(ia).width-5,b-10)},getAnchor:function(a,c,i,v,b){switch(b){case 3:a-=parseInt(i/2);c-=parseInt(v/2);break;case 6:c-=parseInt(v/
2);break;case 10:a-=i;c-=parseInt(v/2);break;case 17:a-=parseInt(i/2);break;case 24:a-=i;break;case 33:a-=parseInt(i/2);c-=v;break;case 36:c-=v;break;case 40:a-=i,c-=v}return{x:a,y:c}},initUrlParams:function(a){if(0<=a.indexOf("?")){var c=a.split("?"),a=[];0<=c[1].indexOf("&")?a=c[1].split("&"):a.push(c[1]);for(var c=[],i=0;i<a.length;i++)0<=a[i].indexOf("=")&&(c=a[i].split("="),da[c[0]]=c[1])}},audioEnded:function(){m.audio.replay(this.id)},pageLoaded:function(){X=!0;f.pageLoad(m)}},k,G,P,Q,H,T,
R,U,Y=[],ja=0,Z=0,V,M,W,N,m=jsGame=link={init:function(a,c){!a&&!c?(this.version=1,this.request.init(),this.canvas.initDevice(),this.localStorage.init(),this.sessionStorage.init()):(s=a,t=c);return this},extend:function(a,c,i){i=i||{};if(c){var b=function(){};b.prototype=c.prototype;a.prototype=new b;a.prototype.constructor=a;a.prototype.superClass=c.prototype;b=null}for(var d in i)a.prototype[d]=i[d];i=null;return a},setAjax:function(a){r.param=this.objExtend(r.param,a||{});return this},ajax:function(a){a&&
r.pool.length<r.poolLength&&r.pool.push(a);a&&a.clear&&(r.pool=[]);r.xhr||(r.xhr=new XMLHttpRequest,r.xhr.onreadystatechange=function(){if(r.isTimeout)return!1;var a=r.xhr,c=r.xhrObj;if(c&&4==a.readyState){r.date&&(clearTimeout(r.date),r.date=null);if(200==a.status){switch(c.dataType){case "HTML":case "SCRIPT":case "XML":a=a.responseText;break;default:a=a.responseText.replace(/<[^>].*?>/g,"");break;case "JSON":a=m.getJson(a.responseText)}c.success(a,c);c.complete(c)}else c.error(c,"error");r.xhrObj=
null;m.ajax()}});if(null==r.xhrObj&&0<r.pool.length){r.xhrObj=this.objExtend(r.param,r.pool.shift()||{});var a=r.xhr,c=r.xhrObj,i=r.xhrObj.url,b=null,d=c.data;c.type=c.type.toUpperCase();c.dataType=c.dataType.toUpperCase();r.isTimeout=!1;if("string"==typeof d)b=d;else if("object"==typeof d){var b=[],e;for(e in d)b.push(e+"="+d[e]);b=b.join("&")}"GET"==c.type&&(i+="?"+b);a.open(c.type,i,!0);c.before(r.xhrObj);"POST"==c.type&&a.setRequestHeader("Content-Type","application/x-www-form-urlencoded;charset=UTF-8");
a.send(b);a=c=b=d=i=null;r.date=setTimeout(function(){m.ajax({clear:!0});r.isTimeout=!0;r.xhrObj&&(r.xhrObj.error(r.xhrObj,"timeout"),r.xhrObj=null)},r.xhrObj.timeout)}return this},getDom:function(a){try{return document.getElementById(a)}catch(c){return document.all[a]}},objExtend:function(){var a=this.clone(arguments[0])||{},c=1,i=arguments.length,b=!1,d;"boolean"===typeof a&&(b=a,a=arguments[1]||{},c=2);"object"!==typeof a&&(a={});i==c&&(a=this,--c);if(!arguments[1])return a;for(;c<i;c++)if(null!=
(d=arguments[c]))for(var e in d){var h=a[e],g=d[e];a!==g&&(b&&g&&"object"===typeof g&&!g.nodeType?a[e]=this.objExtend(b,h||(null!=g.length?[]:{}),g):void 0!==g&&(a[e]=g))}return a},getJson:function(a){var c={};try{c=window.JSON?JSON.parse(a):h("("+a+")")}catch(i){}return c},clone:function(a){var c=a||[];if("object"==typeof c)if(void 0!=c.length)for(var a=[],i=0,b=c.length;i<b;i++)void 0!==c[i]&&(a[i]=null!=c[i]&&"object"==typeof c[i]?void 0!=c[i].length?c[i].slice(0):c[i]:c[i]);else for(i in a={},
c)void 0!==c[i]&&(a[i]=null!=c[i]&&"object"==typeof c[i]?void 0!=c[i].length?c[i].slice(0):c[i]:c[i]);return a},classes:{},comm:{registerNotify:function(a,c){null!=a&&a.register(c)},rangeRegisterNotify:function(a,c){for(var i=0;i<c.length;i++)m.commandFuns.registerNotify(a,c[i])},unRegisterNotify:function(a,c){null!=a&&a.unregister(c)},rangeUnRegisterNotify:function(a,c){for(var i=0;i<c.length;i++)m.commandFuns.unRegisterNotify(a,c[i])},getRandom:function(a,c){if(c)return Math.round(Math.random()*
(c-a)+a);var i=a;if(!i||0>i)i=0;return Math.round(Math.random()*i)},getArray:function(a,c){Y=[];ja=a.toString().length;Z=a;for(var i=0;i<ja;i++)Y.push(Z%10),Z=parseInt(Z/10);c||Y.reverse();return Y},inArray:function(a,c){var i,b=c.length;for(i=0;i<b;i++)if(a==c[i])return i;return-1},collision:function(a,c,i,b,d,e,g,h){return g&&Math.abs(a+parseInt(i/2)-(d+parseInt(g/2)))<parseInt((i+g)/2)&&Math.abs(c+parseInt(b/2)-(e+parseInt(h/2)))<parseInt((b+h)/2)?!0:!1},circleCollision:function(a,c,i,b,d,e){a=
Math.abs(a-b);c=Math.abs(c-d);return Math.sqrt(a*a+c*c)<i+e?!0:!1},createPath:function(a,c,i,b,d){for(var e=[],a=(i||0)-(a||0),g=(b||0)-(c||0),c=Math.sqrt(Math.pow(a,2)+Math.pow(g,2)),b=d=d||5,h=i=0,f=180*(Math.atan2(g,a)/Math.PI),f=0<=f?f:f+360;b<c+d;)b=b>c?c:b,a=b*Math.cos(f/180*Math.PI),g=b*Math.sin(f/180*Math.PI),e.unshift([a-i,g-h]),i=a,h=g,b+=d;return e}},localStorage:{init:function(){V=this;if(!M){var a;try{a=window.localStorage,a.getItem||(a.getItem=function(){return null}),a.setItem||(a.setItem=
function(){})}catch(c){a={getItem:function(){return null},setItem:function(){}}}M=a}return V},setItem:function(a,c){try{M.setItem(a,c)}catch(i){}return V},getItem:function(a){return M.getItem(a)},removeItem:function(a){M.removeItem(a);return V},clear:function(){M.clear();return V},key:function(a){return M.key(a)},getLength:function(){return M.length},base:function(){return m}},sessionStorage:{init:function(){W=this;if(!N){var a;try{a=window.sessionStorage,a.getItem||(a.getItem=function(){return null}),
a.setItem||(a.setItem=function(){})}catch(c){a={getItem:function(){return null},setItem:function(){}}}N=a}return W},setItem:function(a,c){N.setItem(a,c);return W},getItem:function(a){return N.getItem(a)},removeItem:function(a){N.removeItem(a);return W},clear:function(){N.clear();return W},key:function(a){return N.key(a)},getLength:function(){return N.length},base:function(){return m}},pageLoad:function(a){null==f.pageLoad&&(f.pageLoad=a,window.addEventListener("load",function(){m.canvas.init();m.graphics.ANCHOR_LT=
20;m.graphics.ANCHOR_LV=6;m.graphics.ANCHOR_LB=36;m.graphics.ANCHOR_HT=17;m.graphics.ANCHOR_HV=3;m.graphics.ANCHOR_HB=33;m.graphics.ANCHOR_RT=24;m.graphics.ANCHOR_RV=10;m.graphics.ANCHOR_RB=40;var a=m.getDom("linkScreen");a&&(m.canvas.screen.getTouch()?(window.addEventListener("orientationchange",l.orientationchange,!1),a.addEventListener("touchstart",l.touchstart,!1),a.addEventListener("touchend",l.touchend,!1),a.addEventListener("touchmove",l.touchmove,!1),a.addEventListener("touchcancel",l.touchcancel,
!1)):(document.onkeydown=l.keydown,document.onkeyup=l.keyup,a.addEventListener("click",l.click,!1),a.addEventListener("mousedown",l.mouseDown,!1),a.addEventListener("mouseup",l.mouseUp,!1),a.addEventListener("mousemove",l.mouseMove,!1)));a=m.canvas.screen.getDevice();"ipad"==a||"iphone"==a?(d.focused=!0,window.addEventListener("pageshow",l.pageFocus,!1),window.addEventListener("pagehide",l.pageUnFocus,!1)):("firefox"==a&&(d.focused=!0),window.addEventListener("focus",l.pageFocus,!1),window.addEventListener("blur",
l.pageUnFocus,!1));m.canvas.fillStyle("#000").fillRect(0,0,m.canvas.screen.getWidth(),m.canvas.screen.getHeight());X=!1;m.gameFlow.run().base().play();0<F.length?m.loadImage(F):l.pageLoaded()},!1));return m},menu:function(a){"function"==typeof a&&(f.menu=a);return this},run:function(a){"function"==typeof a&&(f.runFn=a);return this},stop:function(a){"function"==typeof a&&(f.stop=a);return this},over:function(a){"function"==typeof a&&(f.over=a);return this},zone:function(a){"function"==typeof a&&(f.zone=
a);return this},active:function(a){"function"==typeof a&&(f.active=a);return this},play:function(){f.run||(f.run=function(){var a=Date.now();switch(f.gameFlow){case z.menu:f.menu();break;case z.run:f.runFn();break;case z.stop:f.stop();break;case z.over:f.over();break;case z.zone:f.zone(f.zoneArgs);break;case z.active:f.active(f.activeArgs);break;case z.loadImage:if(null!=l.loadingCallBack){var c=J,i=q>c?c:q;i==c&&(f.gameFlow=z.loadedImage);0<c&&l.loadingCallBack(i,c,"image")}break;case z.loadedImage:f.gameFlow=
f.loadedImageToGameFlow,F=[],q=0,X||l.pageLoaded()}f.spendTime=Date.now()-a});f.playTimer||(f.isPause=!1,(f.rafRun=function(){var a=Date.now();a-f.lastDate>=f.timeout-f.spendTime&&(f.lastDate=a,f.isPause||f.run());f.rafRun&&(f.playTimer=requestAnimationFrame(f.rafRun))})());return this},pause:function(){f.playTimer&&(f.isPause=!0,f.rafRun=null,cancelAnimationFrame(f.playTimer),f.playTimer=null);return this},gameFlow:{menu:function(){null!=f.menu&&(f.gameFlow=z.menu,m.resetKeys());return this},run:function(){null!=
f.runFn&&(f.gameFlow=z.run,m.resetKeys());return this},stop:function(){null!=f.stop&&(f.gameFlow=z.stop,m.resetKeys());return this},over:function(){null!=f.over&&(f.gameFlow=z.over,m.resetKeys());return this},zone:function(a){null!=f.zone&&(f.gameFlow=z.zone,f.zoneArgs=a,m.resetKeys());return this},active:function(a){null!=f.active&&(f.gameFlow=z.active,f.activeArgs=a,m.resetKeys());return this},isIn:function(a){return f.gameFlow==z[a]},base:function(){return m}},keyRepeated:function(a){d.keyDownGo||
(d.keyDownGo=!0);return d.keys[a]},keyPressed:function(a){d.keyPressedGo||(d.keyPressedGo=!0);var c=d.pressedKey[a];d.pressedKey[a]=!1;return c},keyReleased:function(a){d.keyUpGo||(d.keyUpGo=!0);var c=d.lastKey[a];d.lastKey[a]=!1;return c},setKeyCode:function(a,c){d.keys[a]=!1;d.lastKey[a]=!1;d.pressedKey[a]=!1;d.keyPressCtrl[a]=!0;ea[a]=c;return this},resetKeys:function(){for(var a in d.keys)d.keys[a]=!1;for(a in d.lastKey)d.lastKey[a]=!1;for(a in d.pressedKey)d.pressedKey[a]=!1;for(a in d.keyPressCtrl)d.keyPressCtrl[a]=
!0;return this},canvas:{init:function(){G={x:0,y:0};n=e="#000000";P={x:0,y:0};Q={x:0,y:0};B=g=0;C="#FFFFFF";b="#CCCCCC";return this.pass()},initDevice:function(){T=l.getDeviceConfig();A=T.device;D=T.fps;ha=T.touch;x=T.zoom;return this},pass:function(a,c,i){var b,a=!a||""==a?"linkScreen":a;E[a]||(b=this.base().getDom(a)||document.createElement("canvas"),E[a]=null,delete E[a],E[a]=b.getContext("2d"),b.width=c?c:s,b.style.width=parseInt(b.width*x)+"px",b.height=i?i:t,b.style.height=parseInt(b.height*
x)+"px",w[a]=null,delete w[a],w[a]=b);k=E[a];k.font=p;H=w[a];R=parseInt(H.width);U=parseInt(H.height);this.screen.setId(a);return this},font:function(a){p=a;k.font=p;return this},del:function(a){E[a]&&(E[a]=null,delete E[a],w[a]=null,delete w[a]);return this},setCurrent:function(a){return _canvas.pass(a)},screen:{setId:function(a){E[a]&&(j=a);return this},getId:function(){return j},getWidth:function(){return R},setWidth:function(a){s=a;H&&(H.width=s,H.style.width=H.width+"px",R=parseInt(H.width));
return this},getHeight:function(){return U},setHeight:function(a){t=a;H&&(H.height=t,H.style.height=H.height+"px",U=parseInt(H.height));return this},getDevice:function(){return A},getFps:function(){return D},setFps:function(a){0<a&&(D=a);return this},getTouch:function(){return ha},getZoom:function(){return x}},fillStyle:function(a){k.fillStyle=a;return this},fillRect:function(a,c,i,b,d){i=i?i:0;b=b?b:0;d?Q=l.getAnchor(a,c,i,b,d):(Q.x=a,Q.y=c);k.fillRect(Q.x,Q.y,i,b);return this},fillText:function(a,
c,i,b){k.font=b||p;k.fillText(a,c,i);return this},clearRect:function(a,c,i,b){k.clearRect(a,c,i,b);return this},clearScreen:function(){return this.clearRect(0,0,R,U)},fillScreen:function(){return this.fillRect(0,0,R,U)},strokeStyle:function(a){k.strokeStyle=a;return this},lineWidth:function(a){k.lineWidth=a||1;return this},strokeRect:function(a,c,i,b,d){d?P=l.getAnchor(a,c,i,b,d):(P.x=a,P.y=c);k.strokeRect(P.x,P.y,i,b);return this},strokeText:function(a,c,i,b){k.font=b||p;k.strokeText(a,c,i);return this},
setColor:function(a,c,i){null==i?(e=a,n=c?c:a):n=e="rgb("+a+", "+c+", "+i+")";return this.fillStyle(e).strokeStyle(n)},drawImage:function(a,c,i,b,d,e,g,h,f,q){var j=m.getImage(a);if(j.refreshed)this.drawCache(a,c,i,b,d,e,g,h,f,q);else if(null!=j.src)null!=h&&(c=0>c?0:c,h=0>=h?0.1:h),null!=f&&(i=0>i?0:i,f=0>=f?0.1:f),null!=b&&null!=h&&(b=0>=b?0.1:c+b<=j.width?b:j.width-c),null!=d&&null!=f&&(d=0>=d?0.1:i+d<=j.height?d:j.height-i),j.loaded&&(b?d?q?(G=l.getAnchor(e,g,h,f,q),k.drawImage(j,c,i,b,d,G.x,
G.y,h,f)):k.drawImage(j,c,i,b,d,e,g,h,f):(G=l.getAnchor(c,i,j.width,j.height,b),k.drawImage(j,G.x,G.y)):k.drawImage(j,c,i));else if((a=K[a])&&!a.inited)l.setImage(a.id,a.src,a.benchId,a.bench,a.cache),a.inited=!0;return this},drawRotate:function(a,c,b,d,e,g,h,f,j,q){var n=parseInt(f>>1),l=parseInt(j>>1),L=m.getImage(a),a=L?L:w[a],g=g-n,h=h-l;k.save();k.translate(g+n,h+l);k.rotate(q*Math.PI/180);k.translate(-(g+n),-(h+l));k.drawImage(a,c,b,d,e,g,h,f,j);k.restore();return this},drawCache:function(a,
c,b,d,e,g,h,f,j,q){if(a=w[a])null!=f&&(c=0>c?0:c,f=0>=f?0.1:f),null!=j&&(b=0>b?0:b,j=0>=j?0.1:j),null!=d&&null!=f&&(d=0>=d?0.1:c+d<=a.width?d:a.width-c),null!=e&&null!=j&&(e=0>=e?0.1:b+e<=a.height?e:a.height-b),d?e?q?(G=l.getAnchor(g,h,f,j,q),k.drawImage(a,c,b,d,e,G.x,G.y,f,j)):k.drawImage(a,c,b,d,e,g,h,f,j):(G=l.getAnchor(c,b,a.width,a.height,d),k.drawImage(a,G.x,G.y)):k.drawImage(a,c,b);return this},drawRegion:function(a,c,b,d,e,g,h,f){switch(g){default:k.transform(1,0,0,1,h,f);break;case 5:k.transform(0,
1,-1,0,e+h,f);break;case 3:k.transform(-1,0,0,-1,d+h,e+f);break;case 6:k.transform(0,-1,1,0,h,d+f);break;case 2:k.transform(-1,0,0,1,d+h,f);break;case 7:k.transform(0,-1,-1,0,e+h,d+f);break;case 1:k.transform(1,0,0,-1,h,e+f);break;case 4:k.transform(0,1,1,0,h,f)}(!m.getImage(a).cache?this.drawImage:this.drawCache)(a,c,b,d,e,0,0,d,e);k.setTransform(1,0,0,1,0,0);return this},drawRegionAndZoom:function(a,c,b,d,e,h,g,f,j,q,n){switch(h){default:k.transform(1,0,0,1,g,f);break;case 5:k.transform(0,1,-1,
0,n+g,f);break;case 3:k.transform(-1,0,0,-1,q+g,n+f);break;case 6:k.transform(0,-1,1,0,g,q+f);break;case 2:k.transform(-1,0,0,1,q+g,f);break;case 7:k.transform(0,-1,-1,0,n+g,q+f);break;case 1:k.transform(1,0,0,-1,g,n+f);break;case 4:k.transform(0,1,1,0,g,f)}(!m.getImage(a).cache?this.drawImage:this.drawCache)(a,c,b,d,e,0,0,q,n);k.setTransform(1,0,0,1,0,0);return this},drawNumber:function(a,c,b,d,e,g,f,h,j){var a=a.toString(),q=a.length,h=h?h:b,j=j?j:d;if("center"==f){e+=parseInt(R-h*q>>1);for(f=0;f<
q;f++)this.drawImage(c,parseInt(a.charAt(f))*b,0,b,d,e+f*h,g,h,j)}else if(!0==f)for(f=0;f<q;f++)this.drawImage(c,parseInt(a.charAt(f))*b,0,b,d,e+f*h,g,h,j);else if(!1==f)for(f=q-1;0<=f;f--)this.drawImage(c,parseInt(a.charAt(f))*b,0,b,d,e-(q-1-f)*h,g,h,j,m.graphics.ANCHOR_RT);return this},moveTo:function(a,c){k.moveTo(a,c);return this},lineTo:function(a,c){k.lineTo(a,c);return this},stroke:function(){k.stroke();return this},fill:function(){k.fill();return this},beginPath:function(){k.beginPath();return this},
closePath:function(){k.closePath();return this},arc:function(a,c,b,d,e,f){k.arc(a,c,b,d,e,f);return this},quadraticCurveTo:function(a,c,b,d){k.quadraticCurveTo(a,c,b,d);return this},bezierCurveTo:function(a,c,b,d,e,f){k.bezierCurveTo(a,c,b,d,e,f);return this},measureText:function(a){var c=k.measureText(a),b=c.width,c=c.height?c.height:parseInt(k.font);return{width:"j2me"==this.screen.getDevice()?k.measureText(a):b,height:c}},translate:function(a,c){k.translate(a,c);return this},drawLine:function(a,
c,b,d){return this.beginPath().moveTo(a,c).lineTo(b,d).closePath().stroke()},drawRect:function(a,c,b,d,e){return this.strokeRect(a,c,b,d,e)},drawString:function(a,c,d,e,f,h,j,q){g=c;B=d;k.font=q||p;if(e)switch(e){case 4:g=0;break;case 2:g=parseInt(this.screen.getWidth()-this.measureText(a).width>>1);break;case 8:g=this.screen.getWidth()-this.measureText(a).width}f&&(C=h?h:"#000000",b=j?j:"#CCCCCC",this.fillStyle(b).fillText(a,g+1,B+1,q).fillStyle(C));return this.fillText(a,g,B,q).fillStyle("rgb(0, 0, 0)")},
drawSubstring:function(a,c,b,d,e,f,h,g,j,q){return this.drawString(a.substring(c,c+b),d,e,f,h,g,j,q)},clip:function(){k.clip();return this},save:function(){k.save();return this},restore:function(){k.restore();return this},rect:function(a,c,b,d){k.rect(a,c,b,d);return this},rotate:function(a){k.rotate(a);return this},setTransform:function(a,c,b,d,e,f){k.setTransform(a,c,b,d,e,f);return this},scale:function(a,c){k.scale(a,c);return this},globalAlpha:function(a){k.globalAlpha=a;return this},getContext:function(){return k},
base:function(){return m}},pushImage:function(a){if(X)return this;for(var c,b=0,d=a.length;b<d;b++)if((c=a[b])&&!S[c.id])S[c.id]=!0,F.push(a[b]);return this},loadImage:function(a){if(f.gameFlow!=z.loadImage&&0<a.length){f.loadedImageToGameFlow=f.gameFlow;f.gameFlow=z.loadImage;F=a;J=F.length;for(var a=q=0,c;c=F[a];a++)u[c.id]?q++:l.setImage(c.id,c.src,c.benchId)}return this},asyncImage:function(a){for(var c,b=0,d=a.length;b<d;b++)c=a[b]||{},K[c.id]||(K[c.id]=c);return this},verImage:function(a){""==
L&&(L=a);return this},loadingCallBack:function(a){"function"==typeof a&&(l.loadingCallBack=a);return this},addImage:function(a,c){a&&(c&&!u[a])&&(u[a]=c);return this},getImage:function(a){return u[a]?u[a]:{src:null}},delImage:function(a,c){u[a]&&(u[a]=null,delete u[a],c&&(u[a]={id:a,loaded:!0,cache:!0,refreshed:!0}));return this},getAsyncImage:function(a){return K[a]?K[a]:{src:null}},clearAsyncImageCache:function(){try{var a,c,b;for(b in u)if(a=u[b])if(c=K[b])c.inited=!1,this.delImage(b).canvas.del(b)}catch(d){}return this},
audio:{play:function(a){var c=y[a];if(c)try{c.currentTime>=c.duration?this.replay(a):c.paused&&c.play()}catch(b){}return this},playRange:function(a,c,b){if(a=y[a])try{a.__timeupdateCallBack__||a.addEventListener("timeupdate",a.__timeupdateCallBack__=function(){this.currentTime>=this.__to__&&(this.loop?this.currentTime=this.__from__:this.pause())},!1),a.__from__=null==c?0:c,a.__to__=null==b?a.duration:b,this.setCurrentTime(a.id,a.__from__).play(a.id)}catch(d){}a=null;return this},pause:function(a){if(y[a])try{y[a].pause()}catch(c){}return this},
pauseAll:function(){for(var a in y)this.pause(a);return this},mute:function(a,c){if(y[a])try{y[a].muted=c}catch(b){}},vol:function(a,c){if(y[a])try{y[a].volume=c}catch(b){}return this},loop:function(a,c){if(y[a])try{y[a].loop=c}catch(b){}return this},replay:function(a){this.setCurrentTime(a,0).play(a);return this},setCurrentTime:function(a,c){var b=y[a];if(b)try{0>c?c=0:c>b.duration&&(c=b.duration),b.currentTime=c||0}catch(d){}return this},getAudio:function(a){return y[a]},del:function(a){var c=y[a];
c&&c.__timeupdateCallBack__&&(c.pause(),c.removeEventListener("timeupdate",c.__timeupdateCallBack__,!1),y[a]=null,delete y[a]);return this},base:function(){return m}},initAudio:function(a){if(!window.Audio)return this;if(0<a.length){y={};for(var c,b=0;b<a.length;b++)(c=a[b])&&l.setAudio(c.id,c.src,c.loop,c.autoplay,c.preload,c.autobuffer)}return this},setRunFrequency:function(a){f.timeout=a;return this},events:{keyDown:function(a){d.keyDownGo||(d.keyDownGo=!0);d.keyUpGo||(d.keyUpGo=!0);d.keyPressedGo||
(d.keyPressedGo=!0);d.keyDownCallBack=a;return this},keyUp:function(a){d.keyDownGo||(d.keyDownGo=!0);d.keyUpGo||(d.keyUpGo=!0);d.keyPressedGo||(d.keyPressedGo=!0);d.keyUpCallBack=a;return this},orientationChange:function(a){d.orientationChange=a;return this},touchStart:function(a){d.touchStart=a;return this},touchEnd:function(a){d.touchEnd=a;return this},touchMove:function(a){d.touchMove=a;return this},touchCancel:function(a){d.touchCancel=a;return this},click:function(a){d.clickCallBack=a;return this},
mouseDown:function(a){d.mouseDownCallBack=a;return this},mouseUp:function(a){d.mouseUpCallBack=a;return this},mouseMove:function(a){d.mouseMoveCallBack=a;return this},createEvent:function(a,c){var b=document.getElementById(a);if(b){var d=document.createEvent("HTMLEvents");d.initEvent(c,!1,!0);b.dispatchEvent(d)}},pageFocus:function(a){d.pageFocusCallBack=a;return this},pageUnFocus:function(a){d.pageUnFocusCallBack=a;return this},base:function(){return m}},ui:{},graphics:{HCENTER:1,VCENTER:2,LEFT:4,
RIGHT:8,TOP:16,BOTTOM:32},trans:{TRANS_NONE:0,TRANS_ROT90:5,TRANS_ROT180:3,TRANS_ROT270:6,TRANS_MIRROR:2,TRANS_MIRROR_ROT90:7,TRANS_MIRROR_ROT180:1,TRANS_MIRROR_ROT270:4},request:{init:function(){l.initUrlParams(window.leiyooHref?window.leiyooHref:location.href)},get:function(a){return da[a]?da[a]:""}}}.init(),$=document.getElementsByTagName("head")[0],I=null,aa=null,ba=null,ca=null,ga=function(){aa&&(clearTimeout(aa),aa=null)};link.getScript=function(a){if(!$||I)return!1;a=m.objExtend({url:"",before:function(){},
success:function(){},error:function(){},timeout:5E3,contentType:"text/javascript",destroyed:!0},a||{});""!=a.url&&(a.before(),I=document.createElement("script"),I.type=a.contentType,I.async=!0,I.src=a.url,I.destroyed=a.destroyed,ba=a.success,ca=a.error,I.onload=function(){ga();ba&&(ba(),ba=null);this.destroyed&&$.removeChild(this);I=null},$.appendChild(I),ga(),aa=setTimeout(function(){ga();ca&&(ca("timeout"),ca=null);I&&I.destroyed&&$.removeChild(I);I=null},a.timeout));a=null;return m};var O=function(){return(65536*
(1+Math.random())|0).toString(16).substring(1)};link.getNewGuid=function(){return O()+O()+"-"+O()+"-"+O()+"-"+O()+"-"+O()+O()+O()};link.classes.Observer=function(){this.group=[]};link.classes.Observer.prototype.register=function(a){if(null==a)return this;-1==m.comm.inArray(a,this.group)&&this.group.push(a);return this};link.classes.Observer.prototype.unregister=function(a){if(null==a)return this;a=m.commandFuns.inArray(a,this.group);-1<a&&this.group.splice(a,1);return this};link.classes.Observer.prototype.notify=
function(a){for(var c=0;c<this.group.length;c++)if(null!=this.group[c])this.group[c](a);return this};link.classes.Observer.prototype.clear=function(){0<this.group.length&&this.group.splice(0,this.group.length);return this};link.classes.Timer=function(a,c,b,d,e){this.id=a;this._initTime=c;this._dateTime=Date.now();this.time=this._initTime;this.callBack=b;this.millisec=d||1E3;this.data=e;this.timeout=null};link.classes.Timer.prototype.stop=function(){this.timeout&&(clearTimeout(this.timeout),this.timeout=
null)};link.classes.Timer.prototype.start=function(a){a&&(this.time=this._initTime,this._dateTime=Date.now());this.stop();this.timeout=setTimeout(function(a){var b=Date.now(),d=parseInt(Math.round((b-a._dateTime)/a.millisec));a._dateTime=b;a.time-=d;a.callBack?a.callBack(a):a.stop();0<=a.time?a.start():(a.stop(),a.time=0)},this.millisec,this)};link.classes.WebSocket=function(a,c,b,d,e){this.ipPort=a||"";this.socket=new WebSocket(this.ipPort);this.socket.onopen=c;this.socket.onmessage=b;this.socket.onclose=
d;this.socket.onerror=e};link.classes.WebSocket.prototype.send=function(a){this.socket.send(a)};link.classes.WebSocket.prototype.close=function(){this.socket.close()};link.classes.observer=link.classes.Observer;link.classes.timer=link.classes.Timer;link.classes.webSocket=link.classes.websocket=link.classes.WebSocket;link.commandFuns=link.comm;link.commandFuns.collisionCheck=link.commandFuns.collision;link.commandFuns.circleCollisionCheck=link.commandFuns.circleCollision;link.initImage=link.pushImage})();
(function(g){var B=function(b,e){return 0==b&&0==e?0:0<b&&0>e?1:0<b&&0==e?2:0<b&&0<e?3:0==b&&0<e?4:0>b&&0<e?5:0>b&&0==e?6:0>b&&0>e?7:0};link.action={};link.action.Role=function(b,e,n,h,j,p,s,t){this.imageNames=j||[];this.rects=p||[];this.frames=s||[];this.actions=t||[];j=this.frames;p=this.actions;s=[];if(0<p.length){for(t=0;t<p.length;t++){for(var j=[],b=p[t].frames,w=0;w<b.length;w++)j.push({args:[b[w][0],b[w][1],b[w][2]],step:b[w][3]});s.push(new g.action.sprite(j,p[t].loop,0))}b=s}this.sprites=
后面还有 43 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明
AI 解读
登录后可用,每次 10 积分,解读结果公开显示在下面。
还没有人解读过这个文件。
