123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119 |
- H = 960;
- 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;
- function qp_P(a) {
- LBShare.updateData({ //设置标题+图片+文案
- title: "猫猫瑜伽",
- imgUrl: "./img/maomaoyujia.png",
- desc: "【喵喵瑜伽】,看你能塞进几只猫咪?"
- });
- qp_i = new Qp_Q;
- qp_R();
- var e = function () {
- var a = new createjs.Bitmap(qipaStage.queue.getResult("ready"));
- a.regX = 266;
- a.regY = 80;
- a.x = 320;
- a.y = 450;
- a.scaleX = 3;
- a.scaleY = 3;
- a.alpha = 0;
- createjs.Tween.get(a).to({
- alpha : 1,
- scaleX : 1,
- scaleY : 1
- }, 300).to({
- alpha : 1
- }, qp_K - 300).call(function () {
- var a = new createjs.Bitmap(qipaStage.queue.getResult("go"));
- a.regX = 240;
- a.regY = 136;
- a.x = 320;
- a.y = 450;
- createjs.Tween.get(a).to({
- scaleX : 1
- }, qp_L - 200).to({
- alpha : 0
- }, 200).call(function () {
- var a = new createjs.Bitmap(qipaStage.queue.getResult("score"));
- a.regX = 0;
- a.regY = 0;
- a.x = 40;
- a.y = 15;
- qipaStage.stage.addChild(a);
- qp_T = new createjs.Text("0", "bold 48px Arial", "#ff1e50");
- qp_T.stroke = "white";
- qp_T.textBaseline = "middle";
- qp_T.x = 140;
- qp_T.y = 35;
- qipaStage.stage.addChild(qp_T);
- a = new createjs.Bitmap(qipaStage.queue.getResult("clock"));
- a.regX = 25;
- a.regY = 26;
- a.x = 510;
- a.y = 40;
- qipaStage.stage.addChild(a);
- qp_U = new createjs.Text(qp_N.toString(), "bold 40px Arial", "#ff1e50");
- qp_U.stroke = "white";
- qp_U.textBaseline = "middle";
- qp_U.x = 570;
- qp_U.y = 40;
- qipaStage.stage.addChild(qp_U);
- qp_V = setInterval(function () {
- 0 < qp_N && (qp_N--, qp_U.text = qp_N.toString());
- 0 == qp_N && qp_W()
- }, 1E3);
- qp_X();
- qipaStage.stage.removeChild(this)
- });
- qipaStage.stage.addChild(a);
- qipaStage.stage.removeChild(this)
- });
- qipaStage.stage.addChild(a)
- },
- c = new createjs.Container;
- qipaStage.stage.addChild(c);
- a = new createjs.Shape;
- a.graphics.f("#e8fdea").r(0, 0, 640, 960).ef();
- c.addChild(a);
- a = new createjs.Bitmap(qipaStage.queue.getResult("banner"));
- c.addChild(a);
- a = new createjs.Bitmap(qipaStage.queue.getResult("help"));
- a.y = 315;
- c.addChild(a);
- a = new createjs.Bitmap(qipaStage.queue.getResult("discription"));
- a.x = 15;
- a.y = 675;
- c.addChild(a);
- a = new createjs.Bitmap(qipaStage.queue.getResult("replaybtn"));
- a.regX = 90;
- a.regY = 50;
- a.x = 320;
- a.y = 850;
- a.on("mousedown", function (a) {
- IS_TOUCH && a.nativeEvent instanceof MouseEvent || (e(), qipaStage.stage.removeChild(c))
- });
- c.addChild(a);
- a = new createjs.Bitmap(qipaStage.queue.getResult("toplistbtn"));
- a.regX = 90;
- a.regY = 50;
- a.x = 455;
- a.y = 850;
- a.on("click", function (a) {
- //window.open("../lb.html?gid=" + GID)
- dp_Ranking();
- });
- //c.addChild(a);
- if(!IS_ANDROID){
- //createjs.Sound.registMySound("silenttail", 2.8);
- if(!createjs.Sound.hasOwnProperty('registMySound')){
- return
- }
- createjs.Sound.registMySound("link", 2);
- createjs.Sound.registMySound("unlink", 0);
- }
- qipaApp.onGameStarted();
- qp_Y()
- }
- function qp_Z(a) {
- qp_T.text = qipaApp.score.toString();
- a = new createjs.Shape;
- a.graphics.f("#fff").r(0, 0, 640, 960).ef();
- a.x = 0;
- a.y = 0;
- a.alpha = 1;
- createjs.Tween.get(a).to({
- alpha : 0.8
- }, 200).to({
- alpha : 0.8
- }, 800).to({
- alpha : 0
- }, 200).call(function () {
- qipaStage.stage.removeChild(this)
- });
- qipaStage.stage.addChild(a);
- a = new createjs.Bitmap(qipaStage.queue.getResult("bounus"));
- a.regX = 230;
- a.regY = 100;
- a.x = -230;
- a.y = 480;
- a.alpha = 0;
- createjs.Tween.get(a).to({
- x : 320,
- alpha : 1
- }, 200).to({
- x : 320
- }, 600).to({
- x : 870,
- alpha : 0
- }, 200).call(function () {
- qp_f ==
- qp_g && qp_X();
- qipaStage.stage.removeChild(this)
- });
- qipaStage.stage.addChild(a)
- }
- function qp_ba(a) {
- qp_j.removeAllChildren();
- qp_i.qp_bb();
- !0 == a ? (qp_a = 1, qipaApp.score = 0, qp_T.text = qipaApp.score.toString(), qp_bc = qp_M - 1, qp_V = setInterval(function () {
- 0 < qp_N && (qp_N--, qp_U.text = qp_N.toString());
- 0 == qp_N && qp_W()
- }, 1E3), qp_X()) : (qp_Z(qp_a), qp_a++)
- }
- function qp_W() {
- LBShare.updateData({ //修改分享文案
- desc: "【喵喵瑜伽】:我塞进去了" + qipaApp.score + "只猫咪,战胜了" + a + "%的玩家。不服来战!"
- });
- LBShare.statScore(qipaApp.score) //上报游戏结果
- qp_f = qp_h;
- clearInterval(qp_V);
- qipaStage.stage.removeChild(qp_l);
- qp_l = new createjs.Container;
- qp_l.on("mousedown", function (a) {});
- qipaStage.stage.addChild(qp_l);
- var a = new createjs.Shape;
- a.graphics.f("#fff").r(0, 0, W, H).ef();
- a.x = 0;
- a.y = 0;
- a.alpha = 0.9;
- qp_l.addChild(a);
- var e = new createjs.Bitmap(qipaStage.queue.getResult("star3"));
- e.regX = 30;
- e.regY = 30;
- e.x = 320;
- e.y = 480;
- e.alpha = 0;
- createjs.Tween.get(e).to({
- x : 670,
- rotation : 360
- }, 800);
- createjs.Tween.get(e).to({
- alpha : 1
- }, 400).to({
- alpha : 0
- }, 400).call(function () {
- qp_l.removeChild(e)
- });
- qp_l.addChild(e);
- var c = new createjs.Bitmap(qipaStage.queue.getResult("star3"));
- c.regX = 30;
- c.regY = 30;
- c.x = 320;
- c.y = 480;
- c.alpha = 0;
- createjs.Tween.get(c).to({
- x : -30,
- rotation : 360
- }, 800);
- createjs.Tween.get(c).to({
- alpha : 1
- }, 400).to({
- alpha : 0
- }, 400).call(function () {
- qp_l.removeChild(c)
- });
- qp_l.addChild(c);
- var b = new createjs.Bitmap(qipaStage.queue.getResult("star3"));
- b.regX = 30;
- b.regY = 30;
- b.x = 320;
- b.y = 480;
- b.alpha = 0;
- createjs.Tween.get(b).to({
- y : 130,
- rotation : 360
- }, 800);
- createjs.Tween.get(b).to({
- alpha : 1
- }, 400).to({
- alpha : 0
- },
- 400).call(function () {
- qp_l.removeChild(b)
- });
- qp_l.addChild(b);
- var d = new createjs.Bitmap(qipaStage.queue.getResult("star3"));
- d.regX = 30;
- d.regY = 30;
- d.x = 320;
- d.y = 480;
- d.alpha = 0;
- createjs.Tween.get(d).to({
- y : 830,
- rotation : 360
- }, 800);
- createjs.Tween.get(d).to({
- alpha : 1
- }, 400).to({
- alpha : 0
- }, 400).call(function () {
- qp_l.removeChild(d)
- });
- qp_l.addChild(d);
- var f = new createjs.Bitmap(qipaStage.queue.getResult("star2"));
- f.regX = 62;
- f.regY = 60;
- f.x = 320;
- f.y = 480;
- f.alpha = 0;
- createjs.Tween.get(f).to({
- x : 120,
- y : 280,
- rotation : 360
- }, 800);
- createjs.Tween.get(f).to({
- alpha : 1
- },
- 400).to({
- alpha : 0
- }, 400).call(function () {
- qp_l.removeChild(f)
- });
- qp_l.addChild(f);
- var g = new createjs.Bitmap(qipaStage.queue.getResult("star2"));
- g.regX = 62;
- g.regY = 60;
- g.x = 320;
- g.y = 480;
- g.alpha = 0;
- createjs.Tween.get(g).to({
- x : 520,
- y : 280,
- rotation : 360
- }, 800);
- createjs.Tween.get(g).to({
- alpha : 1
- }, 400).to({
- alpha : 0
- }, 400).call(function () {
- qp_l.removeChild(g)
- });
- qp_l.addChild(g);
- var l = new createjs.Bitmap(qipaStage.queue.getResult("star2"));
- l.regX = 62;
- l.regY = 60;
- l.x = 320;
- l.y = 480;
- l.alpha = 0;
- createjs.Tween.get(l).to({
- x : 120,
- y : 680,
- rotation : 360
- }, 800);
- createjs.Tween.get(l).to({
- alpha : 1
- }, 400).to({
- alpha : 0
- }, 400).call(function () {
- qp_l.removeChild(l)
- });
- qp_l.addChild(l);
- var k = new createjs.Bitmap(qipaStage.queue.getResult("star2"));
- k.regX = 62;
- k.regY = 60;
- k.x = 320;
- k.y = 480;
- k.alpha = 0;
- createjs.Tween.get(k).to({
- x : 520,
- y : 680,
- rotation : 360
- }, 800);
- createjs.Tween.get(k).to({
- alpha : 1
- }, 400).to({
- alpha : 0
- }, 400).call(function () {
- qp_l.removeChild(k)
- });
- qp_l.addChild(k);
- var h = new createjs.Bitmap(qipaStage.queue.getResult("star1"));
- h.regX = 69;
- h.regY = 67;
- h.x = 320;
- h.y =
- 480;
- createjs.Tween.get(h).to({
- rotation : 360
- }, 800);
- createjs.Tween.get(h).to({
- alpha : 1
- }, 400).to({
- alpha : 0
- }, 400).call(function () {
- qp_l.removeChild(h)
- });
- qp_l.addChild(h);
- a = new createjs.Bitmap(qipaStage.queue.getResult("fcwmlogl"));
- a.regX = 195;
- a.regY = 33;
- a.x = 320;
- a.y = 185;
- qp_l.addChild(a);
- a = new createjs.Bitmap(qipaStage.queue.getResult("curscore"));
- a.x = 140;
- a.y = 260;
- qp_l.addChild(a);
- a = new createjs.Bitmap(qipaStage.queue.getResult("bestscore"));
- a.x = 140;
- a.y = 380;
- //qp_l.addChild(a);
- a = new createjs.Text(qipaApp.score.toString(),
- "bold 48px Arial", "#ff1e50");
- a.textAlign = "right";
- a.stroke = "white";
- a.textBaseline = "middle";
- a.x = 500;
- a.y = 300;
- qp_l.addChild(a);
- a = new createjs.Text(qipaApp.best.toString(), "bold 48px Arial", "#ff1e50");
- a.textAlign = "right";
- a.stroke = "white";
- a.textBaseline = "middle";
- a.x = 500;
- a.y = 410;
- //qp_l.addChild(a);
- a = new createjs.Bitmap(qipaStage.queue.getResult("replaybtn"));
- a.regX = 90;
- a.regY = 50;
- a.x = 320;
- a.y = 560;
- a.on("mousedown", function (a) {
- IS_TOUCH && a.nativeEvent instanceof MouseEvent || (qp_f = qp_g, qp_N = qp_M, qp_U.text = qp_N, qipaStage.stage.removeChild(qp_l),
- qp_ba(!0), qipaApp.onGameStarted())
- });
- qp_l.addChild(a);
- a = new createjs.Bitmap(qipaStage.queue.getResult("toplistbtn"));
- a.regX = 90;
- a.regY = 50;
- a.x = 455;
- a.y = 560;
- a.on("click", function (a) {
- //window.open("../lb.html?gid=" + GID)
- dp_Ranking();
- });
- // qp_l.addChild(a);
- a = new createjs.Bitmap(qipaStage.queue.getResult("lowkeysharebtn"));
- a.regX = 125;
- a.regY = 42;
- a.x = 320;
- a.y = 690;
- a.on("click", function (a) {
- LBShare.callShare();
- });
- qp_l.addChild(a);
- qipaApp.onGameOver();
- qp_Y();
- }
- function qp_bd(a, e) {
- qp_i.drawmapmatrix[qp_be(a.i, a.j)] = qp_m
- }
- function qp_X() {
- qp_bf();
- qp_S();
- var a,
- e = !1;
- qp_k.on("mousedown", function (c) {
- 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)) {
-
- if(!IS_ANDROID) createjs.Sound.play("unlink", !0);
- for (var b = !0, d = 0; 5 > d; d++) {
- for (var f = 0, g = 0; 25 > g; g++)
- qp_i.drawmapmatrix[g].type == qp_n &&
- qp_i.drawmapmatrix[g].color == d && f++;
- if (1 == f) {
- b = !1;
- break
- }
- }
- !0 == b && (qipaApp.score -= qp_b, qp_T.text = qipaApp.score);
- qp_bk(qp_i.drawmapmatrix[qp_be(c.i, c.j)].color);
- qp_bj()
- }
- }, qp_k);
- qp_k.on("pressmove", function (c) {
- if (e) {
- var b = a[a.length - 1],
- d = a[a.length - 2];
- c = new Qp_bg(c.localX, c.localY);
- c = qp_bh(c);
- var f = 0;
- if (!1 != qp_bl(b, c) && (b.i != c.i || b.j != c.j)) {
- if (qp_i.drawmapmatrix[qp_be(c.i, c.j)] != qp_m) {
- var g = 0,
- l = a[0],
- k = qp_i.drawmapmatrix[qp_be(l.i, l.j)].color,
- h = qp_i.drawmapmatrix[qp_be(c.i, c.j)].color;
- if (k != h)
- return;
- qp_D++;
- for (var m = !1, n = 0; n < a.length - 3; n++) {
- var p = a[n];
- if (p.i == c.i && p.j == c.j) {
- m = !0;
- break
- }
- }
- if (m) {
- b = a.length;
- for (d = 0; d < b; d++)
- f = a.pop(), qp_bd(f, h);
- qp_bd(c, h);
- qp_i.drawmapmatrix[qp_be(l.i, l.j)] = {
- color : k,
- type : qp_n
- };
- qp_bj(a);
- return
- }
- if (qp_i.drawmapmatrix[qp_be(c.i, c.j)].type == qp_n) {
-
- if(!IS_ANDROID) createjs.Sound.play("link", !0);
- qipaApp.score += qp_b;
- qp_T.text = qipaApp.score.toString();
- e = !1;
- b.j == c.j - 1 && (g = qp_A);
- b.j == c.j + 1 && (g = qp_C);
- b.i == c.i + 1 && (g = qp_B);
- b.i == c.i - 1 && (g = qp_z);
- if (qp_i.drawmapmatrix[qp_be(b.i, b.j)].type == qp_o)
- switch (g) {
- case qp_z:
- f =
- qp_v;
- break;
- case qp_A:
- f = qp_w;
- break;
- case qp_B:
- f = qp_x;
- break;
- case qp_C:
- f = qp_y
- }
- else
- 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 ==
- 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);
- 0 == f && console.log("warning type error");
- qp_i.drawmapmatrix[qp_be(b.i, b.j)] = {
- color : k,
- type : f
- };
- qp_i.drawmapmatrix[qp_be(c.i, c.j)] = {
- color : k,
- type : g
- };
- a.push(c)
- } else
- 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,
- c.j)] = {
- color : k,
- type : g
- },
- qp_bd(l, h);
- qp_bj(a)
- }
- if (qp_i.drawmapmatrix[qp_be(c.i, c.j)] == qp_m) {
- k = qp_i.drawmapmatrix[qp_be(a[0].i, a[0].j)].color;
- g = 0;
- b.j == c.j - 1 && (g = qp_A);
- b.j == c.j + 1 && (g = qp_C);
- b.i == c.i + 1 && (g = qp_B);
- b.i == c.i - 1 && (g = qp_z);
- if (qp_i.drawmapmatrix[qp_be(b.i, b.j)].type == qp_o)
- switch (g) {
- case qp_z:
- f = qp_v;
- break;
- case qp_A:
- f = qp_w;
- break;
- case qp_B:
- f = qp_x;
- break;
- case qp_C:
- f = qp_y
- }
- else
- 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 == 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);
- 0 == f && console.log("warning type error");
- qp_i.drawmapmatrix[qp_be(b.i, b.j)] = {
- color : k,
- type : f
- };
- qp_i.drawmapmatrix[qp_be(c.i, c.j)] = {
- color : k,
- type : g
- };
- a.push(c)
- }
- qp_bj(a)
- }
- }
- }, qp_k);
- qp_k.on("pressup", function (c) {
- e = !1;
- 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))
- }, qp_k)
- }
- function qp_R() {
- var a = new createjs.Bitmap(qipaStage.queue.getResult("bg"));
- qipaStage.stage.addChild(a)
- }
- function qp_S() {
- qipaStage.stage.removeChild(qp_k);
- qp_k = new createjs.Shape;
- qp_k.graphics.f("#C0C0C0").r(0, 0, 640, 960);
- qp_k.alpha = 0.05;
- qipaStage.stage.addChild(qp_k)
- }
- function qp_bf() {
- qipaStage.stage.removeChild(qp_j);
- qp_j = new createjs.Container;
- qipaStage.stage.addChild(qp_j);
- for (var a = 0; a < qp_i.drawmapmatrix.length; a++) {
- var e = qp_i.drawmapmatrix[a];
- e.type == qp_n && (qp_bo(qp_bp(a)), e = qp_bq(e.type, e.color, qp_bp(a)), qp_j.addChild(e))
- }
- }
- function qp_bj(a) {
- qp_j.removeAllChildren();
- for (var e = 0; 25 > e; e++)
- 0 > qp_i.mapmatrix[e] && (a = qp_i.drawmapmatrix[e], a = qp_bq(a.type, a.color, qp_bp(e)), qp_j.addChild(a));
- for (e = 1; 5 >= e; e++) {
- var c = qp_i.colorlinearray[e];
- if (void 0 != c && null != c)
- for (var b = 0; b < c.length; b++) {
- var d = c[b];
- 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))
- }
- }
- }
- function qp_bq(a, e, c) {
- var b = null;
- switch (a) {
- case qp_r:
- b = "cat" + e.toString() + "_conner";
- b = new createjs.Bitmap(qipaStage.queue.getResult(b));
- b.regX = b.getBounds().width / 2;
- b.regY = b.getBounds().height / 2;
- break;
- case qp_s:
- b = "cat" + e.toString() + "_conner";
- b = new createjs.Bitmap(qipaStage.queue.getResult(b));
- b.regX = b.getBounds().width / 2;
- b.regY = b.getBounds().height / 2;
- b.rotation = 90;
- break;
- case qp_t:
- b = "cat" + e.toString() + "_conner";
- b = new createjs.Bitmap(qipaStage.queue.getResult(b));
- b.regX = b.getBounds().width / 2;
- b.regY =
- b.getBounds().height / 2;
- b.rotation = 270;
- break;
- case qp_u:
- b = "cat" + e.toString() + "_conner";
- b = new createjs.Bitmap(qipaStage.queue.getResult(b));
- b.regX = b.getBounds().width / 2;
- b.regY = b.getBounds().height / 2;
- b.rotation = 180;
- break;
- case qp_v:
- b = "cat" + e.toString() + "_head";
- b = new createjs.Bitmap(qipaStage.queue.getResult(b));
- b.regX = b.getBounds().width / 2;
- b.regY = b.getBounds().height / 2;
- break;
- case qp_w:
- b = "cat" + e.toString() + "_head";
- b = new createjs.Bitmap(qipaStage.queue.getResult(b));
- b.regX = b.getBounds().width / 2;
- b.regY = b.getBounds().height /
- 2;
- b.rotation = 270;
- break;
- case qp_x:
- b = "cat" + e.toString() + "_head";
- b = new createjs.Bitmap(qipaStage.queue.getResult(b));
- b.regX = b.getBounds().width / 2;
- b.regY = b.getBounds().height / 2;
- b.rotation = 180;
- break;
- case qp_y:
- b = "cat" + e.toString() + "_head";
- b = new createjs.Bitmap(qipaStage.queue.getResult(b));
- b.regX = b.getBounds().width / 2;
- b.regY = b.getBounds().height / 2;
- b.rotation = 90;
- break;
- case qp_z:
- b = "cat" + e.toString() + "_tail";
- b = new createjs.Bitmap(qipaStage.queue.getResult(b));
- b.regX = b.getBounds().width / 2;
- b.regY = b.getBounds().height /
- 2;
- break;
- case qp_A:
- b = "cat" + e.toString() + "_tail";
- b = new createjs.Bitmap(qipaStage.queue.getResult(b));
- b.regX = b.getBounds().width / 2;
- b.regY = b.getBounds().height / 2;
- b.rotation = 270;
- break;
- case qp_B:
- b = "cat" + e.toString() + "_tail";
- b = new createjs.Bitmap(qipaStage.queue.getResult(b));
- b.regX = b.getBounds().width / 2;
- b.regY = b.getBounds().height / 2;
- b.rotation = 180;
- break;
- case qp_C:
- b = "cat" + e.toString() + "_tail";
- b = new createjs.Bitmap(qipaStage.queue.getResult(b));
- b.regX = b.getBounds().width / 2;
- b.regY = b.getBounds().height / 2;
- b.rotation =
- 90;
- break;
- case qp_p:
- b = "cat" + e.toString() + "_body";
- b = new createjs.Bitmap(qipaStage.queue.getResult(b));
- b.regX = b.getBounds().width / 2;
- b.regY = b.getBounds().height / 2;
- break;
- case qp_q:
- b = "cat" + e.toString() + "_body";
- b = new createjs.Bitmap(qipaStage.queue.getResult(b));
- b.regX = b.getBounds().width / 2;
- b.regY = b.getBounds().height / 2;
- b.rotation = 90;
- break;
- case qp_o:
- b = "cat" + e.toString() + "_head";
- b = new createjs.Bitmap(qipaStage.queue.getResult(b));
- b.regX = b.getBounds().width / 2;
- b.regY = b.getBounds().height / 2;
- break;
- case qp_n:
- b =
- "cat" + e.toString() + "_startpoint",
- b = new createjs.Bitmap(qipaStage.queue.getResult(b)),
- b.regX = b.getBounds().width / 2,
- b.regY = b.getBounds().height / 2
- }
- c = qp_bo(c);
- null == b && console.log("type:" + a + " color:" + e);
- b.x = c.x;
- b.y = c.y;
- return b
- }
- var Qp_Q = function () {
- this.N = 5;
- this.CNT = 25;
- this.mapmatrix = this.qp_br();
- this.drawmapmatrix = [];
- for (var a = 0; 25 > a; a++)
- if (0 > this.mapmatrix[a]) {
- var e = Math.abs(this.mapmatrix[a]);
- this.drawmapmatrix.push({
- color : e,
- type : qp_n
- })
- } else
- this.drawmapmatrix.push(qp_m);
- this.colorlinearray = []
- };
- Qp_Q.prototype.qp_bb = function () {
- this.mapmatrix = this.qp_br();
- this.drawmapmatrix = [];
- for (var a = 0; 25 > a; a++)
- if (0 > this.mapmatrix[a]) {
- var e = Math.abs(this.mapmatrix[a]);
- this.drawmapmatrix.push({
- color : e,
- type : qp_n
- })
- } else
- this.drawmapmatrix.push(qp_m);
- this.colorlinearray = []
- };
- Qp_Q.prototype.qp_bs = function (a) {
- for (var e = 0; e < this.CNT; e++)
- a[e] = 0
- };
- Qp_Q.prototype.qp_bt = function (a, e) {
- for (var c = 0, b = 0; b < this.CNT; b++)
- if (0 == a[b]) {
- if (c == e)
- return b;
- c++
- }
- return -1
- };
- Qp_Q.prototype.qp_bu = function (a) {
- for (var e = 0, c = 0; c < this.CNT; c++)
- 0 == a[c] && e++;
- return e
- };
- Qp_Q.prototype.qp_bv = function () {
- for (var a = [0, 1, 2, 3], e = 4; 0 < e; e--) {
- var c = Math.floor(Math.random() * (e - 1)),
- b = a[c];
- a[c] = a[e - 1];
- a[e - 1] = b
- }
- orders = [];
- for (e = 0; 4 > e; e++)
- switch (a[e]) {
- case 0:
- orders[e] = [-1, 0];
- break;
- case 1:
- orders[e] = [1, 0];
- break;
- case 2:
- orders[e] = [0, -1];
- break;
- case 3:
- orders[e] = [0, 1]
- }
- return orders
- };
- Qp_Q.prototype.qp_bw = function (a, e, c, b, d, f) {
- var g = Math.floor(e / this.N);
- e %= this.N;
- var l = g,
- k = e;
- e += b;
- var g = g + d,
- h = g * this.N + e;
- if (!(0 <= e && e < this.N && 0 <= g && g < this.N) || 0 != a[h])
- return !1;
- for (var m = g - 1; m <= g + 1; m++)
- for (var n = e - 1; n <= e + 1; n++)
- if (0 <= m && m < this.N && 0 <= n && n < this.N && n != k && m != l) {
- var p = m * this.N + n;
- if (a[p] == f || a[p] == -f)
- return !1
- }
- a[h] = 1 == c ? -f : f;
- c--;
- if (0 == c)
- return a;
- newMatrix = this.qp_bw(a.slice(0), h, c, b, d, f);
- if (!1 != newMatrix)
- return newMatrix;
- if (0 == b) {
- newMatrix = this.qp_bw(a.slice(0), h, c, -1, 0, f);
- if (!1 != newMatrix)
- return newMatrix;
- newMatrix = this.qp_bw(a.slice(0), h, c, 1, 0, f);
- if (!1 != newMatrix)
- return newMatrix
- }
- if (0 == d) {
- newMatrix = this.qp_bw(a.slice(0), h, c, 0, -1, f);
- if (!1 != newMatrix)
- return newMatrix;
- newMatrix = this.qp_bw(a.slice(0), h, c, 0, 1, f);
- if (!1 != newMatrix)
- return newMatrix
- }
- return !1
- };
- Qp_Q.prototype.qp_bx = function (a, e, c, b) {
- a[e] = -b;
- for (var d = this.qp_bv(), f = 0; 4 > f; f++) {
- var g = this.qp_bw(a.slice(0), e, c - 1, d[f][0], d[f][1], b);
- if (!1 != g)
- return g
- }
- return !1
- };
- Qp_Q.prototype.qp_by = function (a, e) {
- if (5 < e || 5 == e && 0 < c)
- return !1;
- var c = this.qp_bu(a);
- if (3 <= e && 0 == c)
- return a;
- if (3 > c)
- return !1;
- for (var b = 3; 0 < b--; ) {
- var d = Math.floor(Math.random() * c),
- d = this.qp_bt(a, d),
- f = 3 + Math.floor(8 * Math.random());
- f > c && (f = c);
- if (void 0 == a) {
- console.log("ahahahahahahahahahahhhhhhhhhhhhhhhh");
- break
- }
- d = this.qp_bx(a.slice(0), d, f, e + 1);
- if (!1 != d && (d = this.qp_by(d, e + 1), !1 != d))
- return d
- }
- return !1
- };
- Qp_Q.prototype.qp_br = function () {
- for (var a = [], e = 1E4; 0 < e-- && (a = [], this.qp_bs(a), a = this.qp_by(a, 0), !1 == a); );
- return a
- };
- var Qp_bz = function (a, e) {
- this.i = a;
- this.j = e
- }, Qp_bg = function (a, e) {
- this.x = a;
- this.y = e
- };
- function qp_bp(a) {
- var e = Math.floor(a / 5);
- return new Qp_bz(e, a - 5 * e)
- }
- function qp_be(a, e) {
- return 5 * a + e
- }
- function qp_bo(a) {
- return new Qp_bg(qp_E + (a.j + 0.5) * qp_G + qp_I, qp_F + (a.i + 0.5) * qp_G + qp_I)
- }
- function qp_bh(a) {
- 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)))
- }
- function qp_bA(a) {
- a = qp_bh(a);
- return qp_bo(a)
- }
- function qp_bl(a, e) {
- 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
- }
- function qp_bi(a, e) {
- if (void 0 != qp_i.colorlinearray[a] && null != qp_i.colorlinearray[a] && 0 != qp_i.colorlinearray[a].length) {
- var c = qp_i.colorlinearray[a][0];
- qp_i.drawmapmatrix[qp_be(c.i, c.j)].type = qp_n;
- c = qp_i.colorlinearray[a][qp_i.colorlinearray[a].length - 1];
- qp_i.drawmapmatrix[qp_be(c.i, c.j)].type = qp_n;
- for (c = 1; c < qp_i.colorlinearray[a].length - 1; c++) {
- var b = qp_i.colorlinearray[a][c];
- qp_i.drawmapmatrix[qp_be(b.i, b.j)] = qp_m
- }
- }
- qp_i.colorlinearray[a] = [];
- qp_bk(a);
- return qp_i.colorlinearray[a]
- }
- function qp_bk(a) {
- for (var e = 0; 25 > e; e++)
- 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);
- qp_i.colorlinearray[a] = []
- }
- function qp_bn() {
- for (var a = 0; 25 > a; a++)
- if (qp_i.drawmapmatrix[a].type == qp_n)
- return !1;
- return !0
- }
- function qp_bB(a) {
- for (var e = a.length; 0 < e; e--) {
- var c = Math.floor(Math.random() * (e - 1)),
- b = a[c];
- a[c] = a[e - 1];
- a[e - 1] = b
- }
- }
- function qp_bC(a) {
- for (var e = a.length, c = [], b = 0; b < e; b++)
- c.push(b);
- for (b = e; 0 < b; b--) {
- var d = Math.floor(Math.random() * (b - 1)),
- f = c[d];
- c[d] = c[b - 1];
- c[b - 1] = f
- }
- d = [];
- for (b = 0; b < e; b++)
- d.push(a[c[b]]);
- return d
- }
- function qp_bD(a, e) {
- for (var c = qp_bC(a), b = [], d = 0; d < Math.min(e, a.length); d++)
- b.push(c[d]);
- return b
- }
- function qp_Y() {
- qipaShare.title = "【喵喵瑜伽】,看你能塞进几只猫咪?";
- if (0 == qipaApp.score)
- qipaShare.desc = qipaShare.title;
- else {
- var a = parseInt(Math.sqrt(1E4 * qipaApp.score / 180));
- 99 < a && (a = "99.9");
- LBShare.updateData({ //修改分享文案
- desc: "【喵喵瑜伽】:我塞进去了" + qipaApp.score + "只猫咪,战胜了" + a + "%的玩家。不服来战!"
- });
- LBShare.statScore(qipaApp.score) //上报游戏结果
- }
- }
- var _cfg = {
- startFunc : qp_P,
- img : {
- path : "img/",
- manifest : [{
- src : "discription.png",
- id : "discription"
- }, {
- src : "banner.jpg",
- id : "banner"
- }, {
- src : "help.jpg",
- id : "help"
- }, {
- src : "bounus.png",
- id : "bounus"
- }, {
- src : "clock.png",
- id : "clock"
- }, {
- src : "score.png",
- id : "score"
- }, {
- src : "curscore.png",
- id : "curscore"
- }, {
- src : "bestscore.png",
- id : "bestscore"
- }, {
- src : "fcwmlogl.png",
- id : "fcwmlogl"
- }, {
- src : "lowkeysharebtn.png",
- id : "lowkeysharebtn"
- }, {
- src : "toplistbtn.png",
- id : "toplistbtn"
- }, {
- src : "replaybtn.png",
- id : "replaybtn"
- }, {
- src : "star1.png",
- id : "star1"
- }, {
- src : "star2.png",
- id : "star2"
- }, {
- src : "star3.png",
- id : "star3"
- }, {
- src : "go.png",
- id : "go"
- }, {
- src : "ready.png",
- id : "ready"
- }, {
- src : "bg.jpg",
- id : "bg"
- }, {
- src : "cat1_body.png",
- id : "cat1_body"
- }, {
- src : "cat1_conner.png",
- id : "cat1_conner"
- }, {
- src : "cat1_head.png",
- id : "cat1_head"
- }, {
- src : "cat1_tail.png",
- id : "cat1_tail"
- }, {
- src : "cat1_startpoint.png",
- id : "cat1_startpoint"
- }, {
- src : "cat2_body.png",
- id : "cat2_body"
- }, {
- src : "cat2_conner.png",
- id : "cat2_conner"
- }, {
- src : "cat2_head.png",
- id : "cat2_head"
- }, {
- src : "cat2_tail.png",
- id : "cat2_tail"
- }, {
- src : "cat2_startpoint.png",
- id : "cat2_startpoint"
- }, {
- src : "cat3_body.png",
- id : "cat3_body"
- }, {
- src : "cat3_conner.png",
- id : "cat3_conner"
- }, {
- src : "cat3_head.png",
- id : "cat3_head"
- }, {
- src : "cat3_tail.png",
- id : "cat3_tail"
- }, {
- src : "cat3_startpoint.png",
- id : "cat3_startpoint"
- }, {
- src : "cat4_body.png",
- id : "cat4_body"
- }, {
- src : "cat4_conner.png",
- id : "cat4_conner"
- }, {
- src : "cat4_head.png",
- id : "cat4_head"
- }, {
- src : "cat4_tail.png",
- id : "cat4_tail"
- }, {
- src : "cat4_startpoint.png",
- id : "cat4_startpoint"
- }, {
- src : "cat5_body.png",
- id : "cat5_body"
- }, {
- src : "cat5_conner.png",
- id : "cat5_conner"
- }, {
- src : "cat5_head.png",
- id : "cat5_head"
- }, {
- src : "cat5_tail.png",
- id : "cat5_tail"
- }, {
- src : "cat5_startpoint.png",
- id : "cat5_startpoint"
- }
- ]
- },
- audio : {
- path : "audio/",
- manifest : [{
- src : "link.mp3",
- id : "link"
- }, {
- src : "unlink.mp3",
- id : "unlink"
- }
- ]
- }
- };
- qipaStage.init(_cfg);
|