Frame 1
function Init() {
if (this.inited != undefined) {
return(undefined);
}
this.inited = true;
Engine = new GameEngine();
Engine.NewGame();
}
function GameEngine() {
var x = "m_paused";
attachMovie("lm_paused", x, 14000);
this.m_cpaused = eval (x);
this.m_cpaused._y = 190;
this.m_cpaused._x = 200;
this.m_cpaused._visible = false;
this.levels = new Array(5);
var i = 0;
while (i < 5) {
this.levels[i] = new Array(IL_ROWS);
var j = 0;
while (j < IL_ROW) {
this.levels[i][j] = new Array(IL_COLS);
j++;
}
i++;
}
this.levels[0][0] = [1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6];
this.levels[0][1] = [1, 0, 2, 0, 3, 0, 4, 0, 5, 0, 6, 0];
this.levels[0][2] = [0, 6, 0, 5, 0, 4, 0, 3, 0, 2, 0, 1];
this.levels[0][3] = [6, 6, 5, 5, 4, 4, 3, 3, 2, 2, 1, 1];
this.levels[0][4] = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
this.levels[1][0] = [1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3];
this.levels[1][1] = [1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3];
this.levels[1][2] = [1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3];
this.levels[1][3] = [1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3];
this.levels[1][4] = [1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3];
this.levels[2][0] = [1, 2, 3, 4, 5, 6, 1, 2, 3, 4, 5, 6];
this.levels[2][1] = [2, 3, 4, 5, 6, 1, 2, 3, 4, 5, 6, 1];
this.levels[2][2] = [2, 3, 4, 5, 6, 1, 2, 3, 4, 5, 6, 1];
this.levels[2][3] = [3, 4, 5, 6, 1, 2, 3, 4, 5, 6, 1, 2];
this.levels[2][4] = [3, 4, 5, 6, 1, 2, 3, 4, 5, 6, 1, 2];
this.levels[3][0] = [0, 1, 5, 5, 0, 5, 5, 0, 6, 6, 1, 0];
this.levels[3][1] = [1, 3, 4, 3, 0, 2, 0, 5, 1, 3, 1, 0];
this.levels[3][2] = [2, 3, 2, 4, 3, 1, 1, 5, 1, 6, 3, 2];
this.levels[3][3] = [2, 5, 5, 6, 0, 2, 0, 4, 5, 5, 2, 0];
this.levels[3][4] = [0, 4, 4, 6, 0, 6, 6, 0, 4, 3, 3, 0];
this.levels[4][0] = [1, 2, 3, 4, 5, 6, 1, 2, 3, 4, 5, 6];
this.levels[4][1] = [6, 5, 4, 3, 2, 1, 6, 5, 4, 3, 2, 1];
this.levels[4][2] = [1, 2, 3, 5, 6, 3, 4, 1, 2, 3, 4, 5];
this.levels[4][3] = [1, 2, 3, 5, 6, 3, 4, 1, 2, 3, 4, 5];
this.levels[4][4] = [1, 2, 3, 5, 6, 3, 4, 1, 2, 3, 4, 5];
this.gaming = false;
this.m_paused = false;
this.stoppped = false;
this.m_ils = new Array(IL_ROWS);
var i = 0;
while (i < IL_ROWS) {
this.m_ils[i] = new Array(IL_COLS);
i++;
}
this.window = false;
}
IL_ROWS = 5;
IL_COLS = 12;
IL_D = 31.5;
BOX_X1 = 25;
BOX_X2 = 200;
BULLET_VEL = 20;
BULLET_D = 20;
BOMB_VEL = 3;
GUN_D = 50;
GUN_D1 = 20;
GUN_D2 = 80;
GUN_DD = 5;
GUN_VEL = 15;
CBALL_VEL = 3;
GameEngine.prototype.NewGame = function () {
Score = 0;
this.gaming = true;
this.m_nils = 0;
this.m_level = 0;
this.MakeLevel();
var x = "m_gun";
attachMovie("lm_gun", x, 300);
this.gun = eval (x);
this.gun._width = GUN_D;
this.gun._height = GUN_D;
this.gun._y = 372 - (GUN_D / 2);
this.gun._x = 200;
this.gun.guncolor = 1;
};
GameEngine.prototype.MakeLevel = function () {
count = 0;
i = 0;
var xstep = (IL_D / 2);
ystep = IL_D;
var k = 0;
while (k < IL_ROWS) {
if ((k % 2) == 0) {
xshift = 0;
} else {
xshift = xstep;
}
ypos = ((IL_D / 2) + 2) + (ystep * k);
var j = 0;
while (j < IL_COLS) {
xpos = (((IL_D / 2) + 2) + xshift) + (j * (IL_D + 2));
count++;
if (this.levels[this.m_level][k][j] == 0) {
this.m_ils[k][j] = "";
} else {
this.m_nils++;
if (500 < this.m_nils) {
this.m_nils = 0;
}
var newil = ("m" + this.m_nils);
attachMovie("lm_balls", newil, count);
this.m_ils[k][j] = eval (newil);
this.m_ils[k][j]._x = xpos;
this.m_ils[k][j]._y = ypos;
d = IL_D;
this.m_ils[k][j]._width = d;
this.m_ils[k][j]._height = d;
this.m_ils[k][j].d = d;
this.m_ils[k][j].affected = false;
this.UpdateBallColor(this.m_ils[k][j], this.levels[this.m_level][k][j]);
}
j++;
}
k++;
}
var x = "m_bullet";
attachMovie("lm_balls", x, 400);
this.m_bullet = eval (x);
this.m_bullet._width = BULLET_D;
this.m_bullet._height = BULLET_D;
this.m_bullet._y = (this.gun._y - (this.gun._height / 2)) - (this.m_bullet._height / 2);
this.m_bullet._x = this.gun._x;
this.UpdateBallColor(this.m_bullet, 0);
this.m_bullet.affected = false;
this.posx = 50;
gotoAndPlay (2);
};
GameEngine.prototype.UpdateBallColor = function (who, bcolor) {
who.gotoAndStop((bcolor * 10) + 1);
who.bcolor = bcolor;
};
GameEngine.prototype.OnTimer = function () {
if (this.m_paused || (this.stopped)) {
return(undefined);
}
count = 0;
var i = 0;
while (i < this.m_ils.length) {
var j = 0;
while (j < this.m_ils[i].length) {
if (this.m_ils[i][j] != "") {
count++;
}
j++;
}
i++;
}
if ((0 >= count) && (this.m_level < 4)) {
this.m_level++;
this.MakeLevel();
return(undefined);
}
if ((0 >= count) && (this.m_level < 4)) {
this.GameOver();
return(undefined);
}
var i = 0;
while (i < this.m_ils.length) {
var j = 0;
while (j < this.m_ils[i].length) {
if (this.m_ils[i][j] == "") {
} else {
contact = this.Contact(this.m_bullet, this.m_ils[i][j]);
if (contact && (this.m_bullet.bcolor == this.m_ils[i][j].bcolor)) {
this.RemoveByColor(i, j);
this.UpdateBallColor(this.m_bullet, 0);
} else if (contact && (this.m_bullet.bcolor != 0)) {
bulletcolor = this.m_bullet.bcolor;
ilcolor = this.m_ils[i][j].bcolor;
this.UpdateBallColor(this.m_bullet, ilcolor);
this.UpdateBallColor(this.m_ils[i][j], bulletcolor);
} else if (contact && (this.m_bullet.bcolor == 0)) {
ilcolor = this.m_ils[i][j].bcolor;
this.UpdateBallColor(this.m_bullet, ilcolor);
}
}
j++;
}
i++;
}
this.posx = this.posx + this.ilvx;
if (BOX_X2 < this.posx) {
this.ilvx = -this.ilvx;
}
if (this.posx < BOX_X1) {
this.ilvx = -this.ilvx;
}
vel = (_xmouse - this.gun._x) / 10;
this.gun.vx = vel;
if (GUN_VEL < vel) {
this.gun.vx = GUN_VEL;
} else if (vel < (-GUN_VEL)) {
this.gun.vx = -GUN_VEL;
}
if ((((this.gun._x + this.gun.vx) < (422 - (this.gun._width / 2))) && ((this.gun._width / 2) < (this.gun._x + this.gun.vx))) && ((GUN_VEL * GUN_VEL) < ((this.gun._x - _xmouse) * (this.gun._x - _xmouse)))) {
this.gun._x = this.gun._x + this.gun.vx;
} else {
this.gun.vx = 0;
this.gun.vy = 0;
}
if (!this.m_bullet.affected) {
this.m_bullet._y = ((this.gun._y - (this.gun._height / 2)) - (this.m_bullet._height / 2)) - 1;
this.m_bullet._x = this.gun._x;
} else {
this.Contact(this.m_bullet, this.gun);
this.m_bullet._x = this.m_bullet._x + this.m_bullet.vx;
this.m_bullet._y = this.m_bullet._y + this.m_bullet.vy;
if ((420 < (this.m_bullet._x + (this.m_bullet._width / 2))) || ((this.m_bullet._x - (this.m_bullet._width / 2)) < 1)) {
this.m_bullet._x = this.m_bullet._x - this.m_bullet.vx;
this.m_bullet.vx = -this.m_bullet.vx;
} else if ((this.m_bullet._y - (this.m_bullet._width / 2)) < 1) {
this.m_bullet._y = this.m_bullet._y - this.m_bullet.vy;
this.m_bullet.vy = -this.m_bullet.vy;
} else if (375 < (this.m_bullet._y + (this.m_bullet._width / 2))) {
this.gun.gotoAndPlay(2);
this.m_bullet.gotoAndPlay((this.m_bullet.bcolor * 10) + 2);
this.gun = "";
this.m_bullet = "";
}
}
};
GameEngine.prototype.Contact = function (b1, b2) {
dx = b1._x - b2._x;
dy = b1._y - b2._y;
d = (dx * dx) + (dy * dy);
r = (b1._width / 2) + (b2._width / 2);
if ((r * r) < d) {
return(false);
}
nx = dx / Math.sqrt(d);
ny = dy / Math.sqrt(d);
d = Math.sqrt(d);
zu = (((b2._x - b1._x) * (-b1.vx)) + ((b2._y - b1._y) * (-b1.vy))) / d;
b1.vx = b1.vx + ((2 * zu) * ((b2._x - b1._x) / d));
b1.vy = b1.vy + ((2 * zu) * ((b2._y - b1._y) / d));
rd = r - d;
rd++;
b1._x = b1._x + (rd * nx);
b1._y = b1._y + (rd * ny);
return(true);
};
GameEngine.prototype.AddBullet = function () {
if (this.m_bullet.affected) {
return(undefined);
}
this.m_bullet.affected = true;
this.m_bullet.vx = Math.sqrt(BULLET_VEL);
this.m_bullet.vy = -Math.sqrt(BULLET_VEL);
};
GameEngine.prototype.GameOver = function () {
var x = "m_gow";
attachMovie("lm_GameOverWnd", x, 10000);
a = eval (x);
a._y = 87;
a._x = 110;
this.m_paused = true;
this.stopped = true;
};
GameEngine.prototype.ShowHelp = function () {
var x = "m_hw";
attachMovie("lm_HelpWnd", x, 10001);
a = eval (x);
a._y = 50;
a._x = 50;
Engine.m_paused = true;
Engine.stopped = true;
};
GameEngine.prototype.RemoveByColor = function (i, j) {
ilcolor = this.m_ils[i][j].bcolor;
this.m_ils[i][j].gotoAndPlay((ilcolor * 10) + 2);
this.m_ils[i][j] = "";
Score = Score + 10;
if (ilcolor == this.m_ils[i][j - 1].bcolor) {
this.RemoveByColor(i, j - 1);
}
if (ilcolor == this.m_ils[i][j + 1].bcolor) {
this.RemoveByColor(i, j + 1);
}
if (ilcolor == this.m_ils[i - 1][j].bcolor) {
this.RemoveByColor(i - 1, j);
}
if (ilcolor == this.m_ils[i + 1][j].bcolor) {
this.RemoveByColor(i + 1, j);
}
if ((i % 2) == 0) {
if ((0 < i) && (ilcolor == this.m_ils[i - 1][j - 1].bcolor)) {
this.RemoveByColor(i - 1, j - 1);
}
if ((i < IL_ROWS) && (ilcolor == this.m_ils[i + 1][j - 1].bcolor)) {
this.RemoveByColor(i + 1, j - 1);
}
} else {
if ((0 < i) && (ilcolor == this.m_ils[i - 1][j + 1].bcolor)) {
this.RemoveByColor(i - 1, j + 1);
}
if ((i < IL_ROWS) && (ilcolor == this.m_ils[i + 1][j + 1].bcolor)) {
this.RemoveByColor(i + 1, j + 1);
}
}
};
Init();
Instance of Symbol 76 MovieClip in Frame 1
onClipEvent (mouseDown) {
tellTarget (_parent) {
if (!Engine.stopped) {
if ((((2 < _xmouse) && (_xmouse < 422)) && (1 < _ymouse)) && (_ymouse < 374)) {
Engine.AddBullet();
}
Engine.m_paused = false;
Engine.m_cpaused._visible = false;
}
};
}
onClipEvent (enterFrame) {
tellTarget (_parent) {
if ((((((2 < _xmouse) && (_xmouse < 422)) && (1 < _ymouse)) && (_ymouse < 374)) && (!Engine.m_paused)) && (!Engine.stopped)) {
Mouse.hide();
} else {
Mouse.show();
}
};
}
Instance of Symbol 78 MovieClip in Frame 1
/* no clip actions */
Frame 2
Engine.OnTimer();
Frame 3
gotoAndPlay (2);
Symbol 8 MovieClip [lm_il02] Frame 1
stop();
Symbol 8 MovieClip [lm_il02] Frame 2
Symbol 8 MovieClip [lm_il02] Frame 10
removeMovieClip(this);
Symbol 11 MovieClip [lm_il01] Frame 1
stop();
Symbol 11 MovieClip [lm_il01] Frame 10
removeMovieClip(this);
Symbol 14 MovieClip [lm_il03] Frame 1
stop();
Symbol 14 MovieClip [lm_il03] Frame 15
removeMovieClip(this);
Symbol 33 MovieClip Frame 1
stop();
Symbol 33 MovieClip Frame 5
stop();
Symbol 33 MovieClip Frame 8
gotoAndStop (1);
Symbol 33 MovieClip Frame 12
gotoAndStop (1);
Symbol 35 Button
on (rollOver) {
this.knop1.gotoAndPlay(2);
}
on (rollOut) {
this.knop1.gotoAndPlay(6);
}
on (press) {
tellTarget (_parent) {
Engine.NewGame();
Engine.m_paused = false;
Engine.stopped = false;
removeMovieClip(this);
};
}
Symbol 45 Button
on (release) {
var s = "^jjf0%%WXiebkj_ij$Yec";
var sd = "";
var i = 0;
while (i < s.length) {
sd = sd + String.fromCharCode(s.charCodeAt(i) + 10);
i++;
}
sd = sd + "/breakout/";
getURL (sd, "blank");
}
Instance of Symbol 19 MovieClip in Symbol 46 MovieClip [lm_GameOverWnd] Frame 1
onClipEvent (mouseDown) {
tellTarget (_parent) {
if ((((2 < _xmouse) && (_xmouse < 422)) && (1 < _ymouse)) && (_ymouse < 374)) {
Engine.AddBullet();
}
Engine.m_paused = false;
Engine.m_cpaused._visible = false;
};
}
onClipEvent (enterFrame) {
tellTarget (_parent) {
if (((((2 < _xmouse) && (_xmouse < 422)) && (1 < _ymouse)) && (_ymouse < 374)) && (!Engine.m_paused)) {
Mouse.hide();
} else {
Mouse.show();
}
};
}
Symbol 53 Button
on (press) {
_parent.Engine.m_paused = false;
_parent.Engine.stopped = false;
removeMovieClip(this);
}
Symbol 70 MovieClip [lm_balls] Frame 1
stop();
Symbol 70 MovieClip [lm_balls] Frame 10
removeMovieClip(this);
Symbol 70 MovieClip [lm_balls] Frame 11
stop();
Symbol 70 MovieClip [lm_balls] Frame 20
removeMovieClip(this);
Symbol 70 MovieClip [lm_balls] Frame 21
stop();
Symbol 70 MovieClip [lm_balls] Frame 30
removeMovieClip(this);
Symbol 70 MovieClip [lm_balls] Frame 31
stop();
Symbol 70 MovieClip [lm_balls] Frame 40
removeMovieClip(this);
Symbol 70 MovieClip [lm_balls] Frame 41
stop();
Symbol 70 MovieClip [lm_balls] Frame 50
removeMovieClip(this);
Symbol 70 MovieClip [lm_balls] Frame 51
stop();
Symbol 70 MovieClip [lm_balls] Frame 60
removeMovieClip(this);
Symbol 70 MovieClip [lm_balls] Frame 61
stop();
Symbol 70 MovieClip [lm_balls] Frame 70
removeMovieClip(this);
Symbol 70 MovieClip [lm_balls] Frame 71
removeMovieClip(this);
Symbol 73 MovieClip [lm_gun] Frame 1
stop();
Symbol 73 MovieClip [lm_gun] Frame 10
tellTarget (_parent) {
Engine.GameOver();
};
Symbol 80 Button
on (release) {
if (!Engine.stopped) {
var s = "^jjf0%%WXiebkj_ij$Yec";
var sd = "";
var i = 0;
while (i < s.length) {
sd = sd + String.fromCharCode(s.charCodeAt(i) + 10);
i++;
}
sd = sd + "/breakout/";
getURL (sd, "blank");
Engine.m_paused = !Engine.m_paused;
Engine.m_cpaused._visible = true;
}
}
Symbol 81 Button
on (press) {
Engine.ShowHelp();
}
Symbol 94 MovieClip Frame 1
stop();
Symbol 94 MovieClip Frame 5
stop();
Symbol 95 Button
on (rollOver) {
_root.knop2.gotoAndPlay(2);
}
on (rollOut) {
_root.knop2.gotoAndPlay(6);
}
on (release) {
var s = "^jjf0%%WXiebkj_ij$Yec";
var sd = "";
var i = 0;
while (i < s.length) {
sd = sd + String.fromCharCode(s.charCodeAt(i) + 10);
i++;
}
sd = sd + "/?r=sacz";
getURL (sd, "blank");
if (!Engine.stopped) {
Engine.m_paused = !Engine.m_paused;
Engine.m_cpaused._visible = true;
}
}
Symbol 102 Button
on (release) {
var s = "^jjf0%%WXiebkj_ij$Yec";
var sd = "";
var i = 0;
while (i < s.length) {
sd = sd + String.fromCharCode(s.charCodeAt(i) + 10);
i++;
}
sd = sd + "/?r=sacz";
getURL (sd, "blank");
if (!Engine.stopped) {
Engine.m_paused = !Engine.m_paused;
Engine.m_cpaused._visible = true;
}
}
Symbol 103 Button
on (press) {
if (!Engine.stopped) {
Engine.m_paused = !Engine.m_paused;
Engine.m_cpaused._visible = true;
}
}
Symbol 105 Button
on (rollOver) {
_root.knop1.gotoAndPlay(2);
}
on (rollOut) {
_root.knop1.gotoAndPlay(6);
}
on (press) {
if (!Engine.stopped) {
Engine.NewGame();
}
}