game.min.js 66 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897
  1. SpilGamesBrand = function() {
  2. var d = window.document;
  3. documentElement = d.documentElement || {};
  4. element = d.createElement("div");
  5. container = d.getElementById("spilgames-root");
  6. emptyFn = function() {};
  7. globalSettings = {};
  8. api = {};
  9. updateBodyCheck = function(d) {
  10. var a, b = d,
  11. c = !1;
  12. return function(d, f) {
  13. b = d || b;
  14. c = f || c;
  15. clearTimeout(a);
  16. c && (a = setTimeout(function() {
  17. updateBodyCheck = function(a) {
  18. b = a || b;
  19. b()
  20. };
  21. b()
  22. }, 100))
  23. }
  24. }(emptyFn);
  25. updateSize = function() {
  26. var h = d.body || d.getElementsByTagName("body")[0];
  27. updateSize = function(a) {
  28. a = h.getElementsByTagName("*");
  29. for (var b = a.length, c = 0, k = element.style.zIndex, f = 0; f < b; f++) c++, a[f] !== element && a[f].style.zIndex > c && (c = a[f].style.zIndex), c > k && (k = c, updateBodyCheck());
  30. element.style.zIndex = k;
  31. element.style.width = (window.innerWidth || documentElement.clientWidth || d.getElementsByTagName("body")[0].clientWidth) + "px";
  32. element.style.height = (window.innerHeight || documentElement.clientHeight || d.getElementsByTagName("body")[0].clientHeight) + "px";
  33. waitId = setTimeout(updateSize, updateSpeed)
  34. };
  35. updateSize()
  36. };
  37. und = function(d) {
  38. return void 0 === d
  39. };
  40. fadeOut = function(d) {
  41. var a = d.style,
  42. b = function() {
  43. _SPTimer.end("splashscreen");
  44. clearTimeout(waitId);
  45. globalSettings.container.removeChild(d)
  46. };
  47. return und(a.webkitTransition) && und(a.MozTransition) && und(a.transition) ? (a.opacity = 1, function() {
  48. console.info("opacity")
  49. }) : function() {
  50. a.opacity = 0;
  51. a.webkitTransition = a.MozTransition = a.transition = "opacity 500ms ease 0ms";
  52. d.addEventListener("webkitTransitionEnd", b);
  53. d.addEventListener("mozTransitionEnd", b);
  54. d.addEventListener("transitionend", b)
  55. }
  56. }(element);
  57. waitId = null;
  58. updateSpeed = 100;
  59. endTriggered = !1;
  60. element.id = "splashscreen";
  61. api.show = function(d) {
  62. d = d || {};
  63. globalSettings = {
  64. time: d.time || 2500,
  65. onEnd: d.onEnd || emptyFn,
  66. onStart: d.onStart || emptyFn,
  67. container: d.container || container,
  68. css: d.css || ""
  69. };
  70. 0 > globalSettings.time && (globalSettings.time = 0);
  71. setTimeout(function() {
  72. updateSpeed = 300
  73. }, 3E4);
  74. updateSize();
  75. globalSettings.container.appendChild(element);
  76. element.style.cssText = globalSettings.css;
  77. _SPTimer.start("splashscreen");
  78. globalSettings.onStart()
  79. };
  80. api.end = function() {
  81. var d = !1,
  82. a;
  83. end = function() {
  84. a = d ? 0 : globalSettings.time;
  85. updateBodyCheck(emptyFn);
  86. 0 > a ? fadeOut() : setTimeout(fadeOut, a)
  87. };
  88. return function(b) {
  89. endTriggered || (d = b || !1, endTriggered = !0, b ? end() : updateBodyCheck(end, !0))
  90. }
  91. }();
  92. return api
  93. }(window);
  94. SpilGamesBrand.show({
  95. css: "top: 0px; left: 0px; z-index: 9999; position: absolute; background: #d0e8fd url('logo.png') no-repeat center; -webkit-background-size: 320px 320px !important;"
  96. });
  97. window.FZ = {};
  98. (function() {
  99. window.Gamehub && (window.SpilGames = {
  100. _: function(d) {
  101. var h = arguments,
  102. a = 0;
  103. return d.replace(/%s/g, function(b) {
  104. a++;
  105. return void 0 !== h[a] ? h[a] : b
  106. })
  107. },
  108. Highscores: {
  109. insert: function(d) {
  110. Gamehub.Score.submit(d.score)
  111. },
  112. showScoreboard: function(d) {
  113. Gamehub.ShowScoreboard();
  114. d && setTimeout(d, 100)
  115. }
  116. },
  117. Settings: {
  118. get: function(d) {
  119. switch (d) {
  120. case "currentGameInfo":
  121. return {
  122. splashScreen: Gamehub.Settings.splashScreen,
  123. rotationLockSreen: {
  124. portrait: Gamehub.Settings.rotationLockScreen.portrait,
  125. landscape: Gamehub.Settings.rotationLockScreen.landscape
  126. }
  127. };
  128. default:
  129. return {}
  130. }
  131. }
  132. }
  133. });
  134. FZ.SpilAPI = {
  135. SubmitScore: function(d) {
  136. FZ.SpilAPI.checkSpilAPI();
  137. SpilGames.Highscores.insert({
  138. score: d
  139. })
  140. },
  141. ShowHighscore: function() {
  142. FZ.SpilAPI.checkSpilAPI();
  143. !FZ.SpilAPI.___noSpilGamesAPI && FZ.GameBase && FZ.GameBase.pauseGame();
  144. SpilGames.Highscores.showScoreboard(function() {
  145. FZ.GameBase && FZ.GameBase.resumeGame()
  146. })
  147. },
  148. GetSplashScreenURL: function() {
  149. FZ.SpilAPI.checkSpilAPI();
  150. return FZ.SpilAPI.___noSpilGamesAPI ? "" : SpilGames.Settings.get("currentGameInfo").splashScreen
  151. },
  152. GetPortraitLockURL: function() {
  153. FZ.SpilAPI.checkSpilAPI();
  154. return FZ.SpilAPI.___noSpilGamesAPI ? "" : SpilGames.Settings.get("currentGameInfo").rotationLockSreen.portrait
  155. },
  156. GetLandscapeLockURL: function() {
  157. FZ.SpilAPI.checkSpilAPI();
  158. return FZ.SpilAPI.___noSpilGamesAPI ? "" : SpilGames.Settings.get("currentGameInfo").rotationLockSreen.landscape
  159. },
  160. checkSpilAPI: function() {
  161. return !FZ.SpilAPI.___noSpilGamesAPI
  162. },
  163. init: function() {
  164. FZ.SpilAPI.___noSpilGamesAPI = !window.SpilGames;
  165. window.SpilGames || (window.SpilGames = {
  166. _: function(d) {
  167. var h = arguments,
  168. a = 0;
  169. return d.replace(/%s/g, function(b) {
  170. a++;
  171. return void 0 !== h[a] ? h[a] : b
  172. })
  173. },
  174. Highscores: {
  175. insert: function(d) {
  176. FZ.__localSubmitHighscore && FZ.__localSubmitHighscore(d.score)
  177. },
  178. showScoreboard: function(d) {
  179. FZ.__localShowHighscore ? FZ.__localShowHighscore(d) : setTimeout(d, 0)
  180. }
  181. }
  182. })
  183. }
  184. };
  185. FZ.SpilAPI.init()
  186. })();
  187. (function(d, h) {
  188. d.SpilGames || (d.SpilGames = {
  189. _: function(g) {
  190. var b = 1,
  191. a = arguments;
  192. return g.replace(/%s/g, function() {
  193. return a[b++]
  194. })
  195. }
  196. });
  197. var a = d.JSON,
  198. b = d.document,
  199. c = d.navigator.userAgent,
  200. k = d.navigator.language ? d.navigator.language : d.navigator.userLanguage;
  201. namespace = d.location.href.replace(/\/[^\/]*$/i, "");
  202. var f = /\?/ig,
  203. e = /([^a-z0-9]|^)-([^0-9])/ig,
  204. l = /^([\W\w]*)\.([^:.]*)(:[\W\w]*)$/i,
  205. m = "$1" + (/Webkit/i.test(c) ? "-webkit-" : /Gecko/i.test(c) ? "-moz-" : "") + "$2",
  206. n = {
  207. computer: !/(iPhone|iPad|iPod|Android)/i.test(c),
  208. mobile: /(iPhone|iPad|iPod|Android)/i.test(c),
  209. iOS: /(iPhone|iPad|iPod)/i.test(c),
  210. iPad: /iPad/i.test(c),
  211. iPhone: /iPhone/i.test(c),
  212. iPod: /iPod/i.test(c),
  213. android: /Android/i.test(c),
  214. version: parseFloat(/(iPhone|iPad|iPod|Android|Chrome|Safari|Firefox|MSIE)[^0-9]*([0-9._]*)/i.exec(c)[2].replace("_", "."))
  215. },
  216. p, q, r, s, y, A = {},
  217. t = {},
  218. u = {},
  219. z = {},
  220. O = Array.prototype.slice,
  221. H = function(g) {
  222. for (var b, a, d = arguments.length; 1 < d--;) for (b in a = arguments[d], a) g[b] = a[b];
  223. return g
  224. },
  225. w = function(g) {
  226. if (g.nodeType) return g;
  227. if (g.__mate__ && g.__mate__.nodeType) return g.__mate__
  228. },
  229. B = function(g) {
  230. for (; g && !g.__mate__;) g = g.parentNode;
  231. return g ? g.__mate__ : h
  232. },
  233. C = function() {
  234. d.setTimeout(function() {
  235. d.scrollTo(0, n.android ? 1 : 0)
  236. }, 500)
  237. },
  238. I = function() {
  239. var g = w(t.root).getBoundingClientRect();
  240. q = 0 > g.left ? 0 : g.left;
  241. r = 0 > g.top ? 0 : g.top
  242. },
  243. J = function(g) {
  244. var b, a, d, c = u[g];
  245. if (c) for (b in d = O.call(arguments, 1), c)(a = c[b])[g].apply(a, d)
  246. },
  247. v = function(g, b, c) {
  248. var e, f = 0,
  249. k = z;
  250. g = g.split(".");
  251. for (e = g.length - 1; f < e; f++) k = "object" === typeof k[g[f]] ? k[g[f]] : k[g[f]] = {};
  252. if (b === h) return k[g[f]];
  253. k[g[f]] = b;
  254. !0 === c && d.localStorage.setItem(namespace, a.stringify(z))
  255. },
  256. L = function(g) {
  257. var b = 0,
  258. a = arguments;
  259. return g.replace(f, function() {
  260. return a[++b]
  261. })
  262. },
  263. x = function(g, b) {
  264. if ((g = w(g)) !== h) if (-1 !== b.indexOf(":")) g.style.cssText += b.replace(e, m);
  265. else return g.style[b]
  266. },
  267. E = function(g) {
  268. g = w(g).getBoundingClientRect();
  269. return {
  270. top: g.top - r,
  271. left: g.left - q,
  272. right: g.right - q,
  273. bottom: g.bottom - r,
  274. width: g.width,
  275. height: g.height
  276. }
  277. },
  278. M = function(g) {
  279. var a, d, c, e, f = p.store.local && p.store.local[g];
  280. if (f !== h && arguments.callee.lang !== g) for (p.language = arguments.callee.lang = g, a = b.querySelectorAll("*[local]"), d = a.length; d--;) e = a[d].__mate__, c = a[d].getAttribute("local"), e !== h && (e.lang ? e.lang(f[c]) : e.text(f[c]))
  281. },
  282. N = function(g, b) {
  283. var a;
  284. a = A[g] = function() {};
  285. H(a.prototype, b, F.__make__);
  286. a.prototype.className = g
  287. },
  288. F = function(g, a, d, c, e) {
  289. var f;
  290. g = w(g);
  291. if (g !== h && g.__mate__) return f = g.__mate__.path + "." + a, d = t[f] = new A[d], d.name = a, d.path = f, d.__mate__ = g.appendChild(b.createElement(e || "DIV")), d.__mate__.appendChild(b.createElement("DIV")), d.__mate__.__mate__ = d, x(d, "position: absolute; " + (c || "")), d
  292. },
  293. G = function(g) {
  294. var b = arguments.callee,
  295. a = G.__make__[g],
  296. c = function() {
  297. !0 !== this.finish && (this.finish = !0, d.setTimeout(function() {
  298. J(++b.finish >= b.count ? "after" : "load", b.finish, b.count)
  299. }, 0))
  300. };
  301. g === h && 0 === b.count && c();
  302. b.finish === h && (b.count = 0, b.finish = 0);
  303. return a !== h ?
  304. function(g) {
  305. b.count++;
  306. return a.call(b, g, c)
  307. } : function(g) {
  308. return g
  309. }
  310. };
  311. tween = function(g, b, a, c, e) {
  312. for (var f = +new Date, k = tween.__make__, l = g.concat(), m = g.length; m--;) g[m].time = f;
  313. a = "number" === typeof a ? a : 20;
  314. c = !0 === c ? !0 : !1;
  315. return function() {
  316. var f, m = g.length;
  317. f = d.setTimeout(function() {
  318. for (var e, n, D = [], p = 0, K = [], q = +new Date; p < m; p++) e = g[p], e === h ? K[K.length] = !0 : (n = q - e.time, n < e[3] ? D[p] = k[e[0]](n, e[1], e[2], e[3]) : n >= e[3] && e[4] === h ? (D[p] = k[e[0]](e[3], e[1], e[2], e[3]), g[p] = h) : (D[p] = k[e[0]](e[3], e[1], e[2], e[3]), g[p] = e.slice(4), g[p].time = q));
  319. b(D);
  320. if (K.length < m) f = d.setTimeout(arguments.callee, a);
  321. else if (!0 === c) {
  322. g = l.concat();
  323. for (p = g.length; p--;) g[p].time = q;
  324. f = d.setTimeout(arguments.callee, a)
  325. }
  326. }, a);
  327. return function() {
  328. d.clearTimeout(f);
  329. e && e()
  330. }
  331. }()
  332. };
  333. canvas2D = function(g, a) {
  334. var d, c;
  335. g = w(g);
  336. d = E(g);
  337. c = g.appendChild(b.createElement("CANVAS"));
  338. c.width = d.width;
  339. c.height = d.height;
  340. x(c, "position: absolute; left: 0px; top: 0px;");
  341. a = c.getContext(a);
  342. a.dirtyRect = [];
  343. a.childNodes = [];
  344. return a
  345. };
  346. sprite = function(g, b) {
  347. g.childNodes.push(this);
  348. this.source = b;
  349. this.parent = g
  350. };
  351. parse = function(g) {
  352. for (var a, c = ["config", "class", "object", "store"], e = 0, f = c.length, k = parse.__make__; e < f; e++) a = c[e], k[a](g[a]);
  353. g = b.createEvent("HTMLEvents");
  354. g.initEvent("orientationchange", !0, !0, d, 0, 0, 0, 0, 0, !1, !1, !1, !1, 0, null);
  355. d.dispatchEvent(g)
  356. };
  357. debug = function() {
  358. return t
  359. };
  360. assignEvent = function() {
  361. var g, a, b;
  362. return n.mobile ?
  363. function(g) {
  364. var d, c;
  365. d = g.type;
  366. var e = 3 === g.target.nodeType ? g.target.parentNode : g.target,
  367. f = g.touches[0];
  368. if (!(1 < g.touches.length) && (c = B(e), c !== h)) {
  369. f && (a = f.pageX - q, b = f.pageY - r);
  370. argument = {
  371. target: e,
  372. code: g.keyCode,
  373. button: 1,
  374. clientX: a,
  375. clientY: b
  376. };
  377. switch (d) {
  378. case "touchstart":
  379. c.mouseover && c.mouseover(argument);
  380. c.mousedown && c.mousedown(argument);
  381. break;
  382. case "touchmove":
  383. c.mousemove && c.mousemove(argument);
  384. break;
  385. case "touchend":
  386. c.mouseup && c.mouseup(argument), c.click && (d = E(e), a > d.left && a < d.right && b > d.top && b < d.bottom && c.click(argument)), c.mouseout && c.mouseout(argument)
  387. }
  388. g.stopPropagation();
  389. "DIV" === e.nodeName && g.preventDefault()
  390. }
  391. } : function(a) {
  392. var b, d, c = a.type,
  393. e = 3 === a.target.nodeType ? a.target.parentNode : a.target,
  394. e = "mousedown" === c ? g = e : g || e;
  395. "mouseup" === c && (g = h);
  396. b = B(e);
  397. b !== h && "function" === typeof b[c] && (d = {
  398. target: e,
  399. code: a.keyCode,
  400. button: g === h ? 0 : 1,
  401. clientX: a.pageX - q,
  402. clientY: a.pageY - r
  403. }, b[c](d), a.stopPropagation(), "DIV" === e.nodeName && a.preventDefault())
  404. }
  405. }();
  406. parse.__make__ = {
  407. config: function(g) {
  408. var c;
  409. g.target = g.target === h ? b.body : b.getElementById(g.target) || b.body;
  410. g.angle = 90 === g.angle ? 90 : 0;
  411. g.width = g.width || 320;
  412. g.height = g.height || 416;
  413. g.offset = g.offset === h ? ["auto", "auto"] : g.offset.split(" ");
  414. 1 === g.offset.length && g.offset.push(g.offset[0]);
  415. g.offsetLeft = "auto" === g.offset[1] ? -g.width / 2 + "px" : g.offset[1];
  416. g.offsetTop = "auto" === g.offset[0] ? -g.height / 2 + "px" : g.offset[0];
  417. N(":Unknown", {});
  418. c = t.root = g.target.appendChild(b.createElement("DIV"));
  419. c.__mate__ = {
  420. name: "root",
  421. path: "root",
  422. className: ":Unknown"
  423. };
  424. x(c, L("position: absolute; left: ?; top: ?; width: ?px; height: ?px; margin: ? 0px 0px ?; -user-select: none; overflow: hidden; background: ?;", "auto" === g.offset[1] ? "50%" : "0px", "auto" === g.offset[0] ? "50%" : "0px", g.width, g.height, g.offsetTop, g.offsetLeft, g.background !== h ? "url(" + g.background + ") no-repeat center" || "#FFF" : ""));
  425. H(CanvasRenderingContext2D.prototype, canvas2D.__make__);
  426. s = !0 === g.dirty ? b.body.appendChild(b.createElement("CANVAS")) : b.createElement("CANVAS");
  427. s.width = 600;
  428. s.height = 600;
  429. y = s.getContext("2d");
  430. c = b.getElementsByTagName("head")[0].appendChild(b.createElement("STYLE"));
  431. c.type = "text/css";
  432. c.textContent = " * { padding: 0px; margin: 0px; cursor: default; } body { font: 12px/20px Palatino; }";
  433. I();
  434. z = a.parse(d.localStorage.getItem(namespace) || "{}");
  435. p.config = g
  436. },
  437. "class": function(g) {
  438. for (var a in g) N(a, g[a])
  439. },
  440. object: function(g) {
  441. var a, b;
  442. for (a in g) b = l.exec(a), F(t[b[1]], b[2], b[3], g[a]);
  443. for (a in t)(b = t[a]).construct && b.construct()
  444. },
  445. store: function(a) {
  446. var b, c, d, e;
  447. J("before");
  448. for (b in a) switch (d = a[b], c = G(b), typeof d) {
  449. case "string":
  450. a[b] = c(a[b]);
  451. break;
  452. case "object":
  453. if (!(d instanceof Array)) {
  454. for (e in d) d[e] = c(d[e]);
  455. break
  456. }
  457. case "array":
  458. for (e = d.length; e--;) d[e] = c(d[e])
  459. }
  460. p.store = a || {};
  461. G()
  462. }
  463. };
  464. F.__make__ = {
  465. parent: function() {
  466. return B(this.__mate__.parentNode)
  467. },
  468. child: function(a) {
  469. return t[this.path + "." + a]
  470. },
  471. local: function(a) {
  472. return a === h ? this.__mate__.getAttribute("local") : this.__mate__.setAttribute("local", a)
  473. },
  474. text: function(a) {
  475. var b = this.__mate__.firstChild;
  476. return a === h ? b.innerHTML : b.innerHTML = a
  477. },
  478. rect: function() {
  479. return E(this.__mate__)
  480. },
  481. context: function(a) {
  482. this.__context__ === h && (this.__context__ = canvas2D(this, a));
  483. return this.__context__
  484. }
  485. };
  486. G.__make__ = {
  487. image: function(a, b) {
  488. var c = new Image;
  489. c.addEventListener("load", b, !1);
  490. c.src = a;
  491. return c
  492. },
  493. audio: function(a, b) {
  494. var c = new Audio;
  495. b();
  496. c.src = a;
  497. c.load();
  498. c.play();
  499. c.pause();
  500. return c
  501. },
  502. file: function(a, b) {
  503. var c = new XMLHttpRequest;
  504. c.addEventListener("readystatechange", function() {
  505. 4 === c.readyState && 200 === c.status && b()
  506. }, !1);
  507. c.open("GET", a, !0);
  508. c.send(null);
  509. return c
  510. }
  511. };
  512. tween.__make__ = {
  513. linear: function(a, b, c, d) {
  514. return c * a / d + b
  515. },
  516. "cubic-ease-in": function(a, b, c, d) {
  517. return c * (a /= d) * a * a + b
  518. },
  519. "cubic-ease-out": function(a, b, c, d) {
  520. return c * ((a = a / d - 1) * a * a + 1) + b
  521. },
  522. "cubic-ease-in-out": function(a, b, c, d) {
  523. return 1 > (a /= d / 2) ? c / 2 * a * a * a + b : c / 2 * ((a -= 2) * a * a + 2) + b
  524. },
  525. "elastic-ease-out": function(a, b, c, d, e, f) {
  526. if (0 == a) return b;
  527. if (1 == (a /= d)) return b + c;
  528. f || (f = 0.3 * d);
  529. if (!e || e < Math.abs(c)) {
  530. e = c;
  531. var k = f / 4
  532. } else k = f / (2 * Math.PI) * Math.asin(c / e);
  533. return e * Math.pow(2, -10 * a) * Math.sin(2 * (a * d - k) * Math.PI / f) + c + b
  534. },
  535. "bounce-ease-out": function(a, b, c, d) {
  536. return (a /= d) < 1 / 2.75 ? 7.5625 * c * a * a + b : a < 2 / 2.75 ? c * (7.5625 * (a -= 1.5 / 2.75) * a + 0.75) + b : a < 2.5 / 2.75 ? c * (7.5625 * (a -= 2.25 / 2.75) * a + 0.9375) + b : c * (7.5625 * (a -= 2.625 / 2.75) * a + 0.984375) + b
  537. }
  538. };
  539. canvas2D.__make__ = {
  540. appendChild: function(a, b, c) {
  541. a = new sprite(this, a);
  542. a.size(b, c);
  543. return a
  544. },
  545. clear: function() {
  546. this.childNodes.length = 0;
  547. this.clearRect(0, 0, this.canvas.width, this.canvas.height)
  548. },
  549. draw: function() {
  550. var a, b = 0,
  551. c = this.childNodes,
  552. d = c.length;
  553. this.setTransform(1, 0, 0, 1, 0, 0);
  554. for (this.clearRect(0, 0, this.canvas.width, this.canvas.height); b < d; b++) a = c[b], this.globalAlpha = a.alpha, this.setTransform(a.m11, a.m12, a.m21, a.m22, a.left, a.top), a.draw(this);
  555. this.setTransform(1, 0, 0, 1, 0, 0)
  556. },
  557. refresh: function() {
  558. var a, b, c = 0,
  559. d = this.childNodes,
  560. e = d.length;
  561. a = this.dirtyRect;
  562. var f = this.canvas.width;
  563. b = this.canvas.height;
  564. var k, h, l, m, n, p, q, r, t;
  565. if (0 !== a.length && (k = 0 > a[0] ? 0 : Math.floor(a[0]), f = Math.ceil(a[2] > f ? f : a[2]), h = 0 > a[1] ? 0 : Math.floor(a[1]), l = Math.ceil(a[3] > b ? b : a[3]), m = f - k, n = l - h, !(0 >= m || 0 >= n))) {
  566. b = y;
  567. b.setTransform(1, 0, 0, 1, 0, 0);
  568. for (b.clearRect(k, h, m, n); c < e; c++) if (a = d[c], p = a.left, q = a.left + a.width, r = a.top, t = a.top + a.height, !0 === a.dirty || (q < f ? q : f) >= (p > k ? p : k) && (t < l ? t : l) >= (r > h ? r : h)) b.globalAlpha = a.alpha, b.setTransform(a.m11, a.m12, a.m21, a.m22, p, r), a.draw(b), a.dirty = !1;
  569. this.clearRect(k, h, m, n);
  570. this.drawImage(s, k, h, m, n, k, h, m, n);
  571. this.dirtyRect.length = 0
  572. }
  573. }
  574. };
  575. sprite.prototype = {
  576. RAD: Math.PI / 180,
  577. parent: h,
  578. source: h,
  579. dirty: !1,
  580. alpha: 1,
  581. left: 0,
  582. top: 0,
  583. width: 0,
  584. height: 0,
  585. m11: 1,
  586. m12: 0,
  587. m21: 0,
  588. m22: 1,
  589. col: 0,
  590. row: 0,
  591. cellWidth: 0,
  592. cellHeight: 0,
  593. offset: 0,
  594. draw: function(a) {
  595. a.drawImage(this.source, 0, 0, this.width, this.height)
  596. },
  597. remove: function() {
  598. var a;
  599. a = this.parent.childNodes.indexOf(this); - 1 !== a && (this.merge(), this.parent.childNodes.splice(a, 1))
  600. },
  601. slice: function(a, b) {
  602. 0 === a ? (this.cellWidth = this.cellHeight = parseInt(this.source.naturalHeight / b), this.row = b, this.col = this.source.naturalWidth / this.cellWidth) : 0 === b ? (this.cellHeight = this.cellWidth = parseInt(this.source.naturalWidth / a), this.col = a, this.row = this.source.naturalHeight / this.cellHeight) : (this.cellWidth = parseInt(this.source.naturalWidth / a), this.cellHeight = parseInt(this.source.naturalHeight / b), this.col = a, this.row = b)
  603. },
  604. index: function(a) {
  605. var b, c, d = !1;
  606. if (0 === this.col || 0 === this.row) return d;
  607. a === h && (a = this.offset, a = ++a < this.col * this.row ? a : 0, 0 === a && (d = !0));
  608. this.offset = a;
  609. b = a % this.col * this.cellWidth;
  610. c = parseInt(a / this.cellHeight) * this.cellHeight;
  611. this.draw = function(a) {
  612. a.drawImage(this.source, b, c, this.cellWidth, this.cellHeight, 0, 0, this.width, this.height)
  613. };
  614. this.merge();
  615. return d
  616. },
  617. merge: function() {
  618. var a = this.parent.dirtyRect,
  619. b = this.left,
  620. c = this.top,
  621. d = b + this.width,
  622. e = c + this.height;
  623. this.dirty = !0;
  624. a[0] < b || (a[0] = b);
  625. a[1] < c || (a[1] = c);
  626. a[2] > d || (a[2] = d);
  627. a[3] > e || (a[3] = e)
  628. },
  629. sprite: function(a) {
  630. this.source = a;
  631. this.merge();
  632. delete this.draw;
  633. this.col = this.row = 0
  634. },
  635. opacity: function(a) {
  636. this.alpha = a;
  637. this.merge()
  638. },
  639. position: function(a, b) {
  640. this.merge();
  641. this.left = a;
  642. this.top = b;
  643. this.merge()
  644. },
  645. rotate: function(a) {
  646. var b = this.RAD * a;
  647. a = Math.cos(b);
  648. b = Math.sin(b);
  649. this.m11 = a;
  650. this.m12 = b;
  651. this.m21 = -b;
  652. this.m22 = a
  653. },
  654. size: function(a, b) {
  655. this.merge();
  656. this.width = a;
  657. this.height = b;
  658. this.merge()
  659. }
  660. };
  661. b.addEventListener("DOMContentLoaded", function() {
  662. d.Audio = d.Audio ||
  663. function() {};
  664. d.addEventListener("scroll", C, !1);
  665. d.addEventListener("load", C, !1);
  666. b.addEventListener("touchstart", function(a) {
  667. a.target.value === h && a.preventDefault()
  668. }, !0);
  669. (function() {
  670. var a, c, e;
  671. n.mobile ? (a = b.body.appendChild(b.createElement("DIV")), x(a, "position: absolute; display: none; background: url(./bitmap/flip.png) no-repeat 50% 10px #FFF; left: 0px; top: 0px; width: 100%; font: bolder 20px/200px Verdana; text-align: center; -user-select: none; z-index: 100000;"), c = b.getElementsByTagName("head")[0].appendChild(b.createElement("META")), c.name = "viewport", c.content = n.android ? "initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0;" : n.iPad ? "width=devive-width, initial-scale=2.3, minimum-scale=2.3, maximum-scale=2.3, user-scalable=no;" : "width=devive-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no;", b.addEventListener("touchstart", assignEvent, !1), b.addEventListener("touchmove", assignEvent, !1), b.addEventListener("touchend", assignEvent, !1), d.addEventListener("orientationchange", function() {
  672. if (e === h || e !== (90 === Math.abs(d.orientation) ? 90 : 0)) I(), C(), d.setTimeout(function() {
  673. e = 90 === Math.abs(d.orientation) ? 90 : 0;
  674. p.message("orientation", e);
  675. p.config && x(a, L("display: ?; width: ?px; height: ?px;", p.config.angle === e ? "none" : "block", d.innerWidth, d.innerHeight));
  676. I();
  677. C()
  678. }, n.android ? 1E3 : 0)
  679. }, !1)) : (b.addEventListener("mouseover", assignEvent, !1), b.addEventListener("mousedown", assignEvent, !1), b.addEventListener("mousemove", assignEvent, !1), b.addEventListener("mouseup", assignEvent, !1), b.addEventListener("mouseout", assignEvent, !1), b.addEventListener("click", assignEvent, !1))
  680. })()
  681. }, !1);
  682. d.System = p = {
  683. platform: n,
  684. parse: parse,
  685. style: x,
  686. extend: H,
  687. input: function(a, b) {
  688. b = d.prompt(p.store.local[M.lang][a], b || v("system.input." + a));
  689. null !== b && v("system.input." + a, b, !0);
  690. return null !== b ? b : h
  691. },
  692. getNode: w,
  693. getObject: B,
  694. connect: function(a, b) {
  695. var c = a.path;
  696. c && "function" === typeof a[b] && (u[b] === h && (u[b] = {}), u[b][c] = a)
  697. },
  698. disconnect: function(a, b) {
  699. var c = a.path;
  700. c && delete u[b][c]
  701. },
  702. message: J,
  703. storage: v,
  704. template: L,
  705. timeout: function(a) {
  706. for (var b = 1, c = arguments.length, e = []; b < c;) e[e.length] = arguments[b++], e[e.length - 1].msec = arguments[b++];
  707. return function(b) {
  708. var c, e;
  709. c = b.shift();
  710. e = d.setTimeout(function() {
  711. c.call(a);
  712. (c = b.shift()) && (e = d.setTimeout(argument.callee, c.msec))
  713. }, c.msec);
  714. return function() {
  715. d.clearTimeout(e)
  716. }
  717. }(e)
  718. },
  719. getNodeByPoint: function(a, c) {
  720. return b.elementFromPoint(a + q, c + r)
  721. },
  722. getNodeRect: E,
  723. local: M,
  724. createObject: F,
  725. tween: tween,
  726. random: function(a, b) {
  727. b = ~~b;
  728. return parseInt(Math.random() * (a + 1 - b) + b)
  729. },
  730. playAudio: function(a, b, c) {
  731. var e, f;
  732. if (a === h) return v("system.audio");
  733. if ("AUDIO" !== a.nodeName || !1 === v("system.audio") && !0 !== b) return function() {};
  734. v("system.audio", !0, !0);
  735. f = d.isNaN(a.duration);
  736. f || (a.currentTime = 0, a.loop = 1, a.play(), e = d.setInterval(function() {
  737. a.currentTime = 0;
  738. a.play()
  739. }, 1E3 * (parseInt(a.duration) - 1)), d.onpageshow = function() {
  740. a.play()
  741. }, d.onpagehide = function() {
  742. a.pause()
  743. });
  744. "function" === typeof c && c(!0);
  745. return function() {
  746. f || (d.clearInterval(e), d.onpagehide = d.onpageshow = h, a.pause());
  747. v("system.audio", !1, !0);
  748. "function" === typeof c && c(!1)
  749. }
  750. },
  751. language: k.toLowerCase(),
  752. debug: debug,
  753. empty: "data:image/gif;base64,R0lGODlhAQABAJEAAAAAAP///////wAAACH5BAEAAAIALAAAAAABAAEAAAICVAEAOw=="
  754. }
  755. })(window);
  756. (function(d, h) {
  757. window.construct = {
  758. config: {
  759. offset: "0px auto",
  760. background: "./bitmap/background.png"
  761. },
  762. store: {
  763. image: "./bitmap/tile_0.png ./bitmap/tile_1.png ./bitmap/tile_2.png ./bitmap/tile_3.png ./bitmap/tile_4.png ./bitmap/tile_5.png ./bitmap/floor_0.png ./bitmap/floor_1.png ./bitmap/floor_2.png ./bitmap/hidden.png ./bitmap/bomb.png ./bitmap/lock_0.png ./bitmap/lock_1.png ./bitmap/bomb_0.png ./bitmap/bomb_1.png ./bitmap/bomb_2.png ./bitmap/bomb_3.png ./bitmap/bomb_4.png ./bitmap/bomb_5.png ./bitmap/crump_0.png ./bitmap/crump_1.png ./bitmap/crump_2.png ./bitmap/crump_3.png ./bitmap/crump_4.png ./bitmap/crump_5.png ./bitmap/time_0.png ./bitmap/time_1.png ./bitmap/time_2.png ./bitmap/time_3.png ./bitmap/time_4.png ./bitmap/time_5.png ./bitmap/flash_0.png ./bitmap/flash_1.png ./bitmap/flash_2.png ./bitmap/flash_3.png ./bitmap/flash_4.png ./bitmap/flash_5.png ./bitmap/convert_portait.png ./bitmap/convert_landscape.png ./bitmap/flash.png ./bitmap/button.png ./bitmap/failed.png ./bitmap/succeed.png ./bitmap/infotip.png ./bitmap/menu.png ./bitmap/title.png ./bitmap/button.png ./bitmap/operate.png ./bitmap/pause.png".split(" "),
  764. audio: "./audio/SeaTreasureMatch.mp3",
  765. local: {
  766. en: {
  767. start: SpilGames._("开始游戏"),
  768. scoreboard: SpilGames._("更多游戏"),
  769. level: SpilGames._("等级"),
  770. clock: SpilGames._("剩余时间"),
  771. score: SpilGames._("分数"),
  772. menu: SpilGames._("菜单"),
  773. statistic: SpilGames._("成就"),
  774. restart: SpilGames._("重新开始"),
  775. "return": SpilGames._("返回"),
  776. quit: SpilGames._("退出游戏"),
  777. "quit ask": SpilGames._("你是否决定要退出游戏?"),
  778. combo: SpilGames._("组合 x %s", "?"),
  779. sort: SpilGames._("无效的移动!<br />这个宝石将被重置"),
  780. music: {
  781. off: SpilGames._("音乐关闭"),
  782. on: SpilGames._("音乐打开")
  783. },
  784. dialog: {
  785. statistic: SpilGames._("成就"),
  786. scoreboard: SpilGames._("更多游戏"),
  787. "statistic content": SpilGames._("胜利次数: %s<br />失败次数: %s<br />成功率: %s%", "?", "?", "?"),
  788. "time over": SpilGames._("时间截止"),
  789. "time over content": SpilGames._("时间耗尽.<br />你要再来一次挑战么?"),
  790. succeed: SpilGames._("本关完成!"),
  791. "succeed content": SpilGames._("清除分数: %s<br />时间奖励: %s<br />总计: %s", "?", "?", "?"),
  792. full: SpilGames._("恭喜你"),
  793. "full content": SpilGames._("分数: %s", "?"),
  794. "reset ask": SpilGames._("你需要重置一下成就数据么?"),
  795. ok: SpilGames._("确定"),
  796. rester: SpilGames._("重置"),
  797. menu: SpilGames._("菜单"),
  798. again: SpilGames._("再来一次")
  799. }
  800. }
  801. },
  802. level: [{
  803. time: 300,
  804. map: [
  805. [, , , , , , , , ],
  806. [, , , 0, 0, 0, , , ],
  807. [, , 0, 0, 0, 0, 0, , ],
  808. [, 0, 0, 1, 0, 1, 0, 0],
  809. [, 0, 1, 0, 1, 0, 1, 0],
  810. [, 0, 1, 1, 0, 1, 1, 0],
  811. [, , 0, 0, , 0, 0, , ]
  812. ]
  813. }, {
  814. time: 300,
  815. map: [
  816. [, , , , , , , , ],
  817. [, , 0, 0, 0, 0, 0, , ],
  818. [, 0, 0, 1, 1, 1, 0, 0],
  819. [, 0, 0, 1, , 1, 0, 0],
  820. [, 0, 0, 1, 1, 1, 0, 0],
  821. [, , 1, 1, 0, 1, 1, , ],
  822. [, 0, 0, 0, 0, 0, 0, 0]
  823. ]
  824. }, {
  825. time: 300,
  826. map: [
  827. [, 0, 0, 0, 0, 0, 0, 0],
  828. [, , 0, 0, 1, 0, 0, , ],
  829. [, , , 1, 1, 1, , , ],
  830. [, , , , 4, , , , ],
  831. [, , , 0, 0, 0, , , ],
  832. [, , 0, 0, 1, 0, 0, , ],
  833. [, 0, 1, 1, 1, 1, 1, 0],
  834. [0, 0, 0, 1, 1, 1, 0, 0, 0]
  835. ]
  836. }, {
  837. time: 300,
  838. map: [
  839. [, 0, 0, 0, 0, 0, 0, 0],
  840. [, , 0, 0, 0, 0, 0, 0],
  841. [, 0, 1, 0, , 1, 1, 0],
  842. [, 0, 1, , 0, 0, 1, 0],
  843. [, 0, 1, 0, 0, , 1, 0],
  844. [, 0, 1, 1, , 0, 1, 0],
  845. [, 0, 0, 0, 0, 0, 0, , ]
  846. ]
  847. }, {
  848. time: 300,
  849. map: [
  850. [0, 1, 0, 0, 0, 0, 0, 1, 1],
  851. [0, 1, 0, 0, 0, 0, 1, 1, 0],
  852. [, 0, 0, 0, 0, 1, 1, 0, 0],
  853. [, , 0, 0, 1, 1, 0, 0, 0],
  854. [, , , 1, 1, 4, 4, 4, 4],
  855. [, , , , 0, 0, 0, 0, 0],
  856. [, , , , , 0, 0, 1, 1],
  857. [, , , , , , 0, 0, 0]
  858. ]
  859. }, {
  860. time: 300,
  861. map: [
  862. [, 0, 0, 0, , 0, 0, 0],
  863. [, 0, 0, 0, , 0, 0, 0],
  864. [0, 0, 0, 0, , 0, 0, 0, 0],
  865. [0, 0, 0, 0, , 0, 0, 0, 0],
  866. [1, 1, 1, 1, , 1, 1, 1, 1],
  867. [0, 4, 4, 4, , 4, 4, 4, 0],
  868. [, 1, 1, 1, , 1, 1, 1],
  869. [, 0, 0, 0, , 0, 0, 0]
  870. ]
  871. }, {
  872. time: 360,
  873. map: [
  874. [, , , 0, 0, 0, , , ],
  875. [, , 0, 0, 1, 0, 0, , ],
  876. [, , 0, 1, 1, 1, 0, , ],
  877. [, , 0, 5, 5, 5, 0, , ],
  878. [, 0, 0, 1, 1, 1, 0, 0],
  879. [, 0, 0, 2, 2, 2, 0, 0],
  880. [, 1, 1, 0, 0, 0, 1, 1],
  881. [, 0, 0, , 0, , 0, 0]
  882. ]
  883. }, {
  884. time: 360,
  885. map: [
  886. [0, 0, 0, 0, , 0, 0, 0, 0],
  887. [, 0, 0, 0, , 0, 0, 0],
  888. [, , 0, 0, 0, 0, 0, , ],
  889. [, 0, 2, 2, 0, 2, 2, 0],
  890. [0, 0, , 0, 0, 0, , 0, 0],
  891. [1, 1, 1, 0, , 0, 1, 1, 1],
  892. [0, 1, 1, 1, 0, 1, 1, 1, 0],
  893. [, 0, 0, 0, , 0, 0, 0]
  894. ]
  895. }, {
  896. time: 360,
  897. map: [
  898. [1, 1, 1, 0, 0, 0, 1, 1, 1],
  899. [1, 2, 1, 0, , 0, 1, 2, 1],
  900. [1, 1, 1, , 0, , 1, 1, 1],
  901. [0, 0, , 0, 0, 0, , 0, 0],
  902. [0, , 0, 0, 0, 0, 0, , 0],
  903. [, , 0, 5, 5, 5, 0, , ],
  904. [, 0, 0, 1, 2, 1, 0, 0],
  905. [, 0, 0, 1, 1, 1, 0, 0]
  906. ]
  907. }, {
  908. time: 300,
  909. map: [
  910. [, , , 0, 0, 0, , , ],
  911. [, , 0, 1, 1, 1, 0, , ],
  912. [, 0, 0, 1, 1, 1, 0, 0],
  913. [0, 0, 0, 0, 0, 0, 0, 0, 0],
  914. [0, 0, , , 0, , , 0, 0],
  915. [0, 0, 0, 2, 8, 2, 0, 0, 0],
  916. [, 0, 1, 0, 2, 0, 1, 0, 0],
  917. [, 0, 1, 0, 0, 0, 1, 0]
  918. ]
  919. }, {
  920. time: 360,
  921. map: [
  922. [, 0, 0, 0, , 0, 0, 0],
  923. [, 0, 0, 1, 0, 1, 0, 0],
  924. [0, 0, 1, 1, 0, 1, 1, 0, 0],
  925. [1, 1, 1, , 0, , 1, 1, 1],
  926. [1, 8, 1, 1, 1, 1, 1, 8, 1],
  927. [, 0, , 1, 2, 1, , 0],
  928. [, 0, 0, 1, 1, 1, 0, 0],
  929. [0, 0, 0, 1, 1, 1, 0, 0, 0]
  930. ]
  931. }, {
  932. time: 360,
  933. map: [
  934. [0, 0, 0, 0, 0, 0, 0, 0, 0],
  935. [, 0, 1, 1, 1, 1, 1, 0],
  936. [, 0, 1, 1, 1, 1, 1, 0],
  937. [, , 0, , 0, , 0, , ],
  938. [, 0, , 0, , 0, , 0],
  939. [, 0, 1, 1, 1, 1, 1, 0],
  940. [0, 0, 1, 2, 2, 2, 1, 0, 0],
  941. [0, 0, 1, 2, 2, 2, 1, 0, 0]
  942. ]
  943. }, {
  944. time: 360,
  945. map: [
  946. [, , 0, 0, , 0, 0, , ],
  947. [, 0, 0, 0, , 0, 0, 0],
  948. [0, 0, 2, 0, , 0, 2, 0, 0],
  949. [0, 0, 2, 0, , 0, 2, 0, 0],
  950. [, 5, 1, 5, 1, 5, 1, 5],
  951. [, 0, 0, 2, 2, 2, 0, 0],
  952. [, , 0, 0, 0, 0, 0, , ],
  953. [, , 0, 0, , 0, 0, , ]
  954. ]
  955. }, {
  956. time: 360,
  957. map: [
  958. [0, 0, , 0, 0, 0, , 0, 0],
  959. [0, 0, , 0, 0, 0, , 0, 0],
  960. [0, 0, 0, 0, , 0, 0, 0, 0],
  961. [, 0, 1, 0, , 0, 1, 0],
  962. [0, , 1, 1, , 1, 1, , 0],
  963. [0, 0, 1, 2, 0, 2, 1, 0, 0],
  964. [0, 1, 0, 2, 0, 2, 0, 1, 0],
  965. [0, 0, , 0, 0, 0, , 0, 0]
  966. ]
  967. }, {
  968. time: 360,
  969. map: [
  970. [, , 0, 0, 0, 0, 0, , ],
  971. [, 0, 1, 1, 1, 1, 1, 1],
  972. [0, 5, 5, 5, 1, 5, 5, 5, 0],
  973. [0, 1, 1, 2, 2, 2, 1, 1, 0],
  974. [0, 1, 1, 10, 10, 10, 1, 1, 0],
  975. [0, 1, 1, 1, 1, 1, 1, 1, 0],
  976. [, 0, 1, 1, 1, 1, 1, 0],
  977. [, , 0, 0, 0, 0, 0, , ]
  978. ]
  979. }]
  980. },
  981. object: {
  982. "root.load:Load": "left: 0px; top: 0px; width: 100%; height: 100%;",
  983. "root.load.title:Unknown": "left: 0px; top: 0px; width: 100%; height: 140px; background: url(./bitmap/title.png) no-repeat center;",
  984. "root.load.progress:Unknown": "left: 50%; bottom: 120px; width: 100%; height: 32px; font-weight: bold; color: white; text-shadow: #333 2px 2px 3px; font-size: 32px; text-align: center; margin-left: -50%;",
  985. "root.menu:Menu": "display: none; left: 0px; top: 0px; width: 100%; height: 100%; background: url(./bitmap/menu.png) no-repeat center;",
  986. "root.menu.title:Unknown": "left: 0px; top: 0px; width: 100%; height: 140px; background: url(./bitmap/title.png) no-repeat center;",
  987. "root.menu.highscore:Unknown": "display: none; left: 50%; top: 160px; width: 300px; height: 55px; margin-left: -150px; font: bold 16px/46px Verdana; text-shadow: #333 2px 2px 2px; text-align: center; color: #f4ffa3;",
  988. "root.menu.start:Button": "left: 50%; top: 260px; width: 140px; height: 55px; margin-left: -70px; background: url(./bitmap/button.png) no-repeat center top; font: bold 16px/46px Verdana; text-shadow: #333 2px 2px 2px; text-align: center; color: #f4ffa3;",
  989. "root.menu.music:Button": "left: 50%; top: 310px; width: 140px; height: 55px; margin-left: -70px; background: url(./bitmap/button.png) no-repeat center top; font: bold 16px/46px Verdana; text-shadow: #333 2px 2px 2px; text-align: center; color: #f4ffa3;",
  990. "root.menu.scoreboard:Button": "left: 50%; top: 360px; width: 140px; height: 55px; margin-left: -70px; background: url(./bitmap/button.png) no-repeat center top; font: bold 16px/46px Verdana; text-shadow: #333 2px 2px 2px; text-align: center; color: #f4ffa3;",
  991. "root.main:Main": "display: none; left: 0px; top: 0px; width: 100%; height: 100%;",
  992. "root.main.operate:Unknown": "left: 0px; bottom: 0px; width: 100%; height: 108px; background: url(./bitmap/operate.png) no-repeat center;",
  993. "root.main.operate.statistic:Button": "left: 50%; bottom: -8px; width: 140px; height: 55px; margin-left: -140px; background: url(./bitmap/button.png) no-repeat center top; font: bold 14px/42px Verdana; text-shadow: #333 2px 2px 2px; text-align: center; color: #f4ffa3;",
  994. "root.main.operate.menu:Button": "left: 50%; bottom: -8px; width: 140px; height: 55px; margin-left: 0px; background: url(./bitmap/button.png) no-repeat center top; font: bold 14px/42px Verdana; text-shadow: #333 2px 2px 2px; text-align: center; color: #f4ffa3;",
  995. "root.main.infotip:Unknown": "left: 0px; top: 0px; width: 100%; height: 54px; background: url(./bitmap/infotip.png) no-repeat center;",
  996. "root.main.clock:Clock": "left: 50%; top: 0px; width: 100px; margin-left: -50px; font: bold 14px/18px Verdana; text-shadow: #333 2px 2px 2px; text-align: center; color: #f4ffa3; margin-top: 8px;",
  997. "root.main.level:Level": "left: 50%; top: 0px; width: 110px; margin-left: -160px; font: bold 14px/18px Verdana; text-shadow: #333 2px 2px 2px; text-align: center; color: #f4ffa3; margin-top: 8px;",
  998. "root.main.score:Score": "left: 50%; top: 0px; width: 110px; margin-left: 50px; font: bold 14px/18px Verdana; text-shadow: #333 2px 2px 2px; text-align: center; color: #f4ffa3; margin-top: 8px;",
  999. "root.main.logic:Logic": "left: 50%; top: 40px; width: 306px; height: 306px; margin-left: -153px;" + (d.platform.android ? " /*-transform-style: preserve-3d;*/" : ""),
  1000. "root.main.logic.floor:Delegate": "left: 0px; top: 0px; width: 100%; height: 100%;",
  1001. "root.main.logic.tile:Delegate": "left: 0px; top: 0px; width: 100%; height: 100%;",
  1002. "root.main.logic.surface:Delegate": "left: 0px; top: 0px; width: 100%; height: 100%;",
  1003. "root.main.combo:Combo": "display: none; left: 0px; top: 80px; width: 100%; height: 40px; text-align: center; font: bold 26px/30px Verdana; color: #ffff99; -text-stroke: #006600 1px; -text-fill-color: #ffff99; text-shadow: rgba(255, 255, 255, 0.8) 0px 0px 8px;",
  1004. "root.mask:Unknown": "display: none; left: 0px; top: 0px; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.2);",
  1005. "root.mask.dialog:Dialog": "left: 50%; top: 50%;",
  1006. "root.mask.dialog.title:Unknown": "left: 0px; top: 40px; width: 100%; text-align: center; font: bold 20px/24px Verdana; text-shadow: #333 2px 2px 2px; text-align: center; color: #f4ffa3;",
  1007. "root.mask.dialog.content:Unknown": "left: 0px; top: 74px; width: 100%; height: 66px; text-align: center; font: bold 14px/22px Verdana; text-shadow: #333 2px 2px 2px; text-align: center; color: #f4ffa3;",
  1008. "root.mask.dialog.left:Button": "display: none; left: 50%; top: 170px; width: 140px; height: 55px; margin-left: -136px; background: url(./bitmap/button.png) no-repeat center top; font: bold 14px/42px Verdana; text-shadow: #333 2px 2px 2px; text-align: center; color: #f4ffa3;",
  1009. "root.mask.dialog.right:Button": "display: none; left: 50%; top: 170px; width: 140px; height: 55px; margin-left: 4px; background: url(./bitmap/button.png) no-repeat center top; font: bold 14px/42px Verdana; text-shadow: #333 2px 2px 2px; text-align: center; color: #f4ffa3;",
  1010. "root.mask.dialog.center:Button": "display: none; left: 50%; top: 170px; width: 140px; height: 55px; margin-left: -68px; background: url(./bitmap/button.png) no-repeat center top; font: bold 14px/42px Verdana; text-shadow: #333 2px 2px 2px; text-align: center; color: #f4ffa3;",
  1011. "root.mask.dialog.restart:Button": "display: none; left: 50%; top: 35px; width: 140px; height: 55px; margin-left: -68px; background: url(./bitmap/button.png) no-repeat center top; font: bold 14px/42px Verdana; text-shadow: #333 2px 2px 2px; text-align: center; color: #f4ffa3;",
  1012. "root.mask.dialog.quit:Button": "display: none; left: 50%; top: 80px; width: 140px; height: 55px; margin-left: -68px; background: url(./bitmap/button.png) no-repeat center top; font: bold 14px/42px Verdana; text-shadow: #333 2px 2px 2px; text-align: center; color: #f4ffa3;",
  1013. "root.mask.dialog.return:Button": "display: none; left: 50%; top: 165px; width: 140px; height: 55px; margin-left: -68px; background: url(./bitmap/button.png) no-repeat center top; font: bold 14px/42px Verdana; text-shadow: #333 2px 2px 2px; text-align: center; color: #f4ffa3;"
  1014. },
  1015. "class": {
  1016. ":Button": {
  1017. construct: function() {
  1018. if ("music" === this.name) {
  1019. if (d.platform.android) {
  1020. d.style(this, "display: none;");
  1021. return
  1022. }
  1023. this.lang = function(a) {
  1024. var b = this;
  1025. this.language = a;
  1026. d.playAudio() ? (this.text(this.language.off), this.audio = d.playAudio(d.store.audio, !0, function(a) {
  1027. b.text(a ? b.language.off : b.language.on)
  1028. })) : this.text(this.language.on)
  1029. }
  1030. }
  1031. this.local(this.name)
  1032. },
  1033. mouseover: function() {
  1034. d.style(this, "background-position: center bottom;")
  1035. },
  1036. mouseout: function() {
  1037. d.style(this, "background-position: center top;")
  1038. },
  1039. click: function() {
  1040. var a;
  1041. switch (this.name) {
  1042. case "scoreboard":
  1043. dp_Ranking();
  1044. break;
  1045. case "start":
  1046. d.message("scene", "main");
  1047. break;
  1048. case "menu":
  1049. d.message("dialog", "menu");
  1050. break;
  1051. case "statistic":
  1052. d.message("dialog", "statistic");
  1053. break;
  1054. case "restart":
  1055. d.message("undialog", "again");
  1056. break;
  1057. case "quit":
  1058. confirm(d.store.local[d.language]["quit ask"]) && d.message("undialog", "menu");
  1059. break;
  1060. case "music":
  1061. a = this;
  1062. this.audio ? (this.audio(), this.audio = h) : this.audio = d.playAudio(d.store.audio, !0, function(b) {
  1063. a.text(b ? a.language.off : a.language.on)
  1064. });
  1065. break;
  1066. case "return":
  1067. d.message("undialog", "return")
  1068. }
  1069. }
  1070. },
  1071. ":Load": {
  1072. construct: function() {
  1073. d.connect(this, "load");
  1074. d.connect(this, "after");
  1075. this.progress = this.child("progress")
  1076. },
  1077. load: function(a, b) {
  1078. this.progress.text(parseInt(a / b * 100) + "%")
  1079. },
  1080. after: function() {
  1081. var a = d.store.image,
  1082. b = this;
  1083. d.Empty = new Image;
  1084. d.Empty.src = d.empty;
  1085. d.Floor = [a[6], a[7], a[8]];
  1086. d.Time = [a[25], a[26], a[27], a[28], a[29], a[30]];
  1087. d.Effect = [a[9], a[10], a[39]];
  1088. d.Lock = [d.Empty, a[11], a[12]];
  1089. d.Convert = [a[37], a[38]];
  1090. window.setTimeout(function() {
  1091. d.local("en");
  1092. d.tween([
  1093. ["linear", 1, -1, 500]
  1094. ], function(a) {
  1095. a[0] !== h ? d.style(b, "opacity: " + a[0] + ";") : d.style(b, "display: none;")
  1096. }, 20);
  1097. d.message("scene", "menu", b.name)
  1098. }, 200)
  1099. }
  1100. },
  1101. ":Menu": {
  1102. construct: function() {
  1103. d.connect(this, "scene");
  1104. this.child("highscore").text(SpilGames._("更多游戏: %s", ~~d.storage("highscore")))
  1105. },
  1106. scene: function(a, b) {
  1107. var c = this;
  1108. this.name === a ? "load" === b ? (d.style(this, "display: block; opacity: 0;"), d.tween([
  1109. ["linear", 0, 1, 500]
  1110. ], function(a) {
  1111. a[0] !== h && d.style(c, "opacity: " + a[0] + ";")
  1112. }, 20)) : d.style(this, "display: block;") : d.style(this, "display: none;")
  1113. }
  1114. },
  1115. ":Main": {
  1116. construct: function() {
  1117. d.connect(this, "scene")
  1118. },
  1119. scene: function(a) {
  1120. this.name === a ? (d.style(this, "display: block;"), d.message("start", "reset")) : d.style(this, "display: none;")
  1121. }
  1122. },
  1123. ":Combo": {
  1124. construct: function() {
  1125. d.connect(this, "combo");
  1126. this.local("combo")
  1127. },
  1128. lang: function(a) {
  1129. this.language = a
  1130. },
  1131. combo: function(a) {
  1132. var b = this;
  1133. this.tween && this.tween();
  1134. "number" === typeof a ? this.text(d.template(this.language, a)) : this.text(a);
  1135. d.style(b, "display: block; top: 150px;");
  1136. this.tween = d.tween([
  1137. ["cubic-ease-in", 1, -0.4, 1E3],
  1138. ["linear", 150, -100, 1E3],
  1139. ["cubic-ease-in", 1, -1, 1E3]
  1140. ], function(a) {
  1141. a[0] === h ? d.style(b, "display: none;") : d.style(b, "top: " + a[1] + "px; opacity: " + a[2] + "; -transform: scale(" + a[0] + ");")
  1142. }, 50)
  1143. }
  1144. },
  1145. ":Dialog": {
  1146. construct: function() {
  1147. d.connect(this, "dialog");
  1148. d.connect(this, "undialog");
  1149. this.local("dialog");
  1150. this.title = this.child("title");
  1151. this.content = this.child("content");
  1152. this.left = this.child("left");
  1153. this.right = this.child("right");
  1154. this.center = this.child("center");
  1155. this.restart = this.child("restart");
  1156. this.resume = this.child("return");
  1157. this.quit = this.child("quit")
  1158. },
  1159. lang: function(a) {
  1160. this.langList = a
  1161. },
  1162. setButtonNum: function(a) {
  1163. switch (a) {
  1164. case 1:
  1165. d.style(this.title, "display: block;");
  1166. d.style(this.content, "display: block;");
  1167. d.style(this.left, "display: none;");
  1168. d.style(this.right, "display: none;");
  1169. d.style(this.center, "display: block;");
  1170. d.style(this.restart, "display: none;");
  1171. d.style(this.resume, "display: none;");
  1172. d.style(this.quit, "display: none;");
  1173. break;
  1174. case 2:
  1175. d.style(this.title, "display: block;");
  1176. d.style(this.content, "display: block;");
  1177. d.style(this.left, "display: block;");
  1178. d.style(this.right, "display: block;");
  1179. d.style(this.center, "display: none;");
  1180. d.style(this.restart, "display: none;");
  1181. d.style(this.resume, "display: none;");
  1182. d.style(this.quit, "display: none;");
  1183. break;
  1184. case 3:
  1185. d.style(this.title, "display: none;"), d.style(this.content, "display: none;"), d.style(this.left, "display: none;"), d.style(this.right, "display: none;"), d.style(this.center, "display: none;"), d.style(this.restart, "display: block;"), d.style(this.resume, "display: block;"), d.style(this.quit, "display: block;")
  1186. }
  1187. },
  1188. undialog: function(a) {
  1189. switch (a) {
  1190. case "return":
  1191. d.message("resume");
  1192. break;
  1193. case "again":
  1194. d.message("start", "again");
  1195. break;
  1196. case "next":
  1197. d.message("start", "next");
  1198. break;
  1199. case "menu":
  1200. d.message("scene", "menu");
  1201. break;
  1202. case "sort":
  1203. d.message("start", "sort")
  1204. }
  1205. d.style(this.parent(), "display: none;")
  1206. },
  1207. dialog: function(a) {
  1208. var b = this.langList,
  1209. c = ~~d.storage("succeed"),
  1210. k = ~~d.storage("failed"),
  1211. f = c + k,
  1212. e = d.SCORE;
  1213. 0 === f && (f = 1);
  1214. switch (a) {
  1215. case "menu":
  1216. d.style(this, "width: 207px; height: 240px; margin-top: -120px; margin-left: -108px; background: url(./bitmap/pause.png) no-repeat;");
  1217. this.setButtonNum(3);
  1218. break;
  1219. case "statistic":
  1220. d.style(this, "width: 310px; height: 231px; margin-top: -125px; margin-left: -160px; background: url(./bitmap/failed.png) no-repeat;");
  1221. d.style(this.content, "line-height: 22px;");
  1222. this.setButtonNum(2);
  1223. this.title.text(b.statistic);
  1224. this.content.text(d.template(b["statistic content"], c, k, parseInt(c / f * 100)));
  1225. this.left.text(b.rester);
  1226. this.left.click = function() {
  1227. window.confirm(b["reset ask"]) && (d.storage("succeed", 0), d.storage("failed", 0, !0), d.message("undialog", "return"))
  1228. };
  1229. this.right.text(b.ok);
  1230. this.right.click = function() {
  1231. d.message("undialog", "return")
  1232. };
  1233. break;
  1234. case "failed":
  1235. d.storage("failed", k + 1, !0);
  1236. d.style(this, "width: 310px; height: 231px; margin-top: -125px; margin-left: -160px; background: url(./bitmap/failed.png) no-repeat;");
  1237. d.style(this.content, "line-height: 33px;");
  1238. this.setButtonNum(2);
  1239. this.title.text(b["time over"]);
  1240. this.content.text(b["time over content"]);
  1241. this.left.text(b.again);
  1242. this.left.click = function() {
  1243. d.message("undialog", "again")
  1244. };
  1245. this.right.text(b.scoreboard);
  1246. this.right.click = function() {
  1247. FZ.SpilAPI.ShowHighscore()
  1248. };
  1249. break;
  1250. case "succeed":
  1251. d.storage("succeed", c + 1, !0);
  1252. d.style(this, "width: 310px; height: 231px; margin-top: -125px; margin-left: -160px; background: url(./bitmap/succeed.png) no-repeat;");
  1253. d.style(this.content, "line-height: 22px;");
  1254. this.setButtonNum(1);
  1255. this.title.text(b.succeed);
  1256. a = e.total + e.score + e.time;
  1257. this.content.text(d.template(b["succeed content"], e.score, e.time, a));
  1258. FZ.SpilAPI.SubmitScore(a);
  1259. dp_submitScore(-1, a);~~d.storage("highscore") < a && d.storage("highscore", a, !0);
  1260. this.center.text(b.ok);
  1261. this.center.click = function() {
  1262. d.message("undialog", "next")
  1263. };
  1264. break;
  1265. case "full":
  1266. d.storage("succeed", c + 1, !0);
  1267. d.style(this, "width: 310px; height: 231px; margin-top: -125px; margin-left: -160px; background: url(./bitmap/succeed.png) no-repeat;");
  1268. d.style(this.content, "line-height: 66px;");
  1269. a = e.total + e.score + e.time;
  1270. FZ.SpilAPI.SubmitScore(a);
  1271. dp_submitScore(-1, a);~~d.storage("highscore") < a && d.storage("highscore", a, !0);
  1272. this.setButtonNum(2);
  1273. this.title.text(b.full);
  1274. this.content.text(d.template(b["full content"], a));
  1275. this.left.text(b.ok);
  1276. this.left.click = function() {
  1277. d.message("undialog", "menu")
  1278. };
  1279. this.right.text(b.scoreboard);
  1280. this.right.click = function() {
  1281. FZ.SpilAPI.ShowHighscore()
  1282. };
  1283. break;
  1284. case "sort":
  1285. d.style(this, "width: 310px; height: 231px; margin-top: -125px; margin-left: -160px; background: url(./bitmap/failed.png) no-repeat;");
  1286. d.style(this.content, "line-height: 66px;");
  1287. this.setButtonNum(1);
  1288. this.title.text(b.sort);
  1289. this.content.text(d.template(b["sort content"]));
  1290. this.center.text(b.ok);
  1291. this.center.click = function() {
  1292. d.message("undialog", "sort")
  1293. };
  1294. break;
  1295. default:
  1296. return
  1297. }
  1298. d.message("pause");
  1299. d.style(this.parent(), "display: block;")
  1300. }
  1301. },
  1302. ":Clock": {
  1303. construct: function() {
  1304. d.connect(this, "clock");
  1305. this.local("clock")
  1306. },
  1307. lang: function(a) {
  1308. this.script = a
  1309. },
  1310. clock: function(a) {
  1311. var b = a % 60,
  1312. b = 9 >= b ? "0" + b : b;
  1313. this.text(this.script + "<br />" + parseInt(a / 60) + ":" + b)
  1314. }
  1315. },
  1316. ":Level": {
  1317. construct: function() {
  1318. d.connect(this, "level");
  1319. this.local("level")
  1320. },
  1321. lang: function(a) {
  1322. this.script = a
  1323. },
  1324. level: function(a) {
  1325. this.text(this.script + "<br />" + a)
  1326. }
  1327. },
  1328. ":Score": {
  1329. construct: function() {
  1330. d.connect(this, "score");
  1331. this.local("score")
  1332. },
  1333. lang: function(a) {
  1334. this.script = a
  1335. },
  1336. score: function(a) {
  1337. this.text(this.script + "<br />" + a)
  1338. }
  1339. },
  1340. ":Delegate": {
  1341. mousedown: function(a) {
  1342. this.parent().mousedown(a)
  1343. },
  1344. mouseup: function(a) {
  1345. this.parent().mouseup(a)
  1346. }
  1347. },
  1348. ":Logic": {
  1349. level: 0,
  1350. total: 0,
  1351. score: 0,
  1352. timeLeft: 0,
  1353. offsetTop: 34,
  1354. graph: h,
  1355. busy: !1,
  1356. twice: !1,
  1357. combo: 0,
  1358. passLevel: !1,
  1359. effectList: {},
  1360. construct: function() {
  1361. d.connect(this, "start");
  1362. d.connect(this, "pause");
  1363. d.connect(this, "resume");
  1364. d.connect(this, "orientation")
  1365. },
  1366. orientation: function(a) {
  1367. this.graph !== h && (0 === a ? d.message("resume") : d.message("pause"))
  1368. },
  1369. addScore: function(a) {
  1370. this.score += a;
  1371. d.message("score", this.total + this.score)
  1372. },
  1373. start: function(a) {
  1374. var b, c, k, f = [];
  1375. c = d.store.image;
  1376. var e = d.Floor,
  1377. l = d.Lock;
  1378. this.floor === h && (this.floor = this.child("floor").context("2d"), this.tile = this.child("tile").context("2d"), this.surface = this.child("surface").context("2d"));
  1379. switch (a) {
  1380. case "reset":
  1381. this.level = this.total = this.score = 0;
  1382. break;
  1383. case "again":
  1384. this.score = 0;
  1385. break;
  1386. case "next":
  1387. this.level++;
  1388. this.total += this.score + 10 * this.timeLeft;
  1389. this.score = 0;
  1390. break;
  1391. case "sort":
  1392. this.resume(!0);
  1393. return;
  1394. default:
  1395. return
  1396. }
  1397. this.passLevel = !1;
  1398. d.message("level", this.level + 1);
  1399. d.message("score", this.total + this.score);
  1400. this.pause();
  1401. if (a = d.store.level[this.level]) {
  1402. 10 <= this.level ? (d.Tile = [c[0], c[1], c[2], c[3], c[4], c[5]], d.Bomb = [c[13], c[14], c[15], c[16], c[17], c[18]], d.Crump = [c[19], c[20], c[21], c[22], c[23], c[24]], d.Flash = [c[31], c[32], c[33], c[34], c[35], c[36]]) : (d.Tile = [c[0], c[1], c[2], c[3], c[4]], d.Bomb = [c[13], c[14], c[15], c[16], c[17]], d.Crump = [c[19], c[20], c[21], c[22], c[23]], d.Flash = [c[31], c[32], c[33], c[34], c[35]]);
  1403. this.stopAnimation && this.stopAnimation();
  1404. this.floor.clear();
  1405. this.tile.clear();
  1406. this.surface.clear();
  1407. d.message("clock", this.timeLeft = a.time);
  1408. k = a.map;
  1409. for (a = k.length; a--;) for (f[a] = [], c = k[a].length; c--;) b = k[a][c], b !== h && (b = f[a][c] = [b & 3, b >>> 2, h, 0, h, h, h, 34 * c, 34 * a + this.offsetTop, 0, 0, 0, 0], b[4] = this.floor.appendChild(e[b[0]], 32, 32), b[4].position(b[7], b[8]), b[5] = this.tile.appendChild(d.Empty, 32, 32), b[5].position(b[7], b[8]), 0 < b[1] && (b[6] = this.surface.appendChild(l[b[1]], 32, 32), b[6].position(b[7], b[8])));
  1410. this.floor.draw();
  1411. this.tile.draw();
  1412. this.surface.draw();
  1413. this.graph = f;
  1414. this.resume(!0)
  1415. } else d.SCORE = {
  1416. total: this.total,
  1417. score: this.score,
  1418. time: 10 * this.timeLeft
  1419. }, d.message("dialog", "full")
  1420. },
  1421. pause: function() {
  1422. this.stopDrop = !0;
  1423. this.stopClock && this.stopClock()
  1424. },
  1425. resume: function(a) {
  1426. var b = this,
  1427. c = arguments.callee;
  1428. window.clearInterval(c.clock);
  1429. c.clock = window.setInterval(function() {
  1430. 0 < b.timeLeft && d.message("clock", --b.timeLeft);
  1431. 0 >= b.timeLeft && !1 === b.passLevel && d.message("dialog", "failed")
  1432. }, 1E3);
  1433. this.stopDrop = !1;
  1434. if (a) {
  1435. do this.autoFill();
  1436. while (!1 === this.findNext());
  1437. this.tile.refresh();
  1438. this.busy = !1;
  1439. window.clearTimeout(this.hintSortTime);
  1440. window.clearTimeout(this.hintLongTime);
  1441. this.hintSortTime = window.setTimeout(function() {
  1442. b.hintNext.reject = h;
  1443. b.hintNext()
  1444. }, 5E3);
  1445. this.hintLongTime = window.setTimeout(function() {
  1446. b.hintNext()
  1447. }, 1E4)
  1448. } else this.drop();
  1449. this.stopClock = function() {
  1450. window.clearInterval(c.clock)
  1451. }
  1452. },
  1453. pass: function() {
  1454. var a, b, c, k = this.graph;
  1455. for (a = k.length; a--;) for (b = k[a].length; b--;) if (c = k[a][b], c !== h && 0 !== c[0]) return !1;
  1456. d.SCORE = {
  1457. total: this.total,
  1458. score: this.score,
  1459. time: 10 * this.timeLeft
  1460. };
  1461. return this.passLevel = !0
  1462. },
  1463. convert: function(a, b) {
  1464. var c;
  1465. c = a[2];
  1466. a[2] = b[2];
  1467. b[2] = c;
  1468. c = a[3];
  1469. a[3] = b[3];
  1470. b[3] = c;
  1471. c = a[5];
  1472. a[5] = b[5];
  1473. b[5] = c;
  1474. c = a[11];
  1475. a[11] = b[11];
  1476. b[11] = c
  1477. },
  1478. autoFill: function() {
  1479. var a = this.graph,
  1480. b, c, k, f, e, l, m, n, p = d.Tile;
  1481. k = a.length;
  1482. for (b = 0; b < k; b++) for (c = a[b].length; c--;) if (f = a[b][c], f !== h && 0 === f[3] && (e = a[b - 1], e !== h && 0 !== e.length ? (m = (l = e[c - 1]) !== h && 0 === l[1] && l[2] !== h ? !0 : !1, n = (l = e[c]) !== h && 0 === l[1] && l[2] !== h ? !0 : !1, e = (l = e[c + 1]) !== h && 0 === l[1] && l[2] !== h ? !0 : !1) : m = n = e = !0, !0 === m || !0 === n || !0 === e)) {
  1483. f[2] = d.random(p.length - 1);
  1484. e = a[b];
  1485. n = 3;
  1486. for (m = h; n--;) if (l = e[c + n], 0 === n) {
  1487. m = l;
  1488. do l = d.random(p.length - 1);
  1489. while (f[2] === l);
  1490. f[2] = l
  1491. } else if (l === h || l[2] !== f[2]) break;
  1492. for (n = 3; n--;) if (l = a[b - n], 0 === n) {
  1493. do l = d.random(p.length - 1);
  1494. while (f[2] === l || f[2] === m);
  1495. f[2] = l
  1496. } else if (l === h || (l = l[c]) === h || l[2] !== f[2]) break
  1497. }
  1498. for (b = a.length; b--;) for (c = a[b].length; c--;) f = a[b][c], f !== h && f[2] !== h && 0 === f[3] && (f[5].sprite(p[f[2]]), f[5].position(f[7], f[8]), f[5].slice(0, 1), f[5].index(0));
  1499. this.tile.draw()
  1500. },
  1501. hintNext: function() {
  1502. var a = arguments.callee,
  1503. b = this.graph,
  1504. c = this,
  1505. k, f, e, h = d.Convert;
  1506. k = this.findNext(a.reject);
  1507. !1 !== k && (a.reject = k.reject, a = b[k.row][k.col], this.stopAnimation && this.stopAnimation(), 0 === k.convert ? (f = this.surface.appendChild(h[k.convert], 60, 100), f.position(a[7] - 14, a[8] - 18)) : (f = this.surface.appendChild(h[k.convert], 100, 60), f.position(a[7] - 20, a[8] - 14)), f.slice(13, 1), f.index(0), e = window.setInterval(function() {
  1508. f.index();
  1509. c.surface.refresh()
  1510. }, 50), this.stopAnimation = function() {
  1511. window.clearInterval(e);
  1512. f.remove();
  1513. c.surface.refresh()
  1514. })
  1515. },
  1516. findNext: function(a) {
  1517. var b = this.graph,
  1518. c = [],
  1519. d = [],
  1520. f, e, l, m, n, p, q, r;
  1521. for (f = b.length; f--;) for (e = b[f].length, c[f] = [], d[f] = []; e--;) n = b[f][e], c[f][e] = n === h ? h : n[2], d[f][e] = n === h || 0 === n[1] ? h : !0;
  1522. if ("object" === typeof a) for (b = a.length; b--;) n = a[b], c[n[0]][n[1]] = -1;
  1523. for (f = c.length; f--;) for (e = a = c[f].length; e--;) if (r = 4, n = c[f][e], n !== h && !0 !== d[f][e]) for (; r--;) {
  1524. b = h;
  1525. n = f;
  1526. p = e;
  1527. switch (r) {
  1528. case 0:
  1529. 0 < e - 1 && c[f][e - 1] !== h && !0 !== d[f][e - 1] && (q = 1, n = l = f, p = m = e - 1, b = c[f][e], c[f][e] = c[f][e - 1], c[f][e - 1] = b);
  1530. break;
  1531. case 1:
  1532. c[f - 1] !== h && c[f - 1][e] !== h && !0 !== d[f - 1][e] && (q = 0, n = l = f - 1, p = m = e, b = c[f][e], c[f][e] = c[f - 1][e], c[f - 1][e] = b);
  1533. break;
  1534. case 2:
  1535. e + 1 < a && c[f][e + 1] !== h && !0 !== d[f][e + 1] && (q = 1, l = f, m = e + 1, b = c[f][e], c[f][e] = c[f][e + 1], c[f][e + 1] = b);
  1536. break;
  1537. case 3:
  1538. c[f + 1] !== h && c[f + 1][e] !== h && !0 !== d[f + 1][e] && (q = 0, l = f + 1, m = e, b = c[f][e], c[f][e] = c[f + 1][e], c[f + 1][e] = b)
  1539. }
  1540. if (b !== h) {
  1541. if (!0 === this.autoCheck(c)) return {
  1542. convert: q,
  1543. row: n,
  1544. col: p,
  1545. reject: [
  1546. [f, e],
  1547. [l, m]
  1548. ]
  1549. };
  1550. switch (r) {
  1551. case 0:
  1552. b = c[f][e];
  1553. c[f][e] = c[f][e - 1];
  1554. c[f][e - 1] = b;
  1555. break;
  1556. case 1:
  1557. b = c[f][e];
  1558. c[f][e] = c[f - 1][e];
  1559. c[f - 1][e] = b;
  1560. break;
  1561. case 2:
  1562. b = c[f][e];
  1563. c[f][e] = c[f][e + 1];
  1564. c[f][e + 1] = b;
  1565. break;
  1566. case 3:
  1567. b = c[f][e], c[f][e] = c[f + 1][e], c[f + 1][e] = b
  1568. }
  1569. }
  1570. }
  1571. return !1
  1572. },
  1573. autoCheck: function(a) {
  1574. var b, c, d, f, e;
  1575. for (b = a.length; b--;) for (c = a[b].length; c--;) if (d = a[b][c], d !== h) {
  1576. for (e = 3; e--;) {
  1577. f = a[b][c + e];
  1578. if (0 === e) return !0;
  1579. if (f === h || f !== d) break
  1580. }
  1581. for (e = 3; e--;) {
  1582. f = a[b - e];
  1583. if (0 === e) return !0;
  1584. if (f === h || (f = f[c]) === h || f !== d) break
  1585. }
  1586. }
  1587. return !1
  1588. },
  1589. isProperty: function(a, b, c) {
  1590. var k, f, e, l, m = {},
  1591. n = this.graph,
  1592. p = d.Effect;
  1593. (l = n[b][c - 1]) && l[2] !== h && (l[11] = 2);
  1594. (l = n[b][c + 1]) && l[2] !== h && (l[11] = 1);
  1595. n[b][c][11] = 0;
  1596. k = p[0];
  1597. e = 17;
  1598. f = 69;
  1599. switch (a[3]) {
  1600. case 1:
  1601. a[3] = 0;
  1602. for (k = 2; - 2 < --k;) if (n[b - k] !== h) for (f = 2; - 2 < --f;) l = n[b - k][c - f], l !== h && (l[12] = 1, m[b - k + "," + (c - f)] = l);
  1603. delete m[b + "," + c];
  1604. for (l in m) k = this.effectList[l], "object" === typeof k && (k.sprite(p[1]), k.size(92, 92), k.position(k.left + e - 30, k.top + e - 30), k.slice(15, 1), k.index(0));
  1605. this.eliminate(m);
  1606. k = p[1];
  1607. e = 30;
  1608. f = 92;
  1609. break;
  1610. case 2:
  1611. a[3] = 0;
  1612. for (k = 3; - 3 < --k;) l = n[b][c - k], l !== h && (l[12] = 1, m[b + "," + (c - k)] = l), l = n[b - k], l !== h && l[c] !== h && (l[c][12] = 1, m[b - k + "," + c] = l[c]);
  1613. delete m[b + "," + c];
  1614. for (l in m) k = this.effectList[l], "object" === typeof k && (k.sprite(p[1]), k.size(92, 92), k.position(k.left + e - 30, k.top + e - 30), k.slice(15, 1), k.index(0));
  1615. this.eliminate(m);
  1616. k = p[1];
  1617. e = 30;
  1618. f = 92;
  1619. break;
  1620. case 3:
  1621. a[3] = 0;
  1622. this.timeLeft += 60;
  1623. break;
  1624. case 4:
  1625. a[3] = 0;
  1626. m = this.getFiveTile();
  1627. for (l in m) m[l][12] = 2;
  1628. this.eliminate(m);
  1629. k = p[2];
  1630. e = 19;
  1631. f = 70
  1632. }
  1633. switch (a[12]) {
  1634. case 1:
  1635. k = p[1];
  1636. e = 30;
  1637. f = 92;
  1638. break;
  1639. case 2:
  1640. k = p[2], e = 19, f = 70
  1641. }
  1642. a[2] = h;
  1643. a[5].sprite(d.Empty);
  1644. k = this.surface.appendChild(k, f, f);
  1645. k.position(a[7] - e, a[8] - e);
  1646. k.slice(0, 1);
  1647. k.index(0);
  1648. this.addScore(5 * this.combo);
  1649. return k
  1650. },
  1651. getFiveTile: function() {
  1652. var a = 0,
  1653. b = 0,
  1654. c, k, f, e = 0,
  1655. h = {},
  1656. m = this.graph;
  1657. for (k = a = m.length; a--;) c = m[a].length, c > b && (b = c);
  1658. for (c = b * k; 5 > e;) b = d.random(c), a = parseInt(b / k), b %= k, (f = m[a] && m[a][b]) && 0 === f[3] && (e++, h[a + "," + b] = f);
  1659. return h
  1660. },
  1661. eliminate: function(a) {
  1662. var b, c, k = this,
  1663. f, e = arguments.callee,
  1664. l = d.Floor,
  1665. m = d.Lock;
  1666. for (b in a) c = a[b], 0 < c[1] ? c[6].sprite(m[--c[1]]) : (0 < c[0] && c[4].sprite(l[--c[0]]), f = b.split(","), this.effectList[b] === h && (this.effectList[b] = !0, this.effectList[b] = this.isProperty(c, parseInt(f[0]), parseInt(f[1]))));
  1667. this.floor.refresh();
  1668. this.tile.refresh();
  1669. this.surface.refresh();
  1670. window.clearTimeout(e.timeout);
  1671. e.timeout = window.setTimeout(function() {
  1672. var a, b = k.effectList,
  1673. c = 0;
  1674. for (a in b) b[a].index() ? (over = !1, b[a].remove(), delete b[a]) : c++;
  1675. k.surface.refresh();
  1676. 0 < c && (e.timeout = window.setTimeout(arguments.callee, 20))
  1677. }, 0)
  1678. },
  1679. drop: function() {
  1680. var a = this,
  1681. b, c = !1;
  1682. a.hitab();
  1683. b = this.moveList;
  1684. 0 !== b.length ? d.tween([
  1685. ["linear", 34, -34, 150]
  1686. ], function(c) {
  1687. var d, e = b.length;
  1688. if (c[0] === h)!0 !== a.stopDrop && a.drop();
  1689. else {
  1690. for (; e--;) d = b[e], d[5].position(d[7] - d[9] * c[0], d[8] - d[10] * c[0]);
  1691. a.tile.refresh()
  1692. }
  1693. }, 30) : window.setTimeout(function() {
  1694. if (!1 === a.check()) {
  1695. for (; !1 === a.findNext();) a.autoFill(), c = !0;
  1696. a.tile.refresh();
  1697. !0 === c && d.message("combo", d.store.local[d.language].sort);
  1698. a.busy = !1
  1699. }
  1700. }, 150)
  1701. },
  1702. hitab: function() {
  1703. var a, b, c, k, f, e, l = [],
  1704. m = this.graph,
  1705. n = d.Tile;
  1706. for (a = m.length; a--;) for (c = m[a].length, b = -1; b++ < c;) if (k = m[a][b], k !== h && k[2] === h) {
  1707. f = 0 === a ? [] : m[a - 1];
  1708. if (f[b] && 0 === f[b][1] && f[b][2] !== h) this.convert(k, f[b]), l[l.length] = k;
  1709. else if ((e = f[b + 1]) && 0 === e[1] && 1 !== e[11] && e[2] !== h && ((e = m[a][b + 1]) === h || e[2] !== h)) this.convert(k, f[b + 1]), l[l.length] = k;
  1710. else if ((e = f[b - 1]) && 0 === e[1] && 2 !== e[11] && e[2] !== h && ((e = m[a][b - 1]) === h || e[2] !== h)) this.convert(k, f[b - 1]), l[l.length] = k;
  1711. else if (f[b] === h) {
  1712. if (f[b + 1] !== h) continue;
  1713. if (f[b - 1] !== h) continue;
  1714. l[l.length] = k;
  1715. k[11] = 0;
  1716. k[2] = d.random(n.length - 1);
  1717. e = k[5];
  1718. e.sprite(n[k[2]]);
  1719. e.slice(0, 1);
  1720. e.index(0);
  1721. e.position(k[7], k[8] - 34)
  1722. }
  1723. k[9] = k[7] !== k[5].left ? k[7] > k[5].left ? 1 : -1 : 0;
  1724. k[10] = k[8] !== k[5].top ? k[8] > k[5].top ? 1 : -1 : 0
  1725. }
  1726. this.tile.refresh();
  1727. this.moveList = l
  1728. },
  1729. check: function() {
  1730. var a, b, c, k, f, e, l = 0,
  1731. m = [],
  1732. n = [],
  1733. p = {},
  1734. q = {},
  1735. r = this,
  1736. s = this.graph,
  1737. y = d.Tile,
  1738. A = d.Bomb,
  1739. t = d.Crump,
  1740. u = d.Flash,
  1741. z = d.Time;
  1742. for (a = s.length; a--;) n[a] = [];
  1743. for (a = s.length; a--;) for (b = s[a].length; b--;) if (e = s[a][b], e !== h && e[2] !== h) {
  1744. e[12] = e[11] = 0;
  1745. k = e[2];
  1746. c = a;
  1747. for (m = []; 0 <= --c && (e = s[c][b]) && e[2] === k;) m[m.length] = [c + "," + b, e, c, b];
  1748. if (1 < m.length) for (m[m.length] = [a + "," + b, s[a][b], a, b], c = m.length; c--;) e = m[c], p[e[0]] = e[1], n[e[2]][e[3]] = e[1][2];
  1749. c = b;
  1750. for (m = []; 0 <= --c && (e = s[a][c]) && e[2] === k;) m[m.length] = [a + "," + c, e, a, c];
  1751. if (1 < m.length) for (m[m.length] = [a + "," + b, s[a][b], a, b], c = m.length; c--;) e = m[c], p[e[0]] = e[1], n[e[2]][e[3]] = e[1][2]
  1752. }
  1753. for (f in p) l++;
  1754. if (2 < l) {
  1755. this.combo++;
  1756. this.eliminate(p);
  1757. 1 < this.combo && d.message("combo", this.combo);
  1758. if (4 === this.combo && !0 !== this.crumpSend) {
  1759. for (e in p) break;
  1760. e = e.split(",");
  1761. e = s[parseInt(e[0])][parseInt(e[1])];
  1762. e[3] = 2;
  1763. e[2] = d.random(y.length - 1);
  1764. e[5].sprite(t[e[2]]);
  1765. e[5].slice(0, 1);
  1766. e[5].index(0)
  1767. } else if (4 < l && ((e = this.srcItem)[2] === h || (e = this.tarItem)[2] === h)) {
  1768. switch (this.formation(n, q)) {
  1769. case "T":
  1770. e = s[q.row][q.col] || e;
  1771. e[3] = 4;
  1772. e[2] = q.color;
  1773. e[5].sprite(u[e[2]]);
  1774. break;
  1775. case "L":
  1776. e = s[q.row][q.col] || e;
  1777. e[3] = 1;
  1778. e[2] = q.color;
  1779. e[5].sprite(A[e[2]]);
  1780. break;
  1781. case 5:
  1782. e[3] = 3, e[2] = q.color || d.random(y.length - 1), e[5].sprite(z[e[2]])
  1783. }
  1784. e[5].slice(0, 1);
  1785. e[5].index(0)
  1786. }
  1787. this.tile.refresh();
  1788. window.setTimeout(function() {
  1789. var a = r.effectList,
  1790. b;
  1791. for (b in a) {
  1792. window.setTimeout(arguments.callee, 30);
  1793. return
  1794. return
  1795. }
  1796. r.drop()
  1797. }, 100);
  1798. this.findNextStart = !1;
  1799. this.pass();
  1800. return !0
  1801. }
  1802. this.combo = 0;
  1803. this.pass();
  1804. !0 === this.passLevel ? this.level === d.store.level.length - 1 ? d.message("dialog", "full") : d.message("dialog", "succeed") : (window.clearTimeout(this.hintSortTime), window.clearTimeout(this.hintLongTime), this.hintSortTime = window.setTimeout(function() {
  1805. r.hintNext.reject = h;
  1806. r.hintNext()
  1807. }, 5E3), this.hintLongTime = window.setTimeout(function() {
  1808. r.hintNext()
  1809. }, 1E4));
  1810. return !1
  1811. },
  1812. formation: function(a, b) {
  1813. for (var c = a.length, d, f, e = [], l, m; c--;) for (d = a[c].length; d--;) if (f = a[c][d], f !== h && (m = l = 0, f !== h)) switch (a[c + 1] && a[c + 1][d] === f && (l |= 1, m++), a[c - 1] && a[c - 1][d] === f && (l |= 2, m++), a[c][d + 1] === f && (l |= 4, m++), a[c][d - 1] === f && (l |= 8, m++), e[e.length] = m, b.color = f, m) {
  1814. case 3:
  1815. return b.row = c, b.col = d, "T";
  1816. case 2:
  1817. if (9 === l || 5 === l || 6 === l || 10 === l) return b.row = c, b.col = d, "L"
  1818. }
  1819. if (1 === e.pop() && 1 === e.shift()) for (c = e.length; c--;) if (2 !== e[c]) return !1;
  1820. return 5
  1821. },
  1822. swap: function(a, b) {
  1823. var c = this,
  1824. k = arguments.callee;
  1825. this.convert(a, b);
  1826. k.state = !0;
  1827. a[9] = a[7] !== a[5].left ? a[7] > a[5].left ? 1 : -1 : 0;
  1828. a[10] = a[8] !== a[5].top ? a[8] > a[5].top ? 1 : -1 : 0;
  1829. b[9] = b[7] !== b[5].left ? b[7] > b[5].left ? 1 : -1 : 0;
  1830. b[10] = b[8] !== b[5].top ? b[8] > b[5].top ? 1 : -1 : 0;
  1831. d.tween([
  1832. ["linear", 34, -34, 200]
  1833. ], function(d) {
  1834. d[0] === h ? (!0 === k.state ? !1 === c.check() && c.swap(a, b) : c.busy = !1, k.state = !1) : (a[5].position(a[7] - a[9] * d[0], a[8] - a[10] * d[0]), b[5].position(b[7] - b[9] * d[0], b[8] - b[10] * d[0]), c.tile.refresh())
  1835. }, 10)
  1836. },
  1837. mousedown: function(a) {
  1838. var b = this,
  1839. c = this.rect(),
  1840. d = a.clientX - c.left;
  1841. a = a.clientY - c.top;
  1842. var f, e;
  1843. this.stopAnimation && this.stopAnimation();
  1844. window.clearTimeout(this.hintSortTime);
  1845. window.clearTimeout(this.hintLongTime);
  1846. 0 > a - this.offsetTop || (d = parseInt(d / 34), a = parseInt((a - this.offsetTop) / 34), this.active !== h && (this.active(), this.active = h), this.graph !== h && this.graph[a] !== h && (f = this.graph[a][d], f === h || 0 < f[1] || f[2] === h || !0 === this.busy || !0 === this.stopDrop || !0 === this.twice || (this.srcCol = d, this.srcRow = a, f = f[5], e = window.setTimeout(function() {
  1847. f.index();
  1848. e = window.setTimeout(arguments.callee, 30);
  1849. b.tile.refresh()
  1850. }, 30), this.active = function() {
  1851. window.clearTimeout(e);
  1852. f.index(0);
  1853. b.tile.refresh()
  1854. })))
  1855. },
  1856. mouseup: function(a) {
  1857. var b = this.rect(),
  1858. c = a.clientX - b.left;
  1859. a = a.clientY - b.top;
  1860. if (this.active !== h || !1 !== this.twice) this.busy = !0, this.tarCol = parseInt(c / 34), this.tarRow = parseInt((a - this.offsetTop) / 34), this.gesture()
  1861. },
  1862. gesture: function() {
  1863. var a = this,
  1864. b = this.graph[this.srcRow][this.srcCol],
  1865. c;
  1866. this.tarCol > this.srcCol ? c = this.graph[this.srcRow][this.srcCol + 1] : this.tarCol < this.srcCol ? c = this.graph[this.srcRow][this.srcCol - 1] : this.tarRow > this.srcRow ? c = this.graph[this.srcRow + 1] && this.graph[this.srcRow + 1][this.srcCol] : this.tarRow < this.srcRow && (c = this.graph[this.srcRow - 1] && this.graph[this.srcRow - 1][this.srcCol]);
  1867. c && 0 === c[1] && c[2] !== h ? (this.twice = !1, this.active !== h && this.active(), this.active = h, this.srcItem = b, this.tarItem = c, this.swap(b, c)) : !1 === this.twice ? this.twice = !0 : (this.busy = this.twice = !1, this.active !== h && this.active(), this.active = h, window.clearTimeout(this.hintSortTime), window.clearTimeout(this.hintLongTime), this.hintSortTime = window.setTimeout(function() {
  1868. a.hintNext.reject = h;
  1869. a.hintNext()
  1870. }, 5E3), this.hintLongTime = window.setTimeout(function() {
  1871. a.hintNext()
  1872. }, 1E4))
  1873. }
  1874. }
  1875. }
  1876. };
  1877. window.StartGame = function() {
  1878. window.setTimeout(function() {
  1879. construct && d.parse(construct)
  1880. }, 0)
  1881. };
  1882. window.Gamehub || window.addEventListener("load", StartGame, !1)
  1883. })(window.System);
  1884. setTimeout(function() {
  1885. SpilGamesBrand.end()
  1886. }, 1.5 * (new Date - SpilGamesBrandTimer));
  1887. _SPTimer.end("pageLoad");