Combined Code
frame 1 {
fscommand('showmenu', false);
_root.best = 0;
_root.sunet = 1;
stop();
logo.onEnterFrame = function () {
if (_root.getBytesLoaded() == _root.getBytesTotal()) {
this.play();
} else {
tgFrame = Math.round((_root.getBytesLoaded() / _root.getBytesTotal()) * 100);
this.progress.gotoAndStop(tgFrame);
}
};
}
movieClip 10 {
frame 1 {
stop();
}
}
movieClip 12 {
}
movieClip 14 {
frame 63 {
stop();
}
frame 272 {
_root.gotoAndStop(2);
}
}
frame 2 {
_root.lifes = 3;
son1 = new Sound();
son1.attachSound('shot1');
son1.setVolume(50);
son2 = new Sound();
son2.attachSound('shot2');
if (_root.score > _root.best) {
_root.best = _root.score;
}
_root.score = 0;
i = 1;
while (i <= 150) {
removeMovieClip(_root['tile' + i]);
++i;
}
}
button 26 {
on (release) {
_root.gotoAndPlay('level');
}
}
movieClip 29 {
}
movieClip 31 {
}
movieClip 32 {
}
button 38 {
on (release) {
_root.gotoAndStop('menu');
}
}
button 42 {
on (release) {
if (_root.sunet == 0) {
_root.sunet = 1;
} else {
_root.sunet = 0;
}
}
}
button 44 {
on (release, keyPress 'p') {
if (_root.paused == 0) {
_root.paused = 1;
} else {
_root.paused = 0;
}
}
}
frame 4 {
_root.paused = 0;
ball.vx = 7;
ball.vy = 7;
a = new Array();
_root.piecesOn = 0;
_root.elim = 0;
i = 1;
while (i <= 13) {
a[i] = new Array();
++i;
}
this.generate = function () {
i = 1;
while (i <= 13) {
j = 1;
while (j <= 9) {
a[i][j] = 0;
++j;
}
++i;
}
i = 1;
while (i <= 13) {
j = 1;
while (j <= 9) {
ran = random(2);
if (ran == 1) {
a[i][j] = random(5) + 1;
}
++j;
}
++i;
}
k = 0;
i = 1;
while (i <= 13) {
j = 1;
while (j <= 9) {
++k;
if (a[i][j] != 0) {
++_root.piecesOn;
duplicateMovieClip(_root.tile, 'tile' + k, k);
_root['tile' + k]._y = i * 14 + 30;
_root['tile' + k]._x = j * 52 + 15;
_root['tile' + k].gotoAndStop(5 * a[i][j] - 3);
}
++j;
}
++i;
}
};
generate();
}
instance pad of movieClip 32 {
onClipEvent (enterFrame) {
this._x = _root._xmouse;
if (this.hittest(_root.ball)) {
if (_root.sunet == 1) {
_root.son2.start(0.1, 1);
}
_root.ball.vy = -Math.abs(_root.ball.vy);
}
if (this.targ1.hittest(_root.ball)) {
_root.ball.vx -= 5;
}
if (this.targ2.hittest(_root.ball)) {
_root.ball.vx += 5;
}
}
}
movieClip 48 {
}
movieClip 60 {
frame 1 {
stop();
}
frame 2 {
stop();
this.onEnterFrame = function () {
if (this.hittest(_root.ball)) {
if (_root.sunet == 1) {
_root.son1.start();
}
_root.pad._xscale = 100;
if (this._y > _root.ball._y) {
_root.ball.vy = -Math.abs(_root.ball.vy);
}
if (this._y <= _root.ball._y) {
_root.ball.vy = Math.abs(_root.ball.vy);
}
if (this._x - 15 > _root.ball._x) {
_root.ball.vx = -Math.abs(_root.ball.vx);
}
if (this._x + 15 <= _root.ball._x) {
_root.ball.vx = Math.abs(_root.ball.vx);
}
this.play();
}
};
}
frame 3 {
delete this.onEnterFrame;
}
frame 6 {
stop();
_root.score += 10;
++_root.elim;
if (_root.piecesOn <= _root.elim) {
_root.gotoAndPlay('level');
}
removeMovieClip(this);
}
frame 7 {
stop();
this.onEnterFrame = function () {
if (this.hittest(_root.ball)) {
if (_root.sunet == 1) {
_root.son1.start();
}
_root.pad._xscale = 140;
if (this._y > _root.ball._y) {
_root.ball.vy = -Math.abs(_root.ball.vy);
}
if (this._y <= _root.ball._y) {
_root.ball.vy = Math.abs(_root.ball.vy);
}
if (this._x - 15 > _root.ball._x) {
_root.ball.vx = -Math.abs(_root.ball.vx);
}
if (this._x + 15 <= _root.ball._x) {
_root.ball.vx = Math.abs(_root.ball.vx);
}
this.play();
}
};
}
frame 8 {
delete this.onEnterFrame;
}
frame 11 {
stop();
_root.score += 10;
++_root.elim;
if (_root.piecesOn <= _root.elim) {
_root.gotoAndPlay('level');
}
removeMovieClip(this);
}
frame 12 {
stop();
this.onEnterFrame = function () {
if (this.hittest(_root.ball)) {
if (_root.sunet == 1) {
_root.son1.start();
}
_root.pad._xscale = 40;
if (this._y > _root.ball._y) {
_root.ball.vy = -Math.abs(_root.ball.vy);
}
if (this._y <= _root.ball._y) {
_root.ball.vy = Math.abs(_root.ball.vy);
}
if (this._x - 15 > _root.ball._x) {
_root.ball.vx = -Math.abs(_root.ball.vx);
}
if (this._x + 15 <= _root.ball._x) {
_root.ball.vx = Math.abs(_root.ball.vx);
}
this.play();
}
};
}
frame 13 {
delete this.onEnterFrame;
}
frame 16 {
stop();
_root.score += 10;
++_root.elim;
if (_root.piecesOn <= _root.elim) {
_root.gotoAndPlay('level');
}
removeMovieClip(this);
}
frame 17 {
stop();
this.onEnterFrame = function () {
if (this.hittest(_root.ball)) {
if (_root.sunet == 1) {
_root.son1.start();
}
if (this._y > _root.ball._y) {
_root.ball.vy = -Math.abs(_root.ball.vy);
}
if (this._y <= _root.ball._y) {
_root.ball.vy = Math.abs(_root.ball.vy);
}
if (this._x - 15 > _root.ball._x) {
_root.ball.vx = -Math.abs(_root.ball.vx);
}
if (this._x + 15 <= _root.ball._x) {
_root.ball.vx = Math.abs(_root.ball.vx);
}
this.play();
}
};
}
frame 18 {
delete this.onEnterFrame;
}
frame 21 {
stop();
_root.score += 25;
++_root.elim;
if (_root.piecesOn <= _root.elim) {
_root.gotoAndPlay('level');
}
removeMovieClip(this);
}
frame 22 {
stop();
this.onEnterFrame = function () {
if (this.hittest(_root.ball)) {
if (_root.sunet == 1) {
_root.son1.start();
}
if (this._y > _root.ball._y) {
_root.ball.vy = -Math.abs(_root.ball.vy);
}
if (this._y <= _root.ball._y) {
_root.ball.vy = Math.abs(_root.ball.vy);
}
if (this._x - 15 > _root.ball._x) {
_root.ball.vx = -Math.abs(_root.ball.vx);
}
if (this._x + 15 <= _root.ball._x) {
_root.ball.vx = Math.abs(_root.ball.vx);
}
this.play();
}
};
}
frame 23 {
delete this.onEnterFrame;
}
frame 26 {
stop();
_root.score += 50;
++_root.elim;
if (_root.piecesOn <= _root.elim) {
_root.gotoAndPlay('level');
}
removeMovieClip(this);
}
}
frame 83 {
stop();
ball.vx = 7;
ball.vy = 7;
}
instance pad of movieClip 32 {
onClipEvent (enterFrame) {
if (_root.paused == 0) {
this._x = _root._xmouse;
if (this.hittest(_root.ball)) {
if (_root.sunet == 1) {
_root.son2.start(0.1, 1);
}
_root.ball.vy = -Math.abs(_root.ball.vy);
}
if (this.targ1.hittest(_root.ball)) {
_root.ball.vx -= 5;
}
if (this.targ2.hittest(_root.ball)) {
_root.ball.vx += 5;
}
}
}
}
instance ball of movieClip 48 {
onClipEvent (enterFrame) {
if (_root.paused == 0) {
_x = _x + vx;
_y = _y + vy;
if (this._x < 20) {
vx = Math.abs(vx);
if (_root.sunet == 1) {
_root.son1.start();
}
}
if (this._x > 530) {
if (_root.sunet == 1) {
_root.son1.start();
}
vx = -Math.abs(vx);
}
if (this._y < 20) {
if (_root.sunet == 1) {
_root.son1.start();
}
vy = Math.abs(vy);
}
if (this._y > 400) {
--_root.lifes;
if (_root.lifes < 0) {
_root.gOver.play();
} else {
if (_root.lifes == 2) {
_root.l3._visible = 0;
}
if (_root.lifes == 1) {
_root.l2._visible = 0;
}
if (_root.lifes == 0) {
_root.l1._visible = 0;
}
_root.gotoAndPlay('ball');
}
}
}
}
}
movieClip 65 {
frame 1 {
stop();
}
frame 75 {
_root.gotoAndStop('menu');
}
}