main.js 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119
  1. H = 960;
  2. var qp_a = 1, qp_b = 1, qp_c = 5, qp_d = 5, qp_e = 5, qp_f = 0, qp_g = 0, qp_h = 1, qp_i, qp_j, qp_k, qp_l, qp_m = 0, qp_n = -1, qp_o = 239, qp_p = 256, qp_q = 257, qp_r = 258, qp_s = 259, qp_t = 260, qp_u = 261, qp_v = 266, qp_w = 267, qp_x = 268, qp_y = 269, qp_z = 262, qp_A = 263, qp_B = 264, qp_C = 265, qp_D = 0, qp_E = 20, qp_F = 270, qp_G = (640 - 2 * qp_E) / qp_c, qp_H = 0, qp_I = 2, qp_J = [0, "red", "green", "blue", "yellow", "black"], qp_K = 1200, qp_L = 500, qp_M = 60, qp_N = qp_M, qp_O = 0;
  3. function qp_P(a) {
  4. LBShare.updateData({ //设置标题+图片+文案
  5. title: "猫猫瑜伽",
  6. imgUrl: "./img/maomaoyujia.png",
  7. desc: "【喵喵瑜伽】,看你能塞进几只猫咪?"
  8. });
  9. qp_i = new Qp_Q;
  10. qp_R();
  11. var e = function () {
  12. var a = new createjs.Bitmap(qipaStage.queue.getResult("ready"));
  13. a.regX = 266;
  14. a.regY = 80;
  15. a.x = 320;
  16. a.y = 450;
  17. a.scaleX = 3;
  18. a.scaleY = 3;
  19. a.alpha = 0;
  20. createjs.Tween.get(a).to({
  21. alpha : 1,
  22. scaleX : 1,
  23. scaleY : 1
  24. }, 300).to({
  25. alpha : 1
  26. }, qp_K - 300).call(function () {
  27. var a = new createjs.Bitmap(qipaStage.queue.getResult("go"));
  28. a.regX = 240;
  29. a.regY = 136;
  30. a.x = 320;
  31. a.y = 450;
  32. createjs.Tween.get(a).to({
  33. scaleX : 1
  34. }, qp_L - 200).to({
  35. alpha : 0
  36. }, 200).call(function () {
  37. var a = new createjs.Bitmap(qipaStage.queue.getResult("score"));
  38. a.regX = 0;
  39. a.regY = 0;
  40. a.x = 40;
  41. a.y = 15;
  42. qipaStage.stage.addChild(a);
  43. qp_T = new createjs.Text("0", "bold 48px Arial", "#ff1e50");
  44. qp_T.stroke = "white";
  45. qp_T.textBaseline = "middle";
  46. qp_T.x = 140;
  47. qp_T.y = 35;
  48. qipaStage.stage.addChild(qp_T);
  49. a = new createjs.Bitmap(qipaStage.queue.getResult("clock"));
  50. a.regX = 25;
  51. a.regY = 26;
  52. a.x = 510;
  53. a.y = 40;
  54. qipaStage.stage.addChild(a);
  55. qp_U = new createjs.Text(qp_N.toString(), "bold 40px Arial", "#ff1e50");
  56. qp_U.stroke = "white";
  57. qp_U.textBaseline = "middle";
  58. qp_U.x = 570;
  59. qp_U.y = 40;
  60. qipaStage.stage.addChild(qp_U);
  61. qp_V = setInterval(function () {
  62. 0 < qp_N && (qp_N--, qp_U.text = qp_N.toString());
  63. 0 == qp_N && qp_W()
  64. }, 1E3);
  65. qp_X();
  66. qipaStage.stage.removeChild(this)
  67. });
  68. qipaStage.stage.addChild(a);
  69. qipaStage.stage.removeChild(this)
  70. });
  71. qipaStage.stage.addChild(a)
  72. },
  73. c = new createjs.Container;
  74. qipaStage.stage.addChild(c);
  75. a = new createjs.Shape;
  76. a.graphics.f("#e8fdea").r(0, 0, 640, 960).ef();
  77. c.addChild(a);
  78. a = new createjs.Bitmap(qipaStage.queue.getResult("banner"));
  79. c.addChild(a);
  80. a = new createjs.Bitmap(qipaStage.queue.getResult("help"));
  81. a.y = 315;
  82. c.addChild(a);
  83. a = new createjs.Bitmap(qipaStage.queue.getResult("discription"));
  84. a.x = 15;
  85. a.y = 675;
  86. c.addChild(a);
  87. a = new createjs.Bitmap(qipaStage.queue.getResult("replaybtn"));
  88. a.regX = 90;
  89. a.regY = 50;
  90. a.x = 320;
  91. a.y = 850;
  92. a.on("mousedown", function (a) {
  93. IS_TOUCH && a.nativeEvent instanceof MouseEvent || (e(), qipaStage.stage.removeChild(c))
  94. });
  95. c.addChild(a);
  96. a = new createjs.Bitmap(qipaStage.queue.getResult("toplistbtn"));
  97. a.regX = 90;
  98. a.regY = 50;
  99. a.x = 455;
  100. a.y = 850;
  101. a.on("click", function (a) {
  102. //window.open("../lb.html?gid=" + GID)
  103. dp_Ranking();
  104. });
  105. //c.addChild(a);
  106. if(!IS_ANDROID){
  107. //createjs.Sound.registMySound("silenttail", 2.8);
  108. if(!createjs.Sound.hasOwnProperty('registMySound')){
  109. return
  110. }
  111. createjs.Sound.registMySound("link", 2);
  112. createjs.Sound.registMySound("unlink", 0);
  113. }
  114. qipaApp.onGameStarted();
  115. qp_Y()
  116. }
  117. function qp_Z(a) {
  118. qp_T.text = qipaApp.score.toString();
  119. a = new createjs.Shape;
  120. a.graphics.f("#fff").r(0, 0, 640, 960).ef();
  121. a.x = 0;
  122. a.y = 0;
  123. a.alpha = 1;
  124. createjs.Tween.get(a).to({
  125. alpha : 0.8
  126. }, 200).to({
  127. alpha : 0.8
  128. }, 800).to({
  129. alpha : 0
  130. }, 200).call(function () {
  131. qipaStage.stage.removeChild(this)
  132. });
  133. qipaStage.stage.addChild(a);
  134. a = new createjs.Bitmap(qipaStage.queue.getResult("bounus"));
  135. a.regX = 230;
  136. a.regY = 100;
  137. a.x = -230;
  138. a.y = 480;
  139. a.alpha = 0;
  140. createjs.Tween.get(a).to({
  141. x : 320,
  142. alpha : 1
  143. }, 200).to({
  144. x : 320
  145. }, 600).to({
  146. x : 870,
  147. alpha : 0
  148. }, 200).call(function () {
  149. qp_f ==
  150. qp_g && qp_X();
  151. qipaStage.stage.removeChild(this)
  152. });
  153. qipaStage.stage.addChild(a)
  154. }
  155. function qp_ba(a) {
  156. qp_j.removeAllChildren();
  157. qp_i.qp_bb();
  158. !0 == a ? (qp_a = 1, qipaApp.score = 0, qp_T.text = qipaApp.score.toString(), qp_bc = qp_M - 1, qp_V = setInterval(function () {
  159. 0 < qp_N && (qp_N--, qp_U.text = qp_N.toString());
  160. 0 == qp_N && qp_W()
  161. }, 1E3), qp_X()) : (qp_Z(qp_a), qp_a++)
  162. }
  163. function qp_W() {
  164. LBShare.updateData({ //修改分享文案
  165. desc: "【喵喵瑜伽】:我塞进去了" + qipaApp.score + "只猫咪,战胜了" + a + "%的玩家。不服来战!"
  166. });
  167. LBShare.statScore(qipaApp.score) //上报游戏结果
  168. qp_f = qp_h;
  169. clearInterval(qp_V);
  170. qipaStage.stage.removeChild(qp_l);
  171. qp_l = new createjs.Container;
  172. qp_l.on("mousedown", function (a) {});
  173. qipaStage.stage.addChild(qp_l);
  174. var a = new createjs.Shape;
  175. a.graphics.f("#fff").r(0, 0, W, H).ef();
  176. a.x = 0;
  177. a.y = 0;
  178. a.alpha = 0.9;
  179. qp_l.addChild(a);
  180. var e = new createjs.Bitmap(qipaStage.queue.getResult("star3"));
  181. e.regX = 30;
  182. e.regY = 30;
  183. e.x = 320;
  184. e.y = 480;
  185. e.alpha = 0;
  186. createjs.Tween.get(e).to({
  187. x : 670,
  188. rotation : 360
  189. }, 800);
  190. createjs.Tween.get(e).to({
  191. alpha : 1
  192. }, 400).to({
  193. alpha : 0
  194. }, 400).call(function () {
  195. qp_l.removeChild(e)
  196. });
  197. qp_l.addChild(e);
  198. var c = new createjs.Bitmap(qipaStage.queue.getResult("star3"));
  199. c.regX = 30;
  200. c.regY = 30;
  201. c.x = 320;
  202. c.y = 480;
  203. c.alpha = 0;
  204. createjs.Tween.get(c).to({
  205. x : -30,
  206. rotation : 360
  207. }, 800);
  208. createjs.Tween.get(c).to({
  209. alpha : 1
  210. }, 400).to({
  211. alpha : 0
  212. }, 400).call(function () {
  213. qp_l.removeChild(c)
  214. });
  215. qp_l.addChild(c);
  216. var b = new createjs.Bitmap(qipaStage.queue.getResult("star3"));
  217. b.regX = 30;
  218. b.regY = 30;
  219. b.x = 320;
  220. b.y = 480;
  221. b.alpha = 0;
  222. createjs.Tween.get(b).to({
  223. y : 130,
  224. rotation : 360
  225. }, 800);
  226. createjs.Tween.get(b).to({
  227. alpha : 1
  228. }, 400).to({
  229. alpha : 0
  230. },
  231. 400).call(function () {
  232. qp_l.removeChild(b)
  233. });
  234. qp_l.addChild(b);
  235. var d = new createjs.Bitmap(qipaStage.queue.getResult("star3"));
  236. d.regX = 30;
  237. d.regY = 30;
  238. d.x = 320;
  239. d.y = 480;
  240. d.alpha = 0;
  241. createjs.Tween.get(d).to({
  242. y : 830,
  243. rotation : 360
  244. }, 800);
  245. createjs.Tween.get(d).to({
  246. alpha : 1
  247. }, 400).to({
  248. alpha : 0
  249. }, 400).call(function () {
  250. qp_l.removeChild(d)
  251. });
  252. qp_l.addChild(d);
  253. var f = new createjs.Bitmap(qipaStage.queue.getResult("star2"));
  254. f.regX = 62;
  255. f.regY = 60;
  256. f.x = 320;
  257. f.y = 480;
  258. f.alpha = 0;
  259. createjs.Tween.get(f).to({
  260. x : 120,
  261. y : 280,
  262. rotation : 360
  263. }, 800);
  264. createjs.Tween.get(f).to({
  265. alpha : 1
  266. },
  267. 400).to({
  268. alpha : 0
  269. }, 400).call(function () {
  270. qp_l.removeChild(f)
  271. });
  272. qp_l.addChild(f);
  273. var g = new createjs.Bitmap(qipaStage.queue.getResult("star2"));
  274. g.regX = 62;
  275. g.regY = 60;
  276. g.x = 320;
  277. g.y = 480;
  278. g.alpha = 0;
  279. createjs.Tween.get(g).to({
  280. x : 520,
  281. y : 280,
  282. rotation : 360
  283. }, 800);
  284. createjs.Tween.get(g).to({
  285. alpha : 1
  286. }, 400).to({
  287. alpha : 0
  288. }, 400).call(function () {
  289. qp_l.removeChild(g)
  290. });
  291. qp_l.addChild(g);
  292. var l = new createjs.Bitmap(qipaStage.queue.getResult("star2"));
  293. l.regX = 62;
  294. l.regY = 60;
  295. l.x = 320;
  296. l.y = 480;
  297. l.alpha = 0;
  298. createjs.Tween.get(l).to({
  299. x : 120,
  300. y : 680,
  301. rotation : 360
  302. }, 800);
  303. createjs.Tween.get(l).to({
  304. alpha : 1
  305. }, 400).to({
  306. alpha : 0
  307. }, 400).call(function () {
  308. qp_l.removeChild(l)
  309. });
  310. qp_l.addChild(l);
  311. var k = new createjs.Bitmap(qipaStage.queue.getResult("star2"));
  312. k.regX = 62;
  313. k.regY = 60;
  314. k.x = 320;
  315. k.y = 480;
  316. k.alpha = 0;
  317. createjs.Tween.get(k).to({
  318. x : 520,
  319. y : 680,
  320. rotation : 360
  321. }, 800);
  322. createjs.Tween.get(k).to({
  323. alpha : 1
  324. }, 400).to({
  325. alpha : 0
  326. }, 400).call(function () {
  327. qp_l.removeChild(k)
  328. });
  329. qp_l.addChild(k);
  330. var h = new createjs.Bitmap(qipaStage.queue.getResult("star1"));
  331. h.regX = 69;
  332. h.regY = 67;
  333. h.x = 320;
  334. h.y =
  335. 480;
  336. createjs.Tween.get(h).to({
  337. rotation : 360
  338. }, 800);
  339. createjs.Tween.get(h).to({
  340. alpha : 1
  341. }, 400).to({
  342. alpha : 0
  343. }, 400).call(function () {
  344. qp_l.removeChild(h)
  345. });
  346. qp_l.addChild(h);
  347. a = new createjs.Bitmap(qipaStage.queue.getResult("fcwmlogl"));
  348. a.regX = 195;
  349. a.regY = 33;
  350. a.x = 320;
  351. a.y = 185;
  352. qp_l.addChild(a);
  353. a = new createjs.Bitmap(qipaStage.queue.getResult("curscore"));
  354. a.x = 140;
  355. a.y = 260;
  356. qp_l.addChild(a);
  357. a = new createjs.Bitmap(qipaStage.queue.getResult("bestscore"));
  358. a.x = 140;
  359. a.y = 380;
  360. //qp_l.addChild(a);
  361. a = new createjs.Text(qipaApp.score.toString(),
  362. "bold 48px Arial", "#ff1e50");
  363. a.textAlign = "right";
  364. a.stroke = "white";
  365. a.textBaseline = "middle";
  366. a.x = 500;
  367. a.y = 300;
  368. qp_l.addChild(a);
  369. a = new createjs.Text(qipaApp.best.toString(), "bold 48px Arial", "#ff1e50");
  370. a.textAlign = "right";
  371. a.stroke = "white";
  372. a.textBaseline = "middle";
  373. a.x = 500;
  374. a.y = 410;
  375. //qp_l.addChild(a);
  376. a = new createjs.Bitmap(qipaStage.queue.getResult("replaybtn"));
  377. a.regX = 90;
  378. a.regY = 50;
  379. a.x = 320;
  380. a.y = 560;
  381. a.on("mousedown", function (a) {
  382. IS_TOUCH && a.nativeEvent instanceof MouseEvent || (qp_f = qp_g, qp_N = qp_M, qp_U.text = qp_N, qipaStage.stage.removeChild(qp_l),
  383. qp_ba(!0), qipaApp.onGameStarted())
  384. });
  385. qp_l.addChild(a);
  386. a = new createjs.Bitmap(qipaStage.queue.getResult("toplistbtn"));
  387. a.regX = 90;
  388. a.regY = 50;
  389. a.x = 455;
  390. a.y = 560;
  391. a.on("click", function (a) {
  392. //window.open("../lb.html?gid=" + GID)
  393. dp_Ranking();
  394. });
  395. // qp_l.addChild(a);
  396. a = new createjs.Bitmap(qipaStage.queue.getResult("lowkeysharebtn"));
  397. a.regX = 125;
  398. a.regY = 42;
  399. a.x = 320;
  400. a.y = 690;
  401. a.on("click", function (a) {
  402. LBShare.callShare();
  403. });
  404. qp_l.addChild(a);
  405. qipaApp.onGameOver();
  406. qp_Y();
  407. }
  408. function qp_bd(a, e) {
  409. qp_i.drawmapmatrix[qp_be(a.i, a.j)] = qp_m
  410. }
  411. function qp_X() {
  412. qp_bf();
  413. qp_S();
  414. var a,
  415. e = !1;
  416. qp_k.on("mousedown", function (c) {
  417. if (!(IS_TOUCH && c.nativeEvent instanceof MouseEvent) && (c = new Qp_bg(c.localX, c.localY), c = qp_bh(c), qp_i.drawmapmatrix[qp_be(c.i, c.j)].type == qp_n && (a = qp_bi(qp_i.drawmapmatrix[qp_be(c.i, c.j)].color), qp_i.drawmapmatrix[qp_be(c.i, c.j)].type = qp_o, qp_bj(a), a.push(c), e = !0), 240 < qp_i.drawmapmatrix[qp_be(c.i, c.j)].type)) {
  418. if(!IS_ANDROID) createjs.Sound.play("unlink", !0);
  419. for (var b = !0, d = 0; 5 > d; d++) {
  420. for (var f = 0, g = 0; 25 > g; g++)
  421. qp_i.drawmapmatrix[g].type == qp_n &&
  422. qp_i.drawmapmatrix[g].color == d && f++;
  423. if (1 == f) {
  424. b = !1;
  425. break
  426. }
  427. }
  428. !0 == b && (qipaApp.score -= qp_b, qp_T.text = qipaApp.score);
  429. qp_bk(qp_i.drawmapmatrix[qp_be(c.i, c.j)].color);
  430. qp_bj()
  431. }
  432. }, qp_k);
  433. qp_k.on("pressmove", function (c) {
  434. if (e) {
  435. var b = a[a.length - 1],
  436. d = a[a.length - 2];
  437. c = new Qp_bg(c.localX, c.localY);
  438. c = qp_bh(c);
  439. var f = 0;
  440. if (!1 != qp_bl(b, c) && (b.i != c.i || b.j != c.j)) {
  441. if (qp_i.drawmapmatrix[qp_be(c.i, c.j)] != qp_m) {
  442. var g = 0,
  443. l = a[0],
  444. k = qp_i.drawmapmatrix[qp_be(l.i, l.j)].color,
  445. h = qp_i.drawmapmatrix[qp_be(c.i, c.j)].color;
  446. if (k != h)
  447. return;
  448. qp_D++;
  449. for (var m = !1, n = 0; n < a.length - 3; n++) {
  450. var p = a[n];
  451. if (p.i == c.i && p.j == c.j) {
  452. m = !0;
  453. break
  454. }
  455. }
  456. if (m) {
  457. b = a.length;
  458. for (d = 0; d < b; d++)
  459. f = a.pop(), qp_bd(f, h);
  460. qp_bd(c, h);
  461. qp_i.drawmapmatrix[qp_be(l.i, l.j)] = {
  462. color : k,
  463. type : qp_n
  464. };
  465. qp_bj(a);
  466. return
  467. }
  468. if (qp_i.drawmapmatrix[qp_be(c.i, c.j)].type == qp_n) {
  469. if(!IS_ANDROID) createjs.Sound.play("link", !0);
  470. qipaApp.score += qp_b;
  471. qp_T.text = qipaApp.score.toString();
  472. e = !1;
  473. b.j == c.j - 1 && (g = qp_A);
  474. b.j == c.j + 1 && (g = qp_C);
  475. b.i == c.i + 1 && (g = qp_B);
  476. b.i == c.i - 1 && (g = qp_z);
  477. if (qp_i.drawmapmatrix[qp_be(b.i, b.j)].type == qp_o)
  478. switch (g) {
  479. case qp_z:
  480. f =
  481. qp_v;
  482. break;
  483. case qp_A:
  484. f = qp_w;
  485. break;
  486. case qp_B:
  487. f = qp_x;
  488. break;
  489. case qp_C:
  490. f = qp_y
  491. }
  492. else
  493. d.i + 1 == c.i && d.j + 1 == c.j && d.i + 1 == b.i && d.j == b.j && (f = qp_s), c.i + 1 == d.i && c.j + 1 == d.j && b.i + 1 == d.i && b.j == d.j && (f = qp_t), d.i + 1 == c.i && d.j + 1 == c.j && d.i == b.i && d.j + 1 == b.j && (f = qp_t), c.i + 1 == d.i && c.j + 1 == d.j && b.i == d.i && b.j + 1 == d.j && (f = qp_s), d.i + 1 == c.i && d.j - 1 == c.j && d.i == b.i && d.j - 1 == b.j && (f = qp_u), c.i + 1 == d.i && c.j - 1 == d.j && b.i == d.i && b.j - 1 == d.j && (f = qp_r), d.i + 1 == c.i && d.j - 1 == c.j && d.i + 1 == b.i && d.j == b.j && (f = qp_r), c.i + 1 == d.i && c.j - 1 == d.j && b.i + 1 == d.i && b.j ==
  494. d.j && (f = qp_u), d.i == b.i && d.i == c.i && d.j + 1 == b.j && d.j + 2 == c.j && (f = qp_q), d.i == b.i && d.i == c.i && d.j - 1 == b.j && d.j - 2 == c.j && (f = qp_q), d.j == b.j && d.j == c.j && d.i + 1 == b.i && d.i + 2 == c.i && (f = qp_p), d.j == b.j && d.j == c.j && d.i - 1 == b.i && d.i - 2 == c.i && (f = qp_p);
  495. 0 == f && console.log("warning type error");
  496. qp_i.drawmapmatrix[qp_be(b.i, b.j)] = {
  497. color : k,
  498. type : f
  499. };
  500. qp_i.drawmapmatrix[qp_be(c.i, c.j)] = {
  501. color : k,
  502. type : g
  503. };
  504. a.push(c)
  505. } else
  506. l = a.pop(), m = a[a.length - 2], c.j == m.j + 1 && (g = qp_A), c.j == m.j - 1 && (g = qp_C), c.i == m.i - 1 && (g = qp_B), c.i == m.i + 1 && (g = qp_z), qp_i.drawmapmatrix[qp_be(c.i,
  507. c.j)] = {
  508. color : k,
  509. type : g
  510. },
  511. qp_bd(l, h);
  512. qp_bj(a)
  513. }
  514. if (qp_i.drawmapmatrix[qp_be(c.i, c.j)] == qp_m) {
  515. k = qp_i.drawmapmatrix[qp_be(a[0].i, a[0].j)].color;
  516. g = 0;
  517. b.j == c.j - 1 && (g = qp_A);
  518. b.j == c.j + 1 && (g = qp_C);
  519. b.i == c.i + 1 && (g = qp_B);
  520. b.i == c.i - 1 && (g = qp_z);
  521. if (qp_i.drawmapmatrix[qp_be(b.i, b.j)].type == qp_o)
  522. switch (g) {
  523. case qp_z:
  524. f = qp_v;
  525. break;
  526. case qp_A:
  527. f = qp_w;
  528. break;
  529. case qp_B:
  530. f = qp_x;
  531. break;
  532. case qp_C:
  533. f = qp_y
  534. }
  535. else
  536. d.i + 1 == c.i && d.j + 1 == c.j && d.i + 1 == b.i && d.j == b.j && (f = qp_s), c.i + 1 == d.i && c.j + 1 == d.j && b.i + 1 == d.i && b.j == d.j && (f = qp_t), d.i + 1 == c.i && d.j +
  537. 1 == c.j && d.i == b.i && d.j + 1 == b.j && (f = qp_t), c.i + 1 == d.i && c.j + 1 == d.j && b.i == d.i && b.j + 1 == d.j && (f = qp_s), d.i + 1 == c.i && d.j - 1 == c.j && d.i == b.i && d.j - 1 == b.j && (f = qp_u), c.i + 1 == d.i && c.j - 1 == d.j && b.i == d.i && b.j - 1 == d.j && (f = qp_r), d.i + 1 == c.i && d.j - 1 == c.j && d.i + 1 == b.i && d.j == b.j && (f = qp_r), c.i + 1 == d.i && c.j - 1 == d.j && b.i + 1 == d.i && b.j == d.j && (f = qp_u), d.i == b.i && d.i == c.i && d.j + 1 == b.j && d.j + 2 == c.j && (f = qp_q), d.i == b.i && d.i == c.i && d.j - 1 == b.j && d.j - 2 == c.j && (f = qp_q), d.j == b.j && d.j == c.j && d.i + 1 == b.i && d.i + 2 == c.i && (f = qp_p), d.j == b.j && d.j == c.j && d.i - 1 == b.i &&
  538. d.i - 2 == c.i && (f = qp_p);
  539. 0 == f && console.log("warning type error");
  540. qp_i.drawmapmatrix[qp_be(b.i, b.j)] = {
  541. color : k,
  542. type : f
  543. };
  544. qp_i.drawmapmatrix[qp_be(c.i, c.j)] = {
  545. color : k,
  546. type : g
  547. };
  548. a.push(c)
  549. }
  550. qp_bj(a)
  551. }
  552. }
  553. }, qp_k);
  554. qp_k.on("pressup", function (c) {
  555. e = !1;
  556. void 0 != a && null != a && 0 != a.length && (0 <= qp_i.mapmatrix[qp_be(a[a.length - 1].i, a[a.length - 1].j)] && (qp_bk(qp_i.drawmapmatrix[qp_be(a[a.length - 1].i, a[a.length - 1].j)].color), qp_bj(a)), 1 == a.length && (qp_i.drawmapmatrix[qp_be(a[0].i, a[0].j)].type = qp_n, qp_bj(a)), qp_bn() && qp_ba(!1))
  557. }, qp_k)
  558. }
  559. function qp_R() {
  560. var a = new createjs.Bitmap(qipaStage.queue.getResult("bg"));
  561. qipaStage.stage.addChild(a)
  562. }
  563. function qp_S() {
  564. qipaStage.stage.removeChild(qp_k);
  565. qp_k = new createjs.Shape;
  566. qp_k.graphics.f("#C0C0C0").r(0, 0, 640, 960);
  567. qp_k.alpha = 0.05;
  568. qipaStage.stage.addChild(qp_k)
  569. }
  570. function qp_bf() {
  571. qipaStage.stage.removeChild(qp_j);
  572. qp_j = new createjs.Container;
  573. qipaStage.stage.addChild(qp_j);
  574. for (var a = 0; a < qp_i.drawmapmatrix.length; a++) {
  575. var e = qp_i.drawmapmatrix[a];
  576. e.type == qp_n && (qp_bo(qp_bp(a)), e = qp_bq(e.type, e.color, qp_bp(a)), qp_j.addChild(e))
  577. }
  578. }
  579. function qp_bj(a) {
  580. qp_j.removeAllChildren();
  581. for (var e = 0; 25 > e; e++)
  582. 0 > qp_i.mapmatrix[e] && (a = qp_i.drawmapmatrix[e], a = qp_bq(a.type, a.color, qp_bp(e)), qp_j.addChild(a));
  583. for (e = 1; 5 >= e; e++) {
  584. var c = qp_i.colorlinearray[e];
  585. if (void 0 != c && null != c)
  586. for (var b = 0; b < c.length; b++) {
  587. var d = c[b];
  588. qp_i.drawmapmatrix[qp_be(d.i, d.j)] == qp_m ? console.log("color:" + e + " link:" + d.i + "," + d.j) : (a = qp_i.drawmapmatrix[qp_be(d.i, d.j)], a = qp_bq(a.type, a.color, d), qp_j.addChild(a))
  589. }
  590. }
  591. }
  592. function qp_bq(a, e, c) {
  593. var b = null;
  594. switch (a) {
  595. case qp_r:
  596. b = "cat" + e.toString() + "_conner";
  597. b = new createjs.Bitmap(qipaStage.queue.getResult(b));
  598. b.regX = b.getBounds().width / 2;
  599. b.regY = b.getBounds().height / 2;
  600. break;
  601. case qp_s:
  602. b = "cat" + e.toString() + "_conner";
  603. b = new createjs.Bitmap(qipaStage.queue.getResult(b));
  604. b.regX = b.getBounds().width / 2;
  605. b.regY = b.getBounds().height / 2;
  606. b.rotation = 90;
  607. break;
  608. case qp_t:
  609. b = "cat" + e.toString() + "_conner";
  610. b = new createjs.Bitmap(qipaStage.queue.getResult(b));
  611. b.regX = b.getBounds().width / 2;
  612. b.regY =
  613. b.getBounds().height / 2;
  614. b.rotation = 270;
  615. break;
  616. case qp_u:
  617. b = "cat" + e.toString() + "_conner";
  618. b = new createjs.Bitmap(qipaStage.queue.getResult(b));
  619. b.regX = b.getBounds().width / 2;
  620. b.regY = b.getBounds().height / 2;
  621. b.rotation = 180;
  622. break;
  623. case qp_v:
  624. b = "cat" + e.toString() + "_head";
  625. b = new createjs.Bitmap(qipaStage.queue.getResult(b));
  626. b.regX = b.getBounds().width / 2;
  627. b.regY = b.getBounds().height / 2;
  628. break;
  629. case qp_w:
  630. b = "cat" + e.toString() + "_head";
  631. b = new createjs.Bitmap(qipaStage.queue.getResult(b));
  632. b.regX = b.getBounds().width / 2;
  633. b.regY = b.getBounds().height /
  634. 2;
  635. b.rotation = 270;
  636. break;
  637. case qp_x:
  638. b = "cat" + e.toString() + "_head";
  639. b = new createjs.Bitmap(qipaStage.queue.getResult(b));
  640. b.regX = b.getBounds().width / 2;
  641. b.regY = b.getBounds().height / 2;
  642. b.rotation = 180;
  643. break;
  644. case qp_y:
  645. b = "cat" + e.toString() + "_head";
  646. b = new createjs.Bitmap(qipaStage.queue.getResult(b));
  647. b.regX = b.getBounds().width / 2;
  648. b.regY = b.getBounds().height / 2;
  649. b.rotation = 90;
  650. break;
  651. case qp_z:
  652. b = "cat" + e.toString() + "_tail";
  653. b = new createjs.Bitmap(qipaStage.queue.getResult(b));
  654. b.regX = b.getBounds().width / 2;
  655. b.regY = b.getBounds().height /
  656. 2;
  657. break;
  658. case qp_A:
  659. b = "cat" + e.toString() + "_tail";
  660. b = new createjs.Bitmap(qipaStage.queue.getResult(b));
  661. b.regX = b.getBounds().width / 2;
  662. b.regY = b.getBounds().height / 2;
  663. b.rotation = 270;
  664. break;
  665. case qp_B:
  666. b = "cat" + e.toString() + "_tail";
  667. b = new createjs.Bitmap(qipaStage.queue.getResult(b));
  668. b.regX = b.getBounds().width / 2;
  669. b.regY = b.getBounds().height / 2;
  670. b.rotation = 180;
  671. break;
  672. case qp_C:
  673. b = "cat" + e.toString() + "_tail";
  674. b = new createjs.Bitmap(qipaStage.queue.getResult(b));
  675. b.regX = b.getBounds().width / 2;
  676. b.regY = b.getBounds().height / 2;
  677. b.rotation =
  678. 90;
  679. break;
  680. case qp_p:
  681. b = "cat" + e.toString() + "_body";
  682. b = new createjs.Bitmap(qipaStage.queue.getResult(b));
  683. b.regX = b.getBounds().width / 2;
  684. b.regY = b.getBounds().height / 2;
  685. break;
  686. case qp_q:
  687. b = "cat" + e.toString() + "_body";
  688. b = new createjs.Bitmap(qipaStage.queue.getResult(b));
  689. b.regX = b.getBounds().width / 2;
  690. b.regY = b.getBounds().height / 2;
  691. b.rotation = 90;
  692. break;
  693. case qp_o:
  694. b = "cat" + e.toString() + "_head";
  695. b = new createjs.Bitmap(qipaStage.queue.getResult(b));
  696. b.regX = b.getBounds().width / 2;
  697. b.regY = b.getBounds().height / 2;
  698. break;
  699. case qp_n:
  700. b =
  701. "cat" + e.toString() + "_startpoint",
  702. b = new createjs.Bitmap(qipaStage.queue.getResult(b)),
  703. b.regX = b.getBounds().width / 2,
  704. b.regY = b.getBounds().height / 2
  705. }
  706. c = qp_bo(c);
  707. null == b && console.log("type:" + a + " color:" + e);
  708. b.x = c.x;
  709. b.y = c.y;
  710. return b
  711. }
  712. var Qp_Q = function () {
  713. this.N = 5;
  714. this.CNT = 25;
  715. this.mapmatrix = this.qp_br();
  716. this.drawmapmatrix = [];
  717. for (var a = 0; 25 > a; a++)
  718. if (0 > this.mapmatrix[a]) {
  719. var e = Math.abs(this.mapmatrix[a]);
  720. this.drawmapmatrix.push({
  721. color : e,
  722. type : qp_n
  723. })
  724. } else
  725. this.drawmapmatrix.push(qp_m);
  726. this.colorlinearray = []
  727. };
  728. Qp_Q.prototype.qp_bb = function () {
  729. this.mapmatrix = this.qp_br();
  730. this.drawmapmatrix = [];
  731. for (var a = 0; 25 > a; a++)
  732. if (0 > this.mapmatrix[a]) {
  733. var e = Math.abs(this.mapmatrix[a]);
  734. this.drawmapmatrix.push({
  735. color : e,
  736. type : qp_n
  737. })
  738. } else
  739. this.drawmapmatrix.push(qp_m);
  740. this.colorlinearray = []
  741. };
  742. Qp_Q.prototype.qp_bs = function (a) {
  743. for (var e = 0; e < this.CNT; e++)
  744. a[e] = 0
  745. };
  746. Qp_Q.prototype.qp_bt = function (a, e) {
  747. for (var c = 0, b = 0; b < this.CNT; b++)
  748. if (0 == a[b]) {
  749. if (c == e)
  750. return b;
  751. c++
  752. }
  753. return -1
  754. };
  755. Qp_Q.prototype.qp_bu = function (a) {
  756. for (var e = 0, c = 0; c < this.CNT; c++)
  757. 0 == a[c] && e++;
  758. return e
  759. };
  760. Qp_Q.prototype.qp_bv = function () {
  761. for (var a = [0, 1, 2, 3], e = 4; 0 < e; e--) {
  762. var c = Math.floor(Math.random() * (e - 1)),
  763. b = a[c];
  764. a[c] = a[e - 1];
  765. a[e - 1] = b
  766. }
  767. orders = [];
  768. for (e = 0; 4 > e; e++)
  769. switch (a[e]) {
  770. case 0:
  771. orders[e] = [-1, 0];
  772. break;
  773. case 1:
  774. orders[e] = [1, 0];
  775. break;
  776. case 2:
  777. orders[e] = [0, -1];
  778. break;
  779. case 3:
  780. orders[e] = [0, 1]
  781. }
  782. return orders
  783. };
  784. Qp_Q.prototype.qp_bw = function (a, e, c, b, d, f) {
  785. var g = Math.floor(e / this.N);
  786. e %= this.N;
  787. var l = g,
  788. k = e;
  789. e += b;
  790. var g = g + d,
  791. h = g * this.N + e;
  792. if (!(0 <= e && e < this.N && 0 <= g && g < this.N) || 0 != a[h])
  793. return !1;
  794. for (var m = g - 1; m <= g + 1; m++)
  795. for (var n = e - 1; n <= e + 1; n++)
  796. if (0 <= m && m < this.N && 0 <= n && n < this.N && n != k && m != l) {
  797. var p = m * this.N + n;
  798. if (a[p] == f || a[p] == -f)
  799. return !1
  800. }
  801. a[h] = 1 == c ? -f : f;
  802. c--;
  803. if (0 == c)
  804. return a;
  805. newMatrix = this.qp_bw(a.slice(0), h, c, b, d, f);
  806. if (!1 != newMatrix)
  807. return newMatrix;
  808. if (0 == b) {
  809. newMatrix = this.qp_bw(a.slice(0), h, c, -1, 0, f);
  810. if (!1 != newMatrix)
  811. return newMatrix;
  812. newMatrix = this.qp_bw(a.slice(0), h, c, 1, 0, f);
  813. if (!1 != newMatrix)
  814. return newMatrix
  815. }
  816. if (0 == d) {
  817. newMatrix = this.qp_bw(a.slice(0), h, c, 0, -1, f);
  818. if (!1 != newMatrix)
  819. return newMatrix;
  820. newMatrix = this.qp_bw(a.slice(0), h, c, 0, 1, f);
  821. if (!1 != newMatrix)
  822. return newMatrix
  823. }
  824. return !1
  825. };
  826. Qp_Q.prototype.qp_bx = function (a, e, c, b) {
  827. a[e] = -b;
  828. for (var d = this.qp_bv(), f = 0; 4 > f; f++) {
  829. var g = this.qp_bw(a.slice(0), e, c - 1, d[f][0], d[f][1], b);
  830. if (!1 != g)
  831. return g
  832. }
  833. return !1
  834. };
  835. Qp_Q.prototype.qp_by = function (a, e) {
  836. if (5 < e || 5 == e && 0 < c)
  837. return !1;
  838. var c = this.qp_bu(a);
  839. if (3 <= e && 0 == c)
  840. return a;
  841. if (3 > c)
  842. return !1;
  843. for (var b = 3; 0 < b--; ) {
  844. var d = Math.floor(Math.random() * c),
  845. d = this.qp_bt(a, d),
  846. f = 3 + Math.floor(8 * Math.random());
  847. f > c && (f = c);
  848. if (void 0 == a) {
  849. console.log("ahahahahahahahahahahhhhhhhhhhhhhhhh");
  850. break
  851. }
  852. d = this.qp_bx(a.slice(0), d, f, e + 1);
  853. if (!1 != d && (d = this.qp_by(d, e + 1), !1 != d))
  854. return d
  855. }
  856. return !1
  857. };
  858. Qp_Q.prototype.qp_br = function () {
  859. for (var a = [], e = 1E4; 0 < e-- && (a = [], this.qp_bs(a), a = this.qp_by(a, 0), !1 == a); );
  860. return a
  861. };
  862. var Qp_bz = function (a, e) {
  863. this.i = a;
  864. this.j = e
  865. }, Qp_bg = function (a, e) {
  866. this.x = a;
  867. this.y = e
  868. };
  869. function qp_bp(a) {
  870. var e = Math.floor(a / 5);
  871. return new Qp_bz(e, a - 5 * e)
  872. }
  873. function qp_be(a, e) {
  874. return 5 * a + e
  875. }
  876. function qp_bo(a) {
  877. return new Qp_bg(qp_E + (a.j + 0.5) * qp_G + qp_I, qp_F + (a.i + 0.5) * qp_G + qp_I)
  878. }
  879. function qp_bh(a) {
  880. return a.x < qp_E && a.x > 640 - qp_E ? !1 : a.y < qp_F && a.y > 5 * qp_G ? !1 : new Qp_bz(Math.max(Math.min(Math.floor((a.y - qp_F) / qp_G), 4), 0), Math.max(0, Math.min(Math.floor((a.x - qp_E) / qp_G), 4)))
  881. }
  882. function qp_bA(a) {
  883. a = qp_bh(a);
  884. return qp_bo(a)
  885. }
  886. function qp_bl(a, e) {
  887. return void 0 == a || void 0 == e ? !1 : a.i == e.i && a.j == e.j - 1 || a.i == e.i && a.j == e.j + 1 || a.i == e.i - 1 && a.j == e.j || a.i == e.i + 1 && a.j == e.j ? !0 : !1
  888. }
  889. function qp_bi(a, e) {
  890. if (void 0 != qp_i.colorlinearray[a] && null != qp_i.colorlinearray[a] && 0 != qp_i.colorlinearray[a].length) {
  891. var c = qp_i.colorlinearray[a][0];
  892. qp_i.drawmapmatrix[qp_be(c.i, c.j)].type = qp_n;
  893. c = qp_i.colorlinearray[a][qp_i.colorlinearray[a].length - 1];
  894. qp_i.drawmapmatrix[qp_be(c.i, c.j)].type = qp_n;
  895. for (c = 1; c < qp_i.colorlinearray[a].length - 1; c++) {
  896. var b = qp_i.colorlinearray[a][c];
  897. qp_i.drawmapmatrix[qp_be(b.i, b.j)] = qp_m
  898. }
  899. }
  900. qp_i.colorlinearray[a] = [];
  901. qp_bk(a);
  902. return qp_i.colorlinearray[a]
  903. }
  904. function qp_bk(a) {
  905. for (var e = 0; 25 > e; e++)
  906. 0 > qp_i.mapmatrix[e] && Math.abs(qp_i.mapmatrix[e]) == a ? qp_i.drawmapmatrix[e].type = qp_n : qp_i.drawmapmatrix[e].color == a && (qp_i.drawmapmatrix[e] = qp_m);
  907. qp_i.colorlinearray[a] = []
  908. }
  909. function qp_bn() {
  910. for (var a = 0; 25 > a; a++)
  911. if (qp_i.drawmapmatrix[a].type == qp_n)
  912. return !1;
  913. return !0
  914. }
  915. function qp_bB(a) {
  916. for (var e = a.length; 0 < e; e--) {
  917. var c = Math.floor(Math.random() * (e - 1)),
  918. b = a[c];
  919. a[c] = a[e - 1];
  920. a[e - 1] = b
  921. }
  922. }
  923. function qp_bC(a) {
  924. for (var e = a.length, c = [], b = 0; b < e; b++)
  925. c.push(b);
  926. for (b = e; 0 < b; b--) {
  927. var d = Math.floor(Math.random() * (b - 1)),
  928. f = c[d];
  929. c[d] = c[b - 1];
  930. c[b - 1] = f
  931. }
  932. d = [];
  933. for (b = 0; b < e; b++)
  934. d.push(a[c[b]]);
  935. return d
  936. }
  937. function qp_bD(a, e) {
  938. for (var c = qp_bC(a), b = [], d = 0; d < Math.min(e, a.length); d++)
  939. b.push(c[d]);
  940. return b
  941. }
  942. function qp_Y() {
  943. qipaShare.title = "【喵喵瑜伽】,看你能塞进几只猫咪?";
  944. if (0 == qipaApp.score)
  945. qipaShare.desc = qipaShare.title;
  946. else {
  947. var a = parseInt(Math.sqrt(1E4 * qipaApp.score / 180));
  948. 99 < a && (a = "99.9");
  949. LBShare.updateData({ //修改分享文案
  950. desc: "【喵喵瑜伽】:我塞进去了" + qipaApp.score + "只猫咪,战胜了" + a + "%的玩家。不服来战!"
  951. });
  952. LBShare.statScore(qipaApp.score) //上报游戏结果
  953. }
  954. }
  955. var _cfg = {
  956. startFunc : qp_P,
  957. img : {
  958. path : "img/",
  959. manifest : [{
  960. src : "discription.png",
  961. id : "discription"
  962. }, {
  963. src : "banner.jpg",
  964. id : "banner"
  965. }, {
  966. src : "help.jpg",
  967. id : "help"
  968. }, {
  969. src : "bounus.png",
  970. id : "bounus"
  971. }, {
  972. src : "clock.png",
  973. id : "clock"
  974. }, {
  975. src : "score.png",
  976. id : "score"
  977. }, {
  978. src : "curscore.png",
  979. id : "curscore"
  980. }, {
  981. src : "bestscore.png",
  982. id : "bestscore"
  983. }, {
  984. src : "fcwmlogl.png",
  985. id : "fcwmlogl"
  986. }, {
  987. src : "lowkeysharebtn.png",
  988. id : "lowkeysharebtn"
  989. }, {
  990. src : "toplistbtn.png",
  991. id : "toplistbtn"
  992. }, {
  993. src : "replaybtn.png",
  994. id : "replaybtn"
  995. }, {
  996. src : "star1.png",
  997. id : "star1"
  998. }, {
  999. src : "star2.png",
  1000. id : "star2"
  1001. }, {
  1002. src : "star3.png",
  1003. id : "star3"
  1004. }, {
  1005. src : "go.png",
  1006. id : "go"
  1007. }, {
  1008. src : "ready.png",
  1009. id : "ready"
  1010. }, {
  1011. src : "bg.jpg",
  1012. id : "bg"
  1013. }, {
  1014. src : "cat1_body.png",
  1015. id : "cat1_body"
  1016. }, {
  1017. src : "cat1_conner.png",
  1018. id : "cat1_conner"
  1019. }, {
  1020. src : "cat1_head.png",
  1021. id : "cat1_head"
  1022. }, {
  1023. src : "cat1_tail.png",
  1024. id : "cat1_tail"
  1025. }, {
  1026. src : "cat1_startpoint.png",
  1027. id : "cat1_startpoint"
  1028. }, {
  1029. src : "cat2_body.png",
  1030. id : "cat2_body"
  1031. }, {
  1032. src : "cat2_conner.png",
  1033. id : "cat2_conner"
  1034. }, {
  1035. src : "cat2_head.png",
  1036. id : "cat2_head"
  1037. }, {
  1038. src : "cat2_tail.png",
  1039. id : "cat2_tail"
  1040. }, {
  1041. src : "cat2_startpoint.png",
  1042. id : "cat2_startpoint"
  1043. }, {
  1044. src : "cat3_body.png",
  1045. id : "cat3_body"
  1046. }, {
  1047. src : "cat3_conner.png",
  1048. id : "cat3_conner"
  1049. }, {
  1050. src : "cat3_head.png",
  1051. id : "cat3_head"
  1052. }, {
  1053. src : "cat3_tail.png",
  1054. id : "cat3_tail"
  1055. }, {
  1056. src : "cat3_startpoint.png",
  1057. id : "cat3_startpoint"
  1058. }, {
  1059. src : "cat4_body.png",
  1060. id : "cat4_body"
  1061. }, {
  1062. src : "cat4_conner.png",
  1063. id : "cat4_conner"
  1064. }, {
  1065. src : "cat4_head.png",
  1066. id : "cat4_head"
  1067. }, {
  1068. src : "cat4_tail.png",
  1069. id : "cat4_tail"
  1070. }, {
  1071. src : "cat4_startpoint.png",
  1072. id : "cat4_startpoint"
  1073. }, {
  1074. src : "cat5_body.png",
  1075. id : "cat5_body"
  1076. }, {
  1077. src : "cat5_conner.png",
  1078. id : "cat5_conner"
  1079. }, {
  1080. src : "cat5_head.png",
  1081. id : "cat5_head"
  1082. }, {
  1083. src : "cat5_tail.png",
  1084. id : "cat5_tail"
  1085. }, {
  1086. src : "cat5_startpoint.png",
  1087. id : "cat5_startpoint"
  1088. }
  1089. ]
  1090. },
  1091. audio : {
  1092. path : "audio/",
  1093. manifest : [{
  1094. src : "link.mp3",
  1095. id : "link"
  1096. }, {
  1097. src : "unlink.mp3",
  1098. id : "unlink"
  1099. }
  1100. ]
  1101. }
  1102. };
  1103. qipaStage.init(_cfg);