home *** CD-ROM | disk | FTP | other *** search
- stop();
- var bubble_timer = 2000;
- var last_timer = getTimer();
- var depth = 50000;
- var green_pool = new Array(10);
- var blue_pool = new Array(10);
- var lvl = 10;
- var nbB = 1;
- var vit = 6;
- var vitx = 0;
- var vity = 1;
- var green_char = "";
- var blue_char = "";
- var l = 100000;
- var lastGreen = green_pool.length;
- var lastBlue = blue_pool.length;
- var lastGreenT = _root.lastGreen;
- var lastBlueT = _root.lastBlue;
- var mort = false;
- var mort2 = false;
- var mortBlue = false;
- var mortGreen = false;
- var music = true;
- _root.createEmptyMovieClip("dummy1",50001);
- _root.createEmptyMovieClip("dummy2",50002);
- _root.createEmptyMovieClip("dummy3",50003);
- aqua1.swapDepths(dummy1);
- aqua2.swapDepths(dummy2);
- keyEvent = new Object();
- Key.addListener(keyEvent);
- keyEvent.onKeyDown = function()
- {
- if(Key.isDown(27))
- {
- if(_root.music)
- {
- stopAllSounds();
- _root.music = false;
- }
- else
- {
- _root.music = true;
- _root.musicz.play();
- }
- }
- if(green_char != "")
- {
- if(String.fromCharCode(Key.getAscii()).toUpperCase() == green_char)
- {
- green_char = "";
- j = 0;
- while(j < green_pool.length)
- {
- green_pool[j].onEnterFrame = function()
- {
- this._alpha -= Math.random() * 6;
- if(this._alpha < 50 && !this.lol)
- {
- var _loc3_ = _root.attachMovie("score_plus","s" + l++,l);
- _loc3_._x = this._x;
- _loc3_._y = this._y - 20;
- if(Math.round(Math.random() * 2) == 1)
- {
- var _loc4_ = new Sound(_root);
- _loc4_.attachSound("score");
- _loc4_.start(0,1);
- }
- this.lol = true;
- }
- if(this._alpha < 20)
- {
- score++;
- this.removeMovieClip();
- }
- };
- j++;
- }
- green_pool = new Array(green_pool.length);
- aqua2.lettre.gotoAndStop(1);
- }
- }
- if(blue_char != "")
- {
- if(String.fromCharCode(Key.getAscii()).toUpperCase() == blue_char)
- {
- blue_char = "";
- j = 0;
- while(j < blue_pool.length)
- {
- blue_pool[j].onEnterFrame = function()
- {
- this._alpha -= Math.random() * 6;
- if(this._alpha < 50 && !this.lol)
- {
- var _loc3_ = _root.attachMovie("score_plus","s" + l++,l);
- _loc3_._x = this._x;
- _loc3_._y = this._y - 20;
- if(Math.round(Math.random() * 2) == 1)
- {
- var _loc4_ = new Sound(_root);
- _loc4_.attachSound("score");
- _loc4_.start(0,1);
- }
- this.lol = true;
- }
- if(this._alpha < 20)
- {
- score++;
- this.onEnterFrame = null;
- this.removeMovieClip();
- }
- };
- j++;
- }
- blue_pool = new Array(blue_pool.length);
- aqua1.lettre.gotoAndStop(1);
- }
- }
- };
- _root.onEnterFrame = function()
- {
- var _loc9_ = getTimer();
- if(mort)
- {
- if(mort2)
- {
- section = "gameover";
- play();
- _root.onEnterFrame = null;
- }
- }
- else if(_loc9_ - last_timer > bubble_timer)
- {
- if(lvl-- == 0)
- {
- if(bubble_timer < 1400)
- {
- bubble_timer -= 80;
- }
- else
- {
- bubble_timer -= 100;
- }
- lvl = 10;
- }
- if(bubble_timer < 1600)
- {
- nbB = Math.round(Math.random() * 2);
- }
- if(bubble_timer < 1400)
- {
- nbB = Math.round(Math.random() * 2);
- }
- if(bubble_timer < 1000)
- {
- lvl = -1;
- }
- var _loc7_ = undefined;
- last_timer = _loc9_;
- _loc7_ = 0;
- while(_loc7_ < nbB)
- {
- var _loc4_ = Math.ceil(Math.random() * 2);
- var bubble_n = Math.ceil(Math.random() * 2);
- var bubble = _root.attachMovie("bubble_" + bubble_n,"bubble_" + depth,depth--);
- var _loc5_ = _root["bubble_exit_" + _loc4_];
- bubble._x = _loc5_._x;
- bubble._y = _loc5_._y;
- bubble.exit_n = _loc4_;
- bubble.bubble_n = bubble_n;
- bubble.yspeed = 1 * Math.random();
- if(Math.ceil(Math.random() * 2) == 1)
- {
- bubble.xspeed = -1 * Math.random() - vitx;
- }
- else
- {
- bubble.xspeed = 1 * Math.random() + vitx;
- }
- bubble.onPress = function()
- {
- if(!this.prisonnier)
- {
- this.bubble.gotoAndStop(1);
- this.down = true;
- }
- };
- bubble.onRelease = function()
- {
- this.down = false;
- this.bubble.play();
- };
- bubble.onReleaseOutside = function()
- {
- this.down = false;
- this.bubble.play();
- };
- bubble.onEnterFrame = function()
- {
- if(_root.mort)
- {
- if(!this.mort)
- {
- this.mort = true;
- if(_root.mortBlue && this.prisonnier && this.bubble_n == 1)
- {
- this.gotoAndPlay("mort");
- _root.last_timer = getTimer();
- }
- else if(_root.mortGreen && this.prisonnier && this.bubble_n == 2)
- {
- this.gotoAndPlay("mort");
- _root.last_timer = getTimer();
- }
- else if(this.prisonnier)
- {
- this.onEnterFrame = function()
- {
- this._alpha -= Math.random() * 6;
- if(this._alpha < 50 && !this.lol)
- {
- var _loc3_ = _root.attachMovie("score_plus","s" + l++,l);
- _loc3_._x = this._x;
- _loc3_._y = this._y - 20;
- if(Math.round(Math.random() * 2) == 1)
- {
- var _loc4_ = new Sound(_root);
- _loc4_.attachSound("score");
- _loc4_.start(0,1);
- }
- this.lol = true;
- }
- if(this._alpha < 20)
- {
- score++;
- this.onEnterFrame = null;
- this.removeMovieClip();
- }
- };
- }
- else
- {
- this.gotoAndPlay("mort");
- _root.last_timer = getTimer();
- }
- }
- }
- else
- {
- this.lastY = this._y;
- this.lastX = this._x;
- if(!this.down)
- {
- this._y += this.yspeed;
- this._x += this.xspeed;
- if(this.hitTest(_root.bubble_enter1_contourd) || this.hitTest(_root.bubble_enter2_contourd))
- {
- if(!this.prisonnier)
- {
- this.xspeed = 1 * Math.random() + vitx;
- this._x += vit;
- }
- else
- {
- this.xspeed = -1 * Math.random() - vitx;
- }
- }
- if(this.hitTest(_root.contour2))
- {
- this.xspeed = 1 * Math.random() + vitx;
- this._y = this.lastY;
- this._x = this.lastX + vit;
- }
- if(this.hitTest(_root.bubble_enter2_contourg) || this.hitTest(_root.bubble_enter1_contourg))
- {
- if(!this.prisonnier)
- {
- this.xspeed = -1 * Math.random() - vitx;
- this._x -= vit;
- }
- else
- {
- this.xspeed = 1 * Math.random() + vitx;
- }
- }
- if(this.hitTest(_root.contour4))
- {
- this.xspeed = -1 * Math.random() - vitx;
- this._y = this.lastY;
- this._x = this.lastX - vit;
- }
- if(this.hitTest(_root.bubble_enter1_contourb) || this.hitTest(_root.bubble_enter2_contourb))
- {
- if(!this.prisonnier)
- {
- this.yspeed = 1 * Math.random() + vity;
- }
- else
- {
- this.yspeed = -1 * Math.random() - vity;
- }
- }
- if(this.hitTest(contour3))
- {
- this.yspeed = 1 * Math.random();
- this._y = this.lastY + vit;
- this._x = this.lastX;
- }
- if(this.hitTest(_root.bubble_enter1_contourh) || this.hitTest(_root.bubble_enter2_contourh))
- {
- if(!this.prisonnier)
- {
- this.yspeed = -1 * Math.random() - vity;
- }
- else
- {
- this.yspeed = 1 * Math.random() + vity;
- }
- }
- if(this.hitTest(contour1))
- {
- this.yspeed = -1 * Math.random() - vity;
- this._y = this.lastY - vit;
- this._x = this.lastX;
- }
- }
- else
- {
- this._x = _root._xmouse;
- this._y = _root._ymouse;
- if(this.hitTest(_root.bubble_enter1_contourh) && blue_char != "" || this.hitTest(_root.bubble_enter2_contourh) && green_char != "")
- {
- this.down = false;
- this.bubble.play();
- this._y = this.lastY - vit;
- this._x = this.lastX;
- this.yspeed = -1 * Math.random() - vity;
- }
- else if(this.hitTest(_root.contour1) || this.hitTest(_root.contour3) || this.hitTest(_root.bubble_enter1_contourb) || this.hitTest(_root.bubble_enter2_contourb))
- {
- this.down = false;
- this.bubble.play();
- this._y = this.lastY - vit;
- this._x = this.lastX;
- }
- else if(this.hitTest(_root.contour2) || this.hitTest(_root.bubble_enter1_contourd))
- {
- this.down = false;
- this.bubble.gotoAndPlay("right");
- this._y = this.lastY - vit;
- this._x = this.lastX;
- }
- else if(this.hitTest(_root.contour4) || this.hitTest(_root.bubble_enter2_contourg))
- {
- this.down = false;
- this.bubble.gotoAndPlay("left");
- this._y = this.lastY - vit;
- this._x = this.lastX;
- }
- else
- {
- var _loc5_ = undefined;
- if(this.hitTest(_root.bubble_enter1))
- {
- if(this.bubble_n == 1)
- {
- var _loc4_ = new Sound(_root);
- _loc4_.attachSound("score");
- _loc4_.start(0,1);
- _root.lastBlue = _root.lastBlue - 1;
- _root.lastBlueT = _root.lastBlue;
- _root.aqua1.score.gotoAndPlay(2);
- this.down = false;
- this.prisonnier = true;
- this.bubble.play();
- this.gotoAndStop("normal");
- blue_pool[blue_score++] = this;
- if(blue_score == blue_pool.length)
- {
- blue_score = 0;
- _root.lastBlue = blue_pool.length;
- blue_char = String.fromCharCode(Math.round(Math.random() * 25) + 65);
- aqua1.lettre.play();
- aqua1.lettre.lettre.lettre.text = "PRESS \"" + blue_char + "\"";
- }
- }
- else
- {
- _root.mort = true;
- _root.mortBlue = true;
- }
- }
- if(this.hitTest(_root.bubble_enter2))
- {
- if(this.bubble_n == 2)
- {
- _loc4_ = new Sound(_root);
- _loc4_.attachSound("score");
- _loc4_.start(0,1);
- _root.lastGreen = _root.lastGreen - 1;
- _root.lastGreenT = _root.lastGreen;
- _root.aqua2.score.gotoAndPlay(2);
- this.down = false;
- this.prisonnier = true;
- this.bubble.play();
- this.gotoAndStop("normal");
- green_pool[green_score++] = this;
- if(green_score == green_pool.length)
- {
- green_score = 0;
- _root.lastGreen = green_pool.length;
- green_char = String.fromCharCode(Math.round(Math.random() * 25) + 65);
- aqua2.lettre.play();
- aqua2.lettre.lettre.lettre.text = "PRESS \"" + green_char + "\"";
- }
- }
- else
- {
- _root.mortGreen = true;
- _root.mort = true;
- }
- }
- }
- }
- }
- };
- _loc7_ = _loc7_ + 1;
- }
- }
- };
-