{"size": 7199, "ext": "js", "max_stars_repo_path": "babygo/js/index.min.js", "max_stars_repo_name": "nostarsnow/my-game", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "babygo/js/index.min.js", "max_issues_repo_name": "nostarsnow/my-game", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "babygo/js/index.min.js", "max_forks_repo_name": "nostarsnow/my-game", "max_forks_repo_forks_event_min_datetime": "2020-04-13T12:24:29.000Z", "max_forks_repo_forks_event_max_datetime": "2020-04-13T12:24:29.000Z"}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": 1, "avg_line_length": 7199.0, "max_line_length": 7199, "alphanum_fraction": 0.6960688985}
!function(){function e(){b.html("100%"),T.show(),y.removeClass("xl_loding_show"),ns.loadHide(),b.html("Loading..."),n()}function n(){u.clear(),main=new w.Container,u.addChild(main),TIME=0,timeGo=null,fallSpeed=2300,COINS=[],Man_now=0,SCORE=0,TIME=0,lastDeviceGet=0,ACTION=!1}function a(){t(),clearInterval(timeGo),w.Ticker.setFPS(60),w.Ticker.addEventListener("tick",s),timeGo=setInterval(function(){TIME++},1e3)}function t(){g=d.roadLr.width*p/d.roadLr.height,_.width=g,_.height=p,roadLr=new w.Shape,roadLr.graphics.bf(d.roadLr,"repeat-y",new w.Matrix2D(g/d.road.width,0,0,p/d.road.height,0,0)).dr(0,-p,g,2*p),road=new w.Bitmap(d.road),road.setTransform(0,0,g/d.road.width,p/d.road.height),man_set={bw:100,bh:148,regX:0,regY:0,w:.15*g,x:.5*g,y:.87*p,count:10,speed:.07},man_set.h=man_set.bh*man_set.w/man_set.bw,man_set.hw=.5*man_set.w,man_set.hh=.5*man_set.h,man_set.bottom=man_set.y+man_set.hh,man_set.top=man_set.y-man_set.hh,coin_set={bw:160,bh:160,regX:0,regY:0,w:.18*g,h:.18*g,countC:5,probability:.3},coin_set.hw=.5*coin_set.w,coin_set.hh=.5*coin_set.h,coin_set.rowH=2.5*coin_set.h,coin_set.col=parseInt(p/coin_set.rowH)+1,S_LEFT=.15*g,S_RIGHT=.85*g,man_anim=new w.SpriteSheet({images:[d.man],frames:{width:man_set.bw,height:man_set.bh,count:man_set.count,regX:man_set.regX,regY:man_set.regY},animations:{man0:[0,1,"man0",man_set.speed],man1:[2,3,"man1",man_set.speed],man2:[4,5,"man2",man_set.speed],man3:[6,7,"man3",man_set.speed],man4:[8,9,"man4",man_set.speed]}}),man=new w.Sprite(man_anim,"man"+Man_now),man.setTransform(man_set.x,man_set.y,man_set.w/man_set.bw,man_set.h/man_set.bh,0,0,0,.5*man_set.bw,.5*man_set.bh).framerate=30,man.maxL=S_LEFT+man_set.hw,man.maxR=S_RIGHT-man_set.hw,man.trs=.35*g/90,coinsContainer={coins1:new w.Container,coins2:new w.Container},scoreBg=new w.Shape,scoreBg.graphics.f("#24981d").s("#fff").rr(.17*g,10,.66*g,.1*p,7),scoreShow=new w.Text("0 m","1rem georgiab","#fff"),scoreShow.x=.5*g,scoreShow.y=10+.05*p,scoreShow.textAlign="center",scoreShow.textBaseline="middle",main.addChild(roadLr,road,coinsContainer.coins1,coinsContainer.coins2,scoreBg,scoreShow,man),window.DeviceMotionEvent?window.addEventListener("devicemotion",r,!1):alert("亲，你的浏览器不支持重力感应哟~")}function o(e,n){if(n){var a=coin_set.col-2;SCORE>5e3?(a+=3,fallSpeed=2e3):SCORE>3e3?fallSpeed=2500:SCORE>2e3?(Man_now=4,fallSpeed=3e3,a+=2):SCORE>1500?(Man_now=3,fallSpeed=3500):SCORE>1e3?(Man_now=2,fallSpeed=4e3,a+=1):SCORE>500&&(Man_now=1,fallSpeed=4500)}else var a=0;var t=0;man.gotoAndPlay("man"+Man_now),("coins2"==e||n)&&(t=-p),coinsContainer[e].removeAllChildren(),coinsContainer[e].y=t;for(var s=0;s<a;s++){var r=i(Man_now),c=g*Math.random(),m=coin_set.rowH*s;c<S_LEFT?c=S_LEFT:c>S_RIGHT-coin_set.w&&(c=S_RIGHT-coin_set.w);var l=s;r.x=c,r.y=m,"coins2"==e&&(l=coin_set.col+s),COINS[l]=r,coinsContainer[e].addChild(COINS[l])}n?w.Tween.get(coinsContainer[e]).to({y:p},2*fallSpeed).call(function(){o(e,!0)}):w.Tween.get(coinsContainer[e]).to({y:p},fallSpeed).call(function(){o(e,!0)})}function i(e){var n=Math.floor(Math.random()*coin_set.countC),a=new w.SpriteSheet({images:[d.coin],frames:[[coin_set.bw*n,coin_set.bh*e,coin_set.bw,coin_set.bh]],animations:{go:{frames:[0],next:null}}}),t=new w.Sprite(a,"go");return t.setTransform(0,0,coin_set.w/coin_set.bw,coin_set.h/coin_set.bh).framerate=30,t}function s(){u.update(),ACTION&&(scoreShow.text=++SCORE+" m");for(var e=0,n=COINS.length;e<n;e++)if(COINS[e]&&!COINS[e].geted){var a=COINS[e].y+COINS[e].parent.y;if(!COINS[e].geted&&a-man_set.bottom>0)return void c();collCheck.rect(COINS[e],man)&&(COINS[e].geted=!0,w.Tween.get(COINS[e]).to({x:.5*g,y:-COINS[e].parent.y,alpha:0},500,w.Ease.backIn))}}function r(e){var n=(new Date).getTime();if(n-lastDeviceGet>100){lastDeviceGet=n;var a=e.accelerationIncludingGravity,t=Math.round(a.x/9.81*-90);f&&(t*=-1);var o=man_set.x+t*man.trs;w.Tween.get(man).to({x:o},100,w.Ease.linear)}}function c(){ns.numberTo(M,SCORE,37),w.Ticker.removeAllEventListeners(),clearInterval(timeGo),O.removeClass("current"),L.addClass("current"),ns.numberTo(R,SCORE,37)}function m(){ns.load(),ns.ajax({action:"queryList",pageIndex:S,pageSize:v,active:active},function(e){if(ns.loadHide(),0==e.errcode){ns.ajaxLock=!1;var n=e.list,a=n.length,t="";if(a>0){S++;for(var o=0;o<a;o++)C++,t+='<li><span class="rank_num">'+C+'</span><span class="rank_name">'+n[o].name+'</span><span class="rank_score">'+(n[o].score||0)+"</span></li>";H.append(t)}else x=!0}})}function l(){O.removeClass("current"),k.addClass("current"),a(),man.y=.3*p}var d=[],h=function(e,n){var a=0,t=0;for(var o in e)t++;for(var o in e)/.mp3/.test(e[o])?(d[o]=new Audio(e[o]),d[o].load(),++a>=t&&n()):(d[o]=new Image,d[o].onload=function(){b.html((a/t*100).toFixed(2)+"%"),++a>=t&&n()},d[o].src=e[o])};ns.load();var _=document.getElementById("canvas"),g=$(window).width()>640?640:$(window).width(),p=$(window).height(),w=createjs,u=new w.Stage(_),f=navigator.userAgent.match(/iP(ad|hone|od)/i),S=1,v=50,C=0,x=!1,b=$("#xl_loading_p"),y=$("#xl_loading"),T=$("#main"),I=$("#btn_go"),O=$(".page"),E=$(".page1"),k=$(".page2"),L=$(".page3"),R=($(".page4"),$("#distance")),M=$("#time"),N=$("#btn_action"),G=$(".phone"),j=$(".btn_rank"),A=$("#btn_restart"),B=$("#rank"),H=B.find("ul");$("#myRank"),$("#myScore");window.onload=function(){h({road:"img/road.png",roadLr:"img/roadLr.png",man:"img/man.png",coin:"img/coin.png",buildingBg:"img/buildingBg.png",buildingOn:"img/buildingOn.png",car:"img/car.png"},e)},w.Touch.enable(u),I.on(click,function(){if(1==reged)return void l();$log({title:"让你的朋友知道你吧！",con:'<div class="tip">请输入您的真实姓名和手机号！</div><label class="in_ic40"><span class="l"><i class="fa fa-user"></i></span><span class="r"><input type="text" placeholder="请输入姓名" id="name" name="name" maxlength="12"/></span></label><label class="in_ic40"><span class="l"><i class="fa fa-mobile"></i></span><span class="r"><input type="tel" placeholder="请输入手机号码" id="tel" name="tel" maxlength="11"/></span></label>',go:function(){var e=$("#name").val(),n=$("#tel").val();return!!check.name(e)&&(!!check.tel(n)&&(load(),void $.ajax({type:check.ajaxType,url:check.ajaxUrl+"?xl="+Math.random().toFixed(3),data:{action:"reg",name:e,active:active,tel:n,openid:openid},dataType:check.ajaxDataType,success:function(a){0==a.errcode?(myName=e,myTel=n,reged=1,$tip("注册成功！"),location.href="index.html"):$tip(a.errmsg),load_h()},error:function(){load_h(),$tip(check.ajaxError)}})))}})}),N.on(click,function(){G.hide(),man.y=man_set.y,w.Tween.get(roadLr).to({y:0}).to({y:p},fallSpeed).loop=!0,man.on("pressmove",function(e){e.stageX<man.maxL?man.x=man.maxL:e.stageX>man.maxR?man.x=man.maxR:man.x=e.stageX,e.stageY>man_set.y?man.y=man_set.y:e.stageY<man_set.hh+40?man.y=man_set.hh+40:man.y=e.stageY}),SCORE=0,ACTION=!0,o("coins1"),o("coins2",!0)}),j.on(click,function(){return ns.tip("暂无排行！"),!1}),A.on(click,function(){SCORE>0||TIME>0?location.href="index.html":(O.removeClass("current"),E.addClass("current"))}),B.scroll(function(e){!x&&!ns.ajaxLock&&H.height()-B.height()-B.scrollTop()<20&&(ns.ajaxLock=!0,m())});var D=document.getElementById("bgmp3"),F=!1;$(document).on("touchstart",function(){F?D.play():!1!==D.paused&&(D.load(),F=!0,D.play()),$(document).unbind("touchstart")})}();