├── README.md ├── css ├── common.css └── reset.min.css ├── fla ├── assets.fla └── loading.fla ├── game.js ├── game.json ├── images ├── 1.png ├── 2.png ├── 3.png ├── Bitmap1.png ├── Bitmap1bb.png ├── Bitmap1bbb.png ├── Bitmap1bbbb.png ├── Bitmap1ggg.png ├── Bitmap2.png ├── _1.png ├── _2.png ├── _3.png ├── backBtn.png ├── box1.png ├── box2.png ├── car0001.png ├── car0005.png ├── car0015.png ├── checheche.png ├── ci.png ├── endViewPic.jpg ├── go.png ├── huodui.png ├── jiasuqiu2.png ├── jiaxuqiu1.png ├── jiayouzhan.png ├── jiazaiyewenzi.png ├── jzyBG2.jpg ├── lunzi1.png ├── map.jpg ├── mutong.png ├── nextGameBtnpic.png ├── noLoginBtn.png ├── replayBtn.png ├── returnHomeBtnpic.png ├── sd_00000.png ├── sd_00004.png ├── sd_00008.png ├── sd_00012.png ├── select.jpg ├── shareBtn.png ├── sharemask.png ├── soulLoginBtn.png ├── startGameBtn.png ├── startViewPic.jpg ├── ui1assets.png ├── ui2assets.png ├── ui3assets.png ├── weixin.jpg └── yingzi.png ├── js ├── WXGraphics.js ├── WXLoader.js ├── WXStageGL.js ├── assets.js ├── createjs-1.0-wx.js ├── createjs-2015-wx.js ├── createjs-wx-touch.js ├── libs │ ├── symbol.js │ └── weapp-adapter.js ├── main.js ├── service.js ├── sound.js └── view.js ├── project.config.json ├── sounds ├── _11.mp3 ├── _33.mp3 ├── addSpeedSound.mp3 ├── bgm.mp3 ├── box.mp3 ├── diciSound.mp3 ├── huoSound.mp3 └── mutongSound.mp3 └── 更新文档.txt /README.md: -------------------------------------------------------------------------------- 1 | # createjs-wx 2 | 在createjs的源代码基础上,进行的二次封装,可以支持微信小游戏。 3 | 4 | 重点代码是:WXLoader.js createjs-1.0-wx.js createjs-2015-wx.js createjs-wx-touch.js 5 | 6 | fla里是资源文件,也就是说封装好的createjs是支持animateCC导出的文件的,但是需要小修一下,大家可以对比一下我做的修改。 7 | 8 | 除了开源,为了给大家快速理解,我还用微信小游戏版本的代码重写了之前的赛车游戏,内部注释掉的是以前的写法,大家可以做做对比。 9 | 10 | 因为对自己的es6没有信心,本人暂时没有用es6的方式封装,要es6版本的可以去群里找maksim大神。 11 | 12 | 再补充一点,由于微信的计时单位跟我们平时不一样,所以在使用tween这种需要输入时间参数的api,需要在时间参数上除以1000,也就是:原时间/1000 13 | 14 | 后续修复: 15 | 16 | 由于安卓兼容问题,使用setStrokeStyle需要导入新文件,并如下写代码(坑爹的腾讯安卓ctx.miterLimit接口不支持字符串化的数字): 17 | 18 | var g = new WXGraphics(); 19 | var shape = new createjs.Shape(g); 20 | shape.graphics.setStrokeStyle(3); 21 | shape.graphics.beginStroke("#F00"); 22 | shape.graphics.drawRect(0,0,200,200); 23 | stage.addChild(shape); 24 | 由于安卓兼容问题,使用stagegl需要导入新文件,并初始化新的类文件 25 | 26 | stage = new WXStageGL(canvas); 27 | -------------------------------------------------------------------------------- /css/common.css: -------------------------------------------------------------------------------- 1 | html,body{width:100%;height:100%;} 2 | #maskMain{display:none;position:absolute;top:0;left:0;width:100%;height:100%;background:linear-gradient(top,#482405,#2b1402);background:-webkit-linear-gradient(top,#482405,#2b1402);background:-moz-linear-gradient(top,#482405,#2b1402);background:-o-linear-gradient(top,#482405,#2b1402);} 3 | .rankmain{position:relative;width:13.65rem;height:14.3rem;padding-top:6.15rem;background:url(../images/mainbg.png) no-repeat;background-size:100% 100%;margin:0 auto;margin-top:0.4rem;} 4 | .weekBest{display:block;position:absolute;top:1.825rem;left:9.05rem;width:3.8rem;height:1.65rem;line-height:1.64rem;color:#fff;font-size:0.95rem;font-family:'SimHei';text-align:center;} 5 | .rankBox{width:11.85rem;height:13.4rem;margin-left:0.75rem;} 6 | 7 | .rankBox-hd ul{width:11.85rem;height:1.4rem;overflow:hidden;} 8 | .rankBox-hd li{float:left;position:relative;width:100%;height:1.025rem;border-bottom:0.125rem solid #f1bb55;background:#9a938d;border-top-right-radius:0.4rem;border-top-left-radius:0.4rem;line-height:1.12rem;font-size:0.74rem;font-family:'SimHei';color:#fff;text-align:center;} 9 | .arrow-down{display:none;position:absolute;top:1.12rem;left:50%;margin-left:-0.14rem;width:0;height:0;border-left:0.28rem solid transparent;border-right:0.28rem solid transparent;border-top:0.28rem solid #f1bb55;} 10 | .rankBox-hd li.on{background:#f1bb55;} 11 | .rankBox-hd li.on .arrow-down{display:block;} 12 | .freshen{display:block;width:9.5rem;height:0.55rem;line-height:0.55rem;font-family:'SimHei';text-align:center;background:#dcd5c6;border-radius:0.4rem;margin:0 auto;margin-top:0.12rem;font-size:0.35rem;} 13 | 14 | .rankBox-bd{width:11.85rem;height:10.25rem;overflow-y:auto;} 15 | .ranklist{width:10.15rem;margin:0 auto;padding-bottom:0.4rem;} 16 | .ranklist li{overflow:hidden;width:100%;height:2.2rem;border-bottom:0.05rem solid #d6c6a1;} 17 | .ranklist em{float:left;width:1.5rem;height:2.2rem;color:#46423f;line-height:2.2rem;text-align:center;font-size:0.75rem;font-family:'Microsoft YaHei';} 18 | .ranklist li:nth-child(1) em{background:url(../images/1.png) no-repeat center center;background-size:1.15rem 1.2rem;text-indent:9999px;} 19 | .ranklist li:nth-child(2) em{background:url(../images/2.png) no-repeat center center;background-size:1.15rem 1.2rem;text-indent:9999px;} 20 | .ranklist li:nth-child(3) em{background:url(../images/3.png) no-repeat center center;background-size:1.15rem 1.2rem;text-indent:9999px;} 21 | .ranklist img{float:left;width:1.75rem;height:1.75rem;border-radius:0.25rem;border:0.1rem solid #f39a05;margin-top:0.125rem;} 22 | .ranklist .namebox{float:right;height:2.2rem;width:6rem;font-size:0.65rem;font-family:'SimHei';color:#696562;} 23 | .ranklist .namebox p{width:6rem;height:1.1rem;line-height:1.3rem;} 24 | .ranklist .namebox span{display:block;line-height:0.8rem;color:#ca5108;} 25 | 26 | .myrank{width:11.75rem;height:1.05rem;margin:0 auto;margin-top:0.1rem;background:#ffc048;border-radius:0.4rem;font-family:'SimHei';text-align:center;line-height:0.8rem;font-size:0.525rem;color:#1c1d28;} 27 | .myrankcon{overflow:hidden;display:inline-block;margin:0 auto;} 28 | .myrank span{float:left;line-height:1.05rem;} 29 | .myrank em{float:left;font-size:0.825rem;line-height:1.05rem;color:#1c1d28;} 30 | 31 | .btnRankBox{width:12.95rem;height:1.65rem;margin:0 auto;margin-top:0.84rem;overflow:hidden;} 32 | .btnRankBox a{width:5.05rem;height:1.65rem;} 33 | .btnRankBox a.backRankBtn{float:left;display:none;background:url(../images/backBtn.png) no-repeat; background-size:contain;} 34 | .btnRankBox a.replayRankBtn{float:left;display:none;background:url(../images/replayBtn.png) no-repeat; background-size:contain;} 35 | .btnRankBox a.shareRankBtn{float:right;background:url(../images/shareBtn.png) no-repeat; background-size:contain;} 36 | 37 | .sharemask{display:none;position:absolute;top:0;left:0;width:100%;height:100%;background:url(../images/sharemask.png) no-repeat center top;background-size:contain;background-color:rgba(0,0,0,0.77); filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr="#c4000000", EndColorStr="#c4000000"); zoom:1;} 38 | :root .sharemask{filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr="c4000000",EndColorStr="c4000000"); } 39 | 40 | .testbtn{width:2.5rem;height:1rem;font-size:0.6rem;} 41 | 42 | .endView{background: url(../images/endViewPic.jpg) no-repeat center;position: absolute;top: 0;z-index: 1000;width:750px;height: 1206px;display: none} 43 | .endView .title{font-size: 79px;display: block;color: #000000;text-align: center;margin: 520px auto 0;width: 556px;height: 108px;line-height: 80px;} 44 | .endView .gx{font-size:35px;;display: block;color: #5D5045;text-align: center;margin:-20px auto 0;width: 556px;height: 37px;line-height: 20px;letter-spacing:60px} 45 | .endView .pop-content{width: 556px;height: 110px;font-size: 25px;margin:10px auto 0;text-align: center;color: #5D5045} 46 | .endView .pop-bottom{width: 250px;margin:-30px auto 0;font-size: 25px;} 47 | .endView .pop-bottom .code{width: 180px;text-align: center;display: inline-block} 48 | .endView .pop-bottom .copy{padding-left: 20px;text-decoration: none;cursor: pointer} 49 | .endView .resetBtn{width: 293px;height: 96px;margin: 50px auto 0;cursor: pointer} 50 | .endView .shareBtn{width: 293px;height: 96px;margin: 25px auto 0;cursor: pointer} 51 | .endView .listBtn{width: 293px;height: 96px;margin: 25px auto 0;cursor: pointer} 52 | -------------------------------------------------------------------------------- /css/reset.min.css: -------------------------------------------------------------------------------- 1 | @charset "utf-8"; 2 | body,h1,h2,h3,h4,h5,h6,hr,p,blockquote,dl,dt,dd,ul,ol,li,pre,form,fieldset,legend,button,input,textarea,th,td{margin:0;padding:0;} 3 | body,button,input,select,textarea{font:12px/1.5 tahoma, arial, \5b8b\4f53, sans-serif;} 4 | h1,h2,h3,h4,h5,h6{font-size:100%;} 5 | address,cite,dfn,em,var{font-style:normal;} 6 | code,kbd,pre,samp{font-family:courier new, courier, monospace;} 7 | small{font-size:12px;} 8 | body{color:#666;} 9 | ul,ol{list-style:none;} 10 | a{text-decoration:none;} 11 | a:hover{text-decoration:none;} 12 | sup{vertical-align:text-top;} 13 | sub{vertical-align:text-bottom;} 14 | legend{color:#000;} 15 | fieldset,img{border:0;} 16 | img{-ms-interpolation-mode:bicubic;} 17 | button,input,select,textarea{font-size:100%;} 18 | table{border-collapse:collapse;border-spacing:0;} 19 | input[type="button"],input[type="submit"],select,button{cursor:pointer;} 20 | article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section,summary,time,mark,audio,video{display:block;margin:0;padding:0;} 21 | .p5{padding:5px;} 22 | .p10{padding:10px;} 23 | .p15{padding:15px;} 24 | .p20{padding:20px;} 25 | .pt5{padding-top:5px;} 26 | .pt10{padding-top:10px;} 27 | .pt15{padding-top:15px;} 28 | .pt20{padding-top:20px;} 29 | .pb5{padding-bottom:5px;} 30 | .pb10{padding-bottom:10px;} 31 | .pb15{padding-bottom:15px;} 32 | .pb20{padding-bottom:20px;} 33 | .pl5{padding-left:5px;} 34 | .pl10{padding-left:10px;} 35 | .pl15{padding-left:15px;} 36 | .pl20{padding-left:20px;} 37 | .pr5{padding-right:5px;} 38 | .pr10{padding-right:10px;} 39 | .pr15{padding-right:15px;} 40 | .pr20{padding-right:20px;} 41 | .mauto{margin-left:auto; margin-right:auto;} 42 | .m5{margin:5px;} 43 | .m10{margin:10px;} 44 | .m15{margin:15px;} 45 | .m20{margin:20px;} 46 | .mt5{margin-top:5px;} 47 | .mt10{margin-top:10px;} 48 | .mt15{margin-top:15px;} 49 | .mt20{margin-top:20px;} 50 | .mt30{margin-top:30px;} 51 | .mt40{margin-top:40px;} 52 | .mt50{margin-top:50px;} 53 | .mb5{margin-bottom:5px;} 54 | .mb10{margin-bottom:10px;} 55 | .mb15{margin-bottom:15px;} 56 | .mb20{margin-bottom:20px;} 57 | .ml5{margin-left:5px;} 58 | .ml10{margin-left:10px;} 59 | .ml15{margin-left:15px;} 60 | .ml20{margin-left:20px;} 61 | .mr5{margin-right:5px;} 62 | .mr10{margin-right:10px;} 63 | .mr15{margin-right:15px;} 64 | .mr20{margin-right:20px;} 65 | .clearfix:after{content:"."; display:block; height:0; clear:both; visibility:hidden;} 66 | .clearfix{display:inline-block;} 67 | * html .clearfix{height:1%;} 68 | .clearfix{display:block;} 69 | .clr{clear:both; height:0; line-height:0; font-size:0;} 70 | .none{display:none;} 71 | .hidden{visibility:hidden;} 72 | .visible{visibility:visible;} 73 | .fleft{float:left;} 74 | .fright{float:right;} 75 | .relative{position:relative;} 76 | .absolute{position:absolute;} 77 | .nonline:hover,.nonline a:hover{text-decoration:none;} 78 | .ellipsis{overflow:hidden;white-space:nowrap;-o-text-overflow:ellipsis;text-overflow:ellipsis;_width: 100%;} 79 | -------------------------------------------------------------------------------- /fla/assets.fla: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajex-china/createjs-wx/5653a19caf3e93d652e1ad9e514f74bd0a358ed7/fla/assets.fla -------------------------------------------------------------------------------- /fla/loading.fla: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajex-china/createjs-wx/5653a19caf3e93d652e1ad9e514f74bd0a358ed7/fla/loading.fla -------------------------------------------------------------------------------- /game.js: -------------------------------------------------------------------------------- 1 | import './js/libs/weapp-adapter' 2 | import './js/libs/symbol' 3 | 4 | // import './js/createjs-2015-wx' 5 | import './js/createjs-1.0-wx' 6 | import './js/WXGraphics' 7 | import './js/WXStageGL' 8 | import './js/WXLoader' 9 | import './js/assets' 10 | import './js/sound' 11 | import './js/service' 12 | import './js/view' 13 | import './js/createjs-wx-touch' 14 | import './js/main' 15 | -------------------------------------------------------------------------------- /game.json: -------------------------------------------------------------------------------- 1 | { 2 | "deviceOrientation": "portrait" 3 | } 4 | -------------------------------------------------------------------------------- /images/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajex-china/createjs-wx/5653a19caf3e93d652e1ad9e514f74bd0a358ed7/images/1.png -------------------------------------------------------------------------------- /images/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajex-china/createjs-wx/5653a19caf3e93d652e1ad9e514f74bd0a358ed7/images/2.png -------------------------------------------------------------------------------- /images/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajex-china/createjs-wx/5653a19caf3e93d652e1ad9e514f74bd0a358ed7/images/3.png -------------------------------------------------------------------------------- /images/Bitmap1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajex-china/createjs-wx/5653a19caf3e93d652e1ad9e514f74bd0a358ed7/images/Bitmap1.png -------------------------------------------------------------------------------- /images/Bitmap1bb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajex-china/createjs-wx/5653a19caf3e93d652e1ad9e514f74bd0a358ed7/images/Bitmap1bb.png -------------------------------------------------------------------------------- /images/Bitmap1bbb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajex-china/createjs-wx/5653a19caf3e93d652e1ad9e514f74bd0a358ed7/images/Bitmap1bbb.png -------------------------------------------------------------------------------- /images/Bitmap1bbbb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajex-china/createjs-wx/5653a19caf3e93d652e1ad9e514f74bd0a358ed7/images/Bitmap1bbbb.png -------------------------------------------------------------------------------- /images/Bitmap1ggg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajex-china/createjs-wx/5653a19caf3e93d652e1ad9e514f74bd0a358ed7/images/Bitmap1ggg.png -------------------------------------------------------------------------------- /images/Bitmap2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajex-china/createjs-wx/5653a19caf3e93d652e1ad9e514f74bd0a358ed7/images/Bitmap2.png -------------------------------------------------------------------------------- /images/_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajex-china/createjs-wx/5653a19caf3e93d652e1ad9e514f74bd0a358ed7/images/_1.png -------------------------------------------------------------------------------- /images/_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajex-china/createjs-wx/5653a19caf3e93d652e1ad9e514f74bd0a358ed7/images/_2.png -------------------------------------------------------------------------------- /images/_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajex-china/createjs-wx/5653a19caf3e93d652e1ad9e514f74bd0a358ed7/images/_3.png -------------------------------------------------------------------------------- /images/backBtn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajex-china/createjs-wx/5653a19caf3e93d652e1ad9e514f74bd0a358ed7/images/backBtn.png -------------------------------------------------------------------------------- /images/box1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajex-china/createjs-wx/5653a19caf3e93d652e1ad9e514f74bd0a358ed7/images/box1.png -------------------------------------------------------------------------------- /images/box2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajex-china/createjs-wx/5653a19caf3e93d652e1ad9e514f74bd0a358ed7/images/box2.png -------------------------------------------------------------------------------- /images/car0001.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajex-china/createjs-wx/5653a19caf3e93d652e1ad9e514f74bd0a358ed7/images/car0001.png -------------------------------------------------------------------------------- /images/car0005.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajex-china/createjs-wx/5653a19caf3e93d652e1ad9e514f74bd0a358ed7/images/car0005.png -------------------------------------------------------------------------------- /images/car0015.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajex-china/createjs-wx/5653a19caf3e93d652e1ad9e514f74bd0a358ed7/images/car0015.png -------------------------------------------------------------------------------- /images/checheche.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajex-china/createjs-wx/5653a19caf3e93d652e1ad9e514f74bd0a358ed7/images/checheche.png -------------------------------------------------------------------------------- /images/ci.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajex-china/createjs-wx/5653a19caf3e93d652e1ad9e514f74bd0a358ed7/images/ci.png -------------------------------------------------------------------------------- /images/endViewPic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajex-china/createjs-wx/5653a19caf3e93d652e1ad9e514f74bd0a358ed7/images/endViewPic.jpg -------------------------------------------------------------------------------- /images/go.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajex-china/createjs-wx/5653a19caf3e93d652e1ad9e514f74bd0a358ed7/images/go.png -------------------------------------------------------------------------------- /images/huodui.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajex-china/createjs-wx/5653a19caf3e93d652e1ad9e514f74bd0a358ed7/images/huodui.png -------------------------------------------------------------------------------- /images/jiasuqiu2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajex-china/createjs-wx/5653a19caf3e93d652e1ad9e514f74bd0a358ed7/images/jiasuqiu2.png -------------------------------------------------------------------------------- /images/jiaxuqiu1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajex-china/createjs-wx/5653a19caf3e93d652e1ad9e514f74bd0a358ed7/images/jiaxuqiu1.png -------------------------------------------------------------------------------- /images/jiayouzhan.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajex-china/createjs-wx/5653a19caf3e93d652e1ad9e514f74bd0a358ed7/images/jiayouzhan.png -------------------------------------------------------------------------------- /images/jiazaiyewenzi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajex-china/createjs-wx/5653a19caf3e93d652e1ad9e514f74bd0a358ed7/images/jiazaiyewenzi.png -------------------------------------------------------------------------------- /images/jzyBG2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajex-china/createjs-wx/5653a19caf3e93d652e1ad9e514f74bd0a358ed7/images/jzyBG2.jpg -------------------------------------------------------------------------------- /images/lunzi1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajex-china/createjs-wx/5653a19caf3e93d652e1ad9e514f74bd0a358ed7/images/lunzi1.png -------------------------------------------------------------------------------- /images/map.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajex-china/createjs-wx/5653a19caf3e93d652e1ad9e514f74bd0a358ed7/images/map.jpg -------------------------------------------------------------------------------- /images/mutong.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajex-china/createjs-wx/5653a19caf3e93d652e1ad9e514f74bd0a358ed7/images/mutong.png -------------------------------------------------------------------------------- /images/nextGameBtnpic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajex-china/createjs-wx/5653a19caf3e93d652e1ad9e514f74bd0a358ed7/images/nextGameBtnpic.png -------------------------------------------------------------------------------- /images/noLoginBtn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajex-china/createjs-wx/5653a19caf3e93d652e1ad9e514f74bd0a358ed7/images/noLoginBtn.png -------------------------------------------------------------------------------- /images/replayBtn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajex-china/createjs-wx/5653a19caf3e93d652e1ad9e514f74bd0a358ed7/images/replayBtn.png -------------------------------------------------------------------------------- /images/returnHomeBtnpic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajex-china/createjs-wx/5653a19caf3e93d652e1ad9e514f74bd0a358ed7/images/returnHomeBtnpic.png -------------------------------------------------------------------------------- /images/sd_00000.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajex-china/createjs-wx/5653a19caf3e93d652e1ad9e514f74bd0a358ed7/images/sd_00000.png -------------------------------------------------------------------------------- /images/sd_00004.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajex-china/createjs-wx/5653a19caf3e93d652e1ad9e514f74bd0a358ed7/images/sd_00004.png -------------------------------------------------------------------------------- /images/sd_00008.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajex-china/createjs-wx/5653a19caf3e93d652e1ad9e514f74bd0a358ed7/images/sd_00008.png -------------------------------------------------------------------------------- /images/sd_00012.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajex-china/createjs-wx/5653a19caf3e93d652e1ad9e514f74bd0a358ed7/images/sd_00012.png -------------------------------------------------------------------------------- /images/select.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajex-china/createjs-wx/5653a19caf3e93d652e1ad9e514f74bd0a358ed7/images/select.jpg -------------------------------------------------------------------------------- /images/shareBtn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajex-china/createjs-wx/5653a19caf3e93d652e1ad9e514f74bd0a358ed7/images/shareBtn.png -------------------------------------------------------------------------------- /images/sharemask.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajex-china/createjs-wx/5653a19caf3e93d652e1ad9e514f74bd0a358ed7/images/sharemask.png -------------------------------------------------------------------------------- /images/soulLoginBtn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajex-china/createjs-wx/5653a19caf3e93d652e1ad9e514f74bd0a358ed7/images/soulLoginBtn.png -------------------------------------------------------------------------------- /images/startGameBtn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajex-china/createjs-wx/5653a19caf3e93d652e1ad9e514f74bd0a358ed7/images/startGameBtn.png -------------------------------------------------------------------------------- /images/startViewPic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajex-china/createjs-wx/5653a19caf3e93d652e1ad9e514f74bd0a358ed7/images/startViewPic.jpg -------------------------------------------------------------------------------- /images/ui1assets.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajex-china/createjs-wx/5653a19caf3e93d652e1ad9e514f74bd0a358ed7/images/ui1assets.png -------------------------------------------------------------------------------- /images/ui2assets.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajex-china/createjs-wx/5653a19caf3e93d652e1ad9e514f74bd0a358ed7/images/ui2assets.png -------------------------------------------------------------------------------- /images/ui3assets.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajex-china/createjs-wx/5653a19caf3e93d652e1ad9e514f74bd0a358ed7/images/ui3assets.png -------------------------------------------------------------------------------- /images/weixin.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajex-china/createjs-wx/5653a19caf3e93d652e1ad9e514f74bd0a358ed7/images/weixin.jpg -------------------------------------------------------------------------------- /images/yingzi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajex-china/createjs-wx/5653a19caf3e93d652e1ad9e514f74bd0a358ed7/images/yingzi.png -------------------------------------------------------------------------------- /js/WXGraphics.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by ajex from http://www.ajexoop.com 3 | * versions 0.0.2 4 | */ 5 | export default class WXGraphics extends createjs.Graphics { 6 | constructor() { 7 | super() 8 | } 9 | setStrokeStyle = function (thickness, caps, joints, miterLimit, ignoreScale) { 10 | this._updateInstructions(true); 11 | this._strokeStyle = this.command = new WXGraphics.StrokeStyle(thickness, caps, joints, miterLimit, ignoreScale); 12 | 13 | // ignoreScale lives on Stroke, not StrokeStyle, so we do a little trickery: 14 | if (this._stroke) { this._stroke.ignoreScale = ignoreScale; } 15 | this._strokeIgnoreScale = ignoreScale; 16 | return this; 17 | }; 18 | } 19 | var G = WXGraphics; 20 | var p = (G.StrokeStyle = function (width, caps, joints, miterLimit, ignoreScale) { 21 | this.width = width; 22 | this.caps = caps; 23 | this.joints = joints; 24 | this.miterLimit = miterLimit; 25 | this.ignoreScale = ignoreScale; 26 | }).prototype; 27 | p.exec = function (ctx) { 28 | ctx.lineWidth = (this.width == null ? "1" : this.width); 29 | ctx.lineCap = (this.caps == null ? "butt" : (isNaN(this.caps) ? this.caps : WXGraphics.STROKE_CAPS_MAP[this.caps])); 30 | ctx.lineJoin = (this.joints == null ? "miter" : (isNaN(this.joints) ? this.joints : WXGraphics.STROKE_JOINTS_MAP[this.joints])); 31 | ctx.miterLimit = (this.miterLimit == null ? 10 : this.miterLimit); 32 | ctx.ignoreScale = (this.ignoreScale == null ? false : this.ignoreScale); 33 | }; 34 | p.path = false; -------------------------------------------------------------------------------- /js/WXLoader.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by ajex from http://www.ajexoop.com 3 | * versions 0.0.2 4 | */ 5 | export default class WXLoader extends createjs.EventDispatcher { 6 | constructor(){ 7 | super() 8 | this.assetsList = []; 9 | this.totalLoadCount = 0; 10 | } 11 | 12 | load(assetsList,isLocal){ 13 | if (!assetsList) return; 14 | if (assetsList.length <= 0) return; 15 | this.isLocal = isLocal; 16 | this.assetsList = assetsList; 17 | this.totalLoadCount = this.assetsList.length; 18 | this.startLoad() 19 | } 20 | startLoad() 21 | { 22 | if (this.assetsList.length > 0) var obj = this.assetsList.shift(); 23 | var source; 24 | var item ; 25 | if (typeof (obj) == 'string') { 26 | source = obj; 27 | item = {}; 28 | item.src = source; 29 | item.id = source; 30 | } 31 | else if (typeof (obj) == "object") { 32 | source = obj.src; 33 | item = obj 34 | } 35 | var _this = this; 36 | item.type = "image"; 37 | this.currentItem = item; 38 | if (this.isLocal) 39 | { 40 | var image = new Image() 41 | image.src = source; 42 | image.onload = function () 43 | { 44 | _this.fileload(image) 45 | } 46 | } 47 | else 48 | { 49 | wx.downloadFile({ 50 | url: source, 51 | complete: function (data) { 52 | console.log(data); 53 | if (data.errMsg) { 54 | console.log(data.errMsg); 55 | return; 56 | } 57 | _this.fileload() 58 | } 59 | }) 60 | } 61 | } 62 | fileload(obj) 63 | { 64 | var event = new createjs.Event("fileload") 65 | event.result = obj; 66 | event.item = this.currentItem; 67 | this.dispatchEvent(event); 68 | this.nextLoad(); 69 | } 70 | nextLoad() 71 | { 72 | var progress = this.assetsList.length / this.totalLoadCount; 73 | var loaded = this.totalLoadCount - this.assetsList.length; 74 | var total = this.totalLoadCount; 75 | var event = new createjs.Event("progress"); 76 | event.progress = progress; 77 | event.loaded = loaded; 78 | event.total = total; 79 | this.dispatchEvent(event); 80 | if (this.assetsList.length > 0) 81 | { 82 | this.startLoad(); 83 | } 84 | else 85 | { 86 | this.loadComplete() 87 | } 88 | 89 | } 90 | loadComplete() 91 | { 92 | this.dispatchEvent("complete"); 93 | this.assetsList = []; 94 | this.totalLoadCount = 0; 95 | } 96 | } -------------------------------------------------------------------------------- /js/WXStageGL.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by ajex from http://www.ajexoop.com 3 | * versions 0.0.2 4 | */ 5 | export default class StageGL extends createjs.StageGL { 6 | constructor(canvas, options) { 7 | super(canvas, options) 8 | } 9 | _initializeWebGL() { 10 | if (this.canvas) { 11 | if (!this._webGLContext || this._webGLContext.canvas !== this.canvas) { 12 | // A context hasn't been defined yet, 13 | // OR the defined context belongs to a different canvas, so reinitialize. 14 | 15 | // defaults and options 16 | var options = { 17 | depth: false, // Disable the depth buffer as it isn't used. 18 | alpha: this._transparent, // Make the canvas background transparent. 19 | stencil: true, 20 | antialias: this._antialias, 21 | premultipliedAlpha: this._premultiply, // Assume the drawing buffer contains colors with premultiplied alpha. 22 | preserveDrawingBuffer: this._preserveBuffer 23 | }; 24 | 25 | var gl = this._webGLContext = this._fetchWebGLContext(this.canvas, options); 26 | if (!gl) { return null; } 27 | 28 | this.updateSimultaneousTextureCount(gl.getParameter(gl.MAX_TEXTURE_IMAGE_UNITS)); 29 | this._maxTextureSlots = gl.getParameter(gl.MAX_COMBINED_TEXTURE_IMAGE_UNITS); 30 | this._createBuffers(gl); 31 | this._initTextures(gl); 32 | 33 | gl.disable(gl.DEPTH_TEST); 34 | gl.enable(gl.BLEND); 35 | gl.blendFuncSeparate(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA, gl.ONE, gl.ONE_MINUS_SRC_ALPHA); 36 | gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, this._premultiply); 37 | //gl.pixelStorei(gl.UNPACK_COLORSPACE_CONVERSION_WEBGL, gl.NONE); 38 | 39 | this._webGLContext.clearColor(this._clearColor.r, this._clearColor.g, this._clearColor.b, this._clearColor.a); 40 | this.updateViewport(this._viewportWidth || this.canvas.width, this._viewportHeight || this.canvas.height); 41 | } 42 | } else { 43 | this._webGLContext = null; 44 | } 45 | return this._webGLContext; 46 | }; 47 | _fetchWebGLContext(canvas, options) { 48 | var gl; 49 | 50 | try { 51 | gl = canvas.getContext("webgl", options) || canvas.getContext("experimental-webgl", options); 52 | } catch (e) { 53 | // don't do anything in catch, null check will handle it 54 | } 55 | if (!gl) { 56 | var msg = "Could not initialize WebGL"; 57 | console.error ? console.error(msg) : console.log(msg); 58 | } else { 59 | gl.viewportWidth = canvas.width; 60 | gl.viewportHeight = canvas.height; 61 | } 62 | //WebGLRenderingContext = gl; 63 | if (gl.wxBindCanvasTexture) gl.wxBindCanvasTexture(gl.TEXTURE_2D, canvas) 64 | return gl; 65 | }; 66 | } 67 | 68 | createjs.StageGL.isWebGLActive = function (ctx) { 69 | return true 70 | }; -------------------------------------------------------------------------------- /js/assets.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by ajex from http://www.ajexoop.com 3 | * versions 0.0.2 4 | */ 5 | //var createjs = window.createjs; 6 | //var lib, images, ss; 7 | window.lib = window.lib||{}; 8 | window.images = window.images||{}; 9 | window.ss = window.ss||{}; 10 | (function (lib, img, cjs, ss) { 11 | 12 | var p; // shortcut to reference prototypes 13 | lib.webFontTxtFilters = {}; 14 | 15 | // library properties: 16 | lib.properties = { 17 | width: 750, 18 | height: 1206, 19 | fps: 60, 20 | color: "#000000", 21 | webfonts: {}, 22 | manifest: [ 23 | {src:"images/_1.png", id:"_1"}, 24 | {src:"images/_2.png", id:"_2"}, 25 | {src:"images/_3.png", id:"_3"}, 26 | {src:"images/Bitmap1.png", id:"Bitmap1"}, 27 | {src:"images/Bitmap1bb.png", id:"Bitmap1bb"}, 28 | {src:"images/Bitmap1bbb.png", id:"Bitmap1bbb"}, 29 | {src:"images/Bitmap1bbbb.png", id:"Bitmap1bbbb"}, 30 | {src:"images/Bitmap1ggg.png", id:"Bitmap1ggg"}, 31 | {src:"images/Bitmap2.png", id:"Bitmap2"}, 32 | {src:"images/box1.png", id:"box1"}, 33 | {src:"images/box2.png", id:"box2"}, 34 | {src:"images/car0001.png", id:"car0001"}, 35 | {src:"images/car0005.png", id:"car0005"}, 36 | {src:"images/car0015.png", id:"car0015"}, 37 | {src:"images/checheche.png", id:"checheche"}, 38 | {src:"images/ci.png", id:"ci"}, 39 | {src:"images/endViewPic.jpg", id:"endViewPic"}, 40 | {src:"images/go.png", id:"go"}, 41 | {src:"images/huodui.png", id:"huodui"}, 42 | {src:"images/jiasuqiu2.png", id:"jiasuqiu2"}, 43 | {src:"images/jiaxuqiu1.png", id:"jiaxuqiu1"}, 44 | {src:"images/lunzi1.png", id:"lunzi1"}, 45 | {src:"images/map.jpg", id:"map"}, 46 | {src:"images/mutong.png", id:"mutong"}, 47 | {src:"images/nextGameBtnpic.png", id:"nextGameBtnpic"}, 48 | {src:"images/noLoginBtn.png", id:"noLoginBtn"}, 49 | {src:"images/returnHomeBtnpic.png", id:"returnHomeBtnpic"}, 50 | {src:"images/sd_00000.png", id:"sd_00000"}, 51 | {src:"images/sd_00004.png", id:"sd_00004"}, 52 | {src:"images/sd_00008.png", id:"sd_00008"}, 53 | {src:"images/sd_00012.png", id:"sd_00012"}, 54 | {src:"images/select.jpg", id:"select"}, 55 | {src:"images/soulLoginBtn.png", id:"soulLoginBtn"}, 56 | {src:"images/startGameBtn.png", id:"startGameBtn"}, 57 | {src:"images/startViewPic.jpg", id:"startViewPic"}, 58 | {src:"images/ui1assets.png", id:"ui1assets"}, 59 | {src:"images/ui2assets.png", id:"ui2assets"}, 60 | {src:"images/ui3assets.png", id:"ui3assets"}, 61 | {src:"images/yingzi.png", id:"yingzi"} 62 | ] 63 | }; 64 | 65 | 66 | 67 | lib.webfontAvailable = function(family) { 68 | lib.properties.webfonts[family] = true; 69 | var txtFilters = lib.webFontTxtFilters && lib.webFontTxtFilters[family] || []; 70 | for(var f = 0; f < txtFilters.length; ++f) { 71 | txtFilters[f].updateCache(); 72 | } 73 | }; 74 | // symbols: 75 | 76 | 77 | 78 | (lib._1 = function() { 79 | this.initialize(img._1); 80 | }).prototype = p = new cjs.Bitmap(); 81 | p.nominalBounds = new cjs.Rectangle(0,0,28,64); 82 | 83 | 84 | (lib._2 = function() { 85 | this.initialize(img._2); 86 | }).prototype = p = new cjs.Bitmap(); 87 | p.nominalBounds = new cjs.Rectangle(0,0,65,64); 88 | 89 | 90 | (lib._3 = function() { 91 | this.initialize(img._3); 92 | }).prototype = p = new cjs.Bitmap(); 93 | p.nominalBounds = new cjs.Rectangle(0,0,66,64); 94 | 95 | 96 | (lib.Bitmap1 = function() { 97 | this.initialize(img.Bitmap1); 98 | }).prototype = p = new cjs.Bitmap(); 99 | p.nominalBounds = new cjs.Rectangle(0,0,235,37); 100 | 101 | 102 | (lib.Bitmap1bb = function() { 103 | this.initialize(img.Bitmap1bb); 104 | }).prototype = p = new cjs.Bitmap(); 105 | p.nominalBounds = new cjs.Rectangle(0,0,177,178); 106 | 107 | 108 | (lib.Bitmap1bbb = function() { 109 | this.initialize(img.Bitmap1bbb); 110 | }).prototype = p = new cjs.Bitmap(); 111 | p.nominalBounds = new cjs.Rectangle(0,0,153,177); 112 | 113 | 114 | (lib.Bitmap1bbbb = function() { 115 | this.initialize(img.Bitmap1bbbb); 116 | }).prototype = p = new cjs.Bitmap(); 117 | p.nominalBounds = new cjs.Rectangle(0,0,101,112); 118 | 119 | 120 | (lib.Bitmap1ggg = function() { 121 | this.initialize(img.Bitmap1ggg); 122 | }).prototype = p = new cjs.Bitmap(); 123 | p.nominalBounds = new cjs.Rectangle(0,0,282,208); 124 | 125 | 126 | (lib.Bitmap2 = function() { 127 | this.initialize(img.Bitmap2); 128 | }).prototype = p = new cjs.Bitmap(); 129 | p.nominalBounds = new cjs.Rectangle(0,0,106,58); 130 | 131 | 132 | (lib.box1 = function() { 133 | this.initialize(img.box1); 134 | }).prototype = p = new cjs.Bitmap(); 135 | p.nominalBounds = new cjs.Rectangle(0,0,110,166); 136 | 137 | 138 | (lib.box2 = function() { 139 | this.initialize(img.box2); 140 | }).prototype = p = new cjs.Bitmap(); 141 | p.nominalBounds = new cjs.Rectangle(0,0,110,166); 142 | 143 | 144 | (lib.car0001 = function() { 145 | this.initialize(img.car0001); 146 | }).prototype = p = new cjs.Bitmap(); 147 | p.nominalBounds = new cjs.Rectangle(0,0,142,233); 148 | 149 | 150 | (lib.car0005 = function() { 151 | this.initialize(img.car0005); 152 | }).prototype = p = new cjs.Bitmap(); 153 | p.nominalBounds = new cjs.Rectangle(0,0,147,215); 154 | 155 | 156 | (lib.car0015 = function() { 157 | this.initialize(img.car0015); 158 | }).prototype = p = new cjs.Bitmap(); 159 | p.nominalBounds = new cjs.Rectangle(0,0,141,230); 160 | 161 | 162 | (lib.checheche = function() { 163 | this.initialize(img.checheche); 164 | }).prototype = p = new cjs.Bitmap(); 165 | p.nominalBounds = new cjs.Rectangle(0,0,159,234); 166 | 167 | 168 | (lib.ci = function() { 169 | this.initialize(img.ci); 170 | }).prototype = p = new cjs.Bitmap(); 171 | p.nominalBounds = new cjs.Rectangle(0,0,155,199); 172 | 173 | 174 | (lib.endViewPic = function() { 175 | this.initialize(img.endViewPic); 176 | }).prototype = p = new cjs.Bitmap(); 177 | p.nominalBounds = new cjs.Rectangle(0,0,750,1206); 178 | 179 | 180 | (lib.go = function() { 181 | this.initialize(img.go); 182 | }).prototype = p = new cjs.Bitmap(); 183 | p.nominalBounds = new cjs.Rectangle(0,0,124,64); 184 | 185 | 186 | (lib.huodui = function() { 187 | this.initialize(img.huodui); 188 | }).prototype = p = new cjs.Bitmap(); 189 | p.nominalBounds = new cjs.Rectangle(0,0,128,171); 190 | 191 | 192 | (lib.jiasuqiu2 = function() { 193 | this.initialize(img.jiasuqiu2); 194 | }).prototype = p = new cjs.Bitmap(); 195 | p.nominalBounds = new cjs.Rectangle(0,0,139,134); 196 | 197 | 198 | (lib.jiaxuqiu1 = function() { 199 | this.initialize(img.jiaxuqiu1); 200 | }).prototype = p = new cjs.Bitmap(); 201 | p.nominalBounds = new cjs.Rectangle(0,0,133,120); 202 | 203 | 204 | (lib.lunzi1 = function() { 205 | this.initialize(img.lunzi1); 206 | }).prototype = p = new cjs.Bitmap(); 207 | p.nominalBounds = new cjs.Rectangle(0,0,141,44); 208 | 209 | 210 | (lib.map = function() { 211 | this.initialize(img.map); 212 | }).prototype = p = new cjs.Bitmap(); 213 | p.nominalBounds = new cjs.Rectangle(0,0,750,1300); 214 | 215 | 216 | (lib.mutong = function() { 217 | this.initialize(img.mutong); 218 | }).prototype = p = new cjs.Bitmap(); 219 | p.nominalBounds = new cjs.Rectangle(0,0,171,149); 220 | 221 | 222 | (lib.nextGameBtnpic = function() { 223 | this.initialize(img.nextGameBtnpic); 224 | }).prototype = p = new cjs.Bitmap(); 225 | p.nominalBounds = new cjs.Rectangle(0,0,344,136); 226 | 227 | 228 | (lib.noLoginBtn = function() { 229 | this.initialize(img.noLoginBtn); 230 | }).prototype = p = new cjs.Bitmap(); 231 | p.nominalBounds = new cjs.Rectangle(0,0,342,114); 232 | 233 | 234 | (lib.returnHomeBtnpic = function() { 235 | this.initialize(img.returnHomeBtnpic); 236 | }).prototype = p = new cjs.Bitmap(); 237 | p.nominalBounds = new cjs.Rectangle(0,0,344,136); 238 | 239 | 240 | (lib.sd_00000 = function() { 241 | this.initialize(img.sd_00000); 242 | }).prototype = p = new cjs.Bitmap(); 243 | p.nominalBounds = new cjs.Rectangle(0,0,194,198); 244 | 245 | 246 | (lib.sd_00004 = function() { 247 | this.initialize(img.sd_00004); 248 | }).prototype = p = new cjs.Bitmap(); 249 | p.nominalBounds = new cjs.Rectangle(0,0,183,198); 250 | 251 | 252 | (lib.sd_00008 = function() { 253 | this.initialize(img.sd_00008); 254 | }).prototype = p = new cjs.Bitmap(); 255 | p.nominalBounds = new cjs.Rectangle(0,0,178,193); 256 | 257 | 258 | (lib.sd_00012 = function() { 259 | this.initialize(img.sd_00012); 260 | }).prototype = p = new cjs.Bitmap(); 261 | p.nominalBounds = new cjs.Rectangle(0,0,183,191); 262 | 263 | 264 | (lib.select = function() { 265 | this.initialize(img.select); 266 | }).prototype = p = new cjs.Bitmap(); 267 | p.nominalBounds = new cjs.Rectangle(0,0,750,1206); 268 | 269 | 270 | (lib.soulLoginBtn = function() { 271 | this.initialize(img.soulLoginBtn); 272 | }).prototype = p = new cjs.Bitmap(); 273 | p.nominalBounds = new cjs.Rectangle(0,0,311,89); 274 | 275 | 276 | (lib.startGameBtn = function() { 277 | this.initialize(img.startGameBtn); 278 | }).prototype = p = new cjs.Bitmap(); 279 | p.nominalBounds = new cjs.Rectangle(0,0,464,89); 280 | 281 | 282 | (lib.startViewPic = function() { 283 | this.initialize(img.startViewPic); 284 | }).prototype = p = new cjs.Bitmap(); 285 | p.nominalBounds = new cjs.Rectangle(0,0,750,1206); 286 | 287 | 288 | (lib.ui1assets = function() { 289 | this.initialize(img.ui1assets); 290 | }).prototype = p = new cjs.Bitmap(); 291 | p.nominalBounds = new cjs.Rectangle(0,0,264,79); 292 | 293 | 294 | (lib.ui2assets = function() { 295 | this.initialize(img.ui2assets); 296 | }).prototype = p = new cjs.Bitmap(); 297 | p.nominalBounds = new cjs.Rectangle(0,0,79,79); 298 | 299 | 300 | (lib.ui3assets = function() { 301 | this.initialize(img.ui3assets); 302 | }).prototype = p = new cjs.Bitmap(); 303 | p.nominalBounds = new cjs.Rectangle(0,0,149,148); 304 | 305 | 306 | (lib.yingzi = function() { 307 | this.initialize(img.yingzi); 308 | }).prototype = p = new cjs.Bitmap(); 309 | p.nominalBounds = new cjs.Rectangle(0,0,159,201); 310 | 311 | 312 | (lib.zhuxiaoBtn = function(mode,startPosition,loop) { 313 | this.initialize(mode,startPosition,loop,{}); 314 | 315 | // 图层 2 316 | this.instance = new lib.Bitmap2(); 317 | this.instance.setTransform(-54.4,-28.4); 318 | 319 | this.timeline.addTween(cjs.Tween.get(this.instance).wait(1)); 320 | 321 | }).prototype = p = new cjs.MovieClip(); 322 | p.nominalBounds = new cjs.Rectangle(-54.4,-28.4,106,58); 323 | 324 | 325 | (lib.weixinBtn = function(mode,startPosition,loop) { 326 | this.initialize(mode,startPosition,loop,{}); 327 | 328 | // 图层 1 329 | this.instance = new lib.noLoginBtn(); 330 | this.instance.setTransform(-155.5,-70); 331 | 332 | this.timeline.addTween(cjs.Tween.get(this.instance).wait(1)); 333 | 334 | }).prototype = p = new cjs.MovieClip(); 335 | p.nominalBounds = new cjs.Rectangle(-155.5,-70,342,114); 336 | 337 | 338 | (lib.soulBtn = function(mode,startPosition,loop) { 339 | this.initialize(mode,startPosition,loop,{}); 340 | 341 | // 图层 1 342 | this.instance = new lib.soulLoginBtn(); 343 | this.instance.setTransform(-155.5,-44.5); 344 | 345 | this.timeline.addTween(cjs.Tween.get(this.instance).wait(1)); 346 | 347 | }).prototype = p = new cjs.MovieClip(); 348 | p.nominalBounds = new cjs.Rectangle(-155.5,-44.5,311,89); 349 | 350 | 351 | (lib.returnHomeBtn = function(mode,startPosition,loop) { 352 | this.initialize(mode,startPosition,loop,{}); 353 | 354 | // 图层 1 355 | this.instance = new lib.returnHomeBtnpic(); 356 | 357 | this.timeline.addTween(cjs.Tween.get(this.instance).wait(1)); 358 | 359 | }).prototype = p = new cjs.MovieClip(); 360 | p.nominalBounds = new cjs.Rectangle(0,0,344,136); 361 | 362 | 363 | (lib.resumeGameBtn = function(mode,startPosition,loop) { 364 | this.initialize(mode,startPosition,loop,{}); 365 | 366 | // 图层 1 367 | this.instance = new lib.nextGameBtnpic(); 368 | 369 | this.timeline.addTween(cjs.Tween.get(this.instance).wait(1)); 370 | 371 | }).prototype = p = new cjs.MovieClip(); 372 | p.nominalBounds = new cjs.Rectangle(0,0,344,136); 373 | 374 | 375 | (lib.yingzi_1 = function(mode,startPosition,loop) { 376 | this.initialize(mode,startPosition,loop,{}); 377 | 378 | // 图层 1 379 | this.instance = new lib.yingzi(); 380 | 381 | this.timeline.addTween(cjs.Tween.get(this.instance).wait(1)); 382 | 383 | }).prototype = p = new cjs.MovieClip(); 384 | p.nominalBounds = new cjs.Rectangle(0,0,159,201); 385 | 386 | 387 | (lib.y4 = function(mode,startPosition,loop) { 388 | this.initialize(mode,startPosition,loop,{}); 389 | 390 | // 图层 1 391 | this.instance = new lib.ui1assets(); 392 | this.instance.setTransform(-132,-39.5); 393 | 394 | this.timeline.addTween(cjs.Tween.get(this.instance).wait(1)); 395 | 396 | }).prototype = p = new cjs.MovieClip(); 397 | p.nominalBounds = new cjs.Rectangle(-132,-39.5,264,79); 398 | 399 | 400 | (lib.y3 = function(mode,startPosition,loop) { 401 | this.initialize(mode,startPosition,loop,{}); 402 | 403 | // 图层 1 404 | this.instance = new lib.ui2assets(); 405 | this.instance.setTransform(-39.5,-39.5); 406 | 407 | this.timeline.addTween(cjs.Tween.get(this.instance).wait(1)); 408 | 409 | }).prototype = p = new cjs.MovieClip(); 410 | p.nominalBounds = new cjs.Rectangle(-39.5,-39.5,79,79); 411 | 412 | 413 | (lib.y2 = function(mode,startPosition,loop) { 414 | this.initialize(mode,startPosition,loop,{}); 415 | 416 | // 图层 1 417 | this.instance = new lib.ui3assets(); 418 | this.instance.setTransform(74.5,-74,1,1,0,0,180); 419 | 420 | this.timeline.addTween(cjs.Tween.get(this.instance).wait(1)); 421 | 422 | }).prototype = p = new cjs.MovieClip(); 423 | p.nominalBounds = new cjs.Rectangle(-74.5,-74,149,148); 424 | 425 | 426 | (lib.y1 = function(mode,startPosition,loop) { 427 | this.initialize(mode,startPosition,loop,{}); 428 | 429 | // 图层 1 430 | this.instance = new lib.ui3assets(); 431 | this.instance.setTransform(-74.5,-74); 432 | 433 | this.timeline.addTween(cjs.Tween.get(this.instance).wait(1)); 434 | 435 | }).prototype = p = new cjs.MovieClip(); 436 | p.nominalBounds = new cjs.Rectangle(-74.5,-74,149,148); 437 | 438 | 439 | (lib.tgo = function(mode,startPosition,loop) { 440 | this.initialize(mode,startPosition,loop,{}); 441 | 442 | // 图层 1 443 | this.instance = new lib.go(); 444 | this.instance.setTransform(-62,-32); 445 | 446 | this.timeline.addTween(cjs.Tween.get(this.instance).wait(1)); 447 | 448 | }).prototype = p = new cjs.MovieClip(); 449 | p.nominalBounds = new cjs.Rectangle(-62,-32,124,64); 450 | 451 | 452 | (lib.t3 = function(mode,startPosition,loop) { 453 | this.initialize(mode,startPosition,loop,{}); 454 | 455 | // 图层 1 456 | this.instance = new lib._3(); 457 | this.instance.setTransform(-33,-32); 458 | 459 | this.timeline.addTween(cjs.Tween.get(this.instance).wait(1)); 460 | 461 | }).prototype = p = new cjs.MovieClip(); 462 | p.nominalBounds = new cjs.Rectangle(-33,-32,66,64); 463 | 464 | 465 | (lib.t2 = function(mode,startPosition,loop) { 466 | this.initialize(mode,startPosition,loop,{}); 467 | 468 | // 图层 1 469 | this.instance = new lib._2(); 470 | this.instance.setTransform(-32.5,-32); 471 | 472 | this.timeline.addTween(cjs.Tween.get(this.instance).wait(1)); 473 | 474 | }).prototype = p = new cjs.MovieClip(); 475 | p.nominalBounds = new cjs.Rectangle(-32.5,-32,65,64); 476 | 477 | 478 | (lib.t1 = function(mode,startPosition,loop) { 479 | this.initialize(mode,startPosition,loop,{}); 480 | 481 | // 图层 1 482 | this.instance = new lib._1(); 483 | this.instance.setTransform(-14,-32); 484 | 485 | this.timeline.addTween(cjs.Tween.get(this.instance).wait(1)); 486 | 487 | }).prototype = p = new cjs.MovieClip(); 488 | p.nominalBounds = new cjs.Rectangle(-14,-32,28,64); 489 | 490 | 491 | (lib.sfg = function(mode,startPosition,loop) { 492 | this.initialize(mode,startPosition,loop,{}); 493 | 494 | // 图层 1 495 | this.instance = new lib.mutong(); 496 | 497 | this.timeline.addTween(cjs.Tween.get(this.instance).wait(1)); 498 | 499 | }).prototype = p = new cjs.MovieClip(); 500 | p.nominalBounds = new cjs.Rectangle(0,0,171,149); 501 | 502 | 503 | (lib.sd_00012_1 = function(mode,startPosition,loop) { 504 | this.initialize(mode,startPosition,loop,{}); 505 | 506 | // 图层 1 507 | this.instance = new lib.sd_00012(); 508 | 509 | this.timeline.addTween(cjs.Tween.get(this.instance).wait(1)); 510 | 511 | }).prototype = p = new cjs.MovieClip(); 512 | p.nominalBounds = new cjs.Rectangle(0,0,183,191); 513 | 514 | 515 | (lib.sd_00008_1 = function(mode,startPosition,loop) { 516 | this.initialize(mode,startPosition,loop,{}); 517 | 518 | // 图层 1 519 | this.instance = new lib.sd_00008(); 520 | 521 | this.timeline.addTween(cjs.Tween.get(this.instance).wait(1)); 522 | 523 | }).prototype = p = new cjs.MovieClip(); 524 | p.nominalBounds = new cjs.Rectangle(0,0,178,193); 525 | 526 | 527 | (lib.sd_00004_1 = function(mode,startPosition,loop) { 528 | this.initialize(mode,startPosition,loop,{}); 529 | 530 | // 图层 1 531 | this.instance = new lib.sd_00004(); 532 | 533 | this.timeline.addTween(cjs.Tween.get(this.instance).wait(1)); 534 | 535 | }).prototype = p = new cjs.MovieClip(); 536 | p.nominalBounds = new cjs.Rectangle(0,0,183,198); 537 | 538 | 539 | (lib.sd_00000_1 = function(mode,startPosition,loop) { 540 | this.initialize(mode,startPosition,loop,{}); 541 | 542 | // 图层 1 543 | this.instance = new lib.sd_00000(); 544 | 545 | this.timeline.addTween(cjs.Tween.get(this.instance).wait(1)); 546 | 547 | }).prototype = p = new cjs.MovieClip(); 548 | p.nominalBounds = new cjs.Rectangle(0,0,194,198); 549 | 550 | 551 | (lib.JSGX = function(mode,startPosition,loop) { 552 | this.initialize(mode,startPosition,loop,{}); 553 | 554 | // 图层 1 555 | this.instance = new lib.Bitmap1ggg(); 556 | 557 | this.timeline.addTween(cjs.Tween.get(this.instance).wait(1)); 558 | 559 | }).prototype = p = new cjs.MovieClip(); 560 | p.nominalBounds = new cjs.Rectangle(0,0,282,208); 561 | 562 | 563 | (lib.jiasuqiu1_mc = function(mode,startPosition,loop) { 564 | this.initialize(mode,startPosition,loop,{}); 565 | 566 | // 图层 1 567 | this.instance = new lib.jiaxuqiu1(); 568 | 569 | this.timeline.addTween(cjs.Tween.get(this.instance).wait(1)); 570 | 571 | }).prototype = p = new cjs.MovieClip(); 572 | p.nominalBounds = new cjs.Rectangle(0,0,133,120); 573 | 574 | 575 | (lib.jiaquqiu2_mc = function(mode,startPosition,loop) { 576 | this.initialize(mode,startPosition,loop,{}); 577 | 578 | // 图层 1 579 | this.instance = new lib.jiasuqiu2(); 580 | 581 | this.timeline.addTween(cjs.Tween.get(this.instance).wait(1)); 582 | 583 | }).prototype = p = new cjs.MovieClip(); 584 | p.nominalBounds = new cjs.Rectangle(0,0,139,134); 585 | 586 | 587 | (lib.erhejh = function(mode,startPosition,loop) { 588 | this.initialize(mode,startPosition,loop,{}); 589 | 590 | // 图层 1 591 | this.instance = new lib.huodui(); 592 | 593 | this.timeline.addTween(cjs.Tween.get(this.instance).wait(1)); 594 | 595 | }).prototype = p = new cjs.MovieClip(); 596 | p.nominalBounds = new cjs.Rectangle(0,0,128,171); 597 | 598 | 599 | (lib.ci_mc = function(mode,startPosition,loop) { 600 | this.initialize(mode,startPosition,loop,{}); 601 | 602 | // 图层 1 603 | this.instance = new lib.ci(); 604 | 605 | this.timeline.addTween(cjs.Tween.get(this.instance).wait(1)); 606 | 607 | }).prototype = p = new cjs.MovieClip(); 608 | p.nominalBounds = new cjs.Rectangle(0,0,155,199); 609 | 610 | 611 | (lib.bao_00009 = function(mode,startPosition,loop) { 612 | this.initialize(mode,startPosition,loop,{}); 613 | 614 | // 图层 2 615 | this.instance = new lib.Bitmap1bbbb(); 616 | this.instance.setTransform(68.8,47.6); 617 | 618 | this.timeline.addTween(cjs.Tween.get(this.instance).wait(1)); 619 | 620 | }).prototype = p = new cjs.MovieClip(); 621 | p.nominalBounds = new cjs.Rectangle(68.8,47.6,101,112); 622 | 623 | 624 | (lib.bao_00007 = function(mode,startPosition,loop) { 625 | this.initialize(mode,startPosition,loop,{}); 626 | 627 | // 图层 2 628 | this.instance = new lib.Bitmap1bbb(); 629 | this.instance.setTransform(38,32.5); 630 | 631 | this.timeline.addTween(cjs.Tween.get(this.instance).wait(1)); 632 | 633 | }).prototype = p = new cjs.MovieClip(); 634 | p.nominalBounds = new cjs.Rectangle(38,32.5,153,177); 635 | 636 | 637 | (lib.bao_00005 = function(mode,startPosition,loop) { 638 | this.initialize(mode,startPosition,loop,{}); 639 | 640 | // 图层 2 641 | this.instance = new lib.Bitmap1bb(); 642 | this.instance.setTransform(29,48.5); 643 | 644 | this.timeline.addTween(cjs.Tween.get(this.instance).wait(1)); 645 | 646 | }).prototype = p = new cjs.MovieClip(); 647 | p.nominalBounds = new cjs.Rectangle(29,48.5,177,178); 648 | 649 | 650 | (lib.mc3 = function(mode,startPosition,loop) { 651 | this.initialize(mode,startPosition,loop,{}); 652 | 653 | // 图层 1 654 | this.instance = new lib.startGameBtn(); 655 | this.instance.setTransform(-232,-44.5); 656 | 657 | this.timeline.addTween(cjs.Tween.get(this.instance).wait(1)); 658 | 659 | }).prototype = p = new cjs.MovieClip(); 660 | p.nominalBounds = new cjs.Rectangle(-232,-44.5,464,89); 661 | 662 | 663 | (lib.mc1 = function(mode,startPosition,loop) { 664 | this.initialize(mode,startPosition,loop,{}); 665 | 666 | // 图层 1 667 | this.shape = new cjs.Shape(); 668 | this.shape.graphics.bf(img.endViewPic, null, new cjs.Matrix2D(1,0,0,1,-80,-1115.9)).s().p("AseKTIAA0lIY9AAIAAUlg"); 669 | this.shape.setTransform(-15.4,0,2.276,1); 670 | 671 | this.timeline.addTween(cjs.Tween.get(this.shape).wait(1)); 672 | 673 | }).prototype = p = new cjs.MovieClip(); 674 | p.nominalBounds = new cjs.Rectangle(-197.4,-65.9,364,132); 675 | 676 | 677 | (lib.map1Assets = function(mode,startPosition,loop) { 678 | this.initialize(mode,startPosition,loop,{}); 679 | 680 | // 图层 1 681 | this.instance = new lib.map(); 682 | 683 | this.timeline.addTween(cjs.Tween.get(this.instance).wait(1)); 684 | 685 | }).prototype = p = new cjs.MovieClip(); 686 | p.nominalBounds = new cjs.Rectangle(0,0,750,1300); 687 | 688 | 689 | (lib.lunzi1_mc = function(mode,startPosition,loop) { 690 | this.initialize(mode,startPosition,loop,{}); 691 | 692 | // 图层 1 693 | this.instance = new lib.lunzi1(); 694 | 695 | this.timeline.addTween(cjs.Tween.get(this.instance).wait(1)); 696 | 697 | }).prototype = p = new cjs.MovieClip(); 698 | p.nominalBounds = new cjs.Rectangle(0,0,141,44); 699 | 700 | 701 | (lib.chechechemc = function(mode,startPosition,loop) { 702 | this.initialize(mode,startPosition,loop,{}); 703 | 704 | // 图层 1 705 | this.instance = new lib.checheche(); 706 | 707 | this.timeline.addTween(cjs.Tween.get(this.instance).wait(1)); 708 | 709 | }).prototype = p = new cjs.MovieClip(); 710 | p.nominalBounds = new cjs.Rectangle(0,0,159,234); 711 | 712 | 713 | (lib.carAssets7 = function(mode,startPosition,loop) { 714 | this.initialize(mode,startPosition,loop,{}); 715 | 716 | // 图层 1 717 | this.instance = new lib.box2(); 718 | this.instance.setTransform(-56,-62.9); 719 | 720 | this.timeline.addTween(cjs.Tween.get(this.instance).wait(1)); 721 | 722 | }).prototype = p = new cjs.MovieClip(); 723 | p.nominalBounds = new cjs.Rectangle(-56,-62.9,110,166); 724 | 725 | 726 | (lib.carAssets6 = function(mode,startPosition,loop) { 727 | this.initialize(mode,startPosition,loop,{}); 728 | 729 | // 图层 1 730 | this.instance = new lib.box1(); 731 | this.instance.setTransform(-62,-61.9); 732 | 733 | this.timeline.addTween(cjs.Tween.get(this.instance).wait(1)); 734 | 735 | }).prototype = p = new cjs.MovieClip(); 736 | p.nominalBounds = new cjs.Rectangle(-62,-61.9,110,166); 737 | 738 | 739 | (lib.car0015_1 = function(mode,startPosition,loop) { 740 | this.initialize(mode,startPosition,loop,{}); 741 | 742 | // 图层 1 743 | this.instance = new lib.car0015(); 744 | 745 | this.timeline.addTween(cjs.Tween.get(this.instance).wait(1)); 746 | 747 | }).prototype = p = new cjs.MovieClip(); 748 | p.nominalBounds = new cjs.Rectangle(0,0,141,230); 749 | 750 | 751 | (lib.car0005_1 = function(mode,startPosition,loop) { 752 | this.initialize(mode,startPosition,loop,{}); 753 | 754 | // 图层 1 755 | this.instance = new lib.car0005(); 756 | 757 | this.timeline.addTween(cjs.Tween.get(this.instance).wait(1)); 758 | 759 | }).prototype = p = new cjs.MovieClip(); 760 | p.nominalBounds = new cjs.Rectangle(0,0,147,215); 761 | 762 | 763 | (lib.car0001_1 = function(mode,startPosition,loop) { 764 | this.initialize(mode,startPosition,loop,{}); 765 | 766 | // 图层 1 767 | this.instance = new lib.car0001(); 768 | 769 | this.timeline.addTween(cjs.Tween.get(this.instance).wait(1)); 770 | 771 | }).prototype = p = new cjs.MovieClip(); 772 | p.nominalBounds = new cjs.Rectangle(0,0,142,233); 773 | 774 | 775 | (lib.alphaBtn = function(mode,startPosition,loop) { 776 | this.initialize(mode,startPosition,loop,{}); 777 | 778 | // 图层 1 779 | this.shape = new cjs.Shape(); 780 | this.shape.graphics.f("rgba(7,7,7,0.008)").s().p("AzhP8IAA/3MAnDAAAIAAf3g"); 781 | 782 | this.timeline.addTween(cjs.Tween.get(this.shape).wait(1)); 783 | 784 | }).prototype = p = new cjs.MovieClip(); 785 | p.nominalBounds = new cjs.Rectangle(-125,-102,250.1,204.1); 786 | 787 | 788 | (lib.startViewAssets = function(mode,startPosition,loop) { 789 | this.initialize(mode,startPosition,loop,{}); 790 | 791 | // 图层 1 792 | this.zhuxiaoBtn = new lib.zhuxiaoBtn(); 793 | this.zhuxiaoBtn.setTransform(658,72.1); 794 | 795 | this.txt = new cjs.Text("123456789", "28px 'SimHei'", "#FFFFFF"); 796 | this.txt.name = "txt"; 797 | this.txt.textAlign = "right"; 798 | this.txt.lineHeight = 30; 799 | this.txt.lineWidth = 157; 800 | this.txt.setTransform(603,59.1); 801 | 802 | this.startBtn = new lib.mc3(); 803 | this.startBtn.setTransform(377,1038.4); 804 | 805 | this.weixinBtn = new lib.weixinBtn(); 806 | this.weixinBtn.setTransform(548,1038.9); 807 | 808 | this.soulBtn = new lib.soulBtn(); 809 | this.soulBtn.setTransform(198,1039.4); 810 | 811 | this.instance = new lib.startViewPic(); 812 | 813 | this.timeline.addTween(cjs.Tween.get({}).to({state:[{t:this.instance},{t:this.soulBtn},{t:this.weixinBtn},{t:this.startBtn},{t:this.txt},{t:this.zhuxiaoBtn}]}).wait(1)); 814 | 815 | }).prototype = p = new cjs.MovieClip(); 816 | p.nominalBounds = new cjs.Rectangle(0,0,750,1206); 817 | 818 | 819 | (lib.selectArea = function(mode,startPosition,loop) { 820 | this.initialize(mode,startPosition,loop,{}); 821 | 822 | // 图层 2 823 | this.nameTxt = new cjs.Text("", "25px 'Microsoft YaHei'"); 824 | this.nameTxt.name = "nameTxt"; 825 | this.nameTxt.textAlign = "center"; 826 | this.nameTxt.lineHeight = 35; 827 | this.nameTxt.lineWidth = 384; 828 | this.nameTxt.setTransform(372,692.9); 829 | 830 | this.timeline.addTween(cjs.Tween.get(this.nameTxt).wait(1)); 831 | 832 | // 图层 1 833 | this.btn = new lib.alphaBtn(); 834 | this.btn.setTransform(377.5,782,0.716,0.246); 835 | 836 | this.instance = new lib.select(); 837 | 838 | this.timeline.addTween(cjs.Tween.get({}).to({state:[{t:this.instance},{t:this.btn}]}).wait(1)); 839 | 840 | }).prototype = p = new cjs.MovieClip(); 841 | p.nominalBounds = new cjs.Rectangle(0,0,750,1206); 842 | 843 | 844 | (lib.rightBtn = function(mode,startPosition,loop) { 845 | this.initialize(mode,startPosition,loop,{}); 846 | 847 | // 图层 2 848 | this.instance = new lib.alphaBtn(); 849 | this.instance.setTransform(74,78,1,1.235); 850 | 851 | this.timeline.addTween(cjs.Tween.get(this.instance).wait(1)); 852 | 853 | // 图层 1 854 | this.instance_1 = new lib.alphaBtn(); 855 | this.instance_1.setTransform(74,76,1.702,2.255); 856 | 857 | this.instance_2 = new lib.y2(); 858 | this.instance_2.setTransform(74.5,74); 859 | this.instance_2.alpha = 0.5; 860 | 861 | this.timeline.addTween(cjs.Tween.get({}).to({state:[{t:this.instance_2},{t:this.instance_1}]}).wait(1)); 862 | 863 | }).prototype = p = new cjs.MovieClip(); 864 | p.nominalBounds = new cjs.Rectangle(-138.8,-154,425.7,460.2); 865 | 866 | 867 | (lib.pauseBtn = function(mode,startPosition,loop) { 868 | this.initialize(mode,startPosition,loop,{}); 869 | 870 | // 图层 2 871 | this.instance = new lib.alphaBtn(); 872 | this.instance.setTransform(38,37,0.776,1); 873 | 874 | this.timeline.addTween(cjs.Tween.get(this.instance).wait(1)); 875 | 876 | // 图层 1 877 | this.instance_1 = new lib.y3(); 878 | this.instance_1.setTransform(39,38); 879 | this.instance_1.alpha = 0.5; 880 | 881 | this.timeline.addTween(cjs.Tween.get(this.instance_1).wait(1)); 882 | 883 | }).prototype = p = new cjs.MovieClip(); 884 | p.nominalBounds = new cjs.Rectangle(-59,-65,194.1,204.1); 885 | 886 | 887 | (lib.leftBtn = function(mode,startPosition,loop) { 888 | this.initialize(mode,startPosition,loop,{}); 889 | 890 | // 图层 2 891 | this.instance = new lib.alphaBtn(); 892 | this.instance.setTransform(74.5,74,1,1.157); 893 | 894 | this.timeline.addTween(cjs.Tween.get(this.instance).wait(1)); 895 | 896 | // 图层 1 897 | this.instance_1 = new lib.alphaBtn(); 898 | this.instance_1.setTransform(74,76,1.702,2.255); 899 | 900 | this.instance_2 = new lib.y1(); 901 | this.instance_2.setTransform(74.5,74); 902 | this.instance_2.alpha = 0.5; 903 | 904 | this.timeline.addTween(cjs.Tween.get({}).to({state:[{t:this.instance_2},{t:this.instance_1}]}).wait(1)); 905 | 906 | }).prototype = p = new cjs.MovieClip(); 907 | p.nominalBounds = new cjs.Rectangle(-138.8,-154,425.7,460.2); 908 | 909 | 910 | (lib.daojishi = function(mode,startPosition,loop) { 911 | this.initialize(mode,startPosition,loop,{}); 912 | 913 | // timeline functions: 914 | this.frame_0 = function() { 915 | //this.stop(); 916 | } 917 | this.frame_1 = function() { 918 | playSound("_11"); 919 | } 920 | this.frame_59 = function() { 921 | playSound("_11"); 922 | } 923 | this.frame_119 = function() { 924 | playSound("_11"); 925 | } 926 | this.frame_179 = function() { 927 | playSound("_33"); 928 | } 929 | this.frame_240 = function() { 930 | this.stop(); 931 | if(model) 932 | { 933 | model.dispatchEvent("jiOver"); 934 | } 935 | } 936 | 937 | // actions tween: 938 | this.timeline.addTween(cjs.Tween.get(this).call(this.frame_0).wait(1).call(this.frame_1).wait(58).call(this.frame_59).wait(60).call(this.frame_119).wait(60).call(this.frame_179).wait(61).call(this.frame_240).wait(1)); 939 | 940 | // 图层 4 941 | this.instance = new lib.tgo(); 942 | this.instance.setTransform(383.1,521.6,1.629,1.629); 943 | this.instance._off = true; 944 | 945 | this.timeline.addTween(cjs.Tween.get(this.instance).wait(179).to({_off:false},0).to({scaleX:1,scaleY:1},40).to({alpha:0},21).wait(1)); 946 | 947 | // 图层 3 948 | this.instance_1 = new lib.t3(); 949 | this.instance_1.setTransform(383.1,521.6,1.92,1.92); 950 | 951 | this.timeline.addTween(cjs.Tween.get(this.instance_1).to({scaleX:1,scaleY:1},39).to({alpha:0},20).to({_off:true},1).wait(181)); 952 | 953 | // 图层 2 954 | this.instance_2 = new lib.t2(); 955 | this.instance_2.setTransform(384.1,520.6,1.738,1.738); 956 | this.instance_2._off = true; 957 | 958 | this.timeline.addTween(cjs.Tween.get(this.instance_2).wait(59).to({_off:false},0).to({scaleX:1,scaleY:1},40).to({alpha:0},20).to({_off:true},1).wait(121)); 959 | 960 | // 图层 1 961 | this.instance_3 = new lib.t1(); 962 | this.instance_3.setTransform(384.1,519.6,1.781,1.781); 963 | this.instance_3._off = true; 964 | 965 | this.timeline.addTween(cjs.Tween.get(this.instance_3).wait(119).to({_off:false},0).to({scaleX:1,scaleY:1},40).to({alpha:0},20).to({_off:true},1).wait(61)); 966 | 967 | // 图层 6 968 | this.shape = new cjs.Shape(); 969 | this.shape.graphics.f("rgba(0,0,0,0.498)").s().p("Eg6lBeOMAAAi8bMB1KAAAMAAAC8bg"); 970 | this.shape.setTransform(375,603); 971 | 972 | this.timeline.addTween(cjs.Tween.get(this.shape).to({_off:true},240).wait(1)); 973 | 974 | }).prototype = p = new cjs.MovieClip(); 975 | p.nominalBounds = new cjs.Rectangle(0,0,750,1206); 976 | 977 | 978 | (lib.endViewAssets = function(mode,startPosition,loop) { 979 | this.initialize(mode,startPosition,loop,{}); 980 | 981 | // 图层 2 982 | this.listBtn = new lib.alphaBtn(); 983 | this.listBtn.setTransform(383,1112.9,1.502,0.593); 984 | 985 | this.fenxiangBtn = new lib.alphaBtn(); 986 | this.fenxiangBtn.setTransform(383.3,988.5,1.502,0.593); 987 | 988 | this.resetBtn = new lib.alphaBtn(); 989 | this.resetBtn.setTransform(380.8,869.5,1.502,0.574); 990 | 991 | this.timeline.addTween(cjs.Tween.get({}).to({state:[{t:this.resetBtn},{t:this.fenxiangBtn},{t:this.listBtn}]}).wait(1)); 992 | 993 | // 图层 3 994 | this.zhedang = new lib.mc1(); 995 | this.zhedang.setTransform(395.5,1116.2); 996 | 997 | this.timeline.addTween(cjs.Tween.get(this.zhedang).wait(1)); 998 | 999 | // 图层 1 1000 | this.txt = new cjs.Text("4133m", "79px 'Microsoft YaHei'"); 1001 | this.txt.name = "txt"; 1002 | this.txt.textAlign = "center"; 1003 | this.txt.lineHeight = 106; 1004 | this.txt.lineWidth = 556; 1005 | this.txt.setTransform(374,512.8); 1006 | 1007 | this.instance = new lib.Bitmap1(); 1008 | this.instance.setTransform(250.5,611.7); 1009 | 1010 | this.contentTxt = new cjs.Text("由于你神一般的操控,成功的让梦梦在战场\n行驶了 673 m,已经超越了 69% 的玩家。", "25px 'SimHei'", "#5D5045"); 1011 | this.contentTxt.name = "contentTxt"; 1012 | this.contentTxt.textAlign = "center"; 1013 | this.contentTxt.lineHeight = 37; 1014 | this.contentTxt.lineWidth = 551; 1015 | this.contentTxt.setTransform(371.5,667.5); 1016 | 1017 | this.timeline.addTween(cjs.Tween.get({}).to({state:[{t:this.contentTxt},{t:this.instance},{t:this.txt}]}).wait(1)); 1018 | 1019 | // 图层 4 1020 | this.instance_1 = new lib.endViewPic(); 1021 | 1022 | this.timeline.addTween(cjs.Tween.get(this.instance_1).wait(1)); 1023 | 1024 | }).prototype = p = new cjs.MovieClip(); 1025 | p.nominalBounds = new cjs.Rectangle(0,0,750,1206); 1026 | 1027 | 1028 | (lib.distanceUI = function(mode,startPosition,loop) { 1029 | this.initialize(mode,startPosition,loop,{}); 1030 | 1031 | // 图层 2 1032 | this.txt = new cjs.Text("1206m", "60px 'SimHei'", "#FFFFFF"); 1033 | this.txt.name = "txt"; 1034 | this.txt.textAlign = "center"; 1035 | this.txt.lineHeight = 62; 1036 | this.txt.lineWidth = 247; 1037 | this.txt.setTransform(131.5,7); 1038 | 1039 | this.timeline.addTween(cjs.Tween.get(this.txt).wait(1)); 1040 | 1041 | // 图层 1 1042 | this.instance = new lib.y4(); 1043 | this.instance.setTransform(132,39.5); 1044 | this.instance.alpha = 0.5; 1045 | 1046 | this.timeline.addTween(cjs.Tween.get(this.instance).wait(1)); 1047 | 1048 | }).prototype = p = new cjs.MovieClip(); 1049 | p.nominalBounds = new cjs.Rectangle(0,0,264,79); 1050 | 1051 | 1052 | (lib.carAssets5 = function(mode,startPosition,loop) { 1053 | this.initialize(mode,startPosition,loop,{}); 1054 | 1055 | // sd_.psd 1056 | this.instance = new lib.sd_00000_1(); 1057 | this.instance.setTransform(0.1,-31.9,1,1,0,0,0,97,99); 1058 | 1059 | this.instance_1 = new lib.sd_00004_1(); 1060 | this.instance_1.setTransform(-1.4,-31.9,1,1,0,0,0,91.5,99); 1061 | 1062 | this.instance_2 = new lib.sd_00008_1(); 1063 | this.instance_2.setTransform(-7.9,-29.4,1,1,0,0,0,89,96.5); 1064 | 1065 | this.instance_3 = new lib.sd_00012_1(); 1066 | this.instance_3.setTransform(-2.4,-32.4,1,1,0,0,0,91.5,95.5); 1067 | 1068 | this.timeline.addTween(cjs.Tween.get({}).to({state:[{t:this.instance}]}).to({state:[{t:this.instance_1}]},8).to({state:[{t:this.instance_2}]},8).to({state:[{t:this.instance_3}]},7).to({state:[{t:this.instance}]},7).to({state:[{t:this.instance_1}]},8).to({state:[{t:this.instance_2}]},8).to({state:[{t:this.instance_3}]},7).wait(7)); 1069 | 1070 | // 加速球2 1071 | this.instance_4 = new lib.jiaquqiu2_mc(); 1072 | this.instance_4.setTransform(1.5,-15,1,1,0,0,0,69.5,67); 1073 | 1074 | this.timeline.addTween(cjs.Tween.get(this.instance_4).to({y:-32},29).to({y:-15},30).wait(1)); 1075 | 1076 | // 加速球1 1077 | this.instance_5 = new lib.jiasuqiu1_mc(); 1078 | this.instance_5.setTransform(4.5,69,1,1,0,0,0,66.5,60); 1079 | 1080 | this.timeline.addTween(cjs.Tween.get(this.instance_5).wait(60)); 1081 | 1082 | }).prototype = p = new cjs.MovieClip(); 1083 | p.nominalBounds = new cjs.Rectangle(-96.9,-130.9,194,260); 1084 | 1085 | 1086 | (lib.carAssets4 = function(mode,startPosition,loop) { 1087 | this.initialize(mode,startPosition,loop,{}); 1088 | 1089 | // timeline functions: 1090 | this.frame_0 = function() { 1091 | this.stop(); 1092 | } 1093 | this.frame_20 = function() { 1094 | this.stop(); 1095 | } 1096 | 1097 | // actions tween: 1098 | this.timeline.addTween(cjs.Tween.get(this).call(this.frame_0).wait(20).call(this.frame_20).wait(1)); 1099 | 1100 | // 爆炸 1101 | this.instance = new lib.bao_00005(); 1102 | this.instance.setTransform(-31.5,20.5,1,1,0,0,0,102,140.5); 1103 | 1104 | this.instance_1 = new lib.bao_00007(); 1105 | this.instance_1.setTransform(-2.7,-14.2,1.657,1.657,0,0,0,121.9,130.7); 1106 | 1107 | this.instance_2 = new lib.bao_00009(); 1108 | this.instance_2.setTransform(6,-18.8,1.943,1.943,0,0,0,130,108.4); 1109 | this.instance_2._off = true; 1110 | 1111 | this.timeline.addTween(cjs.Tween.get({}).to({state:[]}).to({state:[{t:this.instance}]},1).to({state:[{t:this.instance_1}]},3).to({state:[{t:this.instance_2}]},3).to({state:[{t:this.instance_2}]},8).to({state:[]},1).to({state:[]},4).wait(1)); 1112 | this.timeline.addTween(cjs.Tween.get(this.instance_2).wait(7).to({_off:false},0).to({regX:129.9,scaleX:3.24,scaleY:3.24,x:5.7,alpha:0},8).to({_off:true},1).wait(5)); 1113 | 1114 | // 图层 1 1115 | this.instance_3 = new lib.erhejh(); 1116 | this.instance_3.setTransform(-4,-34.5,1,1,0,0,0,64,85.5); 1117 | 1118 | this.timeline.addTween(cjs.Tween.get(this.instance_3).to({rotation:-14.7,x:-7,y:-49.5},3).to({rotation:28.7,x:23,y:-80.5},3).to({rotation:-7,x:-8,y:-101.5},3).to({_off:true},1).wait(11)); 1119 | 1120 | // 图层 3 1121 | this.instance_4 = new lib.yingzi_1(); 1122 | this.instance_4.setTransform(-5,29,0.905,0.542,0,0,0,79.5,100.5); 1123 | 1124 | this.timeline.addTween(cjs.Tween.get(this.instance_4).to({_off:true},1).wait(20)); 1125 | 1126 | }).prototype = p = new cjs.MovieClip(); 1127 | p.nominalBounds = new cjs.Rectangle(-77,-120,144,203.5); 1128 | 1129 | 1130 | (lib.carAssets3 = function(mode,startPosition,loop) { 1131 | this.initialize(mode,startPosition,loop,{}); 1132 | 1133 | // timeline functions: 1134 | this.frame_0 = function() { 1135 | this.stop(); 1136 | } 1137 | this.frame_20 = function() { 1138 | this.stop(); 1139 | } 1140 | 1141 | // actions tween: 1142 | this.timeline.addTween(cjs.Tween.get(this).call(this.frame_0).wait(20).call(this.frame_20).wait(1)); 1143 | 1144 | // 爆炸 1145 | this.instance = new lib.bao_00005(); 1146 | this.instance.setTransform(-34.5,24.5,1,1,0,0,0,102,140.5); 1147 | 1148 | this.instance_1 = new lib.bao_00007(); 1149 | this.instance_1.setTransform(-5.8,-10.2,1.657,1.657,0,0,0,121.9,130.7); 1150 | 1151 | this.instance_2 = new lib.bao_00009(); 1152 | this.instance_2.setTransform(2.9,-14.8,1.943,1.943,0,0,0,130,108.4); 1153 | this.instance_2._off = true; 1154 | 1155 | this.timeline.addTween(cjs.Tween.get({}).to({state:[]}).to({state:[{t:this.instance}]},1).to({state:[{t:this.instance_1}]},3).to({state:[{t:this.instance_2}]},3).to({state:[{t:this.instance_2}]},8).to({state:[]},1).to({state:[]},4).wait(1)); 1156 | this.timeline.addTween(cjs.Tween.get(this.instance_2).wait(7).to({_off:false},0).to({regX:129.9,scaleX:3.24,scaleY:3.24,x:2.7,alpha:0},8).to({_off:true},1).wait(5)); 1157 | 1158 | // 图层 1 1159 | this.instance_3 = new lib.sfg(); 1160 | this.instance_3.setTransform(-4.5,-9.5,1,1,0,0,0,85.5,74.5); 1161 | 1162 | this.timeline.addTween(cjs.Tween.get(this.instance_3).to({rotation:-18.5,x:-5.5,y:-24.5},3).to({rotation:19.5,x:15.4,y:-47.5},3).to({rotation:-8.7,x:0.5,y:-80.4},3).to({_off:true},1).wait(11)); 1163 | 1164 | // 图层 3 1165 | this.instance_4 = new lib.yingzi_1(); 1166 | this.instance_4.setTransform(-10.1,29.5,1.088,0.587,0,0,0,79.4,100.5); 1167 | 1168 | this.timeline.addTween(cjs.Tween.get(this.instance_4).to({_off:true},1).wait(20)); 1169 | 1170 | }).prototype = p = new cjs.MovieClip(); 1171 | p.nominalBounds = new cjs.Rectangle(-96.5,-84,177.5,172.5); 1172 | 1173 | 1174 | (lib.carAssets2 = function(mode,startPosition,loop) { 1175 | this.initialize(mode,startPosition,loop,{}); 1176 | 1177 | // timeline functions: 1178 | this.frame_0 = function() { 1179 | this.stop(); 1180 | } 1181 | this.frame_20 = function() { 1182 | this.stop(); 1183 | } 1184 | 1185 | // actions tween: 1186 | this.timeline.addTween(cjs.Tween.get(this).call(this.frame_0).wait(20).call(this.frame_20).wait(1)); 1187 | 1188 | // 爆炸 1189 | this.instance = new lib.bao_00005(); 1190 | this.instance.setTransform(-35.5,39.5,1,1,0,0,0,102,140.5); 1191 | 1192 | this.instance_1 = new lib.bao_00007(); 1193 | this.instance_1.setTransform(-6.7,4.8,1.657,1.657,0,0,0,121.9,130.7); 1194 | 1195 | this.instance_2 = new lib.bao_00009(); 1196 | this.instance_2.setTransform(2,0.2,1.943,1.943,0,0,0,130,108.4); 1197 | this.instance_2._off = true; 1198 | 1199 | this.timeline.addTween(cjs.Tween.get({}).to({state:[]}).to({state:[{t:this.instance}]},1).to({state:[{t:this.instance_1}]},3).to({state:[{t:this.instance_2}]},3).to({state:[{t:this.instance_2}]},8).to({state:[]},1).to({state:[]},4).wait(1)); 1200 | this.timeline.addTween(cjs.Tween.get(this.instance_2).wait(7).to({_off:false},0).to({regX:129.9,scaleX:3.24,scaleY:3.24,x:1.7,alpha:0},8).to({_off:true},1).wait(5)); 1201 | 1202 | // 地刺 1203 | this.instance_3 = new lib.ci_mc(); 1204 | this.instance_3.setTransform(-2.5,-18.5,1,1,0,0,0,77.5,99.5); 1205 | 1206 | this.timeline.addTween(cjs.Tween.get(this.instance_3).to({rotation:-6.2,x:-8.5,y:-32.5},3).to({rotation:9.2,x:7.1,y:-54.6},3).to({rotation:-2.2,x:-14.7,y:-71.5},3).to({rotation:1.2,x:-0.4,y:-111.5},3).to({_off:true},1).wait(8)); 1207 | 1208 | // 影子 1209 | this.instance_4 = new lib.yingzi_1(); 1210 | this.instance_4.setTransform(-7,60.1,0.893,0.433,0,0,0,79.5,100.6); 1211 | 1212 | this.timeline.addTween(cjs.Tween.get(this.instance_4).to({_off:true},1).wait(20)); 1213 | 1214 | }).prototype = p = new cjs.MovieClip(); 1215 | p.nominalBounds = new cjs.Rectangle(-80,-118,155,221.5); 1216 | 1217 | 1218 | (lib.carAssets1 = function(mode,startPosition,loop) { 1219 | this.initialize(mode,startPosition,loop,{}); 1220 | 1221 | // timeline functions: 1222 | this.frame_26 = function() { 1223 | this.gotoAndPlay(0); 1224 | } 1225 | this.frame_41 = function() { 1226 | this.gotoAndPlay(27); 1227 | } 1228 | this.frame_92 = function() { 1229 | this.stop(); 1230 | } 1231 | 1232 | // actions tween: 1233 | this.timeline.addTween(cjs.Tween.get(this).wait(26).call(this.frame_26).wait(15).call(this.frame_41).wait(51).call(this.frame_92).wait(1)); 1234 | 1235 | // car-.psd 1236 | this.instance = new lib.car0001_1(); 1237 | this.instance.setTransform(0,13.5,1,1,0,0,0,71,116.5); 1238 | 1239 | this.instance_1 = new lib.car0005_1(); 1240 | this.instance_1.setTransform(-0.5,7.5,1,1,0,0,0,73.5,107.5); 1241 | 1242 | this.instance_2 = new lib.car0015_1(); 1243 | this.instance_2.setTransform(-0.5,10,1,1,0,0,0,70.5,115); 1244 | 1245 | this.instance_3 = new lib.chechechemc(); 1246 | this.instance_3.setTransform(-4,19,1,1,0,0,0,79.5,117); 1247 | this.instance_3._off = true; 1248 | 1249 | this.timeline.addTween(cjs.Tween.get({}).to({state:[{t:this.instance}]}).to({state:[{t:this.instance_1}]},8).to({state:[{t:this.instance_2}]},9).to({state:[{t:this.instance}]},8).to({state:[{t:this.instance}]},1).to({state:[{t:this.instance_1}]},5).to({state:[{t:this.instance_2}]},6).to({state:[{t:this.instance_3}]},4).to({state:[{t:this.instance_3}]},4).to({state:[{t:this.instance_3}]},4).to({state:[{t:this.instance_3}]},4).to({state:[{t:this.instance_3}]},4).to({state:[{t:this.instance_3}]},4).to({state:[{t:this.instance_3}]},4).to({state:[{t:this.instance_3}]},4).to({state:[{t:this.instance_3}]},4).to({state:[{t:this.instance_3}]},4).to({state:[{t:this.instance_3}]},4).to({state:[{t:this.instance_3}]},4).to({state:[{t:this.instance_3}]},4).wait(4)); 1250 | this.timeline.addTween(cjs.Tween.get(this.instance_3).wait(41).to({_off:false},0).wait(4).to({regY:117.1,rotation:39.7,x:-20,y:16},0).wait(4).to({regY:117,rotation:94.7,y:-2},0).wait(4).to({rotation:146.9,x:-18.9,y:-16},0).wait(4).to({regX:79.6,rotation:206.9,x:7.1,y:-17},0).wait(4).to({rotation:259.4,x:17.1,y:0},0).wait(4).to({regX:79.7,rotation:311.4,x:11.2,y:16.9},0).wait(4).to({regY:117.1,rotation:352.1,x:0.2,y:20},0).wait(4).to({rotation:392.9,x:-13.8},0).wait(4).to({regX:79.6,rotation:434.1,x:-23.8,y:0.9},0).wait(4).to({regX:79.5,rotation:444.7,x:-29.9,y:-11.1},0).wait(4).to({regY:117.2,rotation:449.4,x:-32.9},0).wait(4).to({regX:79.6,rotation:454.1,x:-36.9,y:-17},0).wait(4)); 1251 | 1252 | // 光效 1253 | this.instance_4 = new lib.JSGX(); 1254 | this.instance_4.setTransform(-3.6,-77.2,2.422,2.227,-90,0,0,232.1,106.1); 1255 | this.instance_4._off = true; 1256 | 1257 | this.instance_5 = new lib.lunzi1_mc(); 1258 | this.instance_5.setTransform(-1,-18,1,1,0,0,0,70.5,22); 1259 | this.instance_5._off = true; 1260 | 1261 | this.timeline.addTween(cjs.Tween.get(this.instance_4).wait(28).to({_off:false},0).to({scaleX:3.08,scaleY:1.71,y:-77.3},2).to({regX:232,scaleX:2.03,scaleY:2.23,y:-77},2).to({regX:232.1,scaleX:3,y:-77.2},2).to({scaleX:2.42,scaleY:1.53,x:-3.7},2).to({regX:232,scaleX:2.06,scaleY:2.23,x:-3.6,y:-93.7},2).to({regX:232.1,scaleX:2.42,y:-77.2},2).to({_off:true},1).wait(52)); 1262 | this.timeline.addTween(cjs.Tween.get(this.instance_5).wait(41).to({_off:false},0).wait(4).to({regY:21.9,rotation:52.7,x:10.1,y:-25},0).wait(4).to({rotation:118.2,x:20.1,y:-40},0).wait(4).to({rotation:138.4,x:23.1,y:-46},0).wait(4).to({regY:22,rotation:154.4,x:28.1,y:-52.1},0).wait(4).to({regY:21.9,rotation:170.9,x:31.1,y:-58},0).wait(4).to({rotation:185.3,x:34.1,y:-64},0).wait(28)); 1263 | 1264 | }).prototype = p = new cjs.MovieClip(); 1265 | p.nominalBounds = new cjs.Rectangle(-71,-103,142,233); 1266 | 1267 | 1268 | // stage content: 1269 | 1270 | 1271 | 1272 | (lib.assets = function(mode,startPosition,loop) { 1273 | this.initialize(mode,startPosition,loop,{}); 1274 | 1275 | }).prototype = p = new cjs.MovieClip(); 1276 | p.nominalBounds = null; 1277 | 1278 | })(lib = lib||{}, images = images||{}, createjs = createjs||{}, ss = ss||{}); -------------------------------------------------------------------------------- /js/createjs-wx-touch.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by ajex from http://www.ajexoop.com 3 | * versions 0.0.2 4 | */ 5 | // createjs.Touch.isSupported = function () { 6 | // return true; 7 | // }; 8 | //因为微信中获取canvas宽高是异步的,但是重写touch必须同步,所以参数必须传过来,而不是由类自己获取 9 | createjs.Touch.addWXTouch = function (stage,wid,hei) 10 | { 11 | if (stage.__touch) { return true; } 12 | stage.old_getElementRect = stage._getElementRect; 13 | stage._getElementRect = function () { 14 | var rect = { left: 0, top: 0, right: wid, bottom: hei} 15 | return rect 16 | } 17 | // stage._handlePointerDown=function () 18 | // { 19 | // console.log("test") 20 | // } 21 | 22 | // inject required properties on stage: 23 | stage.__touch = { pointers: {}, multitouch:true,preventDefault:true, count: 0 }; 24 | //var f = function (e) { createjs.Touch._WX_handleEvent(stage, e); }; 25 | // stage.__touch.f = f; 26 | var start_f = function (e) { createjs.Touch._WX_handleEvent(stage, e,"touchstart"); };//坑爹微信安卓无法获取e.type 只能手动赋值 27 | var move_f = function (e) { createjs.Touch._WX_handleEvent(stage, e, "touchmove"); }; 28 | var end_f = function (e) { createjs.Touch._WX_handleEvent(stage, e, "touchend"); }; 29 | var cancel_f = function (e) { createjs.Touch._WX_handleEvent(stage, e, "touchcancel"); }; 30 | wx.onTouchStart(start_f); 31 | wx.onTouchMove(move_f); 32 | wx.onTouchEnd(end_f); 33 | wx.onTouchCancel(cancel_f); 34 | // canvas.addEventListener("touchstart", f, false); 35 | // canvas.addEventListener("touchmove", f, false); 36 | // canvas.addEventListener("touchend", f, false); 37 | // canvas.addEventListener("touchcancel", f, false); 38 | } 39 | createjs.Touch.removeWXTouch = function (stage) 40 | { 41 | //var f = stage.__touch.f; 42 | var start_f = stage.__touch.start_f; 43 | var move_f = stage.__touch.move_f; 44 | var end_f = stage.__touch.end_f; 45 | var cancel_f = stage.__touch.cancel_f; 46 | wx.offTouchStart(start_f); 47 | wx.offTouchMove(move_f); 48 | wx.offTouchEnd(end_f); 49 | wx.offTouchCancel(cancel_f); 50 | // canvas.removeEventListener("touchstart", f, false); 51 | // canvas.removeEventListener("touchmove", f, false); 52 | // canvas.removeEventListener("touchend", f, false); 53 | // canvas.removeEventListener("touchcancel", f, false); 54 | } 55 | createjs.Touch._WX_handleEvent = function (stage, e,f_type) 56 | { 57 | if (!stage) { return; } 58 | // console.log(e,111) 59 | // console.log(e.preventDefault,222) 60 | // console.log(canvas.getBoundingClientRect(),333) 61 | window.getComputedStyle = false; 62 | e.preventDefault = function (){}; 63 | canvas.currentStyle = { paddingLeft: 0, paddingTop: 0, paddingRight: 0, paddingBottom: 0, borderLeftWidth: 0, borderTopWidth: 0, borderRightWidth: 0, borderBottomWidth: 0}//微信获取不到这些值 为了兼容赋予默认值 64 | if (stage.__touch.preventDefault) { e.preventDefault && e.preventDefault(); } 65 | var touches = e.changedTouches; 66 | // console.log(e, touches,444) 67 | var type = e.type; 68 | if (!type) type = f_type 69 | // console.log("type",type); 70 | for (var i = 0, l = touches.length; i < l; i++) { 71 | var touch = touches[i]; 72 | var id = touch.identifier; 73 | if (!touch.target) 74 | { 75 | touch.target = stage.canvas; 76 | } 77 | // console.log(touch,touch.target,stage.canvas,55555) 78 | // if (touch.target != stage.canvas) { continue; } 79 | if (type == "touchstart") { 80 | // console.log(stage, id, e, touch.pageX, touch.pageY,666) 81 | this._handleStart(stage, id, e, touch.pageX, touch.pageY); 82 | } else if (type == "touchmove") { 83 | this._handleMove(stage, id, e, touch.pageX, touch.pageY); 84 | } else if (type == "touchend" || type == "touchcancel") { 85 | this._handleEnd(stage, id, e); 86 | } 87 | 88 | if (type == "ontouchstart") { 89 | console.log(stage, id, e, touch.pageX, touch.pageY, 666) 90 | this._handleStart(stage, id, e, touch.pageX, touch.pageY); 91 | } else if (type == "ontouchmove") { 92 | this._handleMove(stage, id, e, touch.pageX, touch.pageY); 93 | } else if (type == "ontouchend" || type == "ontouchcancel") { 94 | this._handleEnd(stage, id, e); 95 | } 96 | } 97 | } -------------------------------------------------------------------------------- /js/libs/symbol.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 对于ES6中Symbol的极简兼容 3 | * 方便模拟私有变量 4 | */ 5 | 6 | let Symbol = window.Symbol 7 | let idCounter = 0 8 | 9 | if (!Symbol) { 10 | Symbol = function Symbol(key) { 11 | return `__${key}_${Math.floor(Math.random() * 1e9)}_${++idCounter}__` 12 | } 13 | 14 | Symbol.iterator = Symbol('Symbol.iterator') 15 | } 16 | 17 | window.Symbol = Symbol 18 | -------------------------------------------------------------------------------- /js/libs/weapp-adapter.js: -------------------------------------------------------------------------------- 1 | /******/ (function(modules) { // webpackBootstrap 2 | /******/ // The module cache 3 | /******/ var installedModules = {} 4 | 5 | /******/ // The require function 6 | /******/ function __webpack_require__(moduleId) { 7 | 8 | /******/ // Check if module is in cache 9 | /******/ if(installedModules[moduleId]) 10 | /******/ return installedModules[moduleId].exports 11 | 12 | /******/ // Create a new module (and put it into the cache) 13 | /******/ var module = installedModules[moduleId] = { 14 | /******/ exports: {}, 15 | /******/ id: moduleId, 16 | /******/ loaded: false 17 | /******/ } 18 | 19 | /******/ // Execute the module function 20 | /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__) 21 | 22 | /******/ // Flag the module as loaded 23 | /******/ module.loaded = true 24 | 25 | /******/ // Return the exports of the module 26 | /******/ return module.exports 27 | /******/ } 28 | 29 | 30 | /******/ // expose the modules object (__webpack_modules__) 31 | /******/ __webpack_require__.m = modules 32 | 33 | /******/ // expose the module cache 34 | /******/ __webpack_require__.c = installedModules 35 | 36 | /******/ // __webpack_public_path__ 37 | /******/ __webpack_require__.p = "" 38 | 39 | /******/ // Load entry module and return exports 40 | /******/ return __webpack_require__(0) 41 | /******/ }) 42 | /************************************************************************/ 43 | /******/ ([ 44 | /* 0 */ 45 | /***/ (function(module, exports, __webpack_require__) { 46 | 47 | 'use strict' 48 | 49 | var _window2 = __webpack_require__(1) 50 | 51 | var _window = _interopRequireWildcard(_window2) 52 | 53 | function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key] } } newObj.default = obj; return newObj } } 54 | 55 | var global = GameGlobal 56 | 57 | function inject() { 58 | _window.addEventListener = _window.canvas.addEventListener = function (type, listener) { 59 | _window.document.addEventListener(type, listener) 60 | } 61 | _window.removeEventListener = _window.canvas.removeEventListener = function (type, listener) { 62 | _window.document.removeEventListener(type, listener) 63 | } 64 | 65 | var _wx$getSystemInfoSync = wx.getSystemInfoSync(), 66 | platform = _wx$getSystemInfoSync.platform 67 | 68 | // 开发者工具无法重定义 window 69 | 70 | 71 | if (typeof __devtoolssubcontext === 'undefined' && platform === 'devtools') { 72 | for (var key in _window) { 73 | var descriptor = Object.getOwnPropertyDescriptor(global, key) 74 | 75 | if (!descriptor || descriptor.configurable === true) { 76 | Object.defineProperty(window, key, { 77 | value: _window[key] 78 | }) 79 | } 80 | } 81 | 82 | for (var _key in _window.document) { 83 | var _descriptor = Object.getOwnPropertyDescriptor(global.document, _key) 84 | 85 | if (!_descriptor || _descriptor.configurable === true) { 86 | Object.defineProperty(global.document, _key, { 87 | value: _window.document[_key] 88 | }) 89 | } 90 | } 91 | window.parent = window 92 | } else { 93 | for (var _key2 in _window) { 94 | global[_key2] = _window[_key2] 95 | } 96 | global.window = _window 97 | window = global 98 | window.top = window.parent = window 99 | } 100 | } 101 | 102 | if (!GameGlobal.__isAdapterInjected) { 103 | GameGlobal.__isAdapterInjected = true 104 | inject() 105 | } 106 | 107 | /***/ }), 108 | /* 1 */ 109 | /***/ (function(module, exports, __webpack_require__) { 110 | 111 | 'use strict' 112 | 113 | Object.defineProperty(exports, "__esModule", { 114 | value: true 115 | }) 116 | exports.cancelAnimationFrame = exports.requestAnimationFrame = exports.clearInterval = exports.clearTimeout = exports.setInterval = exports.setTimeout = exports.canvas = exports.location = exports.localStorage = exports.HTMLElement = exports.FileReader = exports.Audio = exports.Image = exports.WebSocket = exports.XMLHttpRequest = exports.navigator = exports.document = undefined 117 | 118 | var _WindowProperties = __webpack_require__(2) 119 | 120 | Object.keys(_WindowProperties).forEach(function (key) { 121 | if (key === "default" || key === "__esModule") return 122 | Object.defineProperty(exports, key, { 123 | enumerable: true, 124 | get: function get() { 125 | return _WindowProperties[key] 126 | } 127 | }) 128 | }) 129 | 130 | var _constructor = __webpack_require__(3) 131 | 132 | Object.keys(_constructor).forEach(function (key) { 133 | if (key === "default" || key === "__esModule") return 134 | Object.defineProperty(exports, key, { 135 | enumerable: true, 136 | get: function get() { 137 | return _constructor[key] 138 | } 139 | }) 140 | }) 141 | 142 | var _Canvas = __webpack_require__(9) 143 | 144 | var _Canvas2 = _interopRequireDefault(_Canvas) 145 | 146 | var _document2 = __webpack_require__(10) 147 | 148 | var _document3 = _interopRequireDefault(_document2) 149 | 150 | var _navigator2 = __webpack_require__(17) 151 | 152 | var _navigator3 = _interopRequireDefault(_navigator2) 153 | 154 | var _XMLHttpRequest2 = __webpack_require__(18) 155 | 156 | var _XMLHttpRequest3 = _interopRequireDefault(_XMLHttpRequest2) 157 | 158 | var _WebSocket2 = __webpack_require__(19) 159 | 160 | var _WebSocket3 = _interopRequireDefault(_WebSocket2) 161 | 162 | var _Image2 = __webpack_require__(11) 163 | 164 | var _Image3 = _interopRequireDefault(_Image2) 165 | 166 | var _Audio2 = __webpack_require__(12) 167 | 168 | var _Audio3 = _interopRequireDefault(_Audio2) 169 | 170 | var _FileReader2 = __webpack_require__(20) 171 | 172 | var _FileReader3 = _interopRequireDefault(_FileReader2) 173 | 174 | var _HTMLElement2 = __webpack_require__(4) 175 | 176 | var _HTMLElement3 = _interopRequireDefault(_HTMLElement2) 177 | 178 | var _localStorage2 = __webpack_require__(21) 179 | 180 | var _localStorage3 = _interopRequireDefault(_localStorage2) 181 | 182 | var _location2 = __webpack_require__(22) 183 | 184 | var _location3 = _interopRequireDefault(_location2) 185 | 186 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } 187 | 188 | exports.document = _document3.default 189 | exports.navigator = _navigator3.default 190 | exports.XMLHttpRequest = _XMLHttpRequest3.default 191 | exports.WebSocket = _WebSocket3.default 192 | exports.Image = _Image3.default 193 | exports.Audio = _Audio3.default 194 | exports.FileReader = _FileReader3.default 195 | exports.HTMLElement = _HTMLElement3.default 196 | exports.localStorage = _localStorage3.default 197 | exports.location = _location3.default 198 | 199 | 200 | // 暴露全局的 canvas 201 | var canvas = new _Canvas2.default() 202 | 203 | exports.canvas = canvas 204 | exports.setTimeout = setTimeout 205 | exports.setInterval = setInterval 206 | exports.clearTimeout = clearTimeout 207 | exports.clearInterval = clearInterval 208 | exports.requestAnimationFrame = requestAnimationFrame 209 | exports.cancelAnimationFrame = cancelAnimationFrame 210 | 211 | /***/ }), 212 | /* 2 */ 213 | /***/ (function(module, exports) { 214 | 215 | "use strict" 216 | 217 | Object.defineProperty(exports, "__esModule", { 218 | value: true 219 | }) 220 | 221 | var _wx$getSystemInfoSync = wx.getSystemInfoSync(), 222 | screenWidth = _wx$getSystemInfoSync.screenWidth, 223 | screenHeight = _wx$getSystemInfoSync.screenHeight, 224 | devicePixelRatio = _wx$getSystemInfoSync.devicePixelRatio 225 | 226 | var innerWidth = exports.innerWidth = screenWidth 227 | var innerHeight = exports.innerHeight = screenHeight 228 | exports.devicePixelRatio = devicePixelRatio 229 | var screen = exports.screen = { 230 | availWidth: innerWidth, 231 | availHeight: innerHeight 232 | } 233 | var performance = exports.performance = { 234 | now: function now() { 235 | return Date.now() / 1000 236 | } 237 | } 238 | var ontouchstart = exports.ontouchstart = null 239 | var ontouchmove = exports.ontouchmove = null 240 | var ontouchend = exports.ontouchend = null 241 | 242 | /***/ }), 243 | /* 3 */ 244 | /***/ (function(module, exports, __webpack_require__) { 245 | 246 | 'use strict' 247 | 248 | Object.defineProperty(exports, "__esModule", { 249 | value: true 250 | }) 251 | exports.HTMLCanvasElement = exports.HTMLImageElement = undefined 252 | 253 | var _HTMLElement3 = __webpack_require__(4) 254 | 255 | var _HTMLElement4 = _interopRequireDefault(_HTMLElement3) 256 | 257 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } 258 | 259 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function") } } 260 | 261 | function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called") } return call && (typeof call === "object" || typeof call === "function") ? call : self } 262 | 263 | function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass) } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass } 264 | 265 | var HTMLImageElement = exports.HTMLImageElement = function (_HTMLElement) { 266 | _inherits(HTMLImageElement, _HTMLElement) 267 | 268 | function HTMLImageElement() { 269 | _classCallCheck(this, HTMLImageElement) 270 | 271 | return _possibleConstructorReturn(this, (HTMLImageElement.__proto__ || Object.getPrototypeOf(HTMLImageElement)).call(this, 'img')) 272 | } 273 | 274 | return HTMLImageElement 275 | }(_HTMLElement4.default) 276 | 277 | var HTMLCanvasElement = exports.HTMLCanvasElement = function (_HTMLElement2) { 278 | _inherits(HTMLCanvasElement, _HTMLElement2) 279 | 280 | function HTMLCanvasElement() { 281 | _classCallCheck(this, HTMLCanvasElement) 282 | 283 | return _possibleConstructorReturn(this, (HTMLCanvasElement.__proto__ || Object.getPrototypeOf(HTMLCanvasElement)).call(this, 'canvas')) 284 | } 285 | 286 | return HTMLCanvasElement 287 | }(_HTMLElement4.default) 288 | 289 | /***/ }), 290 | /* 4 */ 291 | /***/ (function(module, exports, __webpack_require__) { 292 | 293 | 'use strict' 294 | 295 | Object.defineProperty(exports, "__esModule", { 296 | value: true 297 | }) 298 | 299 | var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor) } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor } }() 300 | 301 | var _Element2 = __webpack_require__(5) 302 | 303 | var _Element3 = _interopRequireDefault(_Element2) 304 | 305 | var _util = __webpack_require__(8) 306 | 307 | var _WindowProperties = __webpack_require__(2) 308 | 309 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } 310 | 311 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function") } } 312 | 313 | function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called") } return call && (typeof call === "object" || typeof call === "function") ? call : self } 314 | 315 | function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass) } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass } 316 | 317 | var HTMLElement = function (_Element) { 318 | _inherits(HTMLElement, _Element) 319 | 320 | function HTMLElement() { 321 | var tagName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '' 322 | 323 | _classCallCheck(this, HTMLElement) 324 | 325 | var _this = _possibleConstructorReturn(this, (HTMLElement.__proto__ || Object.getPrototypeOf(HTMLElement)).call(this)) 326 | 327 | _this.className = '' 328 | _this.childern = [] 329 | _this.style = { 330 | width: _WindowProperties.innerWidth + 'px', 331 | height: _WindowProperties.innerHeight + 'px' 332 | } 333 | _this.insertBefore = _util.noop 334 | _this.innerHTML = '' 335 | 336 | _this.tagName = tagName.toUpperCase() 337 | return _this 338 | } 339 | 340 | _createClass(HTMLElement, [{ 341 | key: 'setAttribute', 342 | value: function setAttribute(name, value) { 343 | this[name] = value 344 | } 345 | }, { 346 | key: 'getAttribute', 347 | value: function getAttribute(name) { 348 | return this[name] 349 | } 350 | }, { 351 | key: 'getBoundingClientRect', 352 | value: function getBoundingClientRect() { 353 | return { 354 | top: 0, 355 | left: 0, 356 | width: _WindowProperties.innerWidth, 357 | height: _WindowProperties.innerHeight 358 | } 359 | } 360 | }, { 361 | key: 'focus', 362 | value: function focus() {} 363 | }, { 364 | key: 'clientWidth', 365 | get: function get() { 366 | var ret = parseInt(this.style.fontSize, 10) * this.innerHTML.length 367 | 368 | return Number.isNaN(ret) ? 0 : ret 369 | } 370 | }, { 371 | key: 'clientHeight', 372 | get: function get() { 373 | var ret = parseInt(this.style.fontSize, 10) 374 | 375 | return Number.isNaN(ret) ? 0 : ret 376 | } 377 | }]) 378 | 379 | return HTMLElement 380 | }(_Element3.default) 381 | 382 | exports.default = HTMLElement 383 | 384 | /***/ }), 385 | /* 5 */ 386 | /***/ (function(module, exports, __webpack_require__) { 387 | 388 | 'use strict' 389 | 390 | Object.defineProperty(exports, "__esModule", { 391 | value: true 392 | }) 393 | 394 | var _Node2 = __webpack_require__(6) 395 | 396 | var _Node3 = _interopRequireDefault(_Node2) 397 | 398 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } 399 | 400 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function") } } 401 | 402 | function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called") } return call && (typeof call === "object" || typeof call === "function") ? call : self } 403 | 404 | function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass) } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass } 405 | 406 | var ELement = function (_Node) { 407 | _inherits(ELement, _Node) 408 | 409 | function ELement() { 410 | _classCallCheck(this, ELement) 411 | 412 | var _this = _possibleConstructorReturn(this, (ELement.__proto__ || Object.getPrototypeOf(ELement)).call(this)) 413 | 414 | _this.className = '' 415 | _this.children = [] 416 | return _this 417 | } 418 | 419 | return ELement 420 | }(_Node3.default) 421 | 422 | exports.default = ELement 423 | 424 | /***/ }), 425 | /* 6 */ 426 | /***/ (function(module, exports, __webpack_require__) { 427 | 428 | 'use strict' 429 | 430 | Object.defineProperty(exports, "__esModule", { 431 | value: true 432 | }) 433 | 434 | var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor) } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor } }() 435 | 436 | var _EventTarget2 = __webpack_require__(7) 437 | 438 | var _EventTarget3 = _interopRequireDefault(_EventTarget2) 439 | 440 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } 441 | 442 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function") } } 443 | 444 | function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called") } return call && (typeof call === "object" || typeof call === "function") ? call : self } 445 | 446 | function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass) } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass } 447 | 448 | var Node = function (_EventTarget) { 449 | _inherits(Node, _EventTarget) 450 | 451 | function Node() { 452 | _classCallCheck(this, Node) 453 | 454 | var _this = _possibleConstructorReturn(this, (Node.__proto__ || Object.getPrototypeOf(Node)).call(this)) 455 | 456 | _this.childNodes = [] 457 | return _this 458 | } 459 | 460 | _createClass(Node, [{ 461 | key: 'appendChild', 462 | value: function appendChild(node) { 463 | if (node instanceof Node) { 464 | this.childNodes.push(node) 465 | } else { 466 | throw new TypeError('Failed to executed \'appendChild\' on \'Node\': parameter 1 is not of type \'Node\'.') 467 | } 468 | } 469 | }, { 470 | key: 'cloneNode', 471 | value: function cloneNode() { 472 | var copyNode = Object.create(this) 473 | 474 | Object.assign(copyNode, this) 475 | return copyNode 476 | } 477 | }, { 478 | key: 'removeChild', 479 | value: function removeChild(node) { 480 | var index = this.childNodes.findIndex(function (child) { 481 | return child === node 482 | }) 483 | 484 | if (index > -1) { 485 | return this.childNodes.splice(index, 1) 486 | } 487 | return null 488 | } 489 | }]) 490 | 491 | return Node 492 | }(_EventTarget3.default) 493 | 494 | exports.default = Node 495 | 496 | /***/ }), 497 | /* 7 */ 498 | /***/ (function(module, exports) { 499 | 500 | 'use strict' 501 | 502 | Object.defineProperty(exports, "__esModule", { 503 | value: true 504 | }) 505 | 506 | var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor) } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor } }() 507 | 508 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function") } } 509 | 510 | var _events = new WeakMap() 511 | 512 | var EventTarget = function () { 513 | function EventTarget() { 514 | _classCallCheck(this, EventTarget) 515 | 516 | _events.set(this, {}) 517 | } 518 | 519 | _createClass(EventTarget, [{ 520 | key: 'addEventListener', 521 | value: function addEventListener(type, listener) { 522 | var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {} 523 | 524 | var events = _events.get(this) 525 | 526 | if (!events) { 527 | events = {} 528 | _events.set(this, events) 529 | } 530 | if (!events[type]) { 531 | events[type] = [] 532 | } 533 | events[type].push(listener) 534 | 535 | if (options.capture) { 536 | console.warn('EventTarget.addEventListener: options.capture is not implemented.') 537 | } 538 | if (options.once) { 539 | console.warn('EventTarget.addEventListener: options.once is not implemented.') 540 | } 541 | if (options.passive) { 542 | console.warn('EventTarget.addEventListener: options.passive is not implemented.') 543 | } 544 | } 545 | }, { 546 | key: 'removeEventListener', 547 | value: function removeEventListener(type, listener) { 548 | var listeners = _events.get(this)[type] 549 | 550 | if (listeners && listeners.length > 0) { 551 | for (var i = listeners.length; i--; i > 0) { 552 | if (listeners[i] === listener) { 553 | listeners.splice(i, 1) 554 | break 555 | } 556 | } 557 | } 558 | } 559 | }, { 560 | key: 'dispatchEvent', 561 | value: function dispatchEvent() { 562 | var event = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {} 563 | 564 | var listeners = _events.get(this)[event.type] 565 | 566 | if (listeners) { 567 | for (var i = 0; i < listeners.length; i++) { 568 | listeners[i](event) 569 | } 570 | } 571 | } 572 | }]) 573 | 574 | return EventTarget 575 | }() 576 | 577 | exports.default = EventTarget 578 | 579 | /***/ }), 580 | /* 8 */ 581 | /***/ (function(module, exports) { 582 | 583 | "use strict" 584 | 585 | Object.defineProperty(exports, "__esModule", { 586 | value: true 587 | }) 588 | exports.noop = noop 589 | function noop() {} 590 | 591 | /***/ }), 592 | /* 9 */ 593 | /***/ (function(module, exports, __webpack_require__) { 594 | 595 | 'use strict' 596 | 597 | Object.defineProperty(exports, "__esModule", { 598 | value: true 599 | }) 600 | exports.default = Canvas 601 | 602 | var _constructor = __webpack_require__(3) 603 | 604 | var _HTMLElement = __webpack_require__(4) 605 | 606 | var _HTMLElement2 = _interopRequireDefault(_HTMLElement) 607 | 608 | var _document = __webpack_require__(10) 609 | 610 | var _document2 = _interopRequireDefault(_document) 611 | 612 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } 613 | 614 | var hasModifiedCanvasPrototype = false 615 | var hasInit2DContextConstructor = false 616 | var hasInitWebGLContextConstructor = false 617 | 618 | function Canvas() { 619 | var canvas = wx.createCanvas() 620 | 621 | canvas.type = 'canvas' 622 | 623 | canvas.__proto__.__proto__ = new _HTMLElement2.default('canvas') 624 | 625 | var _getContext = canvas.getContext 626 | 627 | canvas.getBoundingClientRect = function () { 628 | var ret = { 629 | top: 0, 630 | left: 0, 631 | width: window.innerWidth, 632 | height: window.innerHeight 633 | } 634 | return ret 635 | } 636 | 637 | return canvas 638 | } 639 | 640 | /***/ }), 641 | /* 10 */ 642 | /***/ (function(module, exports, __webpack_require__) { 643 | 644 | 'use strict' 645 | 646 | Object.defineProperty(exports, "__esModule", { 647 | value: true 648 | }) 649 | 650 | var _window = __webpack_require__(1) 651 | 652 | var window = _interopRequireWildcard(_window) 653 | 654 | var _HTMLElement = __webpack_require__(4) 655 | 656 | var _HTMLElement2 = _interopRequireDefault(_HTMLElement) 657 | 658 | var _Image = __webpack_require__(11) 659 | 660 | var _Image2 = _interopRequireDefault(_Image) 661 | 662 | var _Audio = __webpack_require__(12) 663 | 664 | var _Audio2 = _interopRequireDefault(_Audio) 665 | 666 | var _Canvas = __webpack_require__(9) 667 | 668 | var _Canvas2 = _interopRequireDefault(_Canvas) 669 | 670 | __webpack_require__(15) 671 | 672 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } 673 | 674 | function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key] } } newObj.default = obj; return newObj } } 675 | 676 | var events = {} 677 | 678 | var document = { 679 | readyState: 'complete', 680 | visibilityState: 'visible', 681 | documentElement: window, 682 | hidden: false, 683 | style: {}, 684 | location: window.location, 685 | ontouchstart: null, 686 | ontouchmove: null, 687 | ontouchend: null, 688 | 689 | head: new _HTMLElement2.default('head'), 690 | body: new _HTMLElement2.default('body'), 691 | 692 | createElement: function createElement(tagName) { 693 | if (tagName === 'canvas') { 694 | return new _Canvas2.default() 695 | } else if (tagName === 'audio') { 696 | return new _Audio2.default() 697 | } else if (tagName === 'img') { 698 | return new _Image2.default() 699 | } 700 | 701 | return new _HTMLElement2.default(tagName) 702 | }, 703 | getElementById: function getElementById(id) { 704 | if (id === window.canvas.id) { 705 | return window.canvas 706 | } 707 | return null 708 | }, 709 | getElementsByTagName: function getElementsByTagName(tagName) { 710 | if (tagName === 'head') { 711 | return [document.head] 712 | } else if (tagName === 'body') { 713 | return [document.body] 714 | } else if (tagName === 'canvas') { 715 | return [window.canvas] 716 | } 717 | return [] 718 | }, 719 | querySelector: function querySelector(query) { 720 | if (query === 'head') { 721 | return document.head 722 | } else if (query === 'body') { 723 | return document.body 724 | } else if (query === 'canvas') { 725 | return window.canvas 726 | } else if (query === '#' + window.canvas.id) { 727 | return window.canvas 728 | } 729 | return null 730 | }, 731 | querySelectorAll: function querySelectorAll(query) { 732 | if (query === 'head') { 733 | return [document.head] 734 | } else if (query === 'body') { 735 | return [document.body] 736 | } else if (query === 'canvas') { 737 | return [window.canvas] 738 | } 739 | return [] 740 | }, 741 | addEventListener: function addEventListener(type, listener) { 742 | if (!events[type]) { 743 | events[type] = [] 744 | } 745 | events[type].push(listener) 746 | }, 747 | removeEventListener: function removeEventListener(type, listener) { 748 | var listeners = events[type] 749 | 750 | if (listeners && listeners.length > 0) { 751 | for (var i = listeners.length; i--; i > 0) { 752 | if (listeners[i] === listener) { 753 | listeners.splice(i, 1) 754 | break 755 | } 756 | } 757 | } 758 | }, 759 | dispatchEvent: function dispatchEvent(event) { 760 | var listeners = events[event.type] 761 | 762 | if (listeners) { 763 | for (var i = 0; i < listeners.length; i++) { 764 | listeners[i](event) 765 | } 766 | } 767 | } 768 | } 769 | 770 | exports.default = document 771 | 772 | /***/ }), 773 | /* 11 */ 774 | /***/ (function(module, exports) { 775 | 776 | "use strict" 777 | 778 | Object.defineProperty(exports, "__esModule", { 779 | value: true 780 | }) 781 | exports.default = Image 782 | function Image() { 783 | var image = wx.createImage() 784 | 785 | return image 786 | } 787 | 788 | /***/ }), 789 | /* 12 */ 790 | /***/ (function(module, exports, __webpack_require__) { 791 | 792 | 'use strict' 793 | 794 | Object.defineProperty(exports, "__esModule", { 795 | value: true 796 | }) 797 | 798 | var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor) } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor } }() 799 | 800 | var _HTMLAudioElement2 = __webpack_require__(13) 801 | 802 | var _HTMLAudioElement3 = _interopRequireDefault(_HTMLAudioElement2) 803 | 804 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } 805 | 806 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function") } } 807 | 808 | function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called") } return call && (typeof call === "object" || typeof call === "function") ? call : self } 809 | 810 | function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass) } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass } 811 | 812 | var HAVE_NOTHING = 0 813 | var HAVE_METADATA = 1 814 | var HAVE_CURRENT_DATA = 2 815 | var HAVE_FUTURE_DATA = 3 816 | var HAVE_ENOUGH_DATA = 4 817 | 818 | var _innerAudioContext = new WeakMap() 819 | var _src = new WeakMap() 820 | var _loop = new WeakMap() 821 | var _autoplay = new WeakMap() 822 | 823 | var Audio = function (_HTMLAudioElement) { 824 | _inherits(Audio, _HTMLAudioElement) 825 | 826 | function Audio(url) { 827 | _classCallCheck(this, Audio) 828 | 829 | var _this = _possibleConstructorReturn(this, (Audio.__proto__ || Object.getPrototypeOf(Audio)).call(this)) 830 | 831 | _this.HAVE_NOTHING = HAVE_NOTHING 832 | _this.HAVE_METADATA = HAVE_METADATA 833 | _this.HAVE_CURRENT_DATA = HAVE_CURRENT_DATA 834 | _this.HAVE_FUTURE_DATA = HAVE_FUTURE_DATA 835 | _this.HAVE_ENOUGH_DATA = HAVE_ENOUGH_DATA 836 | _this.readyState = HAVE_NOTHING 837 | 838 | 839 | _src.set(_this, '') 840 | 841 | var innerAudioContext = wx.createInnerAudioContext() 842 | 843 | _innerAudioContext.set(_this, innerAudioContext) 844 | 845 | innerAudioContext.onCanplay(function () { 846 | _this.dispatchEvent({ type: 'load' }) 847 | _this.dispatchEvent({ type: 'loadend' }) 848 | _this.dispatchEvent({ type: 'canplay' }) 849 | _this.dispatchEvent({ type: 'canplaythrough' }) 850 | _this.dispatchEvent({ type: 'loadedmetadata' }) 851 | _this.readyState = HAVE_CURRENT_DATA 852 | }) 853 | innerAudioContext.onPlay(function () { 854 | _this.dispatchEvent({ type: 'play' }) 855 | }) 856 | innerAudioContext.onPause(function () { 857 | _this.dispatchEvent({ type: 'pause' }) 858 | }) 859 | innerAudioContext.onEnded(function () { 860 | _this.dispatchEvent({ type: 'ended' }) 861 | _this.readyState = HAVE_ENOUGH_DATA 862 | }) 863 | innerAudioContext.onError(function () { 864 | _this.dispatchEvent({ type: 'error' }) 865 | }) 866 | 867 | if (url) { 868 | _innerAudioContext.get(_this).src = url 869 | } 870 | return _this 871 | } 872 | 873 | _createClass(Audio, [{ 874 | key: 'load', 875 | value: function load() { 876 | console.warn('HTMLAudioElement.load() is not implemented.') 877 | } 878 | }, { 879 | key: 'play', 880 | value: function play() { 881 | _innerAudioContext.get(this).play() 882 | } 883 | }, { 884 | key: 'pause', 885 | value: function pause() { 886 | _innerAudioContext.get(this).pause() 887 | } 888 | }, { 889 | key: 'canPlayType', 890 | value: function canPlayType() { 891 | var mediaType = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '' 892 | 893 | if (typeof mediaType !== 'string') { 894 | return '' 895 | } 896 | 897 | if (mediaType.indexOf('audio/mpeg') > -1 || mediaType.indexOf('audio/mp4')) { 898 | return 'probably' 899 | } 900 | return '' 901 | } 902 | }, { 903 | key: 'cloneNode', 904 | value: function cloneNode() { 905 | var newAudio = new Audio() 906 | newAudio.loop = _innerAudioContext.get(this).loop 907 | newAudio.autoplay = _innerAudioContext.get(this).loop 908 | newAudio.src = this.src 909 | return newAudio 910 | } 911 | }, { 912 | key: 'currentTime', 913 | get: function get() { 914 | return _innerAudioContext.get(this).currentTime 915 | }, 916 | set: function set(value) { 917 | _innerAudioContext.get(this).seek(value) 918 | } 919 | }, { 920 | key: 'src', 921 | get: function get() { 922 | return _src.get(this) 923 | }, 924 | set: function set(value) { 925 | _src.set(this, value) 926 | _innerAudioContext.get(this).src = value 927 | } 928 | }, { 929 | key: 'loop', 930 | get: function get() { 931 | return _innerAudioContext.get(this).loop 932 | }, 933 | set: function set(value) { 934 | _innerAudioContext.get(this).loop = value 935 | } 936 | }, { 937 | key: 'autoplay', 938 | get: function get() { 939 | return _innerAudioContext.get(this).autoplay 940 | }, 941 | set: function set(value) { 942 | _innerAudioContext.get(this).autoplay = value 943 | } 944 | }, { 945 | key: 'paused', 946 | get: function get() { 947 | return _innerAudioContext.get(this).paused 948 | } 949 | }]) 950 | 951 | return Audio 952 | }(_HTMLAudioElement3.default) 953 | 954 | exports.default = Audio 955 | 956 | /***/ }), 957 | /* 13 */ 958 | /***/ (function(module, exports, __webpack_require__) { 959 | 960 | 'use strict' 961 | 962 | Object.defineProperty(exports, "__esModule", { 963 | value: true 964 | }) 965 | 966 | var _HTMLMediaElement2 = __webpack_require__(14) 967 | 968 | var _HTMLMediaElement3 = _interopRequireDefault(_HTMLMediaElement2) 969 | 970 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } 971 | 972 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function") } } 973 | 974 | function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called") } return call && (typeof call === "object" || typeof call === "function") ? call : self } 975 | 976 | function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass) } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass } 977 | 978 | var HTMLAudioElement = function (_HTMLMediaElement) { 979 | _inherits(HTMLAudioElement, _HTMLMediaElement) 980 | 981 | function HTMLAudioElement() { 982 | _classCallCheck(this, HTMLAudioElement) 983 | 984 | return _possibleConstructorReturn(this, (HTMLAudioElement.__proto__ || Object.getPrototypeOf(HTMLAudioElement)).call(this, 'audio')) 985 | } 986 | 987 | return HTMLAudioElement 988 | }(_HTMLMediaElement3.default) 989 | 990 | exports.default = HTMLAudioElement 991 | 992 | /***/ }), 993 | /* 14 */ 994 | /***/ (function(module, exports, __webpack_require__) { 995 | 996 | 'use strict' 997 | 998 | Object.defineProperty(exports, "__esModule", { 999 | value: true 1000 | }) 1001 | 1002 | var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor) } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor } }() 1003 | 1004 | var _HTMLElement2 = __webpack_require__(4) 1005 | 1006 | var _HTMLElement3 = _interopRequireDefault(_HTMLElement2) 1007 | 1008 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } 1009 | 1010 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function") } } 1011 | 1012 | function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called") } return call && (typeof call === "object" || typeof call === "function") ? call : self } 1013 | 1014 | function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass) } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass } 1015 | 1016 | var HTMLMediaElement = function (_HTMLElement) { 1017 | _inherits(HTMLMediaElement, _HTMLElement) 1018 | 1019 | function HTMLMediaElement(type) { 1020 | _classCallCheck(this, HTMLMediaElement) 1021 | 1022 | return _possibleConstructorReturn(this, (HTMLMediaElement.__proto__ || Object.getPrototypeOf(HTMLMediaElement)).call(this, type)) 1023 | } 1024 | 1025 | _createClass(HTMLMediaElement, [{ 1026 | key: 'addTextTrack', 1027 | value: function addTextTrack() {} 1028 | }, { 1029 | key: 'captureStream', 1030 | value: function captureStream() {} 1031 | }, { 1032 | key: 'fastSeek', 1033 | value: function fastSeek() {} 1034 | }, { 1035 | key: 'load', 1036 | value: function load() {} 1037 | }, { 1038 | key: 'pause', 1039 | value: function pause() {} 1040 | }, { 1041 | key: 'play', 1042 | value: function play() {} 1043 | }]) 1044 | 1045 | return HTMLMediaElement 1046 | }(_HTMLElement3.default) 1047 | 1048 | exports.default = HTMLMediaElement 1049 | 1050 | /***/ }), 1051 | /* 15 */ 1052 | /***/ (function(module, exports, __webpack_require__) { 1053 | 1054 | 'use strict' 1055 | 1056 | __webpack_require__(16) 1057 | 1058 | /***/ }), 1059 | /* 16 */ 1060 | /***/ (function(module, exports, __webpack_require__) { 1061 | 1062 | 'use strict' 1063 | 1064 | var _window = __webpack_require__(1) 1065 | 1066 | var window = _interopRequireWildcard(_window) 1067 | 1068 | var _document = __webpack_require__(10) 1069 | 1070 | var _document2 = _interopRequireDefault(_document) 1071 | 1072 | var _util = __webpack_require__(8) 1073 | 1074 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } 1075 | 1076 | function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key] } } newObj.default = obj; return newObj } } 1077 | 1078 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function") } } 1079 | 1080 | var TouchEvent = function TouchEvent(type) { 1081 | _classCallCheck(this, TouchEvent) 1082 | 1083 | this.target = window.canvas 1084 | this.currentTarget = window.canvas 1085 | this.touches = [] 1086 | this.targetTouches = [] 1087 | this.changedTouches = [] 1088 | this.preventDefault = _util.noop 1089 | this.stopPropagation = _util.noop 1090 | 1091 | this.type = type 1092 | } 1093 | 1094 | function touchEventHandlerFactory(type) { 1095 | return function (event) { 1096 | var touchEvent = new TouchEvent(type) 1097 | 1098 | touchEvent.touches = event.touches 1099 | touchEvent.targetTouches = Array.prototype.slice.call(event.touches) 1100 | touchEvent.changedTouches = event.changedTouches 1101 | touchEvent.timeStamp = event.timeStamp 1102 | _document2.default.dispatchEvent(touchEvent) 1103 | } 1104 | } 1105 | 1106 | wx.onTouchStart(touchEventHandlerFactory('touchstart')) 1107 | wx.onTouchMove(touchEventHandlerFactory('touchmove')) 1108 | wx.onTouchEnd(touchEventHandlerFactory('touchend')) 1109 | wx.onTouchCancel(touchEventHandlerFactory('touchcancel')) 1110 | 1111 | /***/ }), 1112 | /* 17 */ 1113 | /***/ (function(module, exports, __webpack_require__) { 1114 | 1115 | 'use strict' 1116 | 1117 | Object.defineProperty(exports, "__esModule", { 1118 | value: true 1119 | }) 1120 | 1121 | var _util = __webpack_require__(8) 1122 | 1123 | // TODO 需要 wx.getSystemInfo 获取更详细信息 1124 | var _wx$getSystemInfoSync = wx.getSystemInfoSync(), 1125 | platform = _wx$getSystemInfoSync.platform 1126 | 1127 | var navigator = { 1128 | platform: platform, 1129 | language: 'zh-cn', 1130 | appVersion: '5.0 (iPhone; CPU iPhone OS 9_1 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Version/9.0 Mobile/13B143 Safari/601.1', 1131 | userAgent: 'Mozilla/5.0 (iPhone; CPU iPhone OS 10_3_1 like Mac OS X) AppleWebKit/603.1.30 (KHTML, like Gecko) Mobile/14E8301 MicroMessenger/6.6.0 MiniGame NetType/WIFI Language/zh_CN', 1132 | onLine: true, // TODO 用 wx.getNetworkStateChange 和 wx.onNetworkStateChange 来返回真实的状态 1133 | 1134 | // TODO 用 wx.getLocation 来封装 geolocation 1135 | geolocation: { 1136 | getCurrentPosition: _util.noop, 1137 | watchPosition: _util.noop, 1138 | clearWatch: _util.noop 1139 | } 1140 | } 1141 | 1142 | exports.default = navigator 1143 | 1144 | /***/ }), 1145 | /* 18 */ 1146 | /***/ (function(module, exports) { 1147 | 1148 | 'use strict' 1149 | 1150 | Object.defineProperty(exports, "__esModule", { 1151 | value: true 1152 | }) 1153 | 1154 | var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor) } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor } }() 1155 | 1156 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function") } } 1157 | 1158 | var _url = new WeakMap() 1159 | var _method = new WeakMap() 1160 | var _requestHeader = new WeakMap() 1161 | var _responseHeader = new WeakMap() 1162 | var _requestTask = new WeakMap() 1163 | 1164 | function _triggerEvent(type) { 1165 | if (typeof this['on' + type] === 'function') { 1166 | for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { 1167 | args[_key - 1] = arguments[_key] 1168 | } 1169 | 1170 | this['on' + type].apply(this, args) 1171 | } 1172 | } 1173 | 1174 | function _changeReadyState(readyState) { 1175 | this.readyState = readyState 1176 | _triggerEvent.call(this, 'readystatechange') 1177 | } 1178 | 1179 | var XMLHttpRequest = function () { 1180 | // TODO 没法模拟 HEADERS_RECEIVED 和 LOADING 两个状态 1181 | function XMLHttpRequest() { 1182 | _classCallCheck(this, XMLHttpRequest) 1183 | 1184 | this.onabort = null 1185 | this.onerror = null 1186 | this.onload = null 1187 | this.onloadstart = null 1188 | this.onprogress = null 1189 | this.ontimeout = null 1190 | this.onloadend = null 1191 | this.onreadystatechange = null 1192 | this.readyState = 0 1193 | this.response = null 1194 | this.responseText = null 1195 | this.responseType = '' 1196 | this.responseXML = null 1197 | this.status = 0 1198 | this.statusText = '' 1199 | this.upload = {} 1200 | this.withCredentials = false 1201 | 1202 | _requestHeader.set(this, { 1203 | 'content-type': 'application/x-www-form-urlencoded' 1204 | }) 1205 | _responseHeader.set(this, {}) 1206 | } 1207 | 1208 | /* 1209 | * TODO 这一批事件应该是在 XMLHttpRequestEventTarget.prototype 上面的 1210 | */ 1211 | 1212 | 1213 | _createClass(XMLHttpRequest, [{ 1214 | key: 'abort', 1215 | value: function abort() { 1216 | var myRequestTask = _requestTask.get(this) 1217 | 1218 | if (myRequestTask) { 1219 | myRequestTask.abort() 1220 | } 1221 | } 1222 | }, { 1223 | key: 'getAllResponseHeaders', 1224 | value: function getAllResponseHeaders() { 1225 | var responseHeader = _responseHeader.get(this) 1226 | 1227 | return Object.keys(responseHeader).map(function (header) { 1228 | return header + ': ' + responseHeader[header] 1229 | }).join('\n') 1230 | } 1231 | }, { 1232 | key: 'getResponseHeader', 1233 | value: function getResponseHeader(header) { 1234 | return _responseHeader.get(this)[header] 1235 | } 1236 | }, { 1237 | key: 'open', 1238 | value: function open(method, url /* async, user, password 这几个参数在小程序内不支持*/) { 1239 | _method.set(this, method) 1240 | _url.set(this, url) 1241 | _changeReadyState.call(this, XMLHttpRequest.OPENED) 1242 | } 1243 | }, { 1244 | key: 'overrideMimeType', 1245 | value: function overrideMimeType() {} 1246 | }, { 1247 | key: 'send', 1248 | value: function send() { 1249 | var _this = this 1250 | 1251 | var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '' 1252 | 1253 | if (this.readyState !== XMLHttpRequest.OPENED) { 1254 | throw new Error("Failed to execute 'send' on 'XMLHttpRequest': The object's state must be OPENED.") 1255 | } else { 1256 | wx.request({ 1257 | data: data, 1258 | url: _url.get(this), 1259 | method: _method.get(this), 1260 | header: _requestHeader.get(this), 1261 | responseType: this.responseType, 1262 | success: function success(_ref) { 1263 | var data = _ref.data, 1264 | statusCode = _ref.statusCode, 1265 | header = _ref.header 1266 | 1267 | if (typeof data !== 'string' && !(data instanceof ArrayBuffer)) { 1268 | try { 1269 | data = JSON.stringify(data) 1270 | } catch (e) { 1271 | data = data 1272 | } 1273 | } 1274 | 1275 | _this.status = statusCode 1276 | _responseHeader.set(_this, header) 1277 | _triggerEvent.call(_this, 'loadstart') 1278 | _changeReadyState.call(_this, XMLHttpRequest.HEADERS_RECEIVED) 1279 | _changeReadyState.call(_this, XMLHttpRequest.LOADING) 1280 | 1281 | _this.response = data 1282 | 1283 | if (data instanceof ArrayBuffer) { 1284 | _this.responseText = '' 1285 | var bytes = new Uint8Array(data) 1286 | var len = bytes.byteLength 1287 | 1288 | for (var i = 0; i < len; i++) { 1289 | _this.responseText += String.fromCharCode(bytes[i]) 1290 | } 1291 | } else { 1292 | _this.responseText = data 1293 | } 1294 | _changeReadyState.call(_this, XMLHttpRequest.DONE) 1295 | _triggerEvent.call(_this, 'load') 1296 | _triggerEvent.call(_this, 'loadend') 1297 | }, 1298 | fail: function fail(_ref2) { 1299 | var errMsg = _ref2.errMsg 1300 | 1301 | // TODO 规范错误 1302 | if (errMsg.indexOf('abort') !== -1) { 1303 | _triggerEvent.call(_this, 'abort') 1304 | } else { 1305 | _triggerEvent.call(_this, 'error', errMsg) 1306 | } 1307 | _triggerEvent.call(_this, 'loadend') 1308 | } 1309 | }) 1310 | } 1311 | } 1312 | }, { 1313 | key: 'setRequestHeader', 1314 | value: function setRequestHeader(header, value) { 1315 | var myHeader = _requestHeader.get(this) 1316 | 1317 | myHeader[header] = value 1318 | _requestHeader.set(this, myHeader) 1319 | } 1320 | }]) 1321 | 1322 | return XMLHttpRequest 1323 | }() 1324 | 1325 | XMLHttpRequest.UNSEND = 0 1326 | XMLHttpRequest.OPENED = 1 1327 | XMLHttpRequest.HEADERS_RECEIVED = 2 1328 | XMLHttpRequest.LOADING = 3 1329 | XMLHttpRequest.DONE = 4 1330 | exports.default = XMLHttpRequest 1331 | 1332 | /***/ }), 1333 | /* 19 */ 1334 | /***/ (function(module, exports) { 1335 | 1336 | 'use strict' 1337 | 1338 | Object.defineProperty(exports, "__esModule", { 1339 | value: true 1340 | }) 1341 | 1342 | var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor) } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor } }() 1343 | 1344 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function") } } 1345 | 1346 | var _socketTask = new WeakMap() 1347 | 1348 | var WebSocket = function () { 1349 | // TODO 更新 binaryType 1350 | // The connection is in the process of closing. 1351 | // The connection is not yet open. 1352 | function WebSocket(url) { 1353 | var _this = this 1354 | 1355 | var protocols = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [] 1356 | 1357 | _classCallCheck(this, WebSocket) 1358 | 1359 | this.binaryType = '' 1360 | this.bufferedAmount = 0 1361 | this.extensions = '' 1362 | this.onclose = null 1363 | this.onerror = null 1364 | this.onmessage = null 1365 | this.onopen = null 1366 | this.protocol = '' 1367 | this.readyState = 3 1368 | 1369 | if (typeof url !== 'string' || !/(^ws:\/\/)|(^wss:\/\/)/.test(url)) { 1370 | throw new TypeError('Failed to construct \'WebSocket\': The URL \'' + url + '\' is invalid') 1371 | } 1372 | 1373 | this.url = url 1374 | this.readyState = WebSocket.CONNECTING 1375 | 1376 | var socketTask = wx.connectSocket({ 1377 | url: url, 1378 | protocols: Array.isArray(protocols) ? protocols : [protocols] 1379 | }) 1380 | 1381 | _socketTask.set(this, socketTask) 1382 | 1383 | socketTask.onClose(function (res) { 1384 | _this.readyState = WebSocket.CLOSED 1385 | if (typeof _this.onclose === 'function') { 1386 | _this.onclose(res) 1387 | } 1388 | }) 1389 | 1390 | socketTask.onMessage(function (res) { 1391 | if (typeof _this.onmessage === 'function') { 1392 | _this.onmessage(res) 1393 | } 1394 | }) 1395 | 1396 | socketTask.onOpen(function () { 1397 | _this.readyState = WebSocket.OPEN 1398 | if (typeof _this.onopen === 'function') { 1399 | _this.onopen() 1400 | } 1401 | }) 1402 | 1403 | socketTask.onError(function (res) { 1404 | if (typeof _this.onerror === 'function') { 1405 | _this.onerror(new Error(res.errMsg)) 1406 | } 1407 | }) 1408 | 1409 | return this 1410 | } // TODO 小程序内目前获取不到,实际上需要根据服务器选择的 sub-protocol 返回 1411 | // TODO 更新 bufferedAmount 1412 | // The connection is closed or couldn't be opened. 1413 | 1414 | // The connection is open and ready to communicate. 1415 | 1416 | 1417 | _createClass(WebSocket, [{ 1418 | key: 'close', 1419 | value: function close(code, reason) { 1420 | this.readyState = WebSocket.CLOSING 1421 | var socketTask = _socketTask.get(this) 1422 | 1423 | socketTask.close({ 1424 | code: code, 1425 | reason: reason 1426 | }) 1427 | } 1428 | }, { 1429 | key: 'send', 1430 | value: function send(data) { 1431 | if (typeof data !== 'string' && !(data instanceof ArrayBuffer)) { 1432 | throw new TypeError('Failed to send message: The data ' + data + ' is invalid') 1433 | } 1434 | 1435 | var socketTask = _socketTask.get(this) 1436 | 1437 | socketTask.send({ 1438 | data: data 1439 | }) 1440 | } 1441 | }]) 1442 | 1443 | return WebSocket 1444 | }() 1445 | 1446 | WebSocket.CONNECTING = 0 1447 | WebSocket.OPEN = 1 1448 | WebSocket.CLOSING = 2 1449 | WebSocket.CLOSED = 3 1450 | exports.default = WebSocket 1451 | 1452 | /***/ }), 1453 | /* 20 */ 1454 | /***/ (function(module, exports) { 1455 | 1456 | "use strict" 1457 | 1458 | Object.defineProperty(exports, "__esModule", { 1459 | value: true 1460 | }) 1461 | 1462 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function") } } 1463 | 1464 | /* 1465 | * TODO 使用 wx.readFile 来封装 FileReader 1466 | */ 1467 | var FileReader = function FileReader() { 1468 | _classCallCheck(this, FileReader) 1469 | } 1470 | 1471 | exports.default = FileReader 1472 | 1473 | /***/ }), 1474 | /* 21 */ 1475 | /***/ (function(module, exports) { 1476 | 1477 | "use strict" 1478 | 1479 | Object.defineProperty(exports, "__esModule", { 1480 | value: true 1481 | }) 1482 | var localStorage = { 1483 | get length() { 1484 | var _wx$getStorageInfoSyn = wx.getStorageInfoSync(), 1485 | keys = _wx$getStorageInfoSyn.keys 1486 | 1487 | return keys.length 1488 | }, 1489 | 1490 | key: function key(n) { 1491 | var _wx$getStorageInfoSyn2 = wx.getStorageInfoSync(), 1492 | keys = _wx$getStorageInfoSyn2.keys 1493 | 1494 | return keys[n] 1495 | }, 1496 | getItem: function getItem(key) { 1497 | return wx.getStorageSync(key) 1498 | }, 1499 | setItem: function setItem(key, value) { 1500 | return wx.setStorageSync(key, value) 1501 | }, 1502 | removeItem: function removeItem(key) { 1503 | wx.removeStorageSync(key) 1504 | }, 1505 | clear: function clear() { 1506 | wx.clearStorageSync() 1507 | } 1508 | } 1509 | 1510 | exports.default = localStorage 1511 | 1512 | /***/ }), 1513 | /* 22 */ 1514 | /***/ (function(module, exports) { 1515 | 1516 | 'use strict' 1517 | 1518 | Object.defineProperty(exports, "__esModule", { 1519 | value: true 1520 | }) 1521 | var location = { 1522 | href: 'game.js', 1523 | reload: function reload() {} 1524 | } 1525 | 1526 | exports.default = location 1527 | 1528 | /***/ }) 1529 | /******/ ]) -------------------------------------------------------------------------------- /js/main.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by ajex from http://www.ajexoop.com 3 | * versions 0.0.2.1 4 | */ 5 | import WXLoader from './WXLoader' 6 | import WXStageGL from './WXStageGL' 7 | import WXGraphics from './WXGraphics' 8 | 9 | var img,stage,loadPic,selectArea,model,modelData,container,loadingView,gameStartView,gameView,pauseView,selectView,endView,currentView,mainCar,daojishi,stageWidth,stageHeight,stageScale; 10 | // var loadlib = window.loadlib; 11 | // var lib = window.lib; 12 | // var images = window.images; 13 | var View = window.View; 14 | 15 | //showprz宝箱标识 0 无宝箱 1 银宝箱 2 金宝箱 16 | // var gameid,numid,showprz,wxflag,isShowBox = false,boxDistance = 0,prizeText="",blogText="快点来玩梦梦战车吧!"; 17 | window.isServiceStartGame = false;//是否通过服务开始游戏(是否单机玩游戏是否有宝箱) 18 | //var testTxt; 19 | window.model = new createjs.EventDispatcher(); 20 | window.modelData = {}; 21 | window.showprz = ""; 22 | window.isStart = false; 23 | window.checkFps = false; 24 | window.gameid = ""; 25 | window.numid = ""; 26 | window.wxflag = ""; 27 | window.isShowBox = false; 28 | window.boxDistance = 0; 29 | window.prizeText = ""; 30 | window.blogText = "快点来玩梦梦战车吧!"; 31 | window.arrowStatus = "" 32 | 33 | stageWidth = document.documentElement.clientWidth; 34 | stageHeight = document.documentElement.clientHeight; 35 | 36 | init(); 37 | function init() { 38 | 39 | wx.onShareAppMessage() 40 | 41 | stage = new createjs.Stage(canvas); 42 | //开启webgl的时候 需要解开initStageWH方法里的注释 webgl开启是矢量元素都不支持 需要额外的cache或者转为位图 43 | // stage = new WXStageGL(canvas);//使用stagegl需要外部引入StageGL文件 然后直接new 而不是new createjs.WXStageGL() 44 | 45 | 46 | container = new createjs.Container(); 47 | stage.addChild(container); 48 | //createjs.Touch.enable(stage); 49 | initStageWH(); 50 | 51 | 52 | // createjs.Ticker.timingMode = createjs.Ticker.RAF_SYNCHED;//暂时不支持这种模式 使用这种模式需要修改帧频换算单位 53 | // createjs.Ticker.setFPS(60); 54 | createjs.Ticker.framerate = 60; 55 | createjs.Ticker.addEventListener("tick", stageBreakHandler); 56 | 57 | 58 | var loader = new WXLoader(); 59 | loader.addEventListener("fileload", handleFileLoad) 60 | loader.addEventListener("complete", loadCompleteHandler) 61 | loader.load(lib.properties.manifest, true)//暂时只支持单图片加载,sprite的加载模式因为消耗性能实际上也不用支持 62 | 63 | 64 | } 65 | //function handleVisibilityChange() { 66 | // if (document.hidden) { 67 | // if(typeof WeixinJSBridge != 'undefined') 68 | // { 69 | // WeixinJSBridge.call('closeWindow'); 70 | // } 71 | // //pauseSimulation(); 72 | // } else { 73 | // //startSimulation(); 74 | // } 75 | //} 76 | function loadHandleFileLoad(evt) 77 | { 78 | if (evt.item.type == "image") { loadimages[evt.item.id] = evt.result; } 79 | } 80 | function handleFileLoad(evt) { 81 | if (evt.item.type == "image") 82 | { 83 | images[evt.item.id] = evt.result; 84 | // console.log(evt.result) 85 | } 86 | } 87 | function playSound(id, loop) { 88 | createjs.Sound.play(id, createjs.Sound.INTERRUPT_EARLY, 0, 0, loop); 89 | } 90 | function setCookie(name, value, expires, path, domain, secure){ 91 | var cookieText = encodeURIComponent(name) + '=' + encodeURIComponent(value); 92 | 93 | if(expires instanceof Date){ 94 | cookieText += "; expires=" + expires.toGMTString(); 95 | } 96 | if(path){ 97 | cookieText += "; path=" + path; 98 | } 99 | if(domain){ 100 | cookieText += "; domain=" + domain; 101 | } 102 | if(secure){ 103 | cookieText += "; secure"; 104 | } 105 | 106 | document.cookie = cookieText; 107 | }; 108 | 109 | function loadProgressHandler(event) 110 | { 111 | loadingView.back.bar.gotoAndStop(Math.floor(event.progress*99)); 112 | // loadingView.back.icon.txt.text = Math.floor(event.progress*99).toString() + "%"; 113 | } 114 | function loadCompleteHandler(event) 115 | { 116 | event.currentTarget.addEventListener("fileload", handleFileLoad) 117 | event.currentTarget.addEventListener("complete", loadCompleteHandler) 118 | 119 | 120 | 121 | View.init(container); 122 | Sound.init(); 123 | 124 | gameStartView = window.gameStartView; 125 | gameView = window.gameView; 126 | daojishi = window.daojishi; 127 | pauseView = window.pauseView; 128 | 129 | 130 | gameStartView.init(); 131 | 132 | // var g = new WXGraphics();//此代码与本游戏无关 看到的童鞋记一下 安卓要使用shape必须手动传入WXgraphics类 133 | // var shape = new createjs.Shape(g); 134 | // shape.graphics.setStrokeStyle(3); 135 | // shape.graphics.beginStroke("#F00"); 136 | // shape.graphics.drawRect(0,0,200,200); 137 | // stage.addChild(shape); 138 | } 139 | function stageBreakHandler(event) 140 | { 141 | stage.update(); 142 | } 143 | function initStageWH() 144 | { 145 | //获取屏幕宽高 146 | wx.getSystemInfo({ 147 | success: function (res) { 148 | stageWidth = res.windowWidth*2; 149 | stageHeight = res.windowHeight*2; 150 | canvas.width = stageWidth; 151 | canvas.height = stageHeight; 152 | stageScale = stageHeight / 1206; 153 | container.scaleX = stageScale; 154 | container.scaleY = stageScale; 155 | container.x = (stageWidth - 750 * container.scaleX) / 2; 156 | // stage.updateViewport(canvas.width, canvas.height)//开启webgl的时候需要开启这句话 157 | createjs.Touch.addWXTouch(stage, res.windowWidth, res.windowHeight); 158 | } 159 | }) 160 | } 161 | -------------------------------------------------------------------------------- /js/service.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by ajex from http://www.ajexoop.com 3 | * versions 0.0.2 4 | */ 5 | var Service = {}; 6 | Service.baseURL = ""; 7 | Service.zhuxiaoURL = ""; 8 | Service.bindingArea = function (areaid, fun) { 9 | 10 | } 11 | Service.QueryName = function (areaid, fun) { 12 | 13 | } 14 | Service.init = function (fun) { 15 | 16 | } 17 | Service.startGame = function (fun) { 18 | 19 | } 20 | Service.getBox = function (fun) { 21 | 22 | } 23 | Service.gameover = function (gameid, score, fun) { 24 | 25 | } 26 | window.Service = Service; -------------------------------------------------------------------------------- /js/sound.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by ajex from http://www.ajexoop.com 3 | * versions 0.0.2 4 | */ 5 | var Sound = {}; 6 | Sound.init = function () 7 | { 8 | Sound.bgmAudio = new Audio() 9 | Sound.bgmAudio.loop = true 10 | Sound.bgmAudio.src = 'sounds/bgm.mp3' 11 | 12 | Sound.addSpeedAudio = new Audio() 13 | Sound.addSpeedAudio.loop = true 14 | Sound.addSpeedAudio.src = 'sounds/addSpeedSound.mp3' 15 | 16 | Sound.boxAudio = new Audio() 17 | Sound.boxAudio.src = 'sounds/box.mp3' 18 | 19 | Sound.diciAudio = new Audio() 20 | Sound.diciAudio.src = 'sounds/diciSound.mp3' 21 | 22 | Sound.huoAudio = new Audio() 23 | Sound.huoAudio.src = 'sounds/huoSound.mp3' 24 | 25 | Sound.mutongAudio = new Audio() 26 | Sound.mutongAudio.src = 'sounds/mutongSound.mp3' 27 | 28 | Sound._11 = new Audio(); 29 | Sound._11.src = 'sounds/_11.mp3' 30 | 31 | Sound._33 = new Audio(); 32 | Sound._33.src = 'sounds/_33.mp3' 33 | 34 | // Sound.playBgm(); 35 | 36 | 37 | } 38 | Sound.playBgm = function () 39 | { 40 | Sound.bgmAudio.currentTime = 0 41 | Sound.bgmAudio.play() 42 | } 43 | Sound.stopBgm = function () { 44 | Sound.bgmAudio.pause() 45 | } 46 | Sound.playAddSpeed = function playAddSpeed() { 47 | Sound.addSpeedAudio.currentTime = 0 48 | Sound.addSpeedAudio.play(); 49 | } 50 | Sound.stopAddSpeed = function stopAddSpeed() { 51 | Sound.addSpeedAudio.pause(); 52 | } 53 | Sound.playCi = function playCi() { 54 | Sound.diciAudio.play(); 55 | } 56 | Sound.playHuo = function playHuo() { 57 | Sound.huoAudio.play(); 58 | } 59 | Sound.playTong = function playTong() { 60 | Sound.mutongAudio.play(); 61 | } 62 | Sound.playBox = function playBox() { 63 | Sound.boxAudio.play(); 64 | } 65 | window.Sound = Sound; 66 | window.playSound = function (id) 67 | { 68 | Sound[id].play(); 69 | } -------------------------------------------------------------------------------- /js/view.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by ajex from http://www.ajexoop.com 3 | * versions 0.0.2 4 | */ 5 | var lib = window.lib; 6 | var images = window.images; 7 | var Service 8 | var loadingView, gameStartView, gameView, pauseView, selectView, endView, currentView, mainCar, daojishi,container; 9 | 10 | //View 11 | var View = {}; 12 | View.init = function init(con) 13 | { 14 | window.gameStartView = new View.GameStartView(); 15 | window.gameView = new View.GameView(); 16 | // selectView = new View.SelectAreaView(); 17 | window.daojishi = new lib.daojishi(); 18 | window.pauseView = new View.PauseView(); 19 | window.endView = new View.EndView(); 20 | 21 | gameStartView = window.gameStartView; 22 | gameView = window.gameView; 23 | daojishi = window.daojishi; 24 | pauseView = window.pauseView; 25 | endView = window.endView; 26 | 27 | 28 | Service = window.Service; 29 | container = con; 30 | } 31 | View.changeView = function changeView(view, parent, completeFunction, parameterList) { 32 | if (currentView) { 33 | if (currentView.parent) { 34 | currentView.parent.removeChild(currentView); 35 | parent.addChild(view); 36 | currentView = view; 37 | } 38 | } 39 | else { 40 | parent.addChild(view); 41 | currentView = view; 42 | } 43 | }; 44 | //LoadingView 45 | (function () { 46 | "use strict"; 47 | function LoadingView() { 48 | this.Container_constructor(); 49 | 50 | this.back = new loadlib.loadingViewAssets(); 51 | this.addChild(this.back); 52 | // this.back.bar.gotoAndStop(0); 53 | } 54 | var p = createjs.extend(LoadingView, createjs.Container); 55 | View.LoadingView = createjs.promote(LoadingView, "Container"); 56 | }()); 57 | //SelectAreaView 58 | (function () { 59 | "use strict"; 60 | function SelectAreaView() { 61 | this.Container_constructor(); 62 | 63 | this.back = new lib.selectArea(); 64 | this.addChild(this.back); 65 | this.back.btn.addEventListener("click", function () { 66 | var index = selectArea.selectedIndex; 67 | var value = selectArea.options[index].value; 68 | if (value == 0) { 69 | alert("请选择大区!"); 70 | return; 71 | } 72 | else { 73 | Service.bindingArea(value, function (data) { 74 | if (data.resultCode == 1) { 75 | alert("绑定成功"); 76 | selectView.hide(); 77 | // View.changeView(gameView,container); 78 | // gameView.daojishiStart(); 79 | View.changeView(gameStartView, container); 80 | gameStartView.init(); 81 | } 82 | else { 83 | alert(data.resultInfo); 84 | } 85 | }) 86 | } 87 | }) 88 | selectArea.addEventListener("onchange", function (event) { 89 | var index = selectArea.selectedIndex; 90 | var value = selectArea.options[index].value; 91 | Service.QueryName(value, function (data) { 92 | if (data.resultCode == 1) { 93 | this.back.nameTxt.text = data.NickName; 94 | } 95 | else { 96 | alert(data.resultInfo) 97 | } 98 | }) 99 | }) 100 | } 101 | var p = createjs.extend(SelectAreaView, createjs.Container); 102 | p.show = function () { 103 | selectArea.style.display = "block"; 104 | } 105 | p.hide = function () { 106 | selectArea.style.display = "none"; 107 | } 108 | View.SelectAreaView = createjs.promote(SelectAreaView, "Container"); 109 | }()); 110 | //GameStartView 111 | (function () { 112 | "use strict"; 113 | function GameStartView() { 114 | this.Container_constructor(); 115 | this.back = new lib.startViewAssets(); 116 | this.addChild(this.back); 117 | // this.back.listBtn.addEventListener("click",p.listHandler); 118 | this.back.soulBtn.addEventListener("click", p.soulHandler); 119 | this.back.weixinBtn.addEventListener("click", p.weixinHandler); 120 | this.back.startBtn.addEventListener("click", p.checkStartHandler); 121 | this.back.zhuxiaoBtn.addEventListener("click", p.zhuxiaoHandler); 122 | } 123 | var p = createjs.extend(GameStartView, createjs.Container); 124 | p.init = function init() { 125 | this.back.soulBtn.mouseEnabled = false; 126 | this.back.weixinBtn.mouseEnabled = false; 127 | this.back.startBtn.mouseEnabled = false; 128 | this.back.zhuxiaoBtn.mouseEnabled = false; 129 | this.back.soulBtn.mouseChildren = false; 130 | this.back.weixinBtn.mouseChildren = false; 131 | this.back.startBtn.mouseChildren = false; 132 | this.back.zhuxiaoBtn.mouseChildren = false; 133 | var _this = this; 134 | setTimeout(function () { 135 | _this.back.soulBtn.mouseEnabled = true; 136 | _this.back.weixinBtn.mouseEnabled = true; 137 | _this.back.startBtn.mouseEnabled = true; 138 | _this.back.zhuxiaoBtn.mouseEnabled = true; 139 | _this.back.soulBtn.mouseChildren = true; 140 | _this.back.weixinBtn.mouseChildren = true; 141 | _this.back.startBtn.mouseChildren = true; 142 | _this.back.zhuxiaoBtn.mouseChildren = true; 143 | }, 1000) 144 | currentView = gameStartView; 145 | container.addChild(gameStartView); 146 | gameStartView.statusChange("login"); 147 | // $('#popBottom').css("display", "none"); 148 | // Service.init(function (data) { 149 | // console.log("init") 150 | // gameid = data.gameid; 151 | // numid = data.numid; 152 | // wxflag = data.wxflag; 153 | 154 | // if (typeof gameid == 'undefined') { 155 | // currentView = gameStartView; 156 | // container.addChild(gameStartView); 157 | // gameStartView.statusChange("login"); 158 | // } 159 | // // else if(data.areaid == 0) 160 | // // { 161 | // // View.changeView(selectView,container); 162 | // // selectView.show(); 163 | // // } 164 | // else { 165 | // GameConfig.gameType = gameid; 166 | // currentView = gameStartView; 167 | // container.addChild(gameStartView); 168 | // gameStartView.statusChange("start"); 169 | // } 170 | // if (typeof numid != 'undefined') { 171 | // gameStartView.back.txt.text = numid.toString(); 172 | // } 173 | // }) 174 | } 175 | p.listHandler = function listHandler(event) { 176 | cbsRanklist.showRankbox(1); 177 | } 178 | p.zhuxiaoHandler = function zhuxiaoHandler(event) { 179 | window.location.href = Service.zhuxiaoURL; 180 | } 181 | p.weixinHandler = function weixinHandler(event) { 182 | console.log("start") 183 | p.gameStartHandler() 184 | // window.open("http://testat.17m3cdn.com/17m3/mobile/h5game/20151110/zhandoumm/auth.php"); 185 | } 186 | p.checkStartHandler = function checkStartHandler(event) { 187 | window.isServiceStartGame = true; 188 | p.gameStartHandler(); 189 | } 190 | p.gameStartHandler = function gameStartHandler(event) { 191 | View.changeView(gameView, container); 192 | gameView.daojishiStart(); 193 | } 194 | p.soulHandler = function soulHandler(event) { 195 | wx.showModal({ 196 | title: '抱歉', 197 | content: '对不起,暂不支持!', 198 | success: function (res) { 199 | // if (res.confirm) { 200 | // wx.closeModal() 201 | // } 202 | } 203 | }) 204 | return; 205 | try { 206 | if (mslogin) { 207 | mslogin.login(); 208 | } 209 | } 210 | catch (error) { 211 | console.log("没有登录文件") 212 | } 213 | } 214 | p.statusChange = function statusChange(type) { 215 | if (type == "login") { 216 | gameStartView.back.startBtn.visible = false; 217 | gameStartView.back.zhuxiaoBtn.visible = false; 218 | gameStartView.back.txt.visible = false; 219 | gameStartView.back.soulBtn.visible = true; 220 | gameStartView.back.weixinBtn.visible = true; 221 | } 222 | else { 223 | gameStartView.back.startBtn.visible = true; 224 | gameStartView.back.zhuxiaoBtn.visible = true; 225 | gameStartView.back.txt.visible = true; 226 | gameStartView.back.soulBtn.visible = false; 227 | gameStartView.back.weixinBtn.visible = false; 228 | } 229 | } 230 | View.GameStartView = createjs.promote(GameStartView, "Container"); 231 | }()); 232 | //Map 233 | (function () { 234 | "use strict"; 235 | function Map(map) { 236 | this.Container_constructor(); 237 | p.map = map; 238 | this.addChild(p.map); 239 | } 240 | var p = createjs.extend(Map, createjs.Container); 241 | p.width = 750; 242 | p.height = 1300; 243 | View.Map = createjs.promote(Map, "Container"); 244 | }()); 245 | //GameMap 246 | (function () { 247 | "use strict"; 248 | function GameMap() { 249 | this.Container_constructor(); 250 | 251 | // this.back = new lib.home(); 252 | // this.addChild(this.back); 253 | } 254 | var p = createjs.extend(GameMap, createjs.Container); 255 | p.currentMap;//现在的地图 256 | p.nextMap;//下一张地图(用作移动地图) 257 | p.readyMap;//用作切换不同地图时的准备地图 258 | p.destoryMapList = []; 259 | p.readyMapClass; 260 | p.initMap = function initMap(mapCls, width, height) { 261 | p.currentMap = new View.Map(new mapCls()); 262 | p.nextMap = new View.Map(new mapCls()); 263 | p.readyMap = new View.Map(new mapCls()); 264 | p.nextMap.y = - 1300; 265 | p.readyMap.y = -1300 * 2; 266 | this.addChild(p.currentMap); 267 | this.addChild(p.nextMap); 268 | this.addChild(p.readyMap); 269 | } 270 | p.changeMap = function changeMap(mapCls) { 271 | p.readyMapClass = mapCls; 272 | } 273 | p.mapMove = function mapMove(num) { 274 | p.readyMap.y += num; 275 | p.nextMap.y += num; 276 | p.currentMap.y += num; 277 | var bu; 278 | if (p.currentMap.y >= 1300) { 279 | bu = p.currentMap.y - 1300//像素填补 280 | p.currentMap.y = -1300 * 2 + bu; 281 | var obj = p.currentMap; 282 | p.currentMap = p.nextMap; 283 | p.nextMap = p.readyMap; 284 | p.readyMap = obj; 285 | } 286 | 287 | if (GameConfig) { 288 | GameConfig.allDistance += num; 289 | gameView.distanceUI.txt.text = parseInt(GameConfig.allDistance / 20) + "m"; 290 | } 291 | } 292 | View.GameMap = createjs.promote(GameMap, "Container"); 293 | }()); 294 | //GameView 295 | (function () { 296 | "use strict"; 297 | function GameView() { 298 | this.Container_constructor(); 299 | 300 | // this.back = new lib.home(); 301 | // this.addChild(this.back); 302 | if (p.gameMap) { 303 | this.addChild(p.gameMap); 304 | } 305 | p.gameMap.initMap(lib.map1Assets, 750, 1300); 306 | this.addChild(p.carCon); 307 | mainCar = CarFactory.CreateCar(1); 308 | p.carCon.addChild(mainCar); 309 | // p.start(); 310 | this.distanceUI = new lib.distanceUI(); 311 | this.distanceUI.x = 26; 312 | this.distanceUI.y = 42; 313 | this.distanceUI.txt.text = "0m"; 314 | this.addChild(this.distanceUI); 315 | this.pauseBtn = new lib.pauseBtn(); 316 | this.pauseBtn.x = 300; 317 | this.pauseBtn.y = 45; 318 | this.addChild(this.pauseBtn); 319 | this.leftBtn = new lib.leftBtn(); 320 | this.leftBtn.x = 92; 321 | this.leftBtn.y = 1000; 322 | this.addChild(this.leftBtn); 323 | this.rightBtn = new lib.rightBtn(); 324 | this.rightBtn.x = 750 - 234; 325 | this.rightBtn.y = 1000; 326 | this.addChild(this.rightBtn); 327 | 328 | 329 | this.leftBtn.addEventListener("mousedown", p.leftMoveHandler, true); 330 | this.rightBtn.addEventListener("mousedown", p.rightMoveHandler, true); 331 | // this.leftBtn.addEventListener("mouseup", p.upHandler); 332 | // this.rightBtn.addEventListener("mouseup", p.upHandler); 333 | } 334 | var p = createjs.extend(GameView, createjs.Container); 335 | p.carCon = new createjs.Container(); 336 | p.gameMap = new View.GameMap(); 337 | p.gameTick = function gameTick(event) { 338 | if (mainCar.currentSpeed < mainCar.maxSpeed) { 339 | mainCar.currentSpeed += mainCar.addSpeed; 340 | } 341 | else { 342 | mainCar.currentSpeed = mainCar.maxSpeed; 343 | } 344 | // if(arrowStatus == "left") 345 | // { 346 | // mainCar.x -= mainCar.moveSpeed; 347 | // if(mainCar.x < GameConfig.leftValue + mainCar.wr) 348 | // { 349 | // mainCar.x = GameConfig.leftValue + mainCar.wr; 350 | // } 351 | // } 352 | // else if(arrowStatus == "right") 353 | // { 354 | // mainCar.x += mainCar.moveSpeed; 355 | // if(mainCar.x > GameConfig.rightValue - mainCar.wr) 356 | // { 357 | // mainCar.x = GameConfig.rightValue - mainCar.wr; 358 | // } 359 | // } 360 | if (mainCar.addSpeedDistance) { 361 | if (mainCar.addSpeedDistance <= GameConfig.allDistance && mainCar.addSpeedDistance != 0) { 362 | mainCar.reWudi(); 363 | } 364 | } 365 | 366 | //路程到达某个值 且第一次到达这个值 367 | var v = parseInt(GameConfig.allDistance / 1000); 368 | var carType = GameConfig.randomItem[parseInt(Math.random() * (GameConfig.randomItem.length))]; 369 | if (GameConfig.mapInfo.length > 0) { 370 | if (GameConfig.mapInfo.length != v) { 371 | if (GameConfig.mapInfo.length > 18 && GameConfig.maxSpeed != 20) { 372 | 373 | GameConfig.maxSpeed = 20; 374 | mainCar.maxSpeed = GameConfig.maxSpeed; 375 | } 376 | else if (GameConfig.mapInfo.length > 50 && GameConfig.maxSpeed != 25) { 377 | GameConfig.maxSpeed = 25; 378 | mainCar.maxSpeed = GameConfig.maxSpeed; 379 | } 380 | // console.log(Math.abs(GameConfig.allDistance - boxDistance)); 381 | if (Math.abs(GameConfig.allDistance - boxDistance) <= 1000 && boxDistance != 0) { 382 | if (isShowBox == false) { 383 | if (showprz == 1) { 384 | CarFactory.CreateCar(6); 385 | boxDistance = 0; 386 | isShowBox = true; 387 | } 388 | else if (showprz == 2) { 389 | CarFactory.CreateCar(7); 390 | boxDistance = 0; 391 | isShowBox = true; 392 | } 393 | } 394 | } 395 | else { 396 | if (GameConfig.mapInfo.length > 30) { 397 | if (GameConfig.mapInfo.length % 20 == 0) { 398 | CarFactory.CreateCar(5); 399 | } 400 | else { 401 | var a1 = parseInt(Math.random() * GameConfig.randomPoint.length); 402 | var a2 = a1 + 1; 403 | if (a2 > 2) { 404 | a2 = 0; 405 | } 406 | var x1 = GameConfig.randomPoint[a1]; 407 | var x2 = GameConfig.randomPoint[a2]; 408 | CarFactory.CreateCar(carType, x1); 409 | CarFactory.CreateCar(carType, x2); 410 | } 411 | } 412 | else { 413 | if (GameConfig.mapInfo.length % 10 == 0) { 414 | CarFactory.CreateCar(5); 415 | } 416 | else { 417 | CarFactory.CreateCar(carType); 418 | } 419 | } 420 | } 421 | GameConfig.mapInfo.push(v); 422 | } 423 | } 424 | else if (GameConfig.mapInfo.length == 0) { 425 | if (v >= 1) { 426 | CarFactory.CreateCar(carType); 427 | GameConfig.mapInfo.push(v); 428 | } 429 | } 430 | var i; 431 | for (i = 0; i < CarFactory.CarList.length; i++) { 432 | // CarFactory.CarList[i].y += CarFactory.CarList[i].currentSpeed; 433 | CarFactory.CarList[i].y += mainCar.currentSpeed; 434 | } 435 | for (i = 0; i < CarFactory.CarList.length; i++)//分两次运算防止数组变化造成某一单位多运行一次 436 | { 437 | if ((Math.abs(mainCar.x - CarFactory.CarList[i].x) < (mainCar.wr + CarFactory.CarList[i].wr)) && (Math.abs(mainCar.y - CarFactory.CarList[i].y) < (mainCar.hr + CarFactory.CarList[i].hr))) { 438 | // CarFactory.CarList[i].dead(); 439 | if (p.hitTestHandler(CarFactory.CarList[i])) { 440 | return; 441 | } 442 | continue; 443 | } 444 | if (CarFactory.CarList[i].y > 1206 + CarFactory.CarList[i].hr) { 445 | // CarFactory.CarList[i].dead(); 446 | // p.hitTestHandler(CarFactory.CarList[i]); 447 | CarFactory.destoryCar(CarFactory.CarList[i]); 448 | } 449 | } 450 | p.gameMap.mapMove(mainCar.currentSpeed); 451 | } 452 | p.hitTestHandler = function hitTestHandler(obj) { 453 | obj.dead(); 454 | if (obj.deadSound) obj.deadSound(); 455 | if (obj.type != 1 && obj.type != 5 && obj.type != 6 && obj.type != 7 && mainCar.status != "wudi") { 456 | mainCar.dead(); 457 | return true; 458 | } 459 | else if (obj.type == 6 || obj.type == 7) { 460 | var fun = function (data) { 461 | if (data.resultCode == 1) { 462 | prizeText = data.resultInfo; 463 | } 464 | else { 465 | prizeText = ""; 466 | } 467 | if (typeof data.resultData != 'undefined') { 468 | $('#copyTarget').text(data.resultData); 469 | $('#popBottom').css("display", "block"); 470 | } 471 | else { 472 | $('#popBottom').css("display", "none"); 473 | } 474 | } 475 | Service.getBox(fun); 476 | } 477 | else if (obj.type == 5) { 478 | mainCar.wudi(); 479 | } 480 | return false 481 | } 482 | p.start = function start() { 483 | if (showprz == 1 || showprz == 2) { 484 | if (isShowBox == false) { 485 | boxDistance = 3000 + parseInt(Math.random() * 10000); 486 | } 487 | } 488 | // showprz = 2; 489 | // boxDistance = 5000; 490 | 491 | isStart = true 492 | window.model.removeEventListener("jiOver", p.start); 493 | GameConfig.mapInfo = []; 494 | GameConfig.allDistance = 0; 495 | GameConfig.maxSpeed = 15; 496 | mainCar.currentSpeed = 0; 497 | mainCar.maxSpeed = GameConfig.maxSpeed; 498 | mainCar.addSpeedDistance = 0; 499 | prizeText = ""; 500 | createjs.Ticker.addEventListener("tick", p.gameTick); 501 | gameView.pauseBtn.addEventListener("click", p.clickHandler); 502 | Sound.playBgm(); 503 | } 504 | p.pause = function pause() { 505 | isStart = false 506 | // gameView.leftBtn.removeEventListener("mousedown", p.leftMoveHandler); 507 | // gameView.leftBtn.removeEventListener("mouseup", p.upHandler); 508 | // gameView.rightBtn.removeEventListener("mousedown", p.rightMoveHandler); 509 | // gameView.rightBtn.removeEventListener("mouseup", p.upHandler); 510 | gameView.pauseBtn.removeEventListener("click", p.clickHandler); 511 | createjs.Ticker.removeEventListener("tick", p.gameTick); 512 | console.log("pause"); 513 | container.addChild(pauseView); 514 | Sound.stopBgm(); 515 | } 516 | p.resume = function resume() { 517 | // if(gameView.parent) 518 | // { 519 | // gameView.parent.removeChild(gameView); 520 | // stage.update(); 521 | // } 522 | // createjs.Ticker.reset(); 523 | // createjs.Ticker._tickTimes = []; 524 | // createjs.Ticker._times = []; 525 | // createjs.Ticker.removeEventListener("tick", stageBreakHandler); 526 | // setTimeout(p.resumeDelayHandler,2000); 527 | 528 | isStart = true; 529 | window.model.removeEventListener("jiOver", p.resume); 530 | // gameView.leftBtn.addEventListener("mousedown", p.leftMoveHandler); 531 | // gameView.leftBtn.addEventListener("mouseup", p.upHandler); 532 | // gameView.rightBtn.addEventListener("mousedown", p.rightMoveHandler); 533 | // gameView.rightBtn.addEventListener("mouseup", p.upHandler); 534 | gameView.pauseBtn.addEventListener("click", p.clickHandler); 535 | createjs.Ticker.addEventListener("tick", p.gameTick); 536 | console.log("resume"); 537 | if (pauseView.parent) pauseView.parent.removeChild(pauseView); 538 | Sound.playBgm(); 539 | } 540 | p.resumeDelayHandler = function resumeDelayHandler() { 541 | createjs.Ticker.init(); 542 | createjs.Ticker.addEventListener("tick", stageBreakHandler); 543 | container.addChild(gameView); 544 | 545 | isStart = true; 546 | window.model.removeEventListener("jiOver", p.resume); 547 | // gameView.leftBtn.addEventListener("mousedown", p.leftMoveHandler); 548 | // gameView.leftBtn.addEventListener("mouseup", p.upHandler); 549 | // gameView.rightBtn.addEventListener("mousedown", p.rightMoveHandler); 550 | // gameView.rightBtn.addEventListener("mouseup", p.upHandler); 551 | gameView.pauseBtn.addEventListener("click", p.clickHandler); 552 | createjs.Ticker.addEventListener("tick", p.gameTick); 553 | console.log("resume"); 554 | if (pauseView.parent) pauseView.parent.removeChild(pauseView); 555 | Sound.playBgm(); 556 | } 557 | p.over = function over() { 558 | isStart = false; 559 | isShowBox = false; 560 | boxDistance = 0; 561 | if (pauseView.parent) pauseView.parent.removeChild(pauseView); 562 | gameView.pauseBtn.removeEventListener("click", p.clickHandler); 563 | // gameView.leftBtn.removeEventListener("mousedown", p.leftMoveHandler); 564 | // gameView.leftBtn.removeEventListener("mouseup", p.upHandler); 565 | // gameView.rightBtn.removeEventListener("mousedown", p.rightMoveHandler); 566 | // gameView.rightBtn.removeEventListener("mouseup", p.upHandler); 567 | // canvas.removeEventListener('touchstart',touchStart); 568 | // canvas.removeEventListener('touchend',touchEnd); 569 | createjs.Ticker.removeEventListener("tick", p.gameTick); 570 | Sound.stopBgm(); 571 | 572 | var strHandler = function strHandler(fen) { 573 | var str; 574 | if (prizeText != "") { 575 | str = prizeText; 576 | } 577 | else { 578 | if (GameConfig.succper == 0) { 579 | str = " 你让梦梦在战场上行驶了" + fen + "m,\n超越" + GameConfig.succper + "%的玩家。加油,加油,加油!" 580 | } 581 | else if (GameConfig.succper < 99) { 582 | str = "由于你神一般的操控,成功的让梦梦在战场\n行驶了 " + fen + " m,已经超越了" + GameConfig.succper + "%的玩家。"; 583 | } 584 | else if (GameConfig.succper = 100) { 585 | str = "你的超神手速,成功让梦梦行驶了" + fen + "m,\n获得了操控王者的称号,已经超越99%的玩家!" 586 | } 587 | } 588 | blogText = str; 589 | return str; 590 | } 591 | var fen = parseInt(GameConfig.allDistance / 20); 592 | var str; 593 | if (typeof gameid == 'undefined' || gameid == "") { 594 | 595 | setTimeout(function () { 596 | // EndView.show(); 597 | // EndView.tweenTxt(fen); 598 | // $('#pop_content').html("由于你神一般的操控,成功的让梦梦在战场
行驶了 " + fen + " m!"); 599 | View.changeView(endView,container); 600 | endView.tweenTxt(fen); 601 | endView.back.contentTxt.text = "由于你神一般的操控,成功的让梦梦在战场\n行驶了 " + fen + " m!"; 602 | endView.back.zhedang.visible = true; 603 | endView.back.listBtn.mouseEnabled = false; 604 | endView.back.listBtn.mouseChildren = false; 605 | }, 2000); 606 | } 607 | else { 608 | setTimeout(function () { 609 | Service.gameover(gameid, fen, function (data) { 610 | GameConfig.myrank = data.myrank; 611 | GameConfig.succper = data.succper; 612 | GameConfig.succper = parseInt(GameConfig.succper.split("%")[0]); 613 | str = strHandler(fen); 614 | // EndView.show(); 615 | // EndView.tweenTxt(fen); 616 | // $('#pop_content').html(str); 617 | fenxiangTextHandler(); 618 | View.changeView(endView,container); 619 | endView.tweenTxt(fen); 620 | endView.back.contentTxt.text = str; 621 | endView.back.zhedang.visible = false; 622 | endView.back.listBtn.mouseEnabled = true; 623 | endView.back.listBtn.mouseChildren = true; 624 | }) 625 | }, 1500); 626 | } 627 | }; 628 | p.allCarDead = function allCarDead() { 629 | var i; 630 | for (i = 0; i < CarFactory.CarList.length; i++) { 631 | if (CarFactory.CarList[i] != 5 && CarFactory.CarList[i] != 1) { 632 | CarFactory.CarList[i].dead(); 633 | } 634 | } 635 | } 636 | p.leftMoveHandler = function leftMoveHandler(event) { 637 | if (isStart == false) return; 638 | if (arrowStatus == "left") return; 639 | if (mainCar.index <= 0) return; 640 | arrowStatus = "left"; 641 | mainCar.tweenMove(GameConfig.randomPoint[mainCar.index - 1]) 642 | } 643 | p.rightMoveHandler = function rightMoveHandler(event) { 644 | if (isStart == false) return; 645 | if (arrowStatus == "right") return; 646 | if (mainCar.index >= 2) return; 647 | arrowStatus = "right"; 648 | mainCar.tweenMove(GameConfig.randomPoint[mainCar.index + 1]) 649 | } 650 | p.upHandler = function upHandler(event) { 651 | 652 | } 653 | p.clickHandler = function clickHandler(event) { 654 | p.pause(); 655 | } 656 | p.daojishiStart = function daojishiStart() { 657 | var fun = function () { 658 | container.addChild(daojishi); 659 | daojishi.gotoAndPlay(1); 660 | window.model.addEventListener("jiOver", p.start); 661 | gameView.distanceUI.txt.text = "0m"; 662 | mainCar.back.gotoAndPlay(0); 663 | mainCar.x = GameConfig.randomPoint[1]; 664 | mainCar.index = 1; 665 | for (var i = 0; i < CarFactory.CarList.length; i++) { 666 | if (CarFactory.CarList[i].parent) { 667 | CarFactory.CarList[i].parent.removeChild(CarFactory.CarList[i]); 668 | } 669 | } 670 | CarFactory.CarList = []; 671 | } 672 | 673 | if (window.isServiceStartGame == true) { 674 | Service.startGame(function (data) { 675 | showprz = data.showprz; 676 | fun() 677 | }) 678 | } 679 | else { 680 | fun() 681 | } 682 | } 683 | p.daojishiResume = function daojishiResume() { 684 | if (pauseView.parent) pauseView.parent.removeChild(pauseView); 685 | container.addChild(daojishi); 686 | daojishi.gotoAndPlay(1); 687 | window.model.addEventListener("jiOver", p.resume); 688 | } 689 | View.GameView = createjs.promote(GameView, "Container"); 690 | }()); 691 | //PauseView 692 | (function () { 693 | "use strict"; 694 | function PauseView() { 695 | this.Container_constructor(); 696 | this.shape = new createjs.Shape(); 697 | this.shape.graphics.beginFill("#000000").drawRect(0, 0, 750, 1206); 698 | this.addChild(this.shape); 699 | this.shape.alpha = 0.5; 700 | this.resumeGameBtn = new lib.resumeGameBtn(); 701 | this.resumeGameBtn.x = 197; 702 | this.resumeGameBtn.y = 500; 703 | this.addChild(this.resumeGameBtn); 704 | // this.returnHomeBtn = new lib.returnHomeBtn(); 705 | // this.returnHomeBtn.x = 197; 706 | // this.returnHomeBtn.y = 670; 707 | // this.addChild(this.returnHomeBtn); 708 | this.resumeGameBtn.addEventListener("click", p.resumeGameBtnClickHandler); 709 | // this.returnHomeBtn.addEventListener("click", p.returnHomeBtnClickHandler); 710 | } 711 | var p = createjs.extend(PauseView, createjs.Container); 712 | p.resumeGameBtnClickHandler = function resumeGameBtnClickHandler(event) { 713 | gameView.daojishiResume(); 714 | } 715 | p.returnHomeBtnClickHandler = function returnHomeBtnClickHandler(event) { 716 | gameView.over(); 717 | View.changeView(gameStartView, container); 718 | } 719 | View.PauseView = createjs.promote(PauseView, "Container"); 720 | }()); 721 | //EndView 722 | // var EndView = { 723 | // show: function show(fun) { 724 | // // $('#end_pop').show(500, fun); 725 | // }, 726 | // hide: function (fun) { 727 | // //$('#end_pop').hide(500, fun); 728 | // }, 729 | // tweenTxt: function (num) { 730 | // // $('#m_title').text('0m'); 731 | // EndView.num = num; 732 | // EndView.addNum = num / 100; 733 | // EndView.currentNum = 0; 734 | // createjs.Ticker.addEventListener("tick", EndView.tweenTxtMove); 735 | // }, 736 | // tweenTxtMove: function () { 737 | // if (EndView.currentNum + EndView.addNum < EndView.num) { 738 | // EndView.currentNum = EndView.currentNum + EndView.addNum; 739 | // // $('#m_title').text(parseInt(EndView.currentNum) + "m"); 740 | // // console.log(parseInt(EndView.currentNum) + "m") 741 | // } 742 | // else { 743 | // EndView.currentNum = EndView.num; 744 | // EndView.endTween(); 745 | // } 746 | // }, 747 | // endTween: function () { 748 | // //$('#m_title').text(EndView.num + "m"); 749 | // createjs.Ticker.removeEventListener("tick", EndView.tweenTxtMove); 750 | // }, 751 | // resetHandle: function () { 752 | // EndView.endTween(); 753 | // EndView.hide(function () { 754 | // gameStartView.init() 755 | // }); 756 | // View.changeView(gameStartView, container); 757 | 758 | // }, 759 | // shareHandler: function () { 760 | // cbsRanklist.sharegame(1, blogText, 1); 761 | // }, 762 | // listHandler: function () { 763 | // if (typeof gameid == 'undefined') { 764 | // alert("只有登录后,才能查看排行榜!") 765 | // return; 766 | // } 767 | // cbsRanklist.showRankbox(1, function () { 768 | // EndView.hide(function () { 769 | // gameStartView.init(); 770 | // }); 771 | // View.changeView(gameStartView, container); 772 | // }); 773 | // } 774 | // }; 775 | (function() { 776 | function EndView(){ 777 | this.Container_constructor(); 778 | this.back = new lib.endViewAssets(); 779 | this.addChild(this.back); 780 | this.back.resetBtn.addEventListener("click", p.resetHandler); 781 | this.back.fenxiangBtn.addEventListener("click", p.fenxiangHandler); 782 | this.back.listBtn.addEventListener("click", p.listHandler); 783 | } 784 | var p = createjs.extend(EndView,createjs.Container); 785 | p.resetHandler = function resetHandler(event) 786 | { 787 | p.endtween(); 788 | View.changeView(gameStartView,container); 789 | gameStartView.init(); 790 | // View.changeView(gameView,container); 791 | // gameView.daojishiStart(); 792 | // if(endView.parent) 793 | // { 794 | // endView.parent.removeChild(endView); 795 | // gameView.daojishiStart(); 796 | // } 797 | } 798 | p.fenxiangHandler = function fenxiangHandler(event) 799 | { 800 | // alert(cbsRanklist.sharegame); 801 | // cbsRanklist.sharegame(1,blogText,1); 802 | wx.showShareMenu() 803 | } 804 | p.listHandler = function listHandler(event) 805 | { 806 | cbsRanklist.showRankbox(1,function (){ 807 | // if(endView.parent) 808 | // { 809 | // endView.parent.removeChild(endView); 810 | // } 811 | // gameView.daojishiStart(); 812 | // View.changeView(gameView,container); 813 | // gameView.daojishiStart(); 814 | View.changeView(gameStartView,container); 815 | gameStartView.init(); 816 | }); 817 | } 818 | p.tweenTxt = function tweenTxt(num) 819 | { 820 | endView.back.txt.text = "0m"; 821 | p.num = num; 822 | p.addNum = num/100; 823 | p.currentNum = 0; 824 | createjs.Ticker.addEventListener("tick", p.tweenTxtMove); 825 | } 826 | p.tweenTxtMove = function tweenTxtMove() 827 | { 828 | if(p.currentNum + p.addNum < p.num) 829 | { 830 | p.currentNum = p.currentNum + p.addNum; 831 | endView.back.txt.text = parseInt(p.currentNum) + "m"; 832 | } 833 | else 834 | { 835 | p.currentNum = p.num; 836 | p.endtween(); 837 | } 838 | } 839 | p.endtween = function endtween() 840 | { 841 | endView.back.txt.text = p.num + "m"; 842 | createjs.Ticker.removeEventListener("tick", p.tweenTxtMove); 843 | } 844 | View.EndView = createjs.promote(EndView, "Container"); 845 | }()); 846 | //Car 847 | (function () { 848 | "use strict"; 849 | function Car(carAssets) { 850 | this.Container_constructor(); 851 | this.back = carAssets; 852 | this.back.tickChildren = false; 853 | this.addChild(carAssets); 854 | this.index = 1; 855 | } 856 | var p = createjs.extend(Car, createjs.Container); 857 | p.currentSpeed; 858 | p.addSpeed; 859 | p.initSpeed; 860 | p.maxSpeed; 861 | p.moveSpeed//左右速度 862 | p.wr; 863 | p.hr; 864 | p.tweenMove = function tweenMove(x, time) { 865 | if (x < GameConfig.randomPoint[0]) return; 866 | if (x > GameConfig.randomPoint[2]) return; 867 | // if(x > this.x && arrowStatus == "right") return; 868 | // if(x < this.x && arrowStatus == "left") return; 869 | if (arrowStatus == "right") { 870 | this.index++; 871 | } 872 | else if (arrowStatus == "left") { 873 | this.index--; 874 | } 875 | var bi; 876 | if (x > this.x) { 877 | bi = Math.abs((x - this.x) / (GameConfig.randomPoint[2] - GameConfig.randomPoint[1])) 878 | } 879 | else if (x < this.x) { 880 | bi = Math.abs((this.x - x) / (GameConfig.randomPoint[1] - GameConfig.randomPoint[0])); 881 | } 882 | // console.log("bi>>>>>>>>>",bi); 883 | createjs.Tween.removeTweens(this) 884 | console.log("tween",this) 885 | this.tween = createjs.Tween.get(this).to({ x: x }, 150 * bi/1000, createjs.Ease.none).call(p.tweenDelayComplete, [this]); 886 | }; 887 | p.tweenDelayComplete = function tweenDelayComplete(target) { 888 | arrowStatus = "none"; 889 | }; 890 | p.dead = function dead() { 891 | this.back.play(); 892 | CarFactory.deadCar(this); 893 | }; 894 | View.Car = createjs.promote(Car, "Container"); 895 | }()); 896 | //MainCar(玩家车) 897 | (function () { 898 | "use strict"; 899 | function MainCar(carAssets) { 900 | this.Car_constructor(carAssets); 901 | this.status = "none"; 902 | } 903 | var p = createjs.extend(MainCar, View.Car); 904 | p.dead = function dead() { 905 | mainCar.addSpeedDistance = 0; 906 | mainCar.back.gotoAndPlay(42); 907 | gameView.over(); 908 | } 909 | // p.strHandler = function strHandler(fen) 910 | // { 911 | // var str; 912 | // if(GameConfig.succper == 0) 913 | // { 914 | // str = " 你让梦梦在战场上行驶了" + fen + "m,\n超越1%的玩家。加油,加油,加油!"; 915 | // } 916 | // else if(GameConfig.succper < 99) 917 | // { 918 | // str = "由于你神一般的操控,成功的让梦梦在战场\n行驶了 " + fen + " m,已经超越了" + GameConfig.succper + "%的玩家。"; 919 | // } 920 | // else if(GameConfig.succper = 100) 921 | // { 922 | // str = "你的超神手速,成功让梦梦行驶了" + fen + "m,\n获得了操控王者的称号,已经超越99%的玩家!"; 923 | // } 924 | // return str; 925 | // } 926 | p.wudi = function wudi() { 927 | mainCar.maxSpeed = 30; 928 | mainCar.addSpeed = 0.5 929 | mainCar.status = "wudi"; 930 | mainCar.back.gotoAndPlay(27); 931 | mainCar.addSpeedDistance = GameConfig.allDistance + 3000; 932 | 933 | Sound.playAddSpeed(); 934 | // if(mainCar.addTime) 935 | // { 936 | // clearTimeout(mainCar.addTime); 937 | // } 938 | // mainCar.addTime = setTimeout(p.reWudi,3000) 939 | } 940 | p.reWudi = function reWudi() { 941 | mainCar.addSpeedDistance = 0; 942 | gameView.allCarDead(); 943 | mainCar.addTime = null; 944 | mainCar.maxSpeed = GameConfig.maxSpeed; 945 | mainCar.addSpeed = 0.1; 946 | mainCar.back.gotoAndPlay(0); 947 | setTimeout(function () { mainCar.status = "none" }, 200); 948 | Sound.stopAddSpeed(); 949 | } 950 | View.MainCar = createjs.promote(MainCar, "Car"); 951 | }()); 952 | //ItemCar(道具车) 953 | (function () { 954 | "use strict"; 955 | function ItemCar(carAssets) { 956 | this.Car_constructor(carAssets); 957 | } 958 | var p = createjs.extend(ItemCar, View.Car); 959 | p.dead = function dead() { 960 | CarFactory.destoryCar(this); 961 | }; 962 | View.ItemCar = createjs.promote(ItemCar, "Car"); 963 | }()); 964 | //function copyInit() 965 | //{ 966 | // var clipboard = new Clipboard("#copyBtn"); 967 | // clipboard.on("success",function (e){ 968 | // alert("复制成功!") 969 | // e.clearSelection(); 970 | // }) 971 | // clipboard.on("error",function (e){ 972 | // alert("复制失败!请长按激活码复制!") 973 | // }) 974 | //} 975 | //copyInit(); 976 | 977 | //CarFactory 978 | var CarFactory = {}; 979 | CarFactory.CarList = []; 980 | CarFactory.assets2DestoryList = []; 981 | CarFactory.assets3DestoryList = []; 982 | CarFactory.assets4DestoryList = []; 983 | CarFactory.assets5DestoryList = []; 984 | CarFactory.randomControl = function randomControl(obj) { 985 | var point = GameConfig.randomPoint[parseInt(Math.random() * GameConfig.randomPoint.length)]; 986 | while (CarFactory.oldPoint == point) { 987 | point = GameConfig.randomPoint[parseInt(Math.random() * GameConfig.randomPoint.length)]; 988 | } 989 | CarFactory.oldPoint = point 990 | return CarFactory.oldPoint; 991 | } 992 | CarFactory.CreateCar = function CreateCar(type, xx) { 993 | var car; 994 | switch (type) { 995 | case 1: 996 | car = new View.MainCar(new lib.carAssets1()); 997 | car.type = type; 998 | car.addSpeed = 0.1; 999 | car.moveSpeed = 10; 1000 | car.maxSpeed = 15; 1001 | car.initSpeed = 2; 1002 | car.currentSpeed = 0; 1003 | car.wr = 72; 1004 | car.hr = 111; 1005 | car.x = GameConfig.randomPoint[1]; 1006 | car.y = 880; 1007 | break; 1008 | case 2: 1009 | if (CarFactory.assets2DestoryList.length > 0) { 1010 | car = CarFactory.assets2DestoryList.shift() 1011 | } 1012 | else { 1013 | car = new View.Car(new lib.carAssets2()); 1014 | } 1015 | car.type = type; 1016 | car.addSpeed = 0; 1017 | car.moveSpeed = 5; 1018 | car.maxSpeed = 15; 1019 | car.initSpeed = 15; 1020 | car.currentSpeed = 15; 1021 | car.wr = 67; 1022 | car.hr = 40; 1023 | car.x = CarFactory.randomControl(car); 1024 | // car.x = GameConfig.randomPoint[parseInt(((Math.random() *GameConfig.randomPoint.length)+(Math.random() *GameConfig.randomPoint.length))/2)]; 1025 | car.y = - car.hr; 1026 | car.deadSound = Sound.playCi; 1027 | CarFactory.CarList.push(car); 1028 | gameView.carCon.addChild(car); 1029 | car.back.gotoAndStop(0); 1030 | break; 1031 | case 3: 1032 | if (CarFactory.assets3DestoryList.length > 0) { 1033 | car = CarFactory.assets3DestoryList.shift() 1034 | } 1035 | else { 1036 | car = new View.Car(new lib.carAssets3()); 1037 | } 1038 | car.type = type; 1039 | car.addSpeed = 0; 1040 | car.moveSpeed = 5; 1041 | car.maxSpeed = 15; 1042 | car.initSpeed = 15; 1043 | car.currentSpeed = 15; 1044 | car.wr = 75; 1045 | car.hr = 46; 1046 | car.x = GameConfig.randomPoint[parseInt(((Math.random() * GameConfig.randomPoint.length) + (Math.random() * GameConfig.randomPoint.length)) / 2)]; 1047 | car.y = - car.hr; 1048 | car.deadSound = Sound.playTong; 1049 | CarFactory.CarList.push(car); 1050 | gameView.carCon.addChild(car); 1051 | car.back.gotoAndStop(0); 1052 | break; 1053 | case 4: 1054 | if (CarFactory.assets4DestoryList.length > 0) { 1055 | car = CarFactory.assets4DestoryList.shift() 1056 | } 1057 | else { 1058 | car = new View.Car(new lib.carAssets4()); 1059 | } 1060 | car.type = type; 1061 | car.addSpeed = 0; 1062 | car.moveSpeed = 5; 1063 | car.maxSpeed = 15; 1064 | car.initSpeed = 15; 1065 | car.currentSpeed = 15; 1066 | car.wr = 50; 1067 | car.hr = 36; 1068 | car.x = CarFactory.randomControl(car); 1069 | // car.x = GameConfig.randomPoint[parseInt(((Math.random() *GameConfig.randomPoint.length)+(Math.random() *GameConfig.randomPoint.length))/2)]; 1070 | car.y = - car.hr; 1071 | car.deadSound = Sound.playHuo; 1072 | CarFactory.CarList.push(car); 1073 | gameView.carCon.addChild(car); 1074 | car.back.gotoAndStop(0); 1075 | break; 1076 | case 5: 1077 | if (CarFactory.assets5DestoryList.length > 0) { 1078 | car = CarFactory.assets5DestoryList.shift() 1079 | } 1080 | else { 1081 | car = new View.ItemCar(new lib.carAssets5()); 1082 | } 1083 | car.type = type; 1084 | car.addSpeed = 0; 1085 | car.moveSpeed = 5; 1086 | car.maxSpeed = 15; 1087 | car.initSpeed = 15; 1088 | car.currentSpeed = 15; 1089 | car.wr = 60; 1090 | car.hr = 55; 1091 | car.x = CarFactory.randomControl(car); 1092 | // car.x = GameConfig.randomPoint[parseInt(((Math.random() *GameConfig.randomPoint.length)+(Math.random() *GameConfig.randomPoint.length))/2)]; 1093 | car.y = - car.hr; 1094 | CarFactory.CarList.push(car); 1095 | gameView.carCon.addChild(car); 1096 | break; 1097 | case 6: 1098 | car = new View.ItemCar(new lib.carAssets6()); 1099 | car.type = type; 1100 | car.addSpeed = 0; 1101 | car.moveSpeed = 5; 1102 | car.maxSpeed = 15; 1103 | car.initSpeed = 15; 1104 | car.currentSpeed = 15; 1105 | car.wr = 55; 1106 | car.hr = 51; 1107 | car.x = CarFactory.randomControl(car); 1108 | // car.x = GameConfig.randomPoint[parseInt(((Math.random() *GameConfig.randomPoint.length)+(Math.random() *GameConfig.randomPoint.length))/2)]; 1109 | car.y = - car.hr; 1110 | car.deadSound = Sound.playBox; 1111 | CarFactory.CarList.push(car); 1112 | gameView.carCon.addChild(car); 1113 | break; 1114 | case 7: 1115 | car = new View.ItemCar(new lib.carAssets7()); 1116 | car.type = type; 1117 | car.addSpeed = 0; 1118 | car.moveSpeed = 5; 1119 | car.maxSpeed = 15; 1120 | car.initSpeed = 15; 1121 | car.currentSpeed = 15; 1122 | car.wr = 55; 1123 | car.hr = 51; 1124 | car.x = CarFactory.randomControl(car); 1125 | // car.x = GameConfig.randomPoint[parseInt(((Math.random() *GameConfig.randomPoint.length)+(Math.random() *GameConfig.randomPoint.length))/2)]; 1126 | car.y = - car.hr; 1127 | car.deadSound = Sound.playBox; 1128 | CarFactory.CarList.push(car); 1129 | gameView.carCon.addChild(car); 1130 | break; 1131 | default: 1132 | 1133 | break; 1134 | } 1135 | if (xx) car.x = xx; 1136 | return car; 1137 | } 1138 | CarFactory.destoryCar = function destoryCar(car) { 1139 | for (var i = 0; i < CarFactory.CarList.length; i++) { 1140 | if (CarFactory.CarList[i] == car) { 1141 | CarFactory.CarList.splice(i, 1); 1142 | break; 1143 | } 1144 | } 1145 | CarFactory.destory(car); 1146 | }; 1147 | CarFactory.deadCar = function deadCar(car) { 1148 | for (var i = 0; i < CarFactory.CarList.length; i++) { 1149 | if (CarFactory.CarList[i] == car) { 1150 | CarFactory.CarList.splice(i, 1); 1151 | break; 1152 | } 1153 | } 1154 | setTimeout(function () { CarFactory.destory(car) }, 1000); 1155 | } 1156 | CarFactory.destory = function destory(car) { 1157 | if (car.parent) { 1158 | car.parent.removeChild(car); 1159 | } 1160 | if (car.type == 2) { 1161 | CarFactory.assets2DestoryList.push(car); 1162 | } 1163 | else if (car.type == 3) { 1164 | CarFactory.assets3DestoryList.push(car); 1165 | } 1166 | else if (car.type == 4) { 1167 | CarFactory.assets4DestoryList.push(car); 1168 | } 1169 | else if (car.type == 5) { 1170 | CarFactory.assets5DestoryList.push(car); 1171 | } 1172 | } 1173 | // //Sound 1174 | // var Sound = {}; 1175 | // Sound.playSound = function playSound(id, loop) { 1176 | // return createjs.Sound.play(id, createjs.Sound.INTERRUPT_EARLY, 0, 0, loop); 1177 | // } 1178 | // Sound.playBgm = function playBgm() { 1179 | // Sound.playBgmSound = Sound.playSound("carSound", -1); 1180 | // } 1181 | // Sound.stopBgm = function stopBgm() { 1182 | // if (Sound.playBgmSound) { 1183 | // Sound.playBgmSound.stop() 1184 | // } 1185 | // } 1186 | // Sound.playAddSpeed = function playAddSpeed() { 1187 | // Sound.addSpeedSound = Sound.playSound("addSpeedSound", -1); 1188 | // } 1189 | // Sound.stopAddSpeed = function stopAddSpeed() { 1190 | // if (Sound.addSpeedSound) { 1191 | // Sound.addSpeedSound.stop(); 1192 | // } 1193 | // } 1194 | // Sound.playCi = function playCi() { 1195 | // Sound.playSound("diciSound", 0); 1196 | // } 1197 | // Sound.playHuo = function playHuo() { 1198 | // Sound.playSound("huoSound", 0); 1199 | // } 1200 | // Sound.playTong = function playTong() { 1201 | // Sound.playSound("mutongSound", 0); 1202 | // } 1203 | // Sound.playBox = function playBox() { 1204 | // Sound.playSound("box", 0); 1205 | // } 1206 | //GameConfig 1207 | var GameConfig = {}; 1208 | GameConfig.leftValue = 75; 1209 | GameConfig.rightValue = 750 - 65; 1210 | 1211 | GameConfig.randomPoint = [173, 379, 582]; 1212 | GameConfig.randomItem = [2, 3, 4]; 1213 | GameConfig.allDistance = 0; 1214 | GameConfig.maxSpeed = 25; 1215 | //GameConfig.mapDistance = [1200,2400,3600,4800,6000]; 1216 | GameConfig.mapInfo = []; 1217 | window.View = View; -------------------------------------------------------------------------------- /project.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "description": "项目配置文件。", 3 | "setting": { 4 | "urlCheck": true, 5 | "es6": true, 6 | "postcss": true, 7 | "minified": true, 8 | "newFeature": true 9 | }, 10 | "compileType": "game", 11 | "libVersion": "game", 12 | "appid": "wxec304f748fcd3aa5", 13 | "projectname": "test", 14 | "isGameTourist": true, 15 | "condition": { 16 | "search": { 17 | "current": -1, 18 | "list": [] 19 | }, 20 | "conversation": { 21 | "current": -1, 22 | "list": [] 23 | }, 24 | "game": { 25 | "currentL": -1, 26 | "list": [] 27 | }, 28 | "miniprogram": { 29 | "current": -1, 30 | "list": [] 31 | } 32 | } 33 | } -------------------------------------------------------------------------------- /sounds/_11.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajex-china/createjs-wx/5653a19caf3e93d652e1ad9e514f74bd0a358ed7/sounds/_11.mp3 -------------------------------------------------------------------------------- /sounds/_33.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajex-china/createjs-wx/5653a19caf3e93d652e1ad9e514f74bd0a358ed7/sounds/_33.mp3 -------------------------------------------------------------------------------- /sounds/addSpeedSound.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajex-china/createjs-wx/5653a19caf3e93d652e1ad9e514f74bd0a358ed7/sounds/addSpeedSound.mp3 -------------------------------------------------------------------------------- /sounds/bgm.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajex-china/createjs-wx/5653a19caf3e93d652e1ad9e514f74bd0a358ed7/sounds/bgm.mp3 -------------------------------------------------------------------------------- /sounds/box.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajex-china/createjs-wx/5653a19caf3e93d652e1ad9e514f74bd0a358ed7/sounds/box.mp3 -------------------------------------------------------------------------------- /sounds/diciSound.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajex-china/createjs-wx/5653a19caf3e93d652e1ad9e514f74bd0a358ed7/sounds/diciSound.mp3 -------------------------------------------------------------------------------- /sounds/huoSound.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajex-china/createjs-wx/5653a19caf3e93d652e1ad9e514f74bd0a358ed7/sounds/huoSound.mp3 -------------------------------------------------------------------------------- /sounds/mutongSound.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajex-china/createjs-wx/5653a19caf3e93d652e1ad9e514f74bd0a358ed7/sounds/mutongSound.mp3 -------------------------------------------------------------------------------- /更新文档.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajex-china/createjs-wx/5653a19caf3e93d652e1ad9e514f74bd0a358ed7/更新文档.txt --------------------------------------------------------------------------------