Frame 1
stop();
Frame 5
var currentLvl = 1;
var lvl1Code = new Array(1, 1, 1, 1, 1, 1, 1);
var lvl2Code = new Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
var lvl3Code = new Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
var lvl4Code = new Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
var lvl5Code = new Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
var lvlArray = new Array(lvl1Code, lvl2Code, lvl3Code, lvl4Code, lvl5Code);
Frame 6
function calcBallAngle() {
var _local1 = mcBall._x - mcPaddle._x;
var _local2 = (_local1 / (mcPaddle._width - mcBall._width)) - 0.5;
ballXSpeed = _local2 * 10;
ballYSpeed = ballYSpeed * -1;
}
function makeLvl() {
var _local6 = _root.lvlArray[currentLvl - 1].length;
var _local5 = 0;
var _local3 = 0;
while (_local3 < _local6) {
if (lvlArray[currentLvl - 1][_local3] == 1) {
_root.brickAmt++;
_root.attachMovie("mcBrick", "brick" + _local3, _root.getNextHighestDepth());
_root["brick" + _local3]._x = 15 + ((_local3 - (_local5 * 7)) * 75);
_root["brick" + _local3]._y = 10 + (_local5 * 20);
_root["brick" + _local3].onEnterFrame = function () {
if (this.hitTest(_root.mcBall)) {
this.removeMovieClip();
ballYSpeed = ballYSpeed * -1;
_root.brickAmt--;
_root.score = _root.score + 10;
}
if (_root.gameOver) {
this.removeMovieClip();
}
};
var _local4 = 1;
while (_local4 <= 10) {
if (_local3 == ((_local4 * 7) - 1)) {
_local5++;
}
_local4++;
}
}
_local3++;
}
}
stop();
var ballXSpeed = 10;
var ballYSpeed = 10;
var brickAmt = 0;
var lives = 3;
var gameOver = false;
var score = 0;
makeLvl();
mcBg.onRelease = function () {
mcBg._x = 800;
txtStart.text = "";
_root.onEnterFrame = function () {
mcPaddle._x = _xmouse - (mcPaddle._width * 0.5);
if (_xmouse < (mcPaddle._width / 2)) {
mcPaddle._x = 0;
}
if (_xmouse > (Stage.width - (mcPaddle._width / 2))) {
mcPaddle._x = Stage.width - mcPaddle._width;
}
mcBall._x = mcBall._x + ballXSpeed;
mcBall._y = mcBall._y + ballYSpeed;
if (mcBall._x >= (Stage.width - mcBall._width)) {
ballXSpeed = ballXSpeed * -1;
}
if (mcBall._x <= 0) {
ballXSpeed = ballXSpeed * -1;
}
if (mcBall._y >= (Stage.height - mcBall._height)) {
ballYSpeed = ballYSpeed * -1;
lives--;
if (lives <= 0) {
gameOver = true;
gotoAndStop ("lose");
_root.onEnterFrame = null;
}
}
if (mcBall._y <= 0) {
ballYSpeed = ballYSpeed * -1;
}
if (mcBall.hitTest(mcPaddle)) {
calcBallAngle();
}
if (brickAmt == 0) {
currentLvl++;
makeLvl();
mcBall._x = 175;
mcBall._y = 250;
mcBg._x = 0;
_root.onEnterFrame = null;
txtStart.text = "Click To Start";
}
txtStats.text = (((("Level: " + currentLvl) + "\t\tLives: ") + lives) + "\t\tScore: ") + score;
};
};
txtStart.text = "Click To Begin";
txtStats.text = (((("Level: " + currentLvl) + "\t\tLives: ") + lives) + "\t\tScore: ") + score;
Frame 14
mcBg._x = 0;
mcBg.onRelease = function () {
gotoAndPlay (1);
};
Frame 20
var lvlCurrent = 0;
var lvlArray0 = new Array(1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4);
var lvlArray1 = new Array(1, 3, 2, 4, 1, 3, 2, 4, 1, 3, 2, 4, 1, 3, 2, 4);
var lvlArray2 = new Array(4, 3, 2, 1, 4, 3, 2, 1, 4, 3, 2, 1, 4, 3, 2, 1);
var lvlArray3 = new Array(4, 2, 3, 1, 4, 2, 3, 1, 4, 2, 3, 1, 4, 2, 3, 1);
var lvlArray4 = new Array(2, 1, 4, 3, 2, 1, 4, 3, 2, 1, 4, 3, 2, 1, 4, 3);
var lvlNames = new Array("level1", "level2", "level3", "level4", "level5");
var lvlArrayAll = new Array(lvlArray0, lvlArray1, lvlArray2, lvlArray3, lvlArray4);
Frame 24
function removeButtons() {
i = 0;
while (i < lvlArrayAll.length) {
_root["sngButton" + i].removeMovieClip();
i++;
}
}
stop();
i = 0;
while (i < lvlArrayAll.length) {
attachMovie("btnSongSelect", "sngButton" + i, getNextHighestDepth());
this["sngButton" + i]._x = 130;
this["sngButton" + i]._y = 70 + (60 * i);
this["sngButton" + i].lvlID = i;
i++;
}
Frame 29
function beginCode() {
onEnterFrame = function () {
makeLvl();
};
lvlArrayAll[lvlCurrent].push(0, 0, 0, 0, 0);
}
function makeLvl() {
if (sTime < sTempo) {
sTime++;
} else {
sTime = 0;
if (lvlArrayAll[lvlCurrent][sArrow] != 0) {
if (lvlArrayAll[lvlCurrent][sArrow] == 1) {
attachMovie("arrowLeft", "arrow" + sArrow, getNextHighestDepth());
_root["arrow" + sArrow]._x = 135;
_root["arrow" + sArrow].arrowCode = 37;
} else if (lvlArrayAll[lvlCurrent][sArrow] == 2) {
attachMovie("arrowUp", "arrow" + sArrow, getNextHighestDepth());
_root["arrow" + sArrow]._x = 205;
_root["arrow" + sArrow].arrowCode = 38;
} else if (lvlArrayAll[lvlCurrent][sArrow] == 3) {
attachMovie("arrowDown", "arrow" + sArrow, getNextHighestDepth());
_root["arrow" + sArrow]._x = 275;
_root["arrow" + sArrow].arrowCode = 40;
} else if (lvlArrayAll[lvlCurrent][sArrow] == 4) {
attachMovie("arrowRight", "arrow" + sArrow, getNextHighestDepth());
_root["arrow" + sArrow]._x = 345;
_root["arrow" + sArrow].arrowCode = 39;
}
_root["arrow" + sArrow]._y = 500;
_root["arrow" + sArrow].gotHit = false;
_root["arrow" + sArrow].onEnterFrame = function () {
this._y = this._y - arrowSpeed;
if (this.hitTest(_root.mcReceptor) && (!this.gotHit)) {
if (Key.isDown(this.arrowCode)) {
if ((this._y <= (mcReceptor._y + 15)) && (this._y >= (mcReceptor._y + 5))) {
score = score + 10;
scoreString = "Perfect";
changeHealth(5);
} else if ((this._y <= (mcReceptor._y + 25)) && (this._y >= (mcReceptor._y - 5))) {
score = score + 8;
scoreString = "Great";
changeHealth(4);
} else if ((this._y <= (mcReceptor._y + 40)) && (this._y >= (mcReceptor._y - 30))) {
score = score + 6;
scoreString = "Nice";
changeHealth(3);
} else {
score = score + 4;
scoreString = "Good";
changeHealth(2);
}
combo++;
this._visible = false;
this.gotHit = true;
}
}
if (this._y <= -50) {
if (!this.gotHit) {
changeHealth(-10);
scoreString = "Bad";
combo = 0;
}
this.removeMovieClip();
}
};
}
if ((sArrow < lvlArrayAll[lvlCurrent].length) && (!gameIsOver)) {
sArrow++;
} else {
gotoAndStop ("win");
gameIsOver = true;
var _local3 = 0;
while (_local3 < sArrow) {
_root["arrow" + _local3].removeMovieClip();
_local3++;
}
onEnterFrame = null;
}
}
}
function changeHealth(healthDiff) {
if ((mcHealth._xscale + healthDiff) >= 100) {
mcHealth._xscale = 100;
} else if ((mcHealth._xscale + healthDiff) <= 0) {
gameIsOver = true;
var _local2 = 0;
while (_local2 < sArrow) {
_root["arrow" + _local2].removeMovieClip();
_local2++;
}
gotoAndStop ("lose2");
onEnterFrame = null;
} else {
mcHealth._xscale = mcHealth._xscale + healthDiff;
}
}
stop();
var sTime = 0;
var sTempo = 12;
var sArrow = 0;
var arrowSpeed = 10;
var gameIsOver = false;
var score = 0;
var scoreString = "";
var touchLeft = false;
var touchUp = false;
var touchDown = false;
var touchRight = false;
var combo = 0;
mcReceptor.onEnterFrame = function () {
touchLeft = false;
touchUp = false;
touchDown = false;
touchRight = false;
i = sArrow - 10;
while (i <= sArrow) {
if (this.hitTest(_root["arrow" + i]) && (_root["arrow" + i].arrowCode == 37)) {
touchLeft = true;
}
if (this.hitTest(_root["arrow" + i]) && (_root["arrow" + i].arrowCode == 38)) {
touchUp = true;
}
if (this.hitTest(_root["arrow" + i]) && (_root["arrow" + i].arrowCode == 40)) {
touchDown = true;
}
if (this.hitTest(_root["arrow" + i]) && (_root["arrow" + i].arrowCode == 39)) {
touchRight = true;
}
i++;
}
if (Key.isDown(37) && (!touchLeft)) {
changeHealth(-10);
scoreString = "Bad";
combo = 0;
}
if (Key.isDown(38) && (!touchUp)) {
changeHealth(-10);
scoreString = "Bad";
combo = 0;
}
if (Key.isDown(40) && (!touchDown)) {
changeHealth(-10);
scoreString = "Bad";
combo = 0;
}
if (Key.isDown(39) && (!touchRight)) {
changeHealth(-10);
scoreString = "Bad";
combo = 0;
}
};
beginCode();
Frame 34
txtStats.text = "Score: " + score;
btnBack.onRelease = function () {
gotoAndStop ("menu");
};
Frame 39
txtStats.text = "Score: " + score;
btnBack.onRelease = function () {
gotoAndStop ("menu");
};
Frame 45
gotoAndStop (46);
Frame 104
gotoAndPlay ("lvl1");
Frame 146
gotoAndPlay ("lvl2");
Frame 172
gotoAndPlay ("lvl3");
Frame 190
gotoAndPlay ("lvl4");
Frame 191
stop();
Symbol 14 MovieClip [btnSongSelect] Frame 1
var lvlID;
var lvlName = _root.lvlNames[lvlID];
stop();
onRollOver = function () {
nextFrame();
};
onRollOut = function () {
prevFrame();
};
onRelease = function () {
_root.lvlCurrent = lvlID;
_root.gotoAndStop("game");
_root.removeButtons();
};
Symbol 37 Button
on (release) {
gotoAndPlay ("brick");
}
Symbol 51 Button
on (release) {
gotoAndPlay ("RG");
}
Symbol 54 Button
on (release) {
stopAllSounds();
gotoAndStop ("start1");
}
Symbol 57 Button
on (release) {
stopAllSounds();
gotoAndStop ("main");
}
Symbol 95 Button
on (release) {
gotoAndPlay ("lvl1");
}
Symbol 96 Button
on (release) {
stopAllSounds();
gotoAndStop ("main");
}
Symbol 110 Button
on (keyPress "<Space>") {
gotoAndPlay ("lvl2");
}
Symbol 112 Button
on (keyPress "<Space>") {
gotoAndPlay ("lvl3");
}
Symbol 113 Button
on (keyPress "<Space>") {
gotoAndStop ("lvl3");
}
Symbol 114 Button
on (keyPress "<Space>") {
gotoAndPlay ("lvl4");
}
Symbol 115 Button
on (keyPress "<Space>") {
gotoAndStop ("lvl4");
}
Symbol 116 Button
on (keyPress "<Space>") {
gotoAndPlay ("winnn");
}
Symbol 117 Button
on (keyPress "<Space>") {
gotoAndStop ("win");
}
Symbol 121 Button
on (release) {
gotoAndStop ("start1");
}
Symbol 124 Button
on (release) {
stopAllSounds();
gotoAndStop ("main");
}