Frame 1
function defaultSettings() {
style = 2;
detail = 2;
colors = 4;
fuel = 100;
gravity = 2;
shake = 0.5;
blocksH = 13;
isometric = false;
}
function soundFX(fsound, vol) {
if (fsound == "BlockPuff") {
fObj = "FX2";
if (vol > 0) {
fVol = fVol + vol;
} else {
fVol = fVol + 5;
}
if (fVol > 90) {
fVol = 90;
}
_root.FX2.sound.setVolume(((fVol + 10) / 100) * _root.FXVolume);
} else {
fObj = "FX1";
_root.FX1.sound.setVolume(_root.FXVolume);
}
_root[fObj].sound.stop();
_root[fObj].sound.attachSound("FX_" + fsound);
_root[fObj].sound.start(0, 0);
}
stop();
difficulty = 5;
defaultSettings();
FXVolume = 100;
_root.createEmptyMovieClip("FX1", 10);
_root.createEmptyMovieClip("FX2", 11);
_root.createEmptyMovieClip("music1", 12);
_root.createEmptyMovieClip("music2", 13);
_root.FX1.sound = new Sound(_root.FX1);
_root.FX2.sound = new Sound(_root.FX2);
_root.music1.sound = new Sound(_root.music1);
_root.FX2.sound.setVolume(10);
Instance of Symbol 167 MovieClip in Frame 1
onClipEvent (load) {
this.stop();
}
onClipEvent (enterFrame) {
TB = Math.round(_root.getBytesTotal() / 1024);
BLoaded = Math.round(_root.getBytesLoaded() / 1024);
this.b._xscale = (BLoaded / TB) * 100;
if ((this.b._xscale >= 100) && (this._currentframe == 1)) {
this.play();
}
}
Frame 2
stop();
Frame 3
stop();
Frame 4
stop();
Instance of Symbol 220 MovieClip "area" in Frame 4
onClipEvent (load) {
function setColDisplay() {
z = 1;
while (z <= 13) {
_root.attachMovie("testText", "col" + z, -z);
_root["col" + z]._y = this._y;
_root["col" + z]._x = this._x + ((z - 1) * block.width);
z++;
}
}
function refreshColDisplay() {
z = 1;
while (z <= 13) {
_root["col" + z].text = col[z];
z++;
}
}
_root.sec = 0;
area = new Array();
area.height = 360;
area.width = 260;
timerA = 1;
block = new Array();
block.type = 1;
_root.blockWidth = area.width / _root.blocksH;
block.width = _root.blockWidth;
block.height = Math.round(_root.blockWidth);
block.scale = 5 * _root.blockWidth;
block.style = parseInt(_root.style);
difficulty = _parent.difficulty + 1;
timerMax = (10 - parseInt(_parent.difficulty)) * 2;
if (difficulty > 11) {
timerMax = timerMax + ((difficulty - 11) * 2);
timerA = (1 + difficulty) - 10;
}
timer = 0;
detail = parseInt(_root.detail);
}
onClipEvent (enterFrame) {
main();
flameX = 80 + random(30);
flameY = random(30);
_parent.fVol = 0;
refreshColDisplay();
_root.sec++;
if (_root.sec > 1) {
_root.sec = 0;
}
}
onClipEvent (mouseUp) {
endBlockDrag();
}
Frame 5
_root.GameOver.removeMovieClip();
gotoAndStop (3);
Instance of Symbol 240 MovieClip in Frame 6
onClipEvent (load) {
down = 0;
w = 23.0769230769231;
this.dArrow._x = _parent.difficulty * w;
}
onClipEvent (enterFrame) {
if (down == 1) {
dArrow._x = Math.round(_xmouse / w) * w;
if (dArrow._x < 0) {
dArrow._x = 0;
} else if (dArrow._x > 300) {
dArrow._x = 300;
}
_parent.difficulty = Math.round(dArrow._x / w);
}
}
Symbol 7 Button
on (press) {
_parent.startBlockDrag(col, nr);
trace((("Block------------ " + nr) + ", ") + col);
trace("fall: " + fall);
trace("y: " + y);
trace("fuel: " + fuel);
trace("lead: " + lead);
trace("leadTo: " + leadTo);
}
on (rollOver, dragOver) {
if (_parent.dragCol == col) {
}
}
Symbol 54 MovieClip [selectBlock] Frame 7
this.removeMovieClip();
Instance of Symbol 56 MovieClip in Symbol 57 MovieClip [flame] Frame 1
onClipEvent (load) {
scale = 0;
if (_root.area.shake < 8) {
_root.area.shake = 8;
} else {
_root.area.shake = _root.area.shake + 4;
}
fuel = _parent.fuel;
if (fuel == undefined) {
trace("FLAME was UNDEFINED!!");
fuel = _root.area[_parent.name].fuel;
}
z = 1;
}
onClipEvent (enterFrame) {
_parent._y = _root.area[_parent.name]._y;
_xscale = _root.area.flameX;
_yscale = (scale + _root.area.flameY);
_alpha = (_yscale * 2);
if (_root.area[_parent.name].y > 0) {
fuel = fuel - 1;
}
if (((fuel <= 0) || (_root.area[_parent.name].fall == 0)) || (_root.area[_parent.name]._x == undefined)) {
_parent.removeMovieClip();
} else {
if (_root.area[_parent.name].y < 0) {
_root.area.setEffect(_parent.name, "smoke", 3);
}
scale = fuel * 2;
if (scale > 100) {
scale = 100;
}
}
}
Symbol 58 MovieClip [stripe] Frame 1
z1 = 1;
while (z1 <= 1) {
this.attachMovie("stripeAnim", "c" + z1, z1);
this["c" + z1]._x = random(20);
this["c" + z1]._y = 20 + random(20);
z1++;
}
_root.area.shake = _root.area.shake + 1;
Symbol 58 MovieClip [stripe] Frame 8
this.removeMovieClip();
Symbol 59 MovieClip [stars] Frame 1
z1 = 1;
while (z1 <= 2) {
this.attachMovie("starAnim", "c" + z1, z1);
this["c" + z1]._x = random(20);
this["c" + z1]._y = random(20);
z1++;
}
_root.area.shake = _root.area.shake + 1;
Symbol 59 MovieClip [stars] Frame 8
this.removeMovieClip();
Symbol 60 MovieClip [smoke] Frame 1
z1 = 1;
while (z1 <= 1) {
this.attachMovie("smokeAnim", "c" + z1, z1);
this["c" + z1]._x = random(20);
this["c" + z1]._y = 60 + random(20);
this["c" + z1]._rotation = (this["c" + z1] - 10) * 3;
z1++;
}
_root.area.shake = _root.area.shake + 1;
Symbol 60 MovieClip [smoke] Frame 8
this.removeMovieClip();
Symbol 61 MovieClip [blockPuff2] Frame 1
z1 = 1;
while (z1 <= 3) {
this.attachMovie("cloud", "c" + z1, z1);
this["c" + z1]._x = random(20);
this["c" + z1]._y = random(20);
z1++;
}
_root.area.shake = _root.area.shake + 1;
Symbol 61 MovieClip [blockPuff2] Frame 12
this.removeMovieClip();
Symbol 62 MovieClip [blockPuff] Frame 1
z1 = 1;
while (z1 <= 3) {
this.attachMovie("cloud", "c" + z1, z1);
this["c" + z1]._x = random(20);
this["c" + z1]._y = 16 + random(10);
z1++;
}
_root.area.shake = _root.area.shake + 1;
Symbol 62 MovieClip [blockPuff] Frame 12
this.removeMovieClip();
Symbol 66 MovieClip [smokeAnim] Frame 8
stop();
Symbol 69 MovieClip [cloud] Frame 11
stop();
Symbol 86 MovieClip Frame 1
gotoAndStop (2);
Symbol 91 Button
on (press) {
_root.play();
this.removeMovieClip();
}
Instance of Symbol 86 MovieClip in Symbol 92 MovieClip [special] Frame 1
onClipEvent (load) {
max = _parent.text.length - 1;
scaleSpeed = 25;
w = 15;
z1 = 0;
while (z1 <= max) {
_parent.attachMovie("SpecialLetter", "l" + z1, z1);
_parent["l" + z1]._xscale = 0;
_parent["l" + z1]._yscale = 0;
_parent["l" + z1]._y = 0;
_parent["l" + z1]._x = z1 * w;
_parent["l" + z1].normY = _parent["l" + z1]._y;
_parent["l" + z1].normX = _parent["l" + z1]._x;
_parent["l" + z1].letter = _parent.text.charAt(z1);
z1++;
}
}
onClipEvent (enterFrame) {
shake1 = 2 - random(4);
shake2 = 2 - random(4);
z1 = 0;
while (z1 <= max) {
if (_parent["l" + z1]._xscale < 100) {
_parent["l" + z1]._xscale = _parent["l" + z1]._xscale + scaleSpeed;
_parent["l" + z1]._yscale = _parent["l" + z1]._xscale;
}
if ((z1 % 2) == 0) {
_parent["l" + z1]._x = _parent["l" + z1].normX + shake1;
_parent["l" + z1]._y = _parent["l" + z1].normY + shake2;
} else {
_parent["l" + z1]._x = _parent["l" + z1].normX + shake2;
_parent["l" + z1]._y = _parent["l" + z1].normY + shake1;
}
z1++;
}
}
Symbol 92 MovieClip [special] Frame 16
this.removeMovieClip();
Instance of Symbol 86 MovieClip in Symbol 96 MovieClip [GameOver] Frame 1
onClipEvent (load) {
_parent.text = "Game Over";
max = _parent.text.length - 1;
scaleSpeed = 0;
w = 26;
sec = 0;
fl = 1;
z1 = 0;
while (z1 <= max) {
_parent.attachMovie("GameOverLetter", "l" + z1, z1);
_parent["l" + z1]._xscale = 0;
_parent["l" + z1]._yscale = 0;
_parent["l" + z1]._y = 0;
_parent["l" + z1]._x = (-((max * w) / 2)) + (z1 * w);
_parent["l" + z1].normY = _parent["l" + z1]._y;
_parent["l" + z1].normX = _parent["l" + z1]._x;
_parent["l" + z1].letter = _parent.text.charAt(z1);
z1++;
}
}
onClipEvent (enterFrame) {
if (sec >= 0) {
sec = 0;
shake1 = 2 - random(4);
shake2 = 2 - random(4);
} else {
sec++;
}
scaleSpeed = scaleSpeed + 5;
z1 = 0;
while (z1 <= max) {
if (_parent["l" + z1]._xscale < 100) {
_parent["l" + z1]._xscale = _parent["l" + z1]._xscale + scaleSpeed;
_parent["l" + z1]._yscale = _parent["l" + z1]._xscale;
}
if ((z1 % 2) == 0) {
_parent["l" + z1]._x = _parent["l" + z1]._x - (((_parent["l" + z1]._x - _parent["l" + z1].normX) + shake1) / fl);
_parent["l" + z1]._y = _parent["l" + z1]._y - (((_parent["l" + z1]._y - _parent["l" + z1].normY) + shake2) / fl);
} else {
_parent["l" + z1]._x = _parent["l" + z1]._x - (((_parent["l" + z1]._x - _parent["l" + z1].normX) + shake2) / fl);
_parent["l" + z1]._y = _parent["l" + z1]._y - (((_parent["l" + z1]._y - _parent["l" + z1].normY) + shake1) / fl);
}
z1++;
}
}
Symbol 96 MovieClip [GameOver] Frame 50
stop();
Instance of Symbol 105 MovieClip in Symbol 106 MovieClip [schweif] Frame 1
onClipEvent (load) {
this.gotoAndStop(_root.area[_parent.name]._currentframe);
}
onClipEvent (enterFrame) {
_root.area.setEffect(_parent.name, "stripe", 4);
_yscale = (_root.area[_parent.name].y * 15);
_parent._y = (_root.area[_parent.name]._y + _root.area[_parent.name].y) + 5;
if (_yscale > 300) {
_yscale = 300;
} else if ((_yscale <= 0) || (_root.area[_parent.name]._x == null)) {
_parent.removeMovieClip();
}
}
Symbol 109 MovieClip [rowClear] Frame 7
this.removeMovieClip();
stop();
Symbol 112 MovieClip [starAnim] Frame 6
stop();
Symbol 115 MovieClip [stripeAnim] Frame 7
this.removeMovieClip();
stop();
Instance of Symbol 119 MovieClip in Symbol 120 MovieClip [fire] Frame 1
onClipEvent (load) {
}
onClipEvent (enterFrame) {
_parent._y = _root.area[_parent.name]._y + _root.area[_parent.name].y;
if ((_root.area[_parent.name].fall != 1) || (_root.area[_parent.name]._x == undefined)) {
_parent.removeMovieClip();
}
}
Symbol 130 Button
on (press) {
drag = 1;
}
on (release, releaseOutside) {
drag = 0;
}
Instance of Symbol 131 MovieClip "slider" in Symbol 132 MovieClip Frame 1
onClipEvent (enterFrame) {
if (drag == 1) {
this._x = _parent._xmouse;
if (_x < 0) {
_x = 0;
} else if (_x > 110) {
_x = 110;
}
if (fx > 0) {
fx = fx - 1;
}
setValue();
} else {
fx = 0;
}
}
onClipEvent (load) {
function setValue() {
_parent._parent.value = Math.round((range[0] + ((_x / 110) * (range[1] - range[0]))) * komma[1]) / komma[1];
if (((_root[_parent._parent.varName] != _parent._parent.value) && (_parent._parent.value != null)) && (fx == 0)) {
fx = 2;
_root.soundFX("clic", 100);
}
_root[_parent._parent.varName] = _parent._parent.value;
}
function setSlider() {
_x = (((_root[_parent._parent.varName] - range[0]) / (range[1] - range[0])) * 110);
setValue();
}
fx = 0;
if (range == null) {
komma = new Array();
range = new Array();
komma = _parent._parent.range.split(";");
range = komma[0].split("-");
range[0] = parseInt(range[0]);
range[1] = parseInt(range[1]);
setSlider();
}
}
Symbol 139 Button
on (press) {
if (runFunction != null) {
_parent.button = nr;
_parent[runFunction](functionValue);
}
}
Symbol 144 Button
on (press) {
if (runFunction != null) {
_parent.button = nr;
_parent[runFunction](functionValue);
}
}
Symbol 155 MovieClip [menutitle] Frame 9
stop();
Symbol 160 MovieClip Frame 12
_parent.removeMovieClip();
Instance of Symbol 160 MovieClip in Symbol 161 MovieClip [launch] Frame 1
onClipEvent (enterFrame) {
_parent._y = _root.area[_parent.name]._y + _root.area[_parent.name].y;
}
Symbol 167 MovieClip Frame 11
_root.nextFrame();
Symbol 179 Button
on (press) {
play();
}
Symbol 184 MovieClip Frame 70
text = "<font color=\"#33CCCC\"><a href=\"http://www.q-ent.jp/\" target=\"blank\">Q-Entertainment Homepage</a><br>";
text = text + "<a href=\"http://planetmeteos.com\" target=\"blank\">Planet-Meteos</a></font>";
Symbol 184 MovieClip Frame 78
stop();
Symbol 184 MovieClip Frame 85
_root.nextFrame();
Symbol 201 MovieClip Frame 1
function main() {
if (animStat > 0) {
switchMenu(cMenu);
}
}
function getButtonTotal() {
buttons = parseInt(type.length + 1);
starty = (210 - (buttons * bHeight)) / 2;
animSpeed = buttons * 1.7;
animSpeed2 = animSpeed;
}
function setMenu() {
getButtonTotal();
z = 0;
while ((type[z] != null) || (type[z - 1] != null)) {
if (type[z] != null) {
attachMovie("menu" + type[z], "b" + z, buttons - z);
this["b" + z].text = text[z].toLowerCase();
this["b" + z].varName = varName[z];
this["b" + z].range = range[z];
this["b" + z].runFunction = runFunction[z];
this["b" + z].functionValue = functionValue[z];
} else {
attachMovie("menuback", "b" + z, buttons - z);
this["b" + z].text = "back";
this["b" + z].runFunction = "back";
if (mPathZ > 1) {
this["b" + z].gotoAndStop(1);
} else {
this["b" + z].gotoAndStop(2);
}
}
if (z > 0) {
this["b" + z]._visible = 0;
}
this["b" + z].nr = z;
this["b" + z]._y = starty;
this["b" + z].y = starty + (z * bHeight);
z++;
}
}
function removeMenu() {
z = 0;
while ((type[z] != null) || (type[z - 1] != null)) {
this["b" + z].removeMovieClip();
z++;
}
}
function setDefault() {
_root.defaultSettings();
z = 0;
while (z <= buttons) {
this["b" + z].slider.slider.setSlider();
z++;
}
}
function openMenu(fMenu) {
_root.soundFX("menuIN");
switchMenu(fMenu);
}
function switchMenu(fMenu) {
if (cMenu == null) {
animStat = 5;
cMenu = fMenu;
}
if (animStat == 0) {
if (button == null) {
button = 0;
}
lMenu = cMenu;
cMenu = fMenu;
this["b" + button].swapDepths(buttons + 1);
animStat = 2;
buttony = this["b" + button]._y;
} else if (animStat == 2) {
finB = 0;
var _local2 = 0;
while ((_local2 <= buttons) && (_local2 < 20)) {
trace("1");
if (_local2 != button) {
if (this["b" + _local2]._y > (buttony + animSpeed)) {
this["b" + _local2]._y = this["b" + _local2]._y - animSpeed;
} else if (this["b" + _local2]._y < (buttony - animSpeed)) {
this["b" + _local2]._y = this["b" + _local2]._y + animSpeed;
} else {
finB++;
this["b" + _local2]._visible = 0;
this["b" + _local2]._y = buttony;
}
}
_local2++;
}
trace("finB:" + finB);
trace("buttons" + buttons);
if (finB >= buttons) {
animStat = 3;
}
} else if (animStat == 3) {
type = new Array();
this["m" + fMenu]();
getButtonTotal();
type = new Array();
this["m" + lMenu]();
animStat = 4;
} else if (animStat == 4) {
if (this["b" + button]._y > (starty + 2)) {
this["b" + button]._y = this["b" + button]._y - ((this["b" + button]._y - starty) / 3);
} else {
this["b" + button]._y = starty;
animStat = 5;
var _local2 = 0;
}
} else if (animStat == 5) {
removeMenu();
mPathZ++;
mPath[mPathZ] = fMenu;
type = new Array();
text = new Array();
varName = new Array();
range = new Array();
runFunction = new Array();
functionValue = new Array();
this["m" + fMenu]();
setMenu();
animStat = 6;
} else if (animStat == 6) {
finB = 0;
var _local2 = 0;
while ((_local2 <= buttons) && (_local2 < 20)) {
if (this["b" + _local2]._y >= starty) {
this["b" + _local2]._visible = 1;
}
if (this["b" + _local2]._y > (this["b" + _local2].y - animSpeed2)) {
this["b" + _local2]._y = this["b" + _local2].y;
finB++;
} else {
this["b" + _local2]._y = this["b" + _local2]._y + animSpeed2;
}
_local2++;
}
if (finB >= buttons) {
animStat = 7;
}
}
if (animStat >= 7) {
animStat = 0;
}
}
function startGame() {
_root.nextFrame();
}
function back() {
mPath[mPathZ] = null;
mPathZ--;
mPathZ--;
_root.soundFX("menuOUT");
switchMenu(mPath[mPathZ + 1]);
}
function mMain() {
z = 0;
text[z] = "Menu";
type[z] = "title";
z++;
text[z] = "Start";
type[z] = "Button";
runFunction[z] = "startGame";
z++;
text[z] = "Difficulty";
type[z] = "Button";
runFunction[z] = "openMenu";
functionValue[z] = "Difficulty";
z++;
text[z] = "Options";
type[z] = "Button";
runFunction[z] = "openMenu";
functionValue[z] = "Options";
z++;
text[z] = "Sound";
type[z] = "Button";
runFunction[z] = "openMenu";
functionValue[z] = "Sound";
return(z);
}
function mOptions2() {
z = 0;
text[z] = "Options";
type[z] = "title";
z++;
text[z] = "Graphics";
type[z] = "Button";
runFunction[z] = "openMenu";
functionValue[z] = "OptionsGraphics";
z++;
text[z] = "Game Settings";
type[z] = "Button";
runFunction[z] = "openMenu";
functionValue[z] = "OptionsSettings";
z++;
text[z] = "default";
type[z] = "Button";
runFunction[z] = "setDefault";
return(z);
}
function mOptionsGraphics() {
z = 0;
text[z] = "Graphics";
type[z] = "title";
z++;
text[z] = "Style";
type[z] = "text";
z++;
type[z] = "slider";
varName[z] = "style";
range[z] = "1-3;1";
z++;
text[z] = "Isometric";
type[z] = "text";
z++;
type[z] = "slider";
varName[z] = "isometric";
range[z] = "0-1;1";
z++;
text[z] = "Detail";
type[z] = "text";
z++;
type[z] = "slider";
varName[z] = "detail";
range[z] = "0-3;1";
return(z);
}
function mOptionsSettings() {
z = 0;
text[z] = "Game Settings";
type[z] = "title";
z++;
text[z] = "Fuel";
type[z] = "text";
z++;
type[z] = "slider";
varName[z] = "fuel";
range[z] = "0-100;1";
z++;
text[z] = "Blocks in a row";
type[z] = "text";
z++;
type[z] = "slider";
varName[z] = "blocksH";
range[z] = "4-18;1";
z++;
text[z] = "Colors";
type[z] = "text";
z++;
type[z] = "slider";
varName[z] = "colors";
range[z] = "2-7;1";
z++;
text[z] = "gravity";
type[z] = "text";
z++;
type[z] = "slider";
varName[z] = "gravity";
range[z] = "1-10;10";
z++;
text[z] = "Camera Shake";
type[z] = "text";
z++;
type[z] = "slider";
varName[z] = "shake";
range[z] = "0-2;10";
return(z);
}
function mOptions() {
z = 0;
text[z] = "Options";
type[z] = "title";
z++;
text[z] = "Style";
type[z] = "text";
z++;
type[z] = "slider";
varName[z] = "style";
range[z] = "1-3;1";
z++;
text[z] = "Isometric";
type[z] = "text";
z++;
type[z] = "slider";
varName[z] = "isometric";
range[z] = "0-1;1";
z++;
text[z] = "Detail";
type[z] = "text";
z++;
type[z] = "slider";
varName[z] = "detail";
range[z] = "0-3;1";
z++;
text[z] = "Fuel";
type[z] = "text";
z++;
type[z] = "slider";
varName[z] = "fuel";
range[z] = "0-100;1";
z++;
text[z] = "Blocks in a row";
type[z] = "text";
z++;
type[z] = "slider";
varName[z] = "blocksH";
range[z] = "4-18;1";
z++;
text[z] = "Colors";
type[z] = "text";
z++;
type[z] = "slider";
varName[z] = "colors";
range[z] = "2-7;1";
z++;
text[z] = "gravity";
type[z] = "text";
z++;
type[z] = "slider";
varName[z] = "gravity";
range[z] = "1-10;10";
z++;
text[z] = "Camera Shake";
type[z] = "text";
z++;
type[z] = "slider";
varName[z] = "shake";
range[z] = "0-2;10";
z++;
text[z] = "default";
type[z] = "Button";
runFunction[z] = "setDefault";
return(z);
}
function mDifficulty() {
z = 0;
text[z] = "Difficulty";
type[z] = "title";
z++;
text[z] = "easy .. normal .. insane";
type[z] = "text";
z++;
type[z] = "slider";
varName[z] = "difficulty";
range[z] = "0-12;1";
return(z);
}
function mSound() {
z = 0;
text[z] = "Sound";
type[z] = "title";
z++;
text[z] = "FX Volume";
type[z] = "text";
z++;
type[z] = "slider";
varName[z] = "FXVolume";
range[z] = "0-100;1";
return(z);
}
mPath = new Array();
mPathZ = 0;
bHeight = 16;
animSpeed = 10;
buttons = 0;
starty = 0;
animSpeed = 0;
animSpeed2 = 0;
switchMenu("Main");
setMenu();
Instance of Symbol 86 MovieClip in Symbol 201 MovieClip Frame 1
onClipEvent (enterFrame) {
_parent.main();
}
Symbol 218 MovieClip Frame 2
stop();
Symbol 220 MovieClip Frame 1
function gameOver() {
z1 = 0;
while (z1 <= 3) {
destroyNr = destroyNr + 1;
if (destroyNr > area.bheight) {
destroyNr = 1;
destroyCol = destroyCol + 1;
}
fName = (("b" + destroyCol) + "-") + destroyNr;
if (this[fName]._x != undefined) {
setEffect(fName, "blockPuff2", 1);
changeBlock(fName, 1);
z1++;
} else if (destroyCol > col.total) {
game = -1;
check3(1, 1, 1);
_root.attachMovie("GameOver", "GameOver", 5);
_root.GameOver._x = normX + (area.width / 2);
_root.GameOver._y = normY - (area.height / 1.5);
break;
}
}
}
function shakeF() {
if (shake > 0) {
shakeZ = Math.floor(shake);
}
shake = 0;
if (shakeZ >= 3) {
_x = Math.round(normX - (((shakeZ / 2) - random(shakeZ)) * area.shake));
_y = Math.round(normY - (((shakeZ / 2) - random(shakeZ)) * area.shake));
if (shakeZ > 20) {
shakeZ = shakeZ - 6;
} else if (shakeZ > 10) {
shakeZ = shakeZ - 2;
} else {
shakeZ = shakeZ - 1;
}
} else {
_x = normX;
_y = normY;
}
}
function main() {
getHighest();
if (game == 1) {
if (dragCol != null) {
blockDrag();
}
timer = timer + 1;
if (timer > timerMax) {
z = 1;
while (z <= timerA) {
fCol = random(col.total) + 1;
newBlock(fCol, random(area.colors) + 2);
z++;
}
timer = 0;
}
} else if (game == 2) {
startTimer = 6;
gravity = 25;
timer = timer + 1;
if ((timer / startTimer) == Math.round(timer / startTimer)) {
z = 1;
while (z <= area.bwidth) {
do {
fColor2 = random(area.colors) + 2;
} while (fColor == fColor2);
fColor = fColor2;
fCol = z;
newBlock(fCol, fColor);
z++;
}
}
if (timer >= ((startTimer * 4) - 1)) {
game = 1;
timer = 0;
gravity = parseInt(_root.gravity);
}
} else if (game == 0) {
gameOver();
}
if (dragCol != null) {
blockDrag();
}
blocksFall();
shakeF();
}
function blocksFall() {
var _local4 = 1;
while (_local4 <= col.total) {
var _local3 = 1;
while (_local3 <= area.bheight) {
if (_local4 == 1) {
rowCheck[_local3] = 0;
}
if (this[(("b" + _local4) + "-") + _local3].fall > 0) {
fName = (("b" + _local4) + "-") + _local3;
if ((this[fName].lead == "") || (this[fName].lead == "leader")) {
if (this[fName].lead == "leader") {
var _local5 = _local4 + 1;
while (_local5 <= this[fName].leadTo) {
if ((this[(("b" + _local5) + "-") + _local3].y < this[fName].y) && (this[(("b" + _local5) + "-") + _local3].y < 0)) {
this[fName].y = this[(("b" + _local5) + "-") + _local3].y;
this[fName].fuel = this[(("b" + _local5) + "-") + _local3].fuel;
trace("SetY");
}
_local5++;
}
}
if (this[(("b" + _local4) + "-") + _local3].y < 0) {
if (this[(("b" + _local4) + "-") + _local3].y > -5) {
this[(("b" + _local4) + "-") + _local3].y = this[(("b" + _local4) + "-") + _local3].y + 0.2;
} else {
this[(("b" + _local4) + "-") + _local3].y = this[(("b" + _local4) + "-") + _local3].y + 2;
}
} else if (((this[(("b" + _local4) + "-") + _local3].y > 0) && (this[(("b" + _local4) + "-") + _local3].fuel > 0)) && (this[(("b" + _local4) + "-") + _local3].fall == 2)) {
this[(("b" + _local4) + "-") + _local3].fuel = this[(("b" + _local4) + "-") + _local3].fuel - 1;
this[(("b" + _local4) + "-") + _local3].y = 1;
} else {
this[(("b" + _local4) + "-") + _local3].y = this[(("b" + _local4) + "-") + _local3].y + gravity;
}
this[(("b" + _local4) + "-") + _local3]._y = this[(("b" + _local4) + "-") + _local3]._y + this[(("b" + _local4) + "-") + _local3].y;
} else {
this[fName]._y = this[this[fName].lead]._y;
if (this[this[fName].lead].fall > 0) {
this[fName].fall = this[this[fName].lead].fall;
this[fName].y = this[this[fName].lead].y;
this[fName].fuel = this[this[fName].lead].fuel;
} else {
this[fName].lead = "";
this[fName].leadTo = 0;
}
}
if ((this[(("b" + _local4) + "-") + (_local3 + 1)].fall == 0) && (this[(("b" + _local4) + "-") + _local3].y < 0)) {
this[(("b" + _local4) + "-") + (_local3 + 1)].fall = this[(("b" + _local4) + "-") + _local3].fall;
this[(("b" + _local4) + "-") + (_local3 + 1)].y = this[(("b" + _local4) + "-") + _local3].y;
}
if ((this[(("b" + _local4) + "-") + _local3]._y < ((-area.height) - block.height)) && (this[(("b" + _local4) + "-") + _local3].y < 0)) {
addScore(10);
removeBlock(_local4);
}
if (_local3 == 1) {
if (this[(("b" + _local4) + "-") + _local3]._y > (-(_local3 * block.height))) {
this[(("b" + _local4) + "-") + _local3]._y = -(_local3 * block.height);
this[(("b" + _local4) + "-") + _local3].fall = 0;
this[(("b" + _local4) + "-") + _local3].y = 0;
this[(("b" + _local4) + "-") + _local3].lead = "";
this[(("b" + _local4) + "-") + _local3].leadTo = 0;
setEffect((("b" + _local4) + "-") + _local3, "blockPuff", 2);
_root.soundFX("BlockPuff");
check3(this[(("b" + _local4) + "-") + _local3]._currentframe, _local4, _local3);
}
} else if (this[(("b" + _local4) + "-") + _local3]._y > (this[(("b" + _local4) + "-") + (_local3 - 1)]._y - block.height)) {
this[(("b" + _local4) + "-") + _local3]._y = this[(("b" + _local4) + "-") + (_local3 - 1)]._y - block.height;
this[(("b" + _local4) + "-") + _local3].fall = this[(("b" + _local4) + "-") + (_local3 - 1)].fall;
this[(("b" + _local4) + "-") + _local3].fuel = this[(("b" + _local4) + "-") + (_local3 - 1)].fuel;
this[(("b" + _local4) + "-") + _local3].y = this[(("b" + _local4) + "-") + (_local3 - 1)].y;
this[(("b" + _local4) + "-") + _local3].lead = "";
this[(("b" + _local4) + "-") + _local3].leadTo = 0;
setEffect((("b" + _local4) + "-") + _local3, "blockPuff", 2);
_root.soundFX("BlockPuff");
check3(this[(("b" + _local4) + "-") + _local3]._currentframe, _local4, _local3);
if ((this[(("b" + _local4) + "-") + _local3].y == 0) && (_local3 > area.bheight)) {
}
}
}
_local3++;
}
_local4++;
}
}
function newBlock(fCol, fType) {
if (col[fCol] >= area.bheight) {
game = 0;
}
if ((col[fCol] < area.bheight) && ((col[fCol] == 0) || ((this[(("b" + fCol) + "-") + col[fCol]]._y - block.height) < area.height))) {
trace("F COL: " + col[fCol]);
blocks = blocks + 1;
col[fCol] = col[fCol] + 1;
fName = (("b" + fCol) + "-") + col[fCol];
this.attachMovie("block" + block.type, fName, (fCol * 100) + col[fCol]);
this[fName].fall = 0;
this[fName].fall = 1;
this[fName].lead = "";
this[fName].fuel = 200;
this[fName].y = 0;
this[fName].col = fCol;
this[fName].nr = col[fCol];
changeBlock(fName, fType);
this[fName]._y = ((-area.height) - block.height) - Math.round(this[fName].y / 2);
this[fName]._x = (fCol - 1) * block.width;
this[fName]._xscale = block.scale;
this[fName]._yscale = block.scale;
setEffect(fName, "schweif", 1);
if (isometric != true) {
this[fName].iso._visible = false;
}
}
}
function switchBlock(fCol, fNr) {
if ((game == 1) || (game == -1)) {
if (((this[(("b" + fCol) + "-") + (fNr + 1)]._x != undefined) && (this[(("b" + fCol) + "-") + fNr].fall != 1)) && (this[(("b" + fCol) + "-") + (fNr + 1)].fall != 1)) {
fName = ("b" + fCol) + "-";
fFrame1 = this[fName + fNr]._currentframe;
fFrame2 = this[fName + (fNr + 1)]._currentframe;
changeBlock(fName + fNr, fFrame2);
changeBlock(fName + (fNr + 1), fFrame1);
check3(fFrame2, fCol, fNr);
check3(fFrame1, fCol, fNr + 1);
}
}
}
function removeBlock(fCol) {
blocks = blocks - 1;
fName = (("b" + fCol) + "-") + col[fCol];
if (this[fName].lead == "leader") {
var _local2 = fCol + 1;
while (_local2 <= this[fName].leadTo) {
trace("LEAD-REMOVED!!!!");
this[(("b" + _local2) + "-") + col[fCol]].lead = "";
_local2++;
}
}
this[(("b" + fCol) + "-") + col[fCol]].removeMovieClip();
col[fCol] = col[fCol] - 1;
}
function check3(fType, fCol, fNr) {
if (fType == 1) {
checkRow(fNr);
} else {
fHFirst = 0;
fHLast = 0;
fVFirst = 0;
fVLast = 0;
z1 = fNr;
while (((this[(("b" + fCol) + "-") + z1]._currentframe == fType) && (this[(("b" + fCol) + "-") + z1].y == this[(("b" + fCol) + "-") + fNr].y)) && (this[(("b" + fCol) + "-") + z1]._x != undefined)) {
fVFirst = z1;
z1--;
}
z1 = fNr;
while (((this[(("b" + fCol) + "-") + z1]._currentframe == fType) && (this[(("b" + fCol) + "-") + z1].y == this[(("b" + fCol) + "-") + fNr].y)) && (this[(("b" + fCol) + "-") + z1]._x != undefined)) {
fVLast = z1;
z1++;
}
z1 = fCol;
while (((this[(("b" + z1) + "-") + fNr]._currentframe == fType) && (this[(("b" + z1) + "-") + fNr].y == this[(("b" + fCol) + "-") + fNr].y)) && (this[(("b" + z1) + "-") + fNr]._x != undefined)) {
fHFirst = z1;
z1--;
}
z1 = fCol;
while (((this[(("b" + z1) + "-") + fNr]._currentframe == fType) && (this[(("b" + z1) + "-") + fNr].y == this[(("b" + fCol) + "-") + fNr].y)) && (this[(("b" + z1) + "-") + fNr]._x != undefined)) {
fHLast = z1;
z1++;
}
if ((fVLast - fVFirst) >= 2) {
_root.soundFX("RocketBlast");
if (this[(("b" + fCol) + "-") + fVFirst].fall == 2) {
fName = getBottom(fCol, fVFirst);
this[fName].fall = 2;
this[fName].fuel = fuelTank[fType];
this[fName].y = -speed[fType];
setEffect((("b" + fCol) + "-") + bottomNr, "flame", 1);
addEffectVar("fuel", fuelTank[fType], 2);
z1 = fVFirst;
while (z1 <= fVLast) {
changeBlock((("b" + fCol) + "-") + z1, 1);
launchEffects((("b" + fCol) + "-") + z1);
z1++;
}
special("combo", 50);
} else {
special("launch", 50);
z1 = fVFirst;
while (z1 <= fVLast) {
changeBlock((("b" + fCol) + "-") + z1, 1);
this[(("b" + fCol) + "-") + z1].fall = 2;
this[(("b" + fCol) + "-") + z1].fuel = fuelTank[fType];
this[(("b" + fCol) + "-") + z1].lead = "";
this[(("b" + fCol) + "-") + z1].leadTo = 0;
this[(("b" + fCol) + "-") + z1].y = -speed[fType];
addScore(speed[fType]);
z1++;
}
setEffect((("b" + fCol) + "-") + fVFirst, "flame", 1);
addEffectVar("fuel", fuelTank[fType], 2);
setEffect((("b" + fCol) + "-") + fVFirst, "blockPuff2", 1);
launchEffects((("b" + fCol) + "-") + fVFirst);
}
}
if ((fHLast - fHFirst) >= 2) {
_root.soundFX("RocketBlast");
if (this[(("b" + fHFirst) + "-") + fNr].fall == 2) {
fName = getBottom(fHFirst, fNr);
this[fName].fall = 2;
this[fName].fuel = fuelTank[fType];
this[fName].y = -speed[fType];
trace("BOOST: " + this[fName].fuel);
trace("Block: " + fName);
z1 = fHFirst;
while (z1 <= fHLast) {
setEffect((("b" + z1) + "-") + bottomNr, "flame", 1);
addEffectVar("fuel", fuelTank[fType], 2);
launchEffects((("b" + z1) + "-") + fNr);
changeBlock((("b" + z1) + "-") + fNr, 1);
z1++;
}
special("combo", 50);
} else {
special("launch", 50);
z1 = fHFirst;
while (z1 <= fHLast) {
changeBlock((("b" + z1) + "-") + fNr, 1);
this[(("b" + z1) + "-") + fNr].fall = 0;
this[(("b" + z1) + "-") + fNr].fuel = fuelTank[fType];
this[(("b" + z1) + "-") + fNr].lead = "";
this[(("b" + z1) + "-") + fNr].leadTo = 0;
this[(("b" + z1) + "-") + fNr].y = -speed[fType];
addScore(speed[fType]);
setEffect((("b" + z1) + "-") + fNr, "flame", 1);
addEffectVar("fuel", fuelTank[fType], 2);
setEffect((("b" + z1) + "-") + fNr, "blockPuff2", 1);
launchEffects((("b" + z1) + "-") + fNr);
z1++;
}
}
getLead(fNr, speed[fType]);
}
}
}
function getBottom(col, fStart) {
z1 = fStart;
while (this[(("b" + col) + "-") + z1].fall == 2) {
fNr = z1;
z1--;
}
trace((("bottomPart: " + col) + "-") + fNr);
fName = (("b" + col) + "-") + fNr;
if (this[fName].lead != "leader") {
fName = this[fName].lead;
trace("No Leader");
}
trace("!!!!!BottomLeader: " + fName);
bottomNr = fNr;
return(fName);
}
function countTop(fCol, fColTo, fNr) {
fCount = 0;
z1 = fCol;
while (z1 < fColTo) {
z2 = fNr + 2;
while ((this[(("b" + z1) + "-") + z2]._x != undefined) && (this[(("b" + z1) + "-") + z2].y == this[(("b" + z1) + "-") + (z2 - 1)].y)) {
fCount = fCount + 1;
z2++;
}
z1++;
}
trace("countTop: " + fCount);
if (fCount > 5) {
fCount = 5;
}
return(fCount);
}
function getLead(fNr, fSpeed) {
fLead = 0;
fLeadStart = 0;
z1 = 1;
while (z1 <= (col.total + 1)) {
if (((this[(("b" + z1) + "-") + fNr]._currentframe == 1) && (this[(("b" + z1) + "-") + fNr].fall == 0)) && (z1 <= col.total)) {
if (fLead == 0) {
this[(("b" + z1) + "-") + fNr].lead = "leader";
fLeadStart = parseInt(z1);
fLead = (("b" + z1) + "-") + fNr;
} else {
this[(("b" + z1) + "-") + fNr].lead = fLead;
}
} else {
this[(("b" + z1) + "-") + fNr].lead = "";
this[fLead].leadTo = z1 - 1;
if (fLeadStart != 0) {
if (this[fLead].y < 0) {
trace("LAUNCHER");
this[fLead].fall = 2;
}
trace("LeadBoost: " + this[fLead].fuel);
trace("LeadBlock: " + fLead);
z2 = fLeadStart;
while (z2 < z1) {
if (this[(("b" + z2) + "-") + fNr].y < this[fLead].y) {
this[fLead].y = this[(("b" + z2) + "-") + fNr].y;
this[fLead].fall = 2;
}
if (this[(("b" + z2) + "-") + fNr].fuel > this[fLead].fuel) {
this[fLead].fuel = this[(("b" + z2) + "-") + fNr].fuel;
}
z2++;
}
z2 = fLeadStart;
while (z2 < z1) {
this[(("b" + z2) + "-") + fNr].y = this[fLead].y;
this[(("b" + z2) + "-") + fNr]._y = this[fLead]._y;
this[(("b" + z2) + "-") + fNr].fall = this[fLead].fall;
this[(("b" + z2) + "-") + fNr].fuel = this[fLead].fuel;
trace((("setLead: b" + z2) + "-") + fNr);
z2++;
}
}
fLeadStart = 0;
fLead = 0;
}
z1++;
}
if (fLead != 0) {
this[fLead].leadTo = parseInt(col.total);
fLead = 0;
}
}
function checkRow(fNr) {
if (rowCheck[fNr] >= 0) {
z1 = 1;
while (z1 <= col.total) {
if ((this[(("b" + z1) + "-") + fNr]._currentframe == 1) && (this[(("b" + z1) + "-") + fNr].fall == 0)) {
if (z1 == col.total) {
special("!row!", 200);
trace("----row----");
z2 = 1;
while (z2 <= col.total) {
setEffect((("b" + z2) + "-") + fNr, "blockPuff2", 1);
z3 = fNr;
while (z3 <= area.bheight) {
fName = (("b" + z2) + "-") + z3;
fName2 = (("b" + z2) + "-") + (z3 + 1);
if (z3 == col[z2]) {
removeBlock(z2);
} else {
changeBlock(fName, this[fName2]._currentframe);
this[fName]._y = this[fName2]._y;
this[fName].y = this[fName2].y;
this[fName].lead = "";
this[fName].leadTo = 0;
this[fName].fall = 1;
}
z3++;
}
z2++;
}
fName = "b1-" + fNr;
setEffectCoord(this[fName]._x, this[fName]._y + block.height, "rowClear", 1);
_root.soundFX("BlockPuff", 90);
}
} else {
break;
}
z1++;
}
rowCheck[fNr] = 1;
}
}
function setEffect(fBlock, fEffect, fID) {
if (detail >= fID) {
addEffect(fID);
this.attachMovie(fEffect, (fID + "effect") + effect[fID], (effect[fID] + 2000) + ((fID - 1) * 45));
this[(fID + "effect") + effect[fID]].name = fBlock;
this[(fID + "effect") + effect[fID]]._x = this[fBlock]._x;
this[(fID + "effect") + effect[fID]]._y = this[fBlock]._y;
this[(fID + "effect") + effect[fID]]._xscale = block.scale;
this[(fID + "effect") + effect[fID]]._yscale = block.scale;
}
}
function addEffectVar(fVarName, fValue, fID) {
this[(fID + "effect") + effect[fID]][fVarName] = fValue;
trace("ADD EFFECT VAR!!: " + this[(fID + "effect") + effect[fID]][fVarName]);
}
function setEffectCoord(fX, fY, fEffect, fID) {
addEffect(fID);
this.attachMovie(fEffect, (fID + "effect") + effect[fID], (effect[fID] + 2000) + ((fID - 1) * 45));
this[(fID + "effect") + effect[fID]]._x = fX;
this[(fID + "effect") + effect[fID]]._y = fY;
}
function addEffect(fID) {
effect[fID] = effect[fID] + 1;
if (effect[fID] > 40) {
effect[fID] = 1;
}
}
function addScore(fAdd) {
trace("score Plus: " + fAdd);
score = score + fAdd;
if (score >= nextScore) {
nextScore = nextScore + nextScoreStep;
difficulty = difficulty + 1;
timerMax = (10 - parseInt(difficulty)) * 2;
if (difficulty > 11) {
timerMax = timerMax + ((difficulty - 11) * 2);
timerA = (1 + difficulty) - 10;
}
special("Level UP!", 200);
}
}
function changeBlock(fBlock, fFrame) {
this[fBlock].gotoAndStop(fFrame);
this[fBlock].iso.gotoAndStop(fFrame);
this[fBlock].b.gotoAndStop(block.style);
}
function special(fName, fScore) {
addScore(fScore);
specialScore = fName;
this.specialMC.attachMovie("special", "specialText", 1);
this.specialMC.specialText.text = fName;
this.specialMC.specialText._x = 0;
this.specialMC.specialText._y = 0;
}
function blockDrag() {
var _local2 = 1;
while (_local2 <= getYmouseBlockNr()) {
fBlock = (("b" + dragCol) + "-") + _local2;
if (((((_local2 != cBlockDrag) && (_local2 > 0)) && (_local2 <= col[dragCol])) && (_ymouse >= this[fBlock]._y)) && (_ymouse <= (this[fBlock]._y + block.height))) {
if (_local2 > cBlockDrag) {
var _local3 = cBlockDrag;
while (_local3 < _local2) {
switchBlock(dragCol, _local3);
_local3++;
}
} else {
var _local3 = cBlockDrag;
while (_local3 > _local2) {
switchBlock(dragCol, _local3 - 1);
_local3--;
}
}
cBlockDrag = _local2;
setEffect((("b" + dragCol) + "-") + cBlockDrag, "selectBlock", 1);
trace("!!!!!!!!!!!!!!!!!!!!!!!" + cBlockDrag);
break;
}
_local2++;
}
}
function startBlockDrag(fCol, fNr) {
if (dragCol == null) {
dragCol = fCol;
setEffect((("b" + fCol) + "-") + fNr, "selectBlock", 1);
cBlockDrag = fNr;
} else if (fCol == dragCol) {
switchBlock(dragCol, fNr);
trace("!!!!!!!!!!!!!!!!!!!!!!!" + fNr);
}
}
function endBlockDrag() {
dragCol = null;
}
function getYmouseBlockNr() {
return(-Math.round((_ymouse - (block.height / 2)) / block.height));
}
function getHighest() {
var _local1 = 1;
while (_local1 <= area.bwidth) {
if (col[_local1] > col[fCol]) {
fCol = _local1;
}
_local1++;
}
warningBar._alpha = ((col[fCol] - 12) / area.bheight) * (area.bheight * 12);
}
function launchEffects(fBlock) {
setEffect(fBlock, "launch", 2);
}
top.swapDepths(2500);
warningBar._alpha = 0;
rowCheck = new Array();
col = new Array();
col.total = Math.round(area.width / block.width);
area.bwidth = col.total;
area.bheight = Math.round(area.height / block.height);
area.shake = _root.shake;
if (_root.isometric == 1) {
isometric = true;
} else {
isometric = false;
}
dragCol = null;
blocks = 0;
score = 0;
normX = _x;
normY = _y;
shake = 0;
shakeZ = 0;
highest = new Array();
bottomNr = 0;
nextScore = 5000;
nextScoreStep = 5000;
area.colors = _root.colors;
speed = new Array();
speed[1] = 0;
speed[2] = 15;
speed[3] = 20;
speed[4] = 23;
speed[5] = 26;
speed[6] = 17;
speed[7] = 28;
speed[8] = 30;
gravity = parseInt(_root.gravity);
fuelTank = new Array();
fuelTank[1] = 0;
fuelTank[2] = _root.fuel;
fuelTank[3] = _root.fuel;
fuelTank[4] = _root.fuel;
fuelTank[5] = _root.fuel;
fuelTank[6] = _root.fuel;
fuelTank[7] = _root.fuel;
fuelTank[8] = Math.round(_root.fuel / 2.5);
game = 2;
destroyCol = 0;
destroyNr = 0;
effect = new Array();
effect[1] = 0;
effect[2] = 0;
effect[3] = 0;
var z1 = 1;
while (z1 <= col.total) {
col[z1] = 0;
z1++;
}
Symbol 221 Button
on (keyPress "<Up>") {
if (area.game == 1) {
trace("PAUSE");
area.game = -5;
} else if (area.game == -5) {
trace("PLAY");
area.game = 1;
}
}
on (keyPress "<Backspace>") {
play();
}
Symbol 236 Button
on (press) {
down = 1;
}
on (release, releaseOutside) {
down = 0;
}