Frame 1
stop();
Stage.showMenu = false;
Instance of Symbol 32 MovieClip "ProgressBar" in Frame 1
onClipEvent (enterFrame) {
totalData = _root.getBytesTotal();
loadedData = _root.getBytesLoaded();
percentageLoaded = Math.round((loadedData / totalData) * 100) + 1;
gotoAndStop(percentageLoaded);
_root.Percentage = percentageLoaded;
if (totalData == loadedData) {
_root.gotoAndStop("Credits");
}
}
Frame 2
stop();
Instance of Symbol 60 MovieClip "toggleSound" in Frame 3
onClipEvent (load) {
swapDepths(5250);
songNumber = 0;
isMuted = false;
gameSongs = new Sound();
gameSongs.attachSound("Song" + songNumber);
gameSongs.start();
gameSongs.onSoundComplete = function () {
songNumber++;
if (songNumber == 2) {
songNumber = 0;
}
gameSongs.attachSound("Song" + songNumber);
gameSongs.start();
};
_root.gotoAndStop("Menu");
}
on (release) {
allSounds = new Sound();
if (!isMuted) {
isMuted = true;
allSounds.setVolume(0);
gotoAndStop ("Muted");
} else {
isMuted = false;
allSounds.setVolume(100);
gotoAndStop ("Playing");
}
}
Frame 4
stop();
levelNames = ["THE LINE", "TRIPLE LINE", "HAMMER", "DICE", "MASTER SWORD", "VOLCANO", "FLOWER", "SNAKE", "PENCIL", "HOUSE", "CROSSHAIRS", "WATERMELON", "CHICKEN", "COLOR PALETTE", "DEFORMED MAN", "RAINBOW", "SAILBOAT", "COOKIE", "CAMP-FIRE", "VAN", "COMET", "HAPPY FACE", "COMPANION CUBE", "SPIRAL", "FIREWORK"];
saveData = SharedObject.getLocal("pixelistData");
hasPlayed = saveData.data.Played;
if (!hasPlayed) {
saveData.data.scrollPos = 40;
saveData.data.Played = true;
saveData.data.levelMax = 1;
saveData.data.goldMedals = 0;
saveData.data.levelData = [];
saveData.data.achievementData = [];
I = 0;
while (I < 25) {
saveData.data.levelData.push(0);
I++;
}
I = 0;
while (I < 7) {
saveData.data.achievementData.push(0);
I++;
}
saveData.data.scrollPos = 40;
} else {
_root.Scrollbar._x = saveData.data.scrollPos;
_root.Scrollbar.xDestination = _root.Scrollbar._x;
}
Instance of Symbol 68 MovieClip "Scrollbar" in Frame 4
onClipEvent (load) {
Grabbed = false;
xOffset = 0;
Progress = 0;
}
onClipEvent (mouseDown) {
if (hitTest(_root._xmouse, _root._ymouse, true)) {
Grabbed = true;
xOffset = _x - _root._xmouse;
}
}
onClipEvent (mouseUp) {
Grabbed = false;
}
onClipEvent (enterFrame) {
if (Grabbed) {
xDestination = _root._xmouse + xOffset;
if (xDestination < 40) {
xDestination = 40;
} else if (xDestination > 460) {
xDestination = 460;
}
}
xDifference = xDestination - _x;
xDifference = xDifference / 4;
_x = (_x + xDifference);
Progress = (xDestination - 40) / 420;
}
Instance of Symbol 70 MovieClip in Frame 4
onClipEvent (load) {
xOrigin = _x;
I = 0;
while (I < 25) {
newOption = attachMovie("levelOption", "levelOption" + I, I);
newOption._x = (I * newOption._width) + (I * 10);
newOption.Level = I + 1;
newOption.buttonLevel = I;
if (_root.hasPlayed) {
newOption.Medal.gotoAndStop(_root.saveData.data.levelData[I] + 1);
}
if (_root.saveData.data.levelMax > I) {
newOption.Locked._visible = false;
}
I++;
}
}
onClipEvent (enterFrame) {
percentPosition = _root.Scrollbar.Progress;
xDestination = ((-percentPosition) * 1760) + xOrigin;
xDifference = xDestination - _x;
xDifference = xDifference / 4;
_x = (_x + xDifference);
hitLevel = false;
I = 0;
while (I < 25) {
levelNow = this["levelOption" + I];
if (levelNow.hitTest(_root._xmouse, _root._ymouse, true)) {
if ((_root._xmouse >= 40) && (_root._xmouse <= 520)) {
if (!levelNow.Locked._visible) {
hitLevel = true;
_root.levelInformation._visible = true;
_root.levelInformation.levelName = _root.levelNames[I];
_root.levelInformation._x = _root._xmouse + 10;
_root.levelInformation._y = _root._ymouse - 10;
}
}
}
I++;
}
if (!hitLevel) {
_root.levelInformation._visible = false;
}
}
onClipEvent (mouseUp) {
I = 0;
while (I < 25) {
levelNow = this["levelOption" + I];
if ((levelNow.hitTest(_root._xmouse, _root._ymouse, true) && (_root.achievementsMenu.xDestination == _root.achievementsMenu.xStart)) && (_root.instructionsMenu.xDestination == _root.instructionsMenu.xStart)) {
if ((_root._xmouse >= 40) && (_root._xmouse <= 520)) {
_root.saveData.data.scrollPos = _root.Scrollbar._x;
if (!levelNow.Locked._visible) {
_root.Level = levelNow.buttonLevel;
K = 0;
while (K < 25) {
this["levelOption" + K].removeMovieClip();
K++;
}
_root.gotoAndStop("Game");
}
}
}
I++;
}
}
Instance of Symbol 72 MovieClip "Crosshair" in Frame 4
onClipEvent (load) {
swapDepths(10000);
}
onClipEvent (enterFrame) {
_x = _root._xmouse;
_y = _root._ymouse;
Mouse.hide();
}
Instance of Symbol 101 MovieClip "achievementsMenu" in Frame 4
onClipEvent (load) {
xSpeed = 0;
xStart = _x;
xDestination = xStart;
}
onClipEvent (enterFrame) {
xSpeed = xSpeed + ((xDestination - _x) * 0.1);
xSpeed = xSpeed * 0.7;
_x = (_x + xSpeed);
}
Instance of Symbol 123 MovieClip "instructionsMenu" in Frame 4
onClipEvent (load) {
xSpeed = 0;
xStart = _x;
xDestination = xStart;
}
onClipEvent (enterFrame) {
xSpeed = xSpeed + ((xDestination - _x) * 0.1);
xSpeed = xSpeed * 0.7;
_x = (_x + xSpeed);
}
Frame 5
function Start() {
saveData = SharedObject.getLocal("pixelistData");
endLevel();
blockNum = 0;
blockArray = [];
blockInterval = 1550 - (15 * Level);
blockDelay = 0;
blockSpeed = 5;
deadNum = 0;
deadArray = [];
playerMaxHealth = 30;
playerHealth = playerMaxHealth;
playerDamage = 10;
Health.gotoAndStop(100);
rowNow = 2;
columnNow = 0;
smallBlockNum = 0;
smallBlockCounter = getTimer();
smallBlockDelay = 50;
smallBlockArray = [];
O = [150, -50, -200];
W = [200, 200, 200];
Y = [190, 150, -150];
G = [-80, 160, -150];
GR = [-150, -150, -150];
LG = [-50, -50, -50];
BL = [-100, 30, 130];
BR = [-50, -70, -120];
R = [200, -140, -150];
P = [150, -30, 0];
N = 0;
nextDelay = 0;
cursorFriction = 0.4;
Paused = false;
stageLeft = 20;
stageRight = 340;
stageTop = 20;
stageBottom = 340;
levelHits = 0;
Level1 = ["THE LINE", [50, 30], [GR, W, BL]];
Level2 = ["TRIPLE LINE", [50, 10], [G, G, G], [R, R, R], [W, W, W]];
Level3 = ["HAMMER", [30, -10], [N, GR, GR, GR, N], [N, GR, GR, GR, N], [N, N, BR, N, N], [N, N, BR, N, N], [N, N, BR, N, N]];
Level4 = ["DICE", [30, -10], [W, W, W, W, W], [W, GR, W, W, W], [W, W, W, W, W], [W, W, W, GR, W], [W, W, W, W, W]];
Level5 = ["MASTER SWORD", [30, -30], [N, N, BL, N, N], [N, BL, BL, BL, N], [N, N, W, N, N], [N, N, W, N, N], [N, N, W, N, N], [N, GR, GR, GR, N], [GR, GR, GR, GR, GR]];
Level6 = ["VOLCANO", [10, -20], [N, N, O, N, O, N, N], [N, Y, N, R, N, Y, N], [N, N, N, W, N, N, N], [N, N, W, W, W, N, N], [N, GR, GR, GR, GR, GR, N], [GR, GR, GR, GR, GR, GR, GR]];
Level7 = ["FLOWER", [30, -20], [N, R, R, R, N], [N, R, Y, R, N], [N, R, R, R, N], [N, N, G, N, N], [N, G, G, G, N], [N, N, G, N, N]];
Level8 = ["SNAKE", [10, -30], [N, GR, G, G, G, N, R], [N, G, G, R, R, R, N], [N, G, G, G, G, N, R], [N, N, G, N, N, N, N], [G, N, G, N, N, N, N], [G, N, G, G, G, N, N], [N, G, G, G, G, G, N]];
Level9 = ["PENCIL", [50, -40], [P, P, P], [W, W, W], [Y, Y, Y], [Y, Y, Y], [Y, Y, Y], [BR, BR, BR], [N, BR, N], [N, GR, N]];
Level10 = ["HOUSE", [20, -20], [N, N, R, R, N, N], [N, R, R, R, R, N], [R, R, R, R, R, R], [N, W, W, W, W, N], [N, W, BR, W, W, N], [N, W, BR, W, W, N]];
Level11 = ["CROSSHAIRS", [10, -30], [N, N, GR, GR, GR, N, N], [N, GR, W, R, W, GR, N], [GR, W, W, R, W, W, GR], [GR, R, R, R, R, R, GR], [GR, W, W, R, W, W, GR], [N, GR, W, R, W, GR, N], [N, N, GR, GR, GR, N, N]];
Level12 = ["WATERMELON", [10, -20], [N, N, N, R, N, N, N], [N, N, R, R, GR, N, N], [G, GR, R, R, R, R, G], [G, R, R, GR, R, R, G], [N, G, R, R, R, G, N], [N, N, G, G, G, N, N]];
Level13 = ["CHICKEN", [20, -30], [N, N, N, R, R, N], [N, N, N, W, GR, N], [N, W, N, W, W, Y], [W, W, W, W, W, N], [N, W, LG, LG, W, N], [N, N, W, W, N, N], [N, N, O, O, N, N]];
Level14 = ["COLOR PALETTE", [30, -30], [N, BR, BR, BR, N], [BR, BR, R, Y, BR], [BR, BR, BR, G, BR], [BR, BR, BR, BL, BR], [BR, W, BR, BR, BR], [BR, BR, BR, BR, N], [N, BR, BR, N, N]];
Level15 = ["DEFORMED MAN", [30, -20], [N, N, Y, N, N], [Y, R, R, R, Y], [N, N, R, N, N], [N, N, R, N, N], [N, BL, N, BL, N], [GR, BL, N, BL, GR]];
Level16 = ["RAINBOW", [10, -10], [N, R, R, R, R, R, N], [R, G, G, G, G, G, R], [R, G, BL, BL, BL, G, R], [R, G, BL, N, BL, G, R], [R, G, BL, N, BL, G, R]];
Level17 = ["SAILBOAT", [10, -30], [N, N, N, N, W, N, N], [N, N, W, BR, W, W, N], [N, W, W, BR, W, W, N], [W, W, W, BR, W, W, W], [BR, BR, BR, BR, BR, BR, BR], [N, BR, BR, BR, BR, BR, N], [BL, BL, BL, BL, BL, BL, BL]];
Level18 = ["COOKIE", [10, -30], [N, BR, BR, BR, BR, BR, N], [BR, BR, BR, GR, BR, BR, BR], [BR, GR, BR, BR, BR, BR, BR], [BR, BR, BR, BR, BR, GR, BR], [BR, BR, GR, BR, BR, BR, BR], [BR, BR, BR, BR, GR, BR, BR], [N, BR, BR, BR, BR, BR, N]];
Level19 = ["CAMP-FIRE", [30, -40], [N, N, R, N, N], [N, R, R, R, N], [R, R, Y, R, R], [R, Y, Y, Y, R], [R, Y, Y, Y, R], [N, R, Y, R, N], [N, N, BR, N, N], [BR, BR, N, BR, BR]];
Level20 = ["VAN", [10, -20], [N, G, G, G, G, G, N], [G, W, W, G, W, W, G], [G, G, G, G, G, G, G], [G, GR, G, G, G, GR, G], [GR, W, GR, G, GR, W, GR], [N, GR, N, N, N, GR, N]];
Level21 = ["COMET", [20, -20], [R, Y, N, N, N, N], [N, R, O, N, N, N], [N, Y, R, Y, N, N], [N, N, O, R, Y, N], [N, N, Y, O, GR, GR], [N, N, N, Y, GR, GR]];
Level22 = ["HAPPY FACE", [20, -20], [Y, Y, Y, Y, Y, Y], [Y, BL, Y, Y, BL, Y], [Y, Y, Y, Y, Y, Y], [Y, R, Y, Y, R, Y], [Y, R, R, R, R, Y], [Y, Y, Y, Y, Y, Y]];
Level23 = ["COMPANION CUBE", [10, -30], [W, W, LG, LG, LG, W, W], [W, LG, LG, W, LG, LG, W], [LG, LG, W, W, W, LG, LG], [LG, W, P, W, P, W, LG], [LG, LG, W, P, W, LG, LG], [W, LG, LG, W, LG, LG, W], [W, W, LG, LG, LG, W, W]];
Level24 = ["SPIRAL", [20, -20], [Y, Y, G, G, BL, BL], [N, N, N, N, N, P], [P, P, R, R, N, P], [BL, N, N, GR, N, R], [BL, N, N, N, N, R], [G, G, Y, Y, O, O]];
Level25 = ["FIREWORK", [10, -30], [R, N, N, Y, N, BL, R], [BL, R, O, Y, BL, R, N], [N, BL, R, BL, R, O, N], [Y, Y, BL, R, BL, Y, Y], [N, O, R, BL, R, BL, N], [N, R, BL, Y, O, R, BL], [R, BL, N, Y, N, N, R]];
levelArray = [Level1, Level2, Level3, Level4, Level5, Level6, Level7, Level8, Level9, Level10, Level11, Level12, Level13, Level14, Level15, Level16, Level17, Level18, Level19, Level20, Level21, Level22, Level23, Level24, Level25];
levelColoursArray = [];
columnsNum = levelArray[Level][2].length;
rowsNum = levelArray[Level].length;
escDown = false;
parseColours();
startButton._visible = true;
gameStart = false;
lastColour = 0;
drawLevel();
}
function Run() {
crosshairMove();
scaleLevelDisplay();
levelTextDisplay();
pauseGame();
if (!Paused) {
prepareColour();
cursorMove();
showHealth();
if (gameStart) {
displayNext();
blockCreate();
blockMove();
blockRemove();
blockDead();
}
}
}
function Click() {
if (gameStart && (!Paused)) {
repeatBlock();
}
}
function pauseGame() {
if (Key.isDown(27)) {
if (!escDown) {
escDown = true;
if (!Paused) {
nextDelay = blockDelay - getTimer();
Paused = true;
I = 0;
while (I < blockArray.length) {
blockArray[I]._visible = false;
I++;
}
pauseScreen.xDestination = 280;
} else {
Paused = false;
blockDelay = getTimer() + nextDelay;
I = 0;
while (I < blockArray.length) {
blockArray[I]._visible = true;
I++;
}
pauseScreen.xDestination = pauseScreen.xStart;
}
}
} else {
escDown = false;
}
}
function parseColours() {
I = 2;
while (I < rowsNum) {
K = 0;
while (K < columnsNum) {
currentColour = levelArray[Level][I][K];
if (currentColour != N) {
canAdd = true;
J = 0;
while (J < levelColoursArray.length) {
if (currentColour == levelColoursArray[J]) {
canAdd = false;
break;
}
J++;
}
if (canAdd) {
levelColoursArray.push(currentColour);
}
}
K++;
}
I++;
}
}
function prepareColour() {
while (levelArray[Level][rowNow][columnNow] == N) {
columnNow++;
if (columnNow == columnsNum) {
columnNow = 0;
rowNow++;
if (rowNow == rowsNum) {
winLevel();
}
}
}
}
function crosshairMove() {
Crosshair._x = _xmouse;
Crosshair._y = _ymouse;
}
function cursorMove() {
xDifference = _xmouse - Cursor._x;
yDifference = _ymouse - Cursor._y;
xDifference = xDifference * cursorFriction;
yDifference = yDifference * cursorFriction;
Cursor._x = Cursor._x + xDifference;
Cursor._y = Cursor._y + yDifference;
cursorTop = Cursor._y - (Cursor._height / 2);
cursorBottom = Cursor._y + (Cursor._height / 2);
cursorRight = Cursor._x + (Cursor._width / 2);
cursorLeft = Cursor._x - (Cursor._width / 2);
if (cursorRight > stageRight) {
Cursor._x = stageRight - (Cursor._width / 2);
} else if (cursorLeft < stageLeft) {
Cursor._x = stageLeft + (Cursor._width / 2);
}
if (cursorBottom > stageBottom) {
Cursor._y = stageBottom - (Cursor._height / 2);
} else if (cursorTop < stageTop) {
Cursor._y = stageTop + (Cursor._height / 2);
}
}
function levelTextDisplay() {
levelText.Level = "LEVEL " + (Level + 1);
levelText.Name = levelArray[Level][0];
destinationAlpha = 100 - (85 * gameStart);
differenceAlpha = Math.round((destinationAlpha - levelText._alpha) / 10);
levelText._alpha = levelText._alpha + differenceAlpha;
}
function drawLevel() {
I = 2;
while (I < rowsNum) {
K = 0;
while (K < columnsNum) {
currentColour = levelArray[Level][I][K];
if (currentColour == N) {
} else {
newSmallBlock = attachMovie("smallBlock", ("smallBlock" + K) + I, smallBlockNum + 5000);
newSmallBlock._x = ((Display._x + levelArray[Level][1][0]) + (K * 20)) + 20;
newSmallBlock._y = ((Display._y + levelArray[Level][1][1]) + (I * 20)) + 20;
newSmallBlock._alpha = 0;
newSmallBlock._xscale = 10;
newSmallBlock._yscale = 10;
newSmallBlock.destAlpha = 40;
newSmallBlock.destScale = 100;
newSmallBlock.scaleSpeed = 0;
newSmallBlock.Display = false;
smallBlockColour = new Color(newSmallBlock);
myTransform = new Object();
myTransform.rb = currentColour[0];
myTransform.gb = currentColour[1];
myTransform.bb = currentColour[2];
smallBlockColour.setTransform(myTransform);
smallBlockNum++;
smallBlockArray.push(newSmallBlock);
}
K++;
}
I++;
}
}
function scaleLevelDisplay() {
I = 0;
while (I < smallBlockArray.length) {
currentSmallBlock = smallBlockArray[I];
delayDifference = getTimer() - smallBlockCounter;
delayDifference = delayDifference / smallBlockDelay;
if (delayDifference > I) {
currentSmallBlock.scaleSpeed = currentSmallBlock.scaleSpeed + ((currentSmallBlock.destScale - currentSmallBlock._xscale) * 0.1);
currentSmallBlock.scaleSpeed = currentSmallBlock.scaleSpeed * 0.8;
currentSmallBlock._xscale = currentSmallBlock._xscale + currentSmallBlock.scaleSpeed;
currentSmallBlock._yscale = currentSmallBlock._yscale + currentSmallBlock.scaleSpeed;
alphaDifference = currentSmallBlock.destAlpha - currentSmallBlock._alpha;
alphaDifference = alphaDifference / 10;
currentSmallBlock._alpha = currentSmallBlock._alpha + alphaDifference;
}
I++;
}
}
function blockCreate() {
if (getTimer() > blockDelay) {
I = 0;
while (I < 4) {
newBlock = attachMovie("Block", "Block" + blockNum, blockNum);
switch (I) {
case 0 :
newBlock._x = -20;
newBlock._y = (Math.floor(Math.random() * 8) * 40) + 20;
newBlock.xSpeed = 1;
newBlock.ySpeed = 0;
break;
case 1 :
newBlock._x = 350;
newBlock._y = (Math.floor(Math.random() * 8) * 40) + 20;
newBlock.xSpeed = -1;
newBlock.ySpeed = 0;
break;
case 2 :
newBlock._x = (Math.floor(Math.random() * 8) * 40) + 20;
newBlock._y = -20;
newBlock.xSpeed = 0;
newBlock.ySpeed = 1;
break;
case 3 :
newBlock._x = (Math.floor(Math.random() * 8) * 40) + 20;
newBlock._y = 350;
newBlock.xSpeed = 0;
newBlock.ySpeed = -1;
}
newColour = levelColoursArray[Math.floor(Math.random() * levelColoursArray.length)];
newBlockColour = new Color(newBlock);
myTransform = new Object();
myTransform.rb = newColour[0];
myTransform.gb = newColour[1];
myTransform.bb = newColour[2];
newBlockColour.setTransform(myTransform);
newBlock.Colour = newColour;
blockNum++;
blockArray.push(newBlock);
blockDelay = getTimer() + blockInterval;
I++;
}
}
}
function blockMove() {
I = 0;
while (I < blockArray.length) {
currentBlock = blockArray[I];
currentBlock._x = currentBlock._x + (blockSpeed * currentBlock.xSpeed);
currentBlock._y = currentBlock._y + (blockSpeed * currentBlock.ySpeed);
if (currentBlock.hitTest(Cursor)) {
colourHit = currentBlock.Colour;
nextColour = levelArray[Level][rowNow][columnNow];
blockArray.splice(I, 1);
if (colourHit == nextColour) {
currentBlock.xDestination = _root[("smallBlock" + columnNow) + rowNow]._x - 10;
currentBlock.yDestination = _root[("smallBlock" + columnNow) + rowNow]._y - 10;
currentBlock.swapDepths(deadNum + 15000);
deadNum++;
deadArray.push(currentBlock);
collectSound = new Sound();
collectSound.attachSound("Collect");
collectSound.start();
if (playerHealth < playerMaxHealth) {
playerHealth = playerHealth + (playerMaxHealth / 5);
if (playerHealth > playerMaxHealth) {
playerHealth = playerMaxHealth;
}
}
lastColour = colourHit;
_root[("smallBlock" + columnNow) + rowNow].destAlpha = 100;
columnNow++;
if (columnNow == columnsNum) {
rowNow++;
columnNow = 0;
if (rowNow == rowsNum) {
winLevel();
}
}
} else {
wrongSound = new Sound();
wrongSound.attachSound("Wrong");
wrongSound.start();
currentBlock.removeMovieClip();
playerHealth = playerHealth - playerDamage;
levelHits++;
if (playerHealth <= 0) {
loseLevel();
}
}
}
I++;
}
}
function blockRemove() {
I = 0;
while (I < blockArray.length) {
currentBlock = blockArray[I];
blockLeft = currentBlock._x;
blockRight = currentBlock._x + currentBlock._width;
blockTop = currentBlock._y;
blockBottom = currentBlock._y + currentBlock._height;
if (((((blockLeft > stageRight) && (currentBlock.xSpeed == 1)) || ((blockRight < stageLeft) && (currentBlock.xSpeed == -1))) || ((blockTop > stageBottom) && (currentBlock.ySpeed == 1))) || ((blockBottom < stageTop) && (currentBlock.ySpeed == -1))) {
currentBlock.removeMovieClip();
blockArray.splice(I, 1);
}
I++;
}
}
function repeatBlock() {
if (lastColour != 0) {
nextColour = levelArray[Level][rowNow][columnNow];
if (lastColour == nextColour) {
repeatSound = new Sound();
repeatSound.attachSound("Repeat");
repeatSound.start();
if (playerHealth < playerMaxHealth) {
playerHealth = playerHealth + (playerMaxHealth / 10);
if (playerHealth > playerMaxHealth) {
playerHealth = playerMaxHealth;
}
}
_root[("smallBlock" + columnNow) + rowNow].destAlpha = 100;
columnNow++;
if (columnNow == columnsNum) {
rowNow++;
columnNow = 0;
if (rowNow == rowsNum) {
winLevel();
}
}
} else {
wrongSound = new Sound();
wrongSound.attachSound("Wrong");
wrongSound.start();
playerHealth = playerHealth - (playerDamage / 2);
levelHits++;
if (playerHealth <= 0) {
loseLevel();
}
}
}
}
function endLevel() {
I = 0;
while (I < blockArray.length) {
blockArray[I].removeMovieClip();
I++;
}
I = 0;
while (I < smallBlockArray.length) {
smallBlockArray[I].removeMovieClip();
I++;
}
I = 0;
while (I < deadArray.length) {
deadArray[I].removeMovieClip();
I++;
}
deadArray = [];
smallBlockArray = [];
blockArray = [];
gameStart = false;
}
function showHealth() {
currentHealth = playerHealth;
if (playerHealth < 0) {
currentHealth = 0;
}
healthPercentage = Math.round((currentHealth / playerMaxHealth) * 100);
frameDifference = ((healthPercentage + 1) - Health._currentframe) / 5;
if (frameDifference != 0) {
if ((frameDifference < 1) && (frameDifference > 0)) {
frameDifference = 1;
} else if ((frameDifference > -1) && (frameDifference < 0)) {
frameDifference = -1;
}
}
newFrame = Math.round(Health._currentframe + frameDifference);
Health.gotoAndStop(newFrame);
}
function loseLevel() {
endLevel();
Loss.yDestination = 185;
}
function winLevel() {
endLevel();
gotGold = false;
if (levelHits <= 2) {
Victory.Medal.gotoAndStop("Gold");
if (saveData.data.levelData[Level] < 3) {
saveData.data.levelData[Level] = 3;
saveData.data.goldMedals++;
gotGold = true;
}
} else if (levelHits <= 4) {
Victory.Medal.gotoAndStop("Silver");
if (saveData.data.levelData[Level] < 2) {
saveData.data.levelData[Level] = 2;
}
} else {
Victory.Medal.gotoAndStop("Bronze");
if (saveData.data.levelData[Level] < 1) {
saveData.data.levelData[Level] = 1;
}
}
if (Level < 24) {
Victory.yDestination = 185;
} else {
BeatGame.xDestination = 280;
}
if ((saveData.data.levelMax == (Level + 1)) && (saveData.data.levelMax != 25)) {
saveData.data.levelMax++;
}
Achievement1 = ["Across the Finish Line", "Finish all 25 levels."];
Achievement2 = ["Rookie", "Earn gold on 5 levels."];
Achievement3 = ["Novice", "Earn gold on 10 levels."];
Achievement4 = ["Pixel Enthusiast", "Earn gold on 15 levels."];
Achievement5 = ["Dedicated Pixelist", "Earn gold on 20 levels."];
Achievement6 = ["Pixel Precision", "Earn gold on all levels."];
Achievement7 = ["Frogger", "Beat level 25 without any mistakes."];
showAchievement = false;
if (gotGold) {
switch (saveData.data.goldMedals) {
case 5 :
saveData.data.achievementData[1] = 1;
showAchievement = true;
break;
case 10 :
saveData.data.achievementData[2] = 1;
showAchievement = true;
break;
case 15 :
saveData.data.achievementData[3] = 1;
showAchievement = true;
break;
case 20 :
saveData.data.achievementData[4] = 1;
showAchievement = true;
break;
case 25 :
saveData.data.achievementData[5] = 1;
showAchievement = true;
}
}
if ((Level == 24) && (levelHits == 0)) {
saveData.data.achievementData[6] = 1;
showAchievement = true;
}
if ((saveData.data.levelMax == 25) && (!saveData.data.achievementData[0])) {
saveData.data.achievementData[0] = 1;
showAchievement = true;
}
if (showAchievement) {
achievementUnlocked.xDestination = 280;
achievementSound = new Sound();
achievementSound.attachSound("Fanfare");
achievementSound.start();
}
}
function blockDead() {
I = 0;
while (I < deadArray.length) {
currentBlock = deadArray[I];
xDifference = currentBlock.xDestination - currentBlock._x;
yDifference = currentBlock.yDestination - currentBlock._y;
xDifference = xDifference / 5;
yDifference = yDifference / 5;
sizeDifference = 20 - currentBlock._width;
sizeDifference = sizeDifference / 5;
alphaDifference = -currentBlock._alpha;
alphaDifference = alphaDifference / 10;
currentBlock._x = currentBlock._x + xDifference;
currentBlock._y = currentBlock._y + yDifference;
currentBlock._width = currentBlock._width + sizeDifference;
currentBlock._height = currentBlock._height + sizeDifference;
currentBlock._alpha = currentBlock._alpha + alphaDifference;
if (currentBlock._alpha == 0) {
currentBlock.removeMovieClip();
deadArray.splice(I, 1);
}
I++;
}
}
function displayNext() {
myColour = new Color(nextDisplay);
myTransform = new Object();
myTransform.rb = levelArray[Level][rowNow][columnNow][0];
myTransform.gb = levelArray[Level][rowNow][columnNow][1];
myTransform.bb = levelArray[Level][rowNow][columnNow][2];
myColour.setTransform(myTransform);
}
function clearAll() {
endLevel();
Mouse.show();
levelText.removeMovieClip();
Cursor.removeMovieClip();
Display.removeMovieClip();
pauseScreen.removeMovieClip();
Victory.removeMovieClip();
Loss.removeMovieClip();
Background.removeMovieClip();
Health.removeMovieClip();
BeatGame.removeMovieClip();
achievementUnlocked.removeMovieClip();
}
function gotoMainMenu() {
clearAll();
gotoAndStop ("Menu");
}
Instance of Symbol 125 MovieClip "Background" in Frame 5
onClipEvent (load) {
this.swapDepths(4950);
}
Instance of Symbol 128 MovieClip "Display" in Frame 5
onClipEvent (load) {
this.swapDepths(4960);
}
Instance of Symbol 138 MovieClip "Health" in Frame 5
onClipEvent (load) {
swapDepths(7400);
}
Instance of Symbol 150 MovieClip "Victory" in Frame 5
onClipEvent (load) {
swapDepths(7500);
ySpeed = 0;
yStart = _y;
yDestination = yStart;
}
onClipEvent (enterFrame) {
ySpeed = ySpeed + ((yDestination - _y) * 0.1);
ySpeed = ySpeed * 0.7;
_y = (_y + ySpeed);
}
Instance of Symbol 159 MovieClip "Loss" in Frame 5
onClipEvent (load) {
swapDepths(7510);
ySpeed = 0;
yStart = _y;
yDestination = yStart;
}
onClipEvent (enterFrame) {
ySpeed = ySpeed + ((yDestination - _y) * 0.1);
ySpeed = ySpeed * 0.7;
_y = (_y + ySpeed);
}
Instance of Symbol 164 MovieClip "pauseScreen" in Frame 5
onClipEvent (load) {
swapDepths(7530);
xSpeed = 0;
xStart = _x;
xDestination = xStart;
}
onClipEvent (enterFrame) {
xSpeed = xSpeed + ((xDestination - _x) * 0.1);
xSpeed = xSpeed * 0.7;
_x = (_x + xSpeed);
}
Instance of Symbol 168 MovieClip "achievementUnlocked" in Frame 5
onClipEvent (load) {
swapDepths(7600);
xSpeed = 0;
xStart = _x;
xDestination = xStart;
}
onClipEvent (enterFrame) {
xSpeed = xSpeed + ((xDestination - _x) * 0.1);
xSpeed = xSpeed * 0.7;
_x = (_x + xSpeed);
}
Instance of Symbol 172 MovieClip "BeatGame" in Frame 5
onClipEvent (load) {
swapDepths(7560);
xSpeed = 0;
xStart = _x;
xDestination = xStart;
}
onClipEvent (enterFrame) {
xSpeed = xSpeed + ((xDestination - _x) * 0.1);
xSpeed = xSpeed * 0.7;
_x = (_x + xSpeed);
}
Instance of Symbol 116 MovieClip "Cursor" in Frame 5
onClipEvent (load) {
swapDepths(7450);
}
Instance of Symbol 177 MovieClip "levelText" in Frame 5
onClipEvent (load) {
swapDepths(15500);
}
Instance of Symbol 178 MovieClip in Frame 5
onClipEvent (load) {
_root.Start();
}
onClipEvent (enterFrame) {
_root.Run();
}
onClipEvent (mouseDown) {
_root.Click();
}
Symbol 11 MovieClip Frame 1
stop();
Symbol 22 MovieClip Frame 1
stop();
Symbol 32 MovieClip Frame 1
stop();
Symbol 48 Button
on (press) {
getURL ("http://www.armorgames.com", "_blank");
}
Symbol 51 MovieClip Frame 1
_root.stop();
gotoAndPlay (2);
Symbol 51 MovieClip Frame 218
_root.nextFrame();
Symbol 60 MovieClip Frame 1
stop();
Symbol 63 Button
on (release) {
if (_quality == "HIGH") {
_quality = "MEDIUM";
} else if (_quality == "MEDIUM") {
_quality = "LOW";
} else {
_quality = "HIGH";
}
}
Symbol 80 Button
on (release) {
if (_root.achievementsMenu.xDestination == _root.achievementsMenu.xStart) {
_root.instructionsMenu.xDestination = 280;
}
}
Symbol 84 Button
on (release) {
if (_root.instructionsMenu.xDestination == _root.instructionsMenu.xStart) {
_root.achievementsMenu.xDestination = 135;
}
}
Symbol 86 Button
on (release) {
_root.getURL("http://www.armorgames.com", "_blank");
}
Symbol 94 Button
on (release) {
xDestination = xStart;
}
Instance of Symbol 68 MovieClip "Scrollbar" in Symbol 101 MovieClip Frame 1
onClipEvent (load) {
Grabbed = false;
yOffset = 0;
yDestination = _y;
Progress = 0;
}
onClipEvent (mouseDown) {
if (hitTest(_root._xmouse, _root._ymouse, true)) {
Grabbed = true;
yOffset = _y - _root._ymouse;
}
}
onClipEvent (mouseUp) {
Grabbed = false;
}
onClipEvent (enterFrame) {
if (Grabbed) {
yDestination = _root._ymouse + yOffset;
if (yDestination < 40) {
yDestination = 40;
} else if (yDestination > 130) {
yDestination = 130;
}
}
yDifference = yDestination - _y;
yDifference = yDifference / 4;
_y = (_y + yDifference);
Progress = (yDestination - 40) / 100;
}
Instance of Symbol 97 MovieClip in Symbol 101 MovieClip Frame 1
onClipEvent (load) {
Achievement1 = ["Across the Finish Line", "Finish all 25 levels."];
Achievement2 = ["Rookie", "Earn gold on 5 levels."];
Achievement3 = ["Novice Pixelist", "Earn gold on 10 levels."];
Achievement4 = ["Pixel Enthusiast", "Earn gold on 15 levels."];
Achievement5 = ["Dedicated Pixelist", "Earn gold on 20 levels."];
Achievement6 = ["Pixel Perfect", "Earn gold on all levels."];
Achievement7 = ["Frogger", "Beat level 25 with no mistakes."];
Achievements = [Achievement1, Achievement2, Achievement3, Achievement4, Achievement5, Achievement6, Achievement7];
I = 0;
while (I < 7) {
newAchievement = attachMovie("achievementOption", "achievementOption" + I, I);
newAchievement._y = (I * newAchievement._height) + (5 * I);
newAchievement.achievementName = Achievements[I][0];
newAchievement.achievementCriteria = Achievements[I][1];
if (_root.saveData.data.achievementData[I]) {
newAchievement.Status.gotoAndStop("Unlocked");
} else {
newAchievement.Status.gotoAndStop("Locked");
}
I++;
}
yOrigin = _y;
}
onClipEvent (enterFrame) {
percentPosition = _parent.Scrollbar.Progress;
yDestination = ((-percentPosition) * 180) + yOrigin;
yDifference = yDestination - _y;
yDifference = yDifference / 4;
_y = (_y + yDifference);
}
Symbol 104 Button
on (release) {
nextFrame();
}
Symbol 107 Button
on (release) {
prevFrame();
}
Symbol 123 MovieClip Frame 1
stop();
Symbol 130 Button
on (release) {
_root.startButton._visible = false;
_root.gameStart = true;
}
Symbol 138 MovieClip Frame 1
stop();
Symbol 145 Button
on (release) {
_root.Level++;
_root.Start();
yDestination = yStart;
_root.achievementUnlocked.xDestination = _root.achievementUnlocked.xStart;
}
Symbol 149 Button
on (release) {
_root.gotoMainMenu();
}
Symbol 158 Button
on (release) {
_root.Start();
yDestination = yStart;
}
Symbol 162 Button
on (release) {
_root.Start();
xDestination = xStart;
_root.Victory.yDestination = _root.Victory.yStart;
_root.Loss.yDestination = _root.Loss.yStart;
}