home *** CD-ROM | disk | FTP | other *** search
- function left()
- {
- if(0 < manbx)
- {
- manb.gotoandplay("left");
- manbx -= 1;
- manb._x -= 35;
- }
- }
- function right()
- {
- if(manbx < 7)
- {
- manb.gotoandplay("right");
- manbx += 1;
- manb._x += 35;
- }
- }
- function up()
- {
- if(0 < manbnumber)
- {
- manb.gotoandplay("down");
- bscore = scoreb;
- tjs = 10;
- while(tjs >= 0)
- {
- if(b[manbx][tjs] != 0)
- {
- ttb = tjs + 1;
- atb = tjs + 1;
- break;
- }
- tjs--;
- }
- if(b[manbx][0] == 0)
- {
- ttb = 0;
- atb = 0;
- }
- i = 0;
- while(i < manbnumber)
- {
- if(manbcolor == 1)
- {
- duplicateMovieClip("reds","gb" add (ttb * 8 + manbx),16384 + chengb);
- setProperty("gb" add (ttb * 8 + manbx), _X, manbx * 35 + 362);
- setProperty("gb" add (ttb * 8 + manbx), _Y, ttb * 35 + 55);
- b[manbx][ttb] = 1;
- }
- else if(manbcolor == 2)
- {
- duplicateMovieClip("blues","gb" add (ttb * 8 + manbx),16384 + chengb);
- setProperty("gb" add (ttb * 8 + manbx), _X, manbx * 35 + 362);
- setProperty("gb" add (ttb * 8 + manbx), _Y, ttb * 35 + 55);
- b[manbx][ttb] = 2;
- }
- else if(manbcolor == 3)
- {
- duplicateMovieClip("greens","gb" add (ttb * 8 + manbx),16384 + chengb);
- setProperty("gb" add (ttb * 8 + manbx), _X, manbx * 35 + 362);
- setProperty("gb" add (ttb * 8 + manbx), _Y, ttb * 35 + 55);
- b[manbx][ttb] = 3;
- }
- else if(manbcolor == 4)
- {
- duplicateMovieClip("yellows","gb" add (ttb * 8 + manbx),16384 + chengb);
- setProperty("gb" add (ttb * 8 + manbx), _X, manbx * 35 + 362);
- setProperty("gb" add (ttb * 8 + manbx), _Y, ttb * 35 + 55);
- b[manbx][ttb] = 4;
- }
- ttb += 1;
- chengb += 1;
- if(ttb >= 10)
- {
- break;
- }
- i++;
- }
- bloon2 = manbnumber == 1 && b[manbx][ttb - 2] == manbcolor && b[manbx][ttb - 3] == manbcolor;
- if(manbnumber >= 3 || manbnumber == 2 && b[manbx][ttb - 3] == manbcolor || bloon2)
- {
- iib = 1;
- while(iib < 10)
- {
- if(b[manbx][ttb - iib] != manbcolor)
- {
- break;
- }
- this["gb" add ((ttb - iib) * 8 + manbx)].gotoAndPlay("over");
- scoreb += 10;
- b[manbx][ttb - iib] = 0;
- che = 1;
- while(8 >= che)
- {
- if(b[manbx - che][ttb - iib] != manbcolor)
- {
- break;
- }
- this["gb" add ((ttb - iib) * 8 + manbx - che)].gotoAndPlay("over");
- scoreb += 10;
- b[manbx - che][ttb - iib] = 0;
- si = 1;
- while(11 >= si && b[manbx - che][ttb - iib + si] != 0)
- {
- this["gb" add ((ttb - iib + si) * 8 + manbx - che)].gotoAndPlay("down");
- b[manbx - che][ttb - iib + si] = 0;
- si++;
- }
- che++;
- }
- che = 1;
- while(8 >= che)
- {
- if(b[manbx + che][ttb - iib] != manbcolor)
- {
- break;
- }
- this["gb" add ((ttb - iib) * 8 + manbx + che)].gotoAndPlay("over");
- scoreb += 10;
- b[manbx + che][ttb - iib] = 0;
- si = 1;
- while(11 >= si && b[manbx + che][ttb - iib + si] != 0)
- {
- this["gb" add ((ttb - iib + si) * 8 + manbx + che)].gotoAndPlay("down");
- b[manbx + che][ttb - iib + si] = 0;
- si++;
- }
- che++;
- }
- iib++;
- }
- }
- bscore = scoreb - bscore;
- if(100 * xb < scoreb && scoreb < xb * 100 + 100 && x[xb] != 1)
- {
- sss();
- char1.gotoandplay("ded");
- x[xb] = 1;
- xb += 1;
- }
- else if(bscore >= 60)
- {
- sss();
- char1.gotoandplay("cry");
- p2k.gotoandplay(2);
- char2.gotoandplay("happy");
- }
- manbnumber = 0;
- manbcolor = 0;
- }
- }
- function down()
- {
- js = 10;
- while(js >= 0)
- {
- if(b[manbx][js] == 1 || b[manbx][js] == 2 || b[manbx][js] == 3 || b[manbx][js] == 4)
- {
- kkb = js;
- break;
- }
- js--;
- }
- ssb = kkb * 8 + manbx;
- if((manbcolor == 0 || manbcolor == b[manbx][kkb]) && (b[manbx][kkb] == 1 || b[manbx][kkb] == 2 || b[manbx][kkb] == 3 || b[manbx][kkb] == 4))
- {
- manb.gotoandplay("down");
- this["gb" add ssb].gotoandplay("down");
- manbcolor = b[manbx][kkb];
- manbnumber += 1;
- b[manbx][kkb] = 0;
- aab = 1;
- while(aab < 12 && kkb - aab >= 0)
- {
- if(b[manbx][kkb - aab] != manbcolor)
- {
- break;
- }
- manbnumber += 1;
- ssb2 = (kkb - aab) * 8 + manbx;
- this["gb" add ssb2].gotoandplay("down");
- b[manbx][kkb - aab] = 0;
- aab++;
- }
- }
- }
- function pd()
- {
- icpu = 0;
- while(7 >= icpu)
- {
- cput = 10;
- while(cput >= 0)
- {
- if(b[icpu][cput] != 0)
- {
- break;
- }
- cput--;
- }
- if(b[icpu][cput] == 1)
- {
- red++;
- }
- else if(b[icpu][cput] == 2)
- {
- blue++;
- }
- else if(b[icpu][cput] == 3)
- {
- green++;
- }
- else if(b[icpu][cput] == 4)
- {
- yellow++;
- }
- icpu++;
- }
- if(red >= blue)
- {
- if(red >= green)
- {
- if(red >= yellow)
- {
- max = 1;
- }
- else
- {
- max = 4;
- }
- }
- else if(green >= yellow)
- {
- max = 3;
- }
- else
- {
- max = 4;
- }
- }
- else if(blue >= green)
- {
- if(blue >= yellow)
- {
- max = 2;
- }
- else
- {
- max = 4;
- }
- }
- else if(green >= yellow)
- {
- max = 3;
- }
- else
- {
- max = 4;
- }
- mcpu = 1;
- }
- function mpdd()
- {
- if(4 >= manbx)
- {
- i = 0;
- while(i < 8)
- {
- cput = 10;
- while(cput >= 0)
- {
- if(b[i][cput] != 0)
- {
- break;
- }
- cput--;
- }
- if(b[i][cput] == max)
- {
- break;
- }
- i++;
- }
- if(i >= 7 && b[i][cput] != max)
- {
- i = manbx;
- upmove = 1;
- }
- }
- else
- {
- i = 7;
- while(i >= 0)
- {
- cput = 10;
- while(cput >= 0)
- {
- if(b[i][cput] != 0)
- {
- break;
- }
- cput--;
- }
- if(b[i][cput] == max)
- {
- break;
- }
- i--;
- }
- if(0 >= i && b[i][cput] != max)
- {
- i = manbx;
- upmove = 1;
- }
- }
- move = i - manbx;
- mcpu = 2;
- }
- function mm()
- {
- if(move == 0)
- {
- if(upmove == 1)
- {
- up();
- pd();
- mcpu = 0;
- upmove = 0;
- }
- else
- {
- down();
- mcpu = 1;
- }
- }
- else if(0 < move)
- {
- move--;
- right();
- if(0 < manbnumber)
- {
- down();
- }
- }
- else if(move < 0)
- {
- move++;
- left();
- if(0 < manbnumber)
- {
- down();
- }
- }
- }
- rrr();
- ggg();
- rrrb();
- gggb();
- c = new Array();
- x = new Array();
- z = new Array();
-