Frame 1
var M1Snd = new Sound();
M1Snd.attachSound("030_menu1");
var M2Snd = new Sound();
M2Snd.attachSound("031_menu2");
var M3Snd = new Sound();
M3Snd.attachSound("032_menu3");
var M21Snd = new Sound();
M21Snd.attachSound("026_menu21");
var M22Snd = new Sound();
M22Snd.attachSound("027_menu22");
var M23Snd = new Sound();
M23Snd.attachSound("028_menu23");
var MSnd = new Sound();
MSnd.attachSound("029_menu");
var MCSnd = new Sound();
MCSnd.attachSound("033_menuclick");
var mentorappSnd = new Sound();
mentorappSnd.attachSound("022_mentorapp");
var startlevelSnd = new Sound();
startlevelSnd.attachSound("048_start1msg");
var levelcompletedSnd = new Sound();
levelcompletedSnd.attachSound("020_levelcompleted");
var showpicSnd = new Sound();
showpicSnd.attachSound("019_flowers3msg");
var timeoutSnd = new Sound();
timeoutSnd.attachSound("051_timeout");
var timewarningSnd = new Sound();
timewarningSnd.attachSound("052_timewarning");
var twigsdropSnd = new Sound();
twigsdropSnd.attachSound("062_twigsdrop");
var rotatetwigSnd = new Sound();
rotatetwigSnd.attachSound("061_twigrotate");
var connectedSnd = new Sound();
connectedSnd.attachSound("008_chainconnected3");
var deletedSnd = new Sound();
deletedSnd.attachSound("009_chaindeleted1");
var wondSnd = new Sound();
wondSnd.attachSound("021_magicwand");
var LD_LevelMap1 = [[0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 1, 1, 1, 1, 1, 1, 0], [0, 0, 1, 1, 1, 1, 1, 1, 0], [0, 0, 1, 1, 1, 1, 1, 1, 0], [0, 0, 1, 1, 1, 1, 1, 1, 0], [0, 0, 1, 1, 1, 1, 1, 1, 0], [0, 0, 1, 1, 1, 1, 1, 1, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0]];
var LD_LevelMap2 = [[0, 0, 2, 1, 1, 1, 1, 2, 0], [0, 2, 1, 1, 1, 1, 1, 1, 2], [0, 1, 1, 1, 1, 1, 1, 1, 1], [0, 1, 1, 1, 1, 1, 1, 1, 1], [0, 1, 1, 1, 1, 1, 1, 1, 1], [0, 1, 1, 1, 1, 1, 1, 1, 1], [0, 2, 1, 1, 1, 1, 1, 1, 2], [0, 0, 2, 1, 1, 1, 1, 2, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0]];
var LD_LevelMap3 = [[0, 1, 1, 1, 1, 1, 1, 1, 1], [0, 1, 2, 2, 1, 1, 2, 2, 1], [0, 1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 1, 2, 2, 1, 0, 0], [0, 0, 0, 1, 2, 2, 1, 0, 0], [0, 1, 1, 1, 1, 1, 1, 1, 1], [0, 1, 2, 2, 1, 1, 2, 2, 1], [0, 1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0]];
var LD_LevelMap4 = [[1, 1, 0, 1, 1, 1, 0, 1, 1], [1, 1, 0, 1, 1, 1, 0, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 2, 1, 1, 1], [1, 1, 1, 2, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 0, 1, 1, 1, 0, 1, 1], [1, 1, 0, 1, 1, 1, 0, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0]];
var LD_LevelMap5 = [[1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 2, 3, 3, 3, 2, 1, 1], [0, 0, 1, 3, 3, 3, 1, 0, 0], [0, 0, 1, 3, 3, 3, 1, 0, 0], [1, 1, 1, 3, 3, 3, 1, 1, 1], [1, 2, 3, 3, 3, 3, 3, 2, 1], [1, 1, 1, 1, 3, 1, 1, 1, 1], [1, 1, 0, 1, 3, 1, 0, 1, 1], [1, 1, 0, 1, 2, 1, 0, 1, 1]];
var TL_ttype = [[0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 1, 2, 5, 0, 0, 0], [0, 0, 0, 0, 0, 2, 0, 0, 0], [0, 0, 0, 0, 0, 5, 1, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0]];
var TL_trot = [[0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 180, 0, 180, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0]];
var TL_flower = [[0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 3, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 2, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0]];
var BLOCKNUMX = 9;
var BLOCKNUMY = 9;
var GD_LEVELS = 5;
var GD_LIVES = 3;
var GD_WONDS = 5;
var GD_TIMES = [4000, 3500, 3000, 2500, 2500];
var Showhelp = true;
var CurrentScore = 0;
var OldScore = 0;
var CurrentLevel = 1;
var Lives = GD_LIVES;
var OldLives = GD_LIVES;
var Wonds = GD_WONDS;
var OldWonds = GD_WONDS;
var NextLevel = 1;
var ComletedF = false;
var LevelMap = new Array(BLOCKNUMY);
var i = 0;
while (i < BLOCKNUMY) {
LevelMap[i] = new Array(BLOCKNUMX);
i++;
}
shadow._visible = false;
Frame 2
function ef_go() {
progress.setprogress((this.getBytesLoaded() / this.getBytesTotal()) * 100);
if (this.getBytesLoaded() == this.getBytesTotal()) {
this.onEnterFrame = undefined;
_root.gotoAndStop("Menu");
}
}
if (_global.bypass == "true") {
if (_global.link != undefined) {
_root.link = _global.link;
}
if (_global.dload_f != undefined) {
_root.dload_f = _global.dload_f;
}
if (_global.close_f != undefined) {
_root.close_f = _global.close_f;
}
if (_global.alawar_f != undefined) {
_root.alawar_f = _global.alawar_f;
}
} else {
stop();
progress.init();
progress.start();
}
Stage.showMenu = false;
var so = SharedObject.getLocal("temp");
var inf = new Object();
inf.flag = "inf";
inf.showhelp = true;
inf.level = 1;
inf.nlevel = 1;
inf.lives = GD_LIVES;
inf.wonds = GD_WONDS;
inf.score = 0;
inf.completedf = false;
if (so.data.content.flag == "inf") {
inf.showhelp = so.data.content.showhelp;
inf.nlevel = so.data.content.nlevel;
inf.level = so.data.content.level;
inf.lives = so.data.content.lives;
inf.score = so.data.content.score;
inf.wonds = so.data.content.wonds;
inf.completedf = so.data.content.completedf;
Showhelp = inf.showhelp;
NextLevel = inf.nlevel;
CurrentLevel = inf.level;
Lives = inf.lives;
Wonds = inf.wonds;
CurrentScore = inf.score;
CompletedF = inf.completedf;
}
Frame 3
stop();
if (nlflag != true) {
menu.gotoAndStop(1);
} else {
nlflag = undefined;
menu.gotoAndStop(3);
}
Frame 9
var cnt = 0;
_test.onPress = function () {
if (cnt == 0) {
cnt++;
} else if (cnt == 1) {
cnt = 0;
}
};
stop();
_root.shadow.hide();
gamedy.init(CurrentLevel);
gamedy.start();
Frame 10
stop();
_root.shadow.hide();
GotoDownload = function () {
if (_root.link != undefined) {
getURL (link, "_blank");
} else {
getURL ("http://www.alawar.com/download/FlowerQuest.exe", "_blank");
}
if (_root.dload_f != undefined) {
cstr = ("JavaScript:" + _root.dload_f) + "()";
getURL (cstr);
}
};
Symbol 28 MovieClip [_star_] Frame 21
this.removeMovieClip();
Symbol 149 MovieClip Frame 1
stop();
this.onEnterFrame = function () {
if ((Math.floor(Math.random() * 210) == 75) && (this._currentframe == 1)) {
this.play();
}
};
Symbol 151 MovieClip [_fl_] Frame 1
function init() {
Status = "_NORMAL";
if (flower > 0) {
this.attachMovie(("_flower" + flower) + "_", "F", this.getNextHighestDepth());
F._x = F._width / 2;
F._y = F._height / 2;
F.nfl._visible = true;
F.gfl._visible = false;
F.rfl._visible = false;
}
tmove();
}
function tmove() {
this.onEnterFrame = ef_tmove;
}
function ef_tmove() {
if ((this._y + _parent.YSTEP) < (_parent.DY + (yn * _parent.BSY))) {
this._y = this._y + _parent.YSTEP;
} else {
this._y = _parent.DY + (yn * _parent.BSY);
if (_parent[(("TW_" + yn) + "_") + xn] != undefined) {
_parent[(("TW_" + yn) + "_") + xn].refreshflower(flower);
}
this.onEnterFrame = undefined;
this.removeMovieClip();
}
}
var Cnt;
var Status;
init();
Symbol 152 MovieClip [_tw_] Frame 1
function init() {
Status = "_NORMAL";
rotatef = false;
if (tdata.ttype != 6) {
this.attachMovie(("_twig" + tdata.ttype) + "_", "T", this.getNextHighestDepth());
T.ytw._rotation = tdata.trot;
T.gtw._rotation = T.ytw._rotation;
T.rtw._rotation = T.ytw._rotation;
T.ytw._alpha = 100;
T.gtw._alpha = 0;
T.rtw._alpha = 0;
}
if (tdata.flower != 0) {
this.attachMovie(("_flower" + tdata.flower) + "_", "F", this.getNextHighestDepth());
F._x = F._width / 2;
F._y = F._height / 2;
F.nfl._visible = true;
F.gfl._visible = false;
F.rfl._visible = false;
}
tmove();
}
function refreshflower(flwr) {
tdata.flower = flwr;
if (F != undefined) {
F.removeMovieClip();
}
this.attachMovie(("_flower" + tdata.flower) + "_", "F", this.getNextHighestDepth());
F._x = F._width / 2;
F._y = F._height / 2;
F.nfl._visible = true;
F.gfl._visible = false;
F.rfl._visible = false;
}
function rotatetw() {
if ((!rotatef) && (!tdata.tlock)) {
_root.rotatetwigSnd.start();
rotatef = true;
var _local3;
if (Status == "_TOGREEN") {
this.onEnterFrame = undefined;
}
T.ytw._alpha = 100;
T.gtw._alpha = 0;
T.rtw._alpha = 0;
Status = "_YELLOW";
_local3 = tdata.trot + 90;
T.newtrot = _local3;
T.onEnterFrame = ef_rotatetw;
}
}
function ef_rotatetw() {
var _local3 = this.newtrot;
var _local4 = this.ytw._rotation;
if ((_local4 < 0) || ((_local4 == 0) && (_local3 != 90))) {
_local4 = _local4 + 360;
}
if ((_local4 + _root.gamedy.twigs.RSTEP) < _local3) {
this.ytw._rotation = this.ytw._rotation + _root.gamedy.twigs.RSTEP;
this.gtw._rotation = this.gtw._rotation + _root.gamedy.twigs.RSTEP;
this.rtw._rotation = this.rtw._rotation + _root.gamedy.twigs.RSTEP;
} else {
this.onEnterFrame = undefined;
rotatef = false;
if (this._parent.tdata.tlock != true) {
if (_local3 == 360) {
_local3 = 0;
}
this.ytw._rotation = _local3;
this.gtw._rotation = _local3;
this.rtw._rotation = _local3;
this._parent.tdata.trot = _local3;
_root.gamedy.twigs.copyobj(_root.gamedy.twigs.gettwdir(this._parent.tdata.ttype, _local3), this._parent.tdata.tdir);
_root.gamedy.twigs.checktwigs();
}
}
}
function tmove() {
tdata.tlock = true;
T.ytw._alpha = 100;
T.rtw._alpha = 0;
T.gtw._alpha = 0;
F.nfl._visible = true;
F.rfl._visible = false;
F.gfl._visible = false;
Cnt = 0;
this.onEnterFrame = ef_tmove;
}
function ef_tmove() {
if ((tdata.ttype != 6) && ((this._y + _parent.YSTEP) < (_parent.DY + (yn * _parent.BSY)))) {
if (slow) {
this._y = this._y + (_parent.YSTEP / 2.5);
} else {
this._y = this._y + _parent.YSTEP;
}
EndFlg = false;
} else {
this.ytw._rotation = tdata.trot;
this.gtw._rotation = tdata.trot;
this.rtw._rotation = tdata.trot;
this._y = _parent.DY + (yn * _parent.BSY);
if (ff) {
if (Cnt == 2) {
tdata.tlock = false;
_root.twigsdropSnd.start();
this.onEnterFrame = undefined;
if (!_parent.BeginF) {
_root.gamedy.twigs.checktwigs();
}
ff = false;
} else {
Cnt++;
}
} else {
tdata.tlock = false;
_root.twigsdropSnd.start();
this.onEnterFrame = undefined;
}
if (slow) {
slow = undefined;
}
}
}
function togreen() {
Status = "_TOGREEN";
main = undefined;
ToRed = undefined;
T.gtw._alpha = 100;
T.rtw._alpha = 0;
this.onEnterFrame = ef_togreen;
}
function ef_togreen() {
if (T.ytw._alpha > 0) {
T.ytw._alpha = T.ytw._alpha - _parent.TWSSTEP;
} else {
T.ytw._alpha = 0;
Status = "_GREEN";
this.onEnterFrame = undefined;
}
}
function toyellow() {
main = undefined;
ToRed = undefined;
if (Status != "_YELLOW") {
Status = "_TOYELLOW";
T.gtw._alpha = 100;
T.rtw._alpha = 0;
this.onEnterFrame = ef_toyellow;
} else {
this.onEnterFrame = undefined;
}
}
function ef_toyellow() {
if (T.ytw._alpha < 100) {
T.ytw._alpha = T.ytw._alpha + _parent.TWHSTEP;
} else {
Status = "_YELLOW";
T.ytw._alpha = 100;
T.gtw._alpha = 0;
this.onEnterFrame = undefined;
}
}
function tored() {
if (ToRed != tdata.trot) {
SkipToRed = undefined;
T.ytw._alpha = 0;
T.rtw._alpha = 100;
T.gtw._alpha = 100;
F.nfl._visible = false;
F.rfl._visible = true;
F.gfl._visible = true;
Cnt = 0;
ToRed = tdata.trot;
this.onEnterFrame = ef_tored;
if (main) {
_root.connectedSnd.start();
}
} else {
SkipToRed = true;
}
}
function ef_tored() {
if (_parent.WinF) {
T.ytw._alpha = 100;
T.rtw._alpha = 0;
T.gtw._alpha = 0;
F.nfl._visible = true;
F.rfl._visible = false;
F.gfl._visible = false;
return(undefined);
}
if (Cnt < _parent.LIFETIME) {
if (_parent.ktmr.Cnt2 == 0) {
T.gtw._alpha = 0;
F.gfl._visible = true;
}
if (_parent.ktmr.Cnt2 >= (_parent.FLASHTIME / 2)) {
T.gtw._alpha = 100;
F.gfl._visible = false;
}
} else if (Cnt == _parent.LIFETIME) {
tdata.tlock = true;
tdata.mark = undefined;
T.onEnterFrame = undefined;
T.ytw._alpha = 0;
T.rtw._alpha = 100;
T.gtw._alpha = 0;
_root.gamedy.board.blocks.removeblock(this.yn, this.xn);
if (main) {
_root.deletedSnd.start();
}
if (F != undefined) {
F.removeMovieClip();
_root.gamedy.flowereffect.showeffect(this.yn, this.xn);
}
} else if (this._xscale > _parent.KSTEP) {
var _local5 = this._width;
var _local4 = this._height;
this._xscale = this._xscale - this._parent.KSTEP;
this._yscale = this._xscale;
this._x = this._x + ((_local5 - this._width) / 2);
this._y = this._y + ((_local4 - this._height) / 2);
} else {
this._xscale = 0;
this._yscale = 0;
tdata.ttype = -1;
tdata.mark = undefined;
if (main) {
if (flg) {
_root.gamedy.scorefortwig();
this.onEnterFrame = undefined;
_parent.afterkill(this);
} else {
flg = true;
}
} else {
_root.gamedy.scorefortwig();
this.onEnterFrame = undefined;
this.removeMovieClip();
}
}
Cnt++;
}
function wondtw() {
if (!SkipToRed) {
_root.wondSnd.start();
T.ytw._alpha = 0;
T.rtw._alpha = 100;
T.gtw._alpha = 0;
F.nfl._visible = false;
F.rfl._visible = true;
F.gfl._visible = true;
tdata.tlock = true;
tdata.mark = undefined;
T.onEnterFrame = undefined;
_root.gamedy.board.blocks.removeblock(this.yn, this.xn);
F.removeMovieClip();
_root.gamedy.flowereffect.showeffect(this.yn, this.xn);
this.onEnterFrame = ef_wondtw;
_parent._parent.wondcur.wondreset();
_root.Wonds--;
_parent._parent.wondsbox.text = _root.Wonds;
}
}
function ef_wondtw() {
if (this._xscale > _parent.KSTEP) {
var _local5 = this._width;
var _local4 = this._height;
this._xscale = this._xscale - this._parent.KSTEP;
this._yscale = this._xscale;
this._x = this._x + ((_local5 - this._width) / 2);
this._y = this._y + ((_local4 - this._height) / 2);
} else {
this._xscale = 0;
this._yscale = 0;
tdata.ttype = -1;
tdata.mark = undefined;
_root.gamedy.scorefortwig();
this.onEnterFrame = undefined;
_parent.afterkill(this);
}
}
var Cnt;
var Status;
var rotatef;
init();
Symbol 154 MovieClip Frame 1
function hide() {
Status = "_HIDE";
this._visible = true;
this._alpha = 100;
this.onEnterFrame = ef_hide;
}
function ef_hide() {
if (this._alpha > 0) {
this._alpha = this._alpha - HSTEP;
} else {
this._alpha = 100;
this._visible = false;
this.onEnterFrame = undefined;
Status = "_READY";
}
}
function show() {
Status = "_SHOW";
this._visible = true;
this._alpha = 0;
this.onEnterFrame = ef_show;
}
function ef_show() {
if (this._alpha < 100) {
this._alpha = this._alpha + SSTEP;
} else {
this._alpha = 100;
this.onEnterFrame = undefined;
Status = "_READY";
}
}
var HSTEP = 12;
var SSTEP = 20;
var Status;
Symbol 162 MovieClip Frame 1
function init() {
this._alpha = 0;
up1._x = INITXUP;
down1._x = INITXDOWN - (1 * down1._width);
if (up2 != undefined) {
removeMovieClip(up2);
}
if (down2 != undefined) {
removeMovieClip(down2);
}
if (up3 != undefined) {
removeMovieClip(up3);
}
if (down3 != undefined) {
removeMovieClip(down3);
}
}
function start() {
duplicateMovieClip (up1, "up2", this.getNextHighestDepth());
duplicateMovieClip (up1, "up3", this.getNextHighestDepth());
duplicateMovieClip (down1, "down2", this.getNextHighestDepth());
duplicateMovieClip (down1, "down3", this.getNextHighestDepth());
up2._x = up1._width;
up3._x = up1._width * 2;
down2._x = 0;
down3._x = down1._width;
this.onEnterFrame = ef_start;
}
function ef_start() {
up1._x = up1._x - SHIFTSTEP;
up2._x = up2._x - SHIFTSTEP;
up3._x = up3._x - SHIFTSTEP;
down1._x = down1._x + SHIFTSTEP;
down2._x = down2._x + SHIFTSTEP;
down3._x = down3._x + SHIFTSTEP;
i = 1;
while (i <= 3) {
if (this["up" + i]._x < (-1 * up1._width)) {
this["up" + i]._x = up1._width * 2;
}
if (this["down" + i]._x > (2 * down1._width)) {
this["down" + i]._x = -1 * down1._width;
}
i++;
}
if (this._alpha <= (ALPHA - ALPHASTEP)) {
this._alpha = this._alpha + ALPHASTEP;
} else {
this._alpha = ALPHA;
}
}
var INITXUP = 0;
var INITXDOWN = 0;
var SHIFTSTEP = 1;
var ALPHASTEP = 0.7;
var ALPHA;
Symbol 164 MovieClip Frame 1
function init() {
text1.init();
text1.ALPHA = 75;
text2.init();
text2.ALPHA = 15;
}
function start() {
text1.start();
text2.start();
}
Symbol 168 MovieClip Frame 1
FirstTime = true;
Symbol 168 MovieClip Frame 28
if (FirstTime) {
stop();
FirstTime = false;
}
Symbol 168 MovieClip Frame 55
gotoAndPlay (2);
Symbol 188 MovieClip Frame 1
function start() {
Cnt = 0;
this.onEnterFrame = ef_start;
}
function ef_start() {
var _local3;
var _local4;
Cnt++;
if (Cnt < LFRAMES) {
i = 1;
while (i <= 10) {
_local4 = (INITAMP * Math.sin(((((Math.PI*2) / LFRAMES) / 4) * Cnt) + (Math.PI/4))) * (1 - (Cnt / LFRAMES));
_local3 = 100 - (_local4 * Math.sin((((Math.PI*2) / LFRAMES) * LPER) * ((Cnt + INITPH) + (i * LV))));
this["L" + i]._xscale = _local3;
this["L" + i]._yscale = _local3;
_local3 = this["L" + i]._xscale - 100;
if (_local3 > 0) {
if (_local3 > 19) {
this["L" + i]._alpha = (100 - (_local3 * 2.1)) - 20;
} else {
this["L" + i]._alpha = 100 - (_local3 * 2.1);
}
}
i++;
}
} else {
i = 1;
while (i <= 10) {
this["L" + i]._xscale = 100;
this["L" + i]._yscale = 100;
this["L" + i]._alpha = 100;
i++;
}
this.onEnterFrame = undefined;
_parent.dummy.onMouseMove = _parent.go;
}
}
function wave(cx) {
OldCX = CX;
CX = cx;
Cnt = 0;
startf = false;
this.onEnterFrame = ef_wave;
}
function ef_wave() {
var _local3;
var _local5;
var _local4;
Cnt++;
if ((Cnt > 1) && (!startf)) {
return(undefined);
}
if (Cnt < LFRAMES) {
i = 1;
while (i <= 10) {
_local4 = ((((Math.PI*2) * CX) / this._width) * 0.7) + 0.1;
_local5 = (INITAMP * Math.sin(((((Math.PI*2) / LFRAMES) / 4) * Cnt) + (Math.PI/4))) * (1 - (Cnt / LFRAMES));
if ((CX - OldCX) >= 0) {
_local3 = 100 - (_local5 * Math.sin(((((Math.PI*2) / LFRAMES) * LPER) * ((Cnt + INITPH) + (i * LV))) + _local4));
} else {
_local3 = 100 - (_local5 * Math.sin(((((Math.PI*2) / LFRAMES) * LPER) * ((Cnt + INITPH) - (i * LV))) + _local4));
}
if (_local3 < 100) {
_local3 = 100 - ((100 - _local3) * 0.8);
}
this["L" + i]._xscale = _local3;
this["L" + i]._yscale = _local3;
_local3 = this["L" + i]._xscale - 100;
if (_local3 > 0) {
if (_local3 > 18) {
this["L" + i]._alpha = (100 - (_local3 * 2.1)) - 20;
} else {
this["L" + i]._alpha = 100 - (_local3 * 2.1);
}
}
i++;
}
} else {
i = 1;
while (i <= 10) {
this["L" + i]._xscale = 100;
this["L" + i]._yscale = 100;
this["L" + i]._alpha = 100;
i++;
}
this.onEnterFrame = undefined;
_parent.dummy.onMouseMove = _parent.go;
}
}
var LFRAMES = 100;
var LPER = 3;
var INITAMP = 27;
var INITPH = 5;
var LV = 2;
var Cnt;
var CX;
var OldCX = 0;
var startf;
Symbol 194 MovieClip Frame 1
function go() {
if ((((dummy._xmouse < dummy._width) && (dummy._xmouse > 0)) && (dummy._ymouse < dummy._height)) && (dummy._ymouse > 0)) {
loading.wave(dummy._xmouse);
}
}
dummy.useHandCursor = false;
dummy.onRollOut = function () {
loading.startf = true;
};
Symbol 199 MovieClip Frame 1
function start() {
duplicateMovieClip (prnload, "prnload1", this.getNextHighestDepth());
duplicateMovieClip (prnload, "prnload2", this.getNextHighestDepth());
prnload._alpha = PRALPHAINIT;
prnload._xscale = PRMAGNINIT;
prnload._yscale = PRMAGNINIT;
prnload1._alpha = PRALPHAINIT1;
prnload1._xscale = PRMAGNINIT1;
prnload1._yscale = PRMAGNINIT1;
prnload2._alpha = PRALPHAINIT2;
prnload2._xscale = PRMAGNINIT2;
prnload2._yscale = PRMAGNINIT2;
this.onEnterFrame = ef1_start;
}
function ef1_start() {
if (prnload._xscale > 100) {
tmp = PRMAGNSTEP;
if ((prnload._xscale - tmp) < 0) {
tmp = prnload._xscale - 100;
}
prnload._xscale = prnload._xscale - tmp;
prnload._yscale = prnload._yscale - tmp;
prnload._alpha = prnload._alpha + (PRALPHASTEP * PRALPHASTEP);
} else {
prnload._xscale = prnload._xscale - 0.8;
prnload._yscale = prnload._yscale - 0.8;
}
if (prnload._xscale < PRSTART1) {
if (prnload1._xscale > 100) {
tmp = (PRMAGNSTEP1 * PRMAGNSTEP1) / 23;
if ((prnload1._xscale - tmp) < 100) {
tmp = prnload1._xscale - 100;
}
prnload1._xscale = prnload1._xscale - tmp;
prnload1._yscale = prnload1._yscale - tmp;
if (prnload._xscale > 100) {
prnload1._alpha = prnload1._alpha + (PRALPHASTEP1 * PRALPHASTEP1);
} else {
prnload1._alpha = prnload1._alpha - (PRALPHASTEP1 * PRALPHASTEP1);
}
} else {
removeMovieClip(prnload1);
}
}
if (prnload._xscale < PRSTART2) {
if (prnload2._xscale > 100) {
tmp = (PRMAGNSTEP2 * PRMAGNSTEP2) / 15.4;
if ((prnload2._xscale - tmp) < 100) {
tmp = prnload2._xscale - 100;
}
prnload2._xscale = prnload2._xscale - tmp;
prnload2._yscale = prnload2._yscale - tmp;
if (prnload1._xscale != 100) {
prnload2._alpha = prnload2._alpha + (PRALPHASTEP2 * PRALPHASTEP2);
} else {
prnload2._alpha = prnload2._alpha - (PRALPHASTEP2 * PRALPHASTEP2);
}
} else {
removeMovieClip(prnload2);
}
}
if (prnload2 == undefined) {
Cnt = 0;
prnload._alpha = 100;
shadow.play();
prnload.loading.start();
prnload.progress._alpha = 35;
this.onEnterFrame = ef2_start;
_root.onEnterFrame = _root.ef_go;
}
}
function ef2_start() {
Cnt++;
if (Cnt == TEXTSTART) {
text.start();
}
if (Cnt < WVFRAMES) {
tmp = 100 - ((WVINITAMP * (1 - (Cnt / WVFRAMES))) * Math.sin((((Math.PI * Cnt) / WVFRAMES) * WVPERIODS) + (Math.PI/4)));
prnload._xscale = tmp;
prnload._yscale = tmp;
maskmc._xscale = tmp;
maskmc._yscale = tmp;
filled._xscale = tmp;
filled._yscale = tmp;
} else {
this.onEnterFrame = undefined;
}
}
function init() {
text.init();
Cnt = 0;
this._alpha = 100;
htmp = maskmc.target._height;
ytmp = maskmc.target._y;
maskmc.target._height = 0;
maskmc.target._y = ytmp + htmp;
}
function setprogress(pr) {
maskmc.target._height = (pr * htmp) / 100;
maskmc.target._y = ytmp + (htmp * (1 - (pr / 100)));
}
var PRMAGNINIT = 1000;
var PRALPHAINIT = 0;
var PRMAGNSTEP = 25;
var PRALPHASTEP = 1.5;
var PRMAGNINIT1 = 1000;
var PRALPHAINIT1 = 0;
var PRMAGNSTEP1 = 25;
var PRALPHASTEP1 = 1.5;
var PRSTART1 = 700;
var PRMAGNINIT2 = 1000;
var PRALPHAINIT2 = 0;
var PRMAGNSTEP2 = 25;
var PRALPHASTEP2 = 1.6;
var PRSTART2 = 300;
var WVFRAMES = 85;
var WVINITAMP = 17;
var WVPERIODS = 3.5;
var TEXTSTART = 30;
var htmp;
var ytmp;
var Cnt;
Symbol 220 MovieClip Frame 1
stop();
this.onEnterFrame = function () {
if ((Math.floor(Math.random() * 210) == 75) && (this._currentframe == 1)) {
this.play();
}
};
Symbol 256 MovieClip Frame 1
function show() {
this._visible = true;
this.onEnterFrame = ef_show;
}
function ef_show() {
if (this._alpha < 100) {
this._alpha = this._alpha + STEP;
} else {
this._alpha = 100;
this.onEnterFrame = undefined;
}
}
function hide() {
this.onEnterFrame = ef_hide;
}
function ef_hide() {
if (this._alpha > 0) {
this._alpha = this._alpha - STEP;
} else {
this._alpha = 0;
this._visible = false;
this.onEnterFrame = undefined;
}
}
var STEP = 8;
Symbol 267 MovieClip Frame 1
function show(dn, cur) {
Dn = dn;
Cur = cur;
if (cur == _root.inf.level) {
_parent.arrow.showdots(Dn, Cur);
return(undefined);
}
this._visible = true;
this._alpha = 0;
this.onEnterFrame = ef_show;
}
function ef_show() {
if (this._alpha < (100 - ASTEP)) {
this._alpha = this._alpha + ASTEP;
} else {
this._alpha = 100;
this.onEnterFrame = undefined;
}
}
function hide() {
this.onEnterFrame = ef_hide;
}
function ef_hide() {
if (this._alpha >= ASTEP) {
this._alpha = this._alpha - ASTEP;
} else {
this._alpha = 100;
this._visible = false;
this.onEnterFrame = undefined;
}
}
var Dn;
var Cur;
var ASTEP = 20;
yesbtn.onRelease = function () {
_parent.arrow.showdots(Dn, Cur);
this._parent.hide();
};
nobtn.onRelease = function () {
this._parent.hide();
};
Symbol 281 Button
on (release) {
_root.MCSnd.start();
this.gotoAndStop(2);
_root.Showhelp = false;
}
Symbol 286 Button
on (release) {
_root.MCSnd.start();
this.gotoAndStop(1);
_root.Showhelp = true;
}
Symbol 287 MovieClip Frame 1
stop();
Symbol 287 MovieClip Frame 2
stop();
Symbol 288 MovieClip Frame 1
function show() {
area.useHandCursor = false;
if (game == true) {
checkb._visible = true;
helpwond._visible = false;
} else {
checkb._visible = false;
helpwond._visible = true;
}
this._visible = true;
this._alpha = 0;
this.onEnterFrame = ef_show;
}
function ef_show() {
if (this._alpha < (100 - ASTEP)) {
this._alpha = this._alpha + ASTEP;
} else {
this._alpha = 100;
this.onEnterFrame = undefined;
}
}
function hide() {
this.onEnterFrame = ef_hide;
}
function ef_hide() {
if (this._alpha >= ASTEP) {
this._alpha = this._alpha - ASTEP;
} else {
this._alpha = 100;
this._visible = false;
this.onEnterFrame = undefined;
}
}
var game;
var ASTEP = 25;
okbtn.onRollOver = function () {
};
okbtn.onRelease = function () {
_root.MCSnd.start();
if (game) {
game = false;
_parent.realplay();
}
this._parent.hide();
if (_parent.time != undefined) {
_parent.time.continuet();
}
};
Symbol 322 Button
on (press) {
_parent.reset.show(_root.NextLevel, 1);
}
Symbol 323 Button
on (press) {
_parent.reset.show(_root.NextLevel, 2);
}
Symbol 324 Button
on (press) {
_parent.reset.show(_root.NextLevel, 3);
}
Symbol 325 Button
on (press) {
_parent.reset.show(_root.NextLevel, 4);
}
Symbol 326 Button
on (press) {
_parent.reset.show(_root.NextLevel, 5);
}
Symbol 351 MovieClip Frame 1
stop();
light._visible = false;
normal._visible = true;
dummy.onRollOver = function () {
normal._visible = false;
light._visible = true;
};
dummy.onRollOut = function () {
normal._visible = true;
light._visible = false;
};
dummy.onRelease = function () {
_root.CurrentLevel = _parent._currentframe - 1;
_parent._parent.play.onPress();
};
Symbol 352 MovieClip Frame 1
function showdots(dn, cur) {
var _local3 = 1;
while (_local3 <= 5) {
if (_local3 <= dn) {
this["dot" + _local3]._visible = true;
} else {
this["dot" + _local3]._visible = false;
}
_local3++;
}
this["dot" + cur]._visible = false;
gotoAndStop(cur + 1);
_root.CurrentLevel = cur;
}
showdots(_root.NextLevel, _root.CurrentLevel);
Symbol 353 MovieClip Frame 1
function ef_cshadow() {
if (_root.shadow.Status == "_READY") {
this.onEnterFrame = undefined;
disbtn._visible = false;
}
}
warning._visible = false;
reset._visible = false;
helpm._visible = false;
completed._visible = false;
if (_root.alawar_f != undefined) {
completed._y = completed._y + 35;
}
help.onPress = function () {
_root.MCSnd.start();
helpm.show();
};
help.onRollOver = function () {
_root.M21Snd.start();
};
exit.onRollOver = function () {
_root.M22Snd.start();
};
exit.onRelease = function () {
_root.MCSnd.start();
fscommand ("quit");
if (_root.close_f != undefined) {
cstr = ("JavaScript:" + _root.close_f) + "()";
getURL (cstr);
}
};
function ef_playtd() {
if (_root.shadow.Status == "_READY") {
this._parent.onEnterFrame = undefined;
if (_root.NextLevel > 1) {
gotoAndStop (3);
} else {
gotoAndStop (2);
}
}
}
stop();
if (_root.firsttime == false) {
_root.shadow.hide();
this.onEnterFrame = ef_cshadow;
} else {
_root.shadow._visible = false;
_root.firsttime = false;
}
playtd.onPress = function () {
_root.MCSnd.start();
if (Key.isDown(17)) {
_root.so.clear();
}
_root.shadow.show();
this._parent.onEnterFrame = ef_playtd;
};
playtd.onRollOver = function () {
_root.M1Snd.start();
};
playts.onRollOver = function () {
warning.show();
_root.M2Snd.start();
};
playts.onRollOut = function () {
warning.hide();
};
playcm.onRollOver = function () {
warning.show();
_root.M3Snd.start();
};
playcm.onRollOut = function () {
warning.hide();
};
if (_root.close_f == undefined) {
exit._visible = false;
} else {
exit._visible = true;
}
playts.onPress = function () {
_root.MCSnd.start();
};
playcm.onPress = function () {
_root.MCSnd.start();
};
function ef_getnow() {
if (_root.shadow.Status == "_READY") {
this._parent.onEnterFrame = undefined;
_root.gotoAndStop("Download");
}
}
if (_root.alawar_f != undefined) {
getnow._visible = false;
}
getnow.onRollOver = function () {
_root.M23Snd.start();
};
getnow.onPress = function () {
_root.MCSnd.start();
_root.shadow.show();
this._parent.onEnterFrame = ef_getnow;
};
Symbol 353 MovieClip Frame 2
function ef_cont() {
if (_root.shadow.Status == "_READY") {
this._parent.onEnterFrame = undefined;
gotoAndStop (3);
}
}
stop();
warning._visible = false;
_root.shadow.hide();
this.onEnterFrame = ef_cshadow;
cont.onPress = function () {
_root.MCSnd.start();
_root.shadow.show();
this._parent.onEnterFrame = ef_cont;
};
function ef_getnow() {
if (_root.shadow.Status == "_READY") {
this._parent.onEnterFrame = undefined;
_root.gotoAndStop("Download");
}
}
if (_root.alawar_f != undefined) {
getnow._visible = false;
}
getnow.onRollOver = function () {
_root.M23Snd.start();
};
getnow.onPress = function () {
_root.MCSnd.start();
_root.shadow.show();
this._parent.onEnterFrame = ef_getnow;
};
Symbol 353 MovieClip Frame 3
function realplay() {
if (_root.CurrentLevel != _root.inf.level) {
_root.CurrentScore = 0;
_root.Lives = _root.GD_LIVES;
_root.Wonds = _root.GD_WONDS;
}
_root.shadow.show();
this.onEnterFrame = ef_play;
}
function ef_play() {
if (_root.shadow.Status == "_READY") {
this._parent.onEnterFrame = undefined;
_root.RetryF = false;
_root.gotoAndPlay("Game");
}
}
function ef_menu() {
if (_root.shadow.Status == "_READY") {
this._parent.onEnterFrame = undefined;
gotoAndStop (1);
}
}
stop();
warning._visible = false;
if (_root.CompletedF) {
completed._visible = true;
}
_root.shadow.hide();
this.onEnterFrame = ef_cshadow;
play.onRollOver = function () {
_root.M21Snd.start();
};
menu.onRollOver = function () {
_root.M22Snd.start();
};
play.onPress = function () {
_root.MCSnd.start();
if (_root.Showhelp) {
helpm.game = true;
helpm.show();
} else {
realplay();
}
};
menu.onPress = function () {
_root.MCSnd.start();
_root.shadow.show();
this._parent.onEnterFrame = ef_menu;
};
function ef_getnow() {
if (_root.shadow.Status == "_READY") {
this._parent.onEnterFrame = undefined;
_root.gotoAndStop("Download");
}
}
if (_root.alawar_f != undefined) {
getnow._visible = false;
}
getnow.onRollOver = function () {
_root.M23Snd.start();
};
getnow.onPress = function () {
_root.MCSnd.start();
_root.shadow.show();
this._parent.onEnterFrame = ef_getnow;
};
Symbol 363 MovieClip Frame 12
_root.gamedy.anykey.target = "NEXTLEVEL";
_root.gamedy.anykey._visible = true;
stop();
Symbol 376 MovieClip Frame 1
stop();
Symbol 376 MovieClip Frame 25
stop();
Symbol 376 MovieClip Frame 50
stop();
Symbol 376 MovieClip Frame 75
stop();
Symbol 376 MovieClip Frame 100
stop();
Symbol 376 MovieClip Frame 125
stop();
Symbol 415 MovieClip Frame 1
stop();
Symbol 416 MovieClip Frame 1
this.onEnterFrame = function () {
if ((Math.floor(Math.random() * 200) == 75) && (anim._currentframe == 1)) {
anim.play();
}
};
Symbol 431 MovieClip Frame 1
stop();
Symbol 440 MovieClip Frame 1
stop();
var Cnt = 6;
Symbol 440 MovieClip Frame 5
Cnt--;
if (Cnt < 0) {
gotoAndStop (1);
} else {
gotoAndPlay (2);
}
Symbol 446 MovieClip Frame 1
stop();
this.onEnterFrame = function () {
if ((Math.floor(Math.random() * 100) == 75) && (this._currentframe == 1)) {
this.play();
}
};
Symbol 448 MovieClip Frame 1
stop();
this.onEnterFrame = function () {
if ((Math.floor(Math.random() * 250) == 75) && (this._currentframe == 1)) {
elve.krilya.play();
this.play();
}
};
Symbol 448 MovieClip Frame 50
stick.play();
Symbol 501 MovieClip Frame 1
var Cnt = 0;
this.onEnterFrame = function () {
if (Math.floor(Math.random() * 18) == 15) {
i = 0;
while (i < Math.floor(Math.random() * 3)) {
x = Math.floor(Math.random() * 40);
y = Math.floor(Math.random() * 15);
this.attachMovie("_star_", "star_" + Cnt, this.getNextHighestDepth());
this["star_" + Cnt]._x = x;
this["star_" + Cnt]._y = y;
Cnt++;
if (Cnt == 100) {
Cnt = 0;
}
i++;
}
}
};
Symbol 502 MovieClip Frame 1
function ef_menu2() {
if (_root.shadow.Status == "_READY") {
this._parent.onEnterFrame = undefined;
_root.CurrentScore = _root.OldScore;
_root.Lives = _root.OldLives;
_root.Wonds = _root.OldWonds;
_root.gotoAndStop("Menu");
}
}
help.onRollOver = function () {
_root.M21Snd.start();
};
menu2.onRollOver = function () {
_root.M22Snd.start();
};
menu2.onRelease = function () {
_root.MCSnd.start();
_root.shadow.show();
this._parent.onEnterFrame = ef_menu2;
};
wondbtn.onRollOver = function () {
_root.M21Snd.start();
};
wondbtn.onPress = function () {
_parent.wond();
};
help.onPress = function () {
_root.MCSnd.start();
_parent.time.pauset();
_parent.helpm.show();
};
function ef_getnow() {
if (_root.shadow.Status == "_READY") {
this._parent.onEnterFrame = undefined;
_root.CurrentScore = _root.OldScore;
_root.Lives = _root.OldLives;
_root.Wonds = _root.OldWonds;
_root.gotoAndStop("Download");
}
}
if (_root.alawar_f != undefined) {
getnow._visible = false;
}
getnow.onRollOver = function () {
_root.M23Snd.start();
};
getnow.onPress = function () {
_root["M\u0421Snd"].start();
_root.shadow.show();
this._parent.onEnterFrame = ef_getnow;
};
Symbol 514 MovieClip Frame 1
stop();
Symbol 514 MovieClip Frame 2
stop();
Symbol 514 MovieClip Frame 3
stop();
Symbol 514 MovieClip Frame 4
stop();
Symbol 514 MovieClip Frame 5
stop();
Symbol 514 MovieClip Frame 6
stop();
Symbol 526 MovieClip Frame 1
stop();
Symbol 526 MovieClip Frame 2
stop();
Symbol 526 MovieClip Frame 3
stop();
Symbol 526 MovieClip Frame 4
stop();
Symbol 526 MovieClip Frame 5
stop();
Symbol 526 MovieClip Frame 6
stop();
Symbol 603 MovieClip Frame 76
_parent.gotoAndStop(1);
gotoAndStop (1);
Symbol 604 MovieClip Frame 1
stop();
Symbol 605 MovieClip Frame 1
function init() {
var _local2 = 1;
while (_local2 <= 5) {
this["flower" + _local2].gotoAndStop(1);
this["rflower" + _local2].gotoAndStop(1);
_local2++;
}
FlashF = false;
Status = "_INIT";
}
function stopt() {
flower1._visible = true;
flower2._visible = true;
rflower1._visible = true;
rflower2._visible = true;
this.onEnterFrame = undefined;
}
function pauset() {
this.onEnterFrame = undefined;
}
function continuet() {
this.onEnterFrame = ef_timer;
}
function reset(time) {
Status = "_COUNT";
FlashF = false;
Step = time / FL;
Tmr = time;
Flwr = FL;
refreshf();
this.onEnterFrame = ef_timer;
}
function ef_timer() {
if (FlashF && (((Tmr / 10) - Math.floor(Tmr / 10)) == 0)) {
if (!flower1._visible) {
flower1._visible = true;
if (Flwr > 5) {
flower2._visible = true;
}
} else {
flower1._visible = false;
if (Flwr > 5) {
flower2._visible = false;
}
}
}
if (Tmr == 0) {
this.onEnterFrame = undefined;
_parent.timesup();
}
if ((((Tmr / Step) - Math.floor(Tmr / Step)) == 0) && (Tmr != (Step * FL))) {
Flwr--;
if (Flwr == 6) {
FlashF = true;
}
refreshf();
}
Tmr--;
}
function refreshf() {
var _local3;
i = 1;
while (i <= 5) {
this["flower" + i].gotoAndStop(6);
this["rflower" + i].gotoAndStop(6);
i++;
}
_local3 = Math.floor(Flwr / 5);
i = 1;
while (i <= _local3) {
this["flower" + i].gotoAndStop(1);
this["rflower" + i].gotoAndStop(1);
i++;
}
if (Flwr > (_local3 * 5)) {
this["flower" + i].gotoAndStop((6 - Flwr) + (_local3 * 5));
this["rflower" + i].gotoAndStop((6 - Flwr) + (_local3 * 5));
}
if (Flwr < 25) {
flying.gotoAndStop(Flwr + 2);
if (FlashF) {
_root.timewarningSnd.start();
}
}
}
var FL = 25;
var Step;
var Tmr;
var Flwr;
var FlashF;
var Status;
Symbol 608 MovieClip Frame 1
function show() {
var _local4;
var _local3;
Cnt = 0;
_local4 = 0;
while (_local4 < _root.BLOCKNUMY) {
_local3 = 0;
while (_local3 < _root.BLOCKNUMX) {
if (_root.LevelMap[_local4][_local3] > 0) {
this.attachMovie(("_block" + _root.LevelMap[_local4][_local3]) + "_", (("B_" + _local4) + "_") + _local3, this.getNextHighestDepth());
this[(("B_" + _local4) + "_") + _local3].btype = _root.LevelMap[_local4][_local3];
this[(("B_" + _local4) + "_") + _local3].xn = _local3;
this[(("B_" + _local4) + "_") + _local3].yn = _local4;
this[(("B_" + _local4) + "_") + _local3]._x = DX + (_local3 * BSX);
this[(("B_" + _local4) + "_") + _local3]._y = DY + (_local4 * BSY);
Cnt++;
}
_local3++;
}
_local4++;
}
}
function clear() {
Cnt = 0;
for (var _local3 in this) {
var _local2 = new Object();
_local2 = this[_local3];
if (_local2 instanceof MovieClip) {
removeMovieClip(_local2);
}
}
}
function removeblock(yn, xn) {
if (this[(("B_" + yn) + "_") + xn] != undefined) {
var _local6 = this[(("B_" + yn) + "_") + xn].btype;
if (_local6 == 3) {
_root.LevelMap[yn][xn] = 1;
this[(("B_" + yn) + "_") + xn].removeMovieClip();
this.attachMovie("_block1_", (("B_" + yn) + "_") + xn, this.getNextHighestDepth());
this[(("B_" + yn) + "_") + xn].btype = 1;
this[(("B_" + yn) + "_") + xn].xn = xn;
this[(("B_" + yn) + "_") + xn].yn = yn;
this[(("B_" + yn) + "_") + xn]._x = DX + (xn * BSX);
this[(("B_" + yn) + "_") + xn]._y = DY + (yn * BSY);
} else {
Cnt--;
if (Cnt == 0) {
_parent._parent.blockeffect.WinFlag = true;
}
this[(("B_" + yn) + "_") + xn].removeMovieClip();
}
_root.gamedy.blockeffect.showeffect(yn, xn, _local6);
_root.gamedy.scoreforblock(_local6);
}
}
var BSX = 40;
var BSY = 40;
var DX = 25;
var DY = 23;
var Cnt;
Symbol 629 MovieClip Frame 1
stop();
Symbol 629 MovieClip Frame 2
stop();
Symbol 629 MovieClip Frame 3
stop();
Symbol 629 MovieClip Frame 4
stop();
Symbol 629 MovieClip Frame 5
stop();
Symbol 630 MovieClip Frame 1
function clear() {
Status = "_READY";
this.onEnterFrame = undefined;
for (var _local4 in this) {
var _local3 = new Object();
_local3 = this[_local4];
if (_local3 instanceof MovieClip) {
removeMovieClip(_local3);
}
}
i = 0;
while (i < _root.BLOCKNUMY) {
j = 0;
while (j < _root.BLOCKNUMX) {
TwigsMap[i][j].ttype = 0;
tTwigsMap[i][j].ttype = 0;
j++;
}
i++;
}
}
function show() {
var _local5;
var _local4;
this.createEmptyMovieClip("ktmr", this.getNextHighestDepth());
ktmr.Cnt2 = 0;
ktmr.onEnterFrame = ef_ktmr;
Status = "_SHOW";
creatematrix(_root.LevelMap, false);
refreshtmap();
BeginF = true;
createtwigs(TwigsMap, TwigsMap);
Cnt = 0;
FlCnt = 0;
_parent.leveln._visible = true;
_parent.leveln._alpha = 0;
this.onEnterFrame = ef_show;
}
function ef_show() {
if (Cnt < 50) {
if (Cnt == 40) {
_root.startlevelSnd.start();
}
} else if (Cnt < 70) {
_parent.leveln._alpha = _parent.leveln._alpha + 5;
} else if (Cnt < 90) {
} else if (Cnt < 110) {
_parent.leveln._alpha = _parent.leveln._alpha - 5;
} else {
_parent.leveln._visible = false;
_parent.leveln._alpha = 100;
BeginF = false;
checktwigs();
this.onEnterFrame = undefined;
}
Cnt++;
}
function ef_ktmr() {
if (this.Cnt2 == this._parent.FLASHTIME) {
this.Cnt2 = 0;
} else {
this.Cnt2++;
}
}
function creatematrix(arr, onlyf) {
var _local3;
var _local2;
var _local6 = 0;
var _local4 = 0;
_local3 = 0;
while (_local3 < _root.BLOCKNUMY) {
_local2 = 0;
while (_local2 < _root.BLOCKNUMX) {
if ((TwigsMap[_local3][_local2].ttype > 0) && (TwigsMap[_local3][_local2].flower > 0)) {
_local4++;
}
_local2++;
}
_local3++;
}
trace("stcnt: " + _local4);
_local3 = 0;
while (_local3 < _root.BLOCKNUMY) {
_local2 = 0;
while (_local2 < _root.BLOCKNUMX) {
if (arr[_local3][_local2] > 0) {
tTwigsMap[_local3][_local2].tlock = true;
tTwigsMap[_local3][_local2].ttype = gettwtype();
if (((!onlyf) && (_root.CurrentLevel == 1)) && (tTwigsMap[_local3][_local2].ttype == 1)) {
tTwigsMap[_local3][_local2].ttype = 2;
}
if ((_local4 >= 8) && (tTwigsMap[_local3][_local2].ttype == 1)) {
tTwigsMap[_local3][_local2].ttype = 2;
}
tTwigsMap[_local3][_local2].trot = gettwrotation();
tTwigsMap[_local3][_local2].tdir = new Object();
copyobj(gettwdir(tTwigsMap[_local3][_local2].ttype, tTwigsMap[_local3][_local2].trot), tTwigsMap[_local3][_local2].tdir);
if (tTwigsMap[_local3][_local2].ttype == 1) {
tTwigsMap[_local3][_local2].flower = getflower();
_local6++;
} else if (((_local4 < 8) && (!((!onlyf) && (_root.CurrentLevel == 1)))) && (Math.floor(Math.random() * FlProb) == 1)) {
tTwigsMap[_local3][_local2].flower = getflower();
_local6++;
} else {
tTwigsMap[_local3][_local2].flower = 0;
}
if (((!onlyf) && (_root.CurrentLevel == 1)) && (_root.TL_ttype[_local3][_local2] > 0)) {
tTwigsMap[_local3][_local2].ttype = _root.TL_ttype[_local3][_local2];
tTwigsMap[_local3][_local2].trot = _root.TL_trot[_local3][_local2];
copyobj(gettwdir(tTwigsMap[_local3][_local2].ttype, tTwigsMap[_local3][_local2].trot), tTwigsMap[_local3][_local2].tdir);
tTwigsMap[_local3][_local2].flower = _root.TL_flower[_local3][_local2];
}
} else {
tTwigsMap[_local3][_local2].ttype = 0;
if (((_local4 < 8) && (onlyf)) && (_root.LevelMap[_local3][_local2] > 0)) {
if ((Math.floor(Math.random() * OnlyfProb) == 1) && (TwigsMap[_local3][_local2].ttype != 1)) {
tTwigsMap[_local3][_local2].ttype = 6;
tTwigsMap[_local3][_local2].flower = getflower();
_local6++;
}
}
}
_local2++;
}
_local3++;
}
trace("flcnt: " + _local6);
if (((_local4 < 8) && (_local6 < 2)) && (onlyf)) {
var _local9 = 0;
while (_local9 < (2 - _local6)) {
var _local7 = false;
while (!_local7) {
_local3 = Math.floor(Math.random() * _root.BLOCKNUMY);
_local2 = Math.floor(Math.random() * _root.BLOCKNUMX);
if ((((_root.LevelMap[_local3][_local2] > 0) && (arr[_local3][_local2] == 0)) && (TwigsMap[_local3][_local2].ttype != 1)) && (TwigsMap[_local3][_local2].flower == 0)) {
tTwigsMap[_local3][_local2].ttype = 6;
tTwigsMap[_local3][_local2].flower = getflower();
_local7 = true;
}
}
_local9++;
}
_local6 = 2;
}
}
function refreshtmap() {
i = 0;
while (i < _root.BLOCKNUMY) {
j = 0;
while (j < _root.BLOCKNUMX) {
if (tTwigsMap[i][j].ttype > 0) {
if (tTwigsMap[i][j].ttype == 6) {
} else {
copyobj(tTwigsMap[i][j], TwigsMap[i][j]);
}
}
j++;
}
i++;
}
}
function createtwigs(arr, arr2) {
var _local4;
var _local3;
var _local5 = -2000;
var _local10 = false;
var _local7 = 0;
var _local8;
_local4 = 0;
while (_local4 < _root.BLOCKNUMY) {
_local3 = 0;
while (_local3 < _root.BLOCKNUMX) {
if (arr2[_local4][_local3].ttype > 0) {
if (arr2[_local4][_local3].ttype != 6) {
if (this[(("TW_" + _local4) + "_") + _local3] != undefined) {
this[(("TW_" + _local4) + "_") + _local3].removeMovieClip();
}
this.attachMovie("_tw_", (("TW_" + _local4) + "_") + _local3, this.getNextHighestDepth());
this[(("TW_" + _local4) + "_") + _local3].tdata = new Object();
this[(("TW_" + _local4) + "_") + _local3].tdata = arr[_local4][_local3];
this[(("TW_" + _local4) + "_") + _local3].xn = _local3;
this[(("TW_" + _local4) + "_") + _local3].yn = _local4;
this[(("TW_" + _local4) + "_") + _local3]._x = DX + (_local3 * BSX);
this[(("TW_" + _local4) + "_") + _local3]._y = ((DY + (_local4 * 150)) - (_local3 * _local3)) - 2000;
if ((this[(("TW_" + _local4) + "_") + _local3]._y + this[(("TW_" + _local4) + "_") + _local3]._height) > _local5) {
_local5 = this[(("TW_" + _local4) + "_") + _local3]._y;
}
if (this[(("TW_" + _local4) + "_") + _local3]._y < _local7) {
_local7 = this[(("TW_" + _local4) + "_") + _local3]._y;
_local8 = this[(("TW_" + _local4) + "_") + _local3];
}
} else {
if (this[(("FL_" + _local4) + "_") + _local3] != undefined) {
this[(("FL_" + _local4) + "_") + _local3].removeMovieClip();
}
this.attachMovie("_fl_", (("FL_" + _local4) + "_") + _local3, this.getNextHighestDepth());
this[(("FL_" + _local4) + "_") + _local3].flower = arr2[_local4][_local3].flower;
this[(("FL_" + _local4) + "_") + _local3].xn = _local3;
this[(("FL_" + _local4) + "_") + _local3].yn = _local4;
this[(("FL_" + _local4) + "_") + _local3]._x = DX + (_local3 * BSX);
this[(("FL_" + _local4) + "_") + _local3]._y = ((DY + (_local4 * 150)) - (_local3 * _local3)) - 2000;
if ((this[(("FL_" + _local4) + "_") + _local3]._y + this[(("FL_" + _local4) + "_") + _local3]._height) > _local5) {
_local5 = this[(("FL_" + _local4) + "_") + _local3]._y;
}
}
}
_local3++;
}
_local4++;
}
_local4 = 0;
while (_local4 < _root.BLOCKNUMY) {
_local3 = 0;
while (_local3 < _root.BLOCKNUMX) {
if (arr2[_local4][_local3].ttype > 0) {
if (arr2[_local4][_local3].ttype != 6) {
this[(("TW_" + _local4) + "_") + _local3]._y = this[(("TW_" + _local4) + "_") + _local3]._y - ((_local5 + this._y) + this[(("TW_" + _local4) + "_") + _local3]._height);
} else {
this[(("FL_" + _local4) + "_") + _local3]._y = this[(("FL_" + _local4) + "_") + _local3]._y - ((_local5 + this._y) + this[(("FL_" + _local4) + "_") + _local3]._height);
}
}
_local3++;
}
_local4++;
}
_local8.ff = true;
}
function getflower() {
return(Math.ceil(Math.random() * 5));
}
function gettwtype() {
var _local1;
_local1 = Math.random() * TwProb[4];
if (_local1 <= TwProb[0]) {
return(1);
}
if (_local1 <= TwProb[1]) {
return(2);
}
if (_local1 <= TwProb[2]) {
return(3);
}
if (_local1 <= TwProb[3]) {
return(4);
}
if (_local1 <= TwProb[4]) {
return(5);
}
}
function gettwrotation() {
var _local1 = Math.random() * 100;
if (_local1 < 25) {
return(0);
}
if (_local1 < 50) {
return(90);
}
if (_local1 < 75) {
return(180);
}
if (_local1 <= 100) {
return(270);
}
}
function gettwdir(ttype, trot) {
var _local1 = new Object();
_local1.l = TwDir[ttype - 1][trot / 90][0];
_local1.u = TwDir[ttype - 1][trot / 90][1];
_local1.r = TwDir[ttype - 1][trot / 90][2];
_local1.d = TwDir[ttype - 1][trot / 90][3];
if (_local1.l == 1) {
_local1.l = true;
} else {
_local1.l = false;
}
if (_local1.u == 1) {
_local1.u = true;
} else {
_local1.u = false;
}
if (_local1.r == 1) {
_local1.r = true;
} else {
_local1.r = false;
}
if (_local1.d == 1) {
_local1.d = true;
} else {
_local1.d = false;
}
return(_local1);
}
function rotatetw(xn, yn) {
if (((this[(("TW_" + yn) + "_") + xn] != undefined) && (!TwigsMap[yn][xn].tlock)) && (!BeginF)) {
if (_parent.time.Status != "_COUNT") {
_parent.time.reset(_root.GD_TIMES[_root.CurrentLevel - 1]);
}
if (!_parent.WondF) {
this[(("TW_" + yn) + "_") + xn].rotatetw();
} else {
this[(("TW_" + yn) + "_") + xn].wondtw();
}
}
}
function checktwigs() {
if (_parent.WinF) {
return(undefined);
}
var _local5;
var _local4;
var _local10 = 1;
var _local7 = false;
var _local6 = false;
var _local11 = false;
var _local12 = false;
var _local9 = new Array();
var _local8 = new Array();
_local5 = 0;
while (_local5 < _root.BLOCKNUMY) {
_local4 = 0;
while (_local4 < _root.BLOCKNUMX) {
if ((TwigsMap[_local5][_local4].ttype > 0) && (!TwigsMap[_local5][_local4].tlock)) {
if (checknb(_local4, _local5).l || (checknb(_local4, _local5).u)) {
if (checknb(_local4, _local5).l) {
TwigsMap[_local5][_local4].mark = TwigsMap[_local5][_local4 - 1].mark;
}
if (checknb(_local4, _local5).u) {
TwigsMap[_local5][_local4].mark = TwigsMap[_local5 - 1][_local4].mark;
}
} else if (checknb(_local4, _local5).r || (checknb(_local4, _local5).d)) {
TwigsMap[_local5][_local4].mark = _local10;
_local10++;
} else if (TwigsMap[_local5][_local4].flower > 0) {
TwigsMap[_local5][_local4].mark = _local10;
_local10++;
} else {
TwigsMap[_local5][_local4].mark = undefined;
}
} else {
TwigsMap[_local5][_local4].mark = undefined;
}
_local4++;
}
_local5++;
}
while (!_local7) {
_local7 = true;
_local5 = 0;
while (_local5 < _root.BLOCKNUMY) {
_local4 = 0;
while (_local4 < _root.BLOCKNUMX) {
if (TwigsMap[_local5][_local4].ttype > 0) {
if (checknb(_local4, _local5).l) {
if (TwigsMap[_local5][_local4].mark > TwigsMap[_local5][_local4 - 1].mark) {
TwigsMap[_local5][_local4].mark = TwigsMap[_local5][_local4 - 1].mark;
_local7 = false;
} else if (TwigsMap[_local5][_local4].mark < TwigsMap[_local5][_local4 - 1].mark) {
TwigsMap[_local5][_local4 - 1].mark = TwigsMap[_local5][_local4].mark;
_local7 = false;
}
}
if (checknb(_local4, _local5).r) {
if (TwigsMap[_local5][_local4].mark > TwigsMap[_local5][_local4 + 1].mark) {
TwigsMap[_local5][_local4].mark = TwigsMap[_local5][_local4 + 1].mark;
_local7 = false;
} else if (TwigsMap[_local5][_local4].mark < TwigsMap[_local5][_local4 + 1].mark) {
TwigsMap[_local5][_local4 + 1].mark = TwigsMap[_local5][_local4].mark;
_local7 = false;
}
}
if (checknb(_local4, _local5).u) {
if (TwigsMap[_local5][_local4].mark > TwigsMap[_local5 - 1][_local4].mark) {
TwigsMap[_local5][_local4].mark = TwigsMap[_local5 - 1][_local4].mark;
_local7 = false;
} else if (TwigsMap[_local5][_local4].mark < TwigsMap[_local5 - 1][_local4].mark) {
TwigsMap[_local5 - 1][_local4].mark = TwigsMap[_local5][_local4].mark;
_local7 = false;
}
}
if (checknb(_local4, _local5).d) {
if (TwigsMap[_local5][_local4].mark > TwigsMap[_local5 + 1][_local4].mark) {
TwigsMap[_local5][_local4].mark = TwigsMap[_local5 + 1][_local4].mark;
_local7 = false;
} else if (TwigsMap[_local5][_local4].mark < TwigsMap[_local5 + 1][_local4].mark) {
TwigsMap[_local5 + 1][_local4].mark = TwigsMap[_local5][_local4].mark;
_local7 = false;
}
}
}
_local4++;
}
_local5++;
}
}
_local5 = 0;
while (_local5 < _root.BLOCKNUMY) {
_local4 = 0;
while (_local4 < _root.BLOCKNUMX) {
if (((TwigsMap[_local5][_local4].ttype > 0) && (TwigsMap[_local5][_local4].mark != undefined)) && (TwigsMap[_local5][_local4].flower > 0)) {
_local6 = false;
k = 0;
while (k < _local9.length) {
if (_local9[k] == TwigsMap[_local5][_local4].mark) {
_local6 = true;
}
k++;
}
if (!_local6) {
_local9.push(TwigsMap[_local5][_local4].mark);
} else {
_local6 = false;
k = 0;
while (k < _local8.length) {
if (_local8[k] == TwigsMap[_local5][_local4].mark) {
_local6 = true;
}
k++;
}
if (!_local6) {
_local8.push(TwigsMap[_local5][_local4].mark);
}
}
}
_local4++;
}
_local5++;
}
_local5 = 0;
while (_local5 < _root.BLOCKNUMY) {
_local4 = 0;
while (_local4 < _root.BLOCKNUMX) {
if ((TwigsMap[_local5][_local4].ttype > 0) && (!TwigsMap[_local5][_local4].tlock)) {
if (TwigsMap[_local5][_local4].mark != undefined) {
_local6 = false;
k = 0;
while (k < _local9.length) {
if (_local9[k] == TwigsMap[_local5][_local4].mark) {
_local6 = true;
}
k++;
}
_local11 = false;
k = 0;
while (k < _local8.length) {
if (_local8[k] == TwigsMap[_local5][_local4].mark) {
_local11 = true;
}
k++;
}
if (_local6 && (!_local11)) {
this[(("TW_" + _local5) + "_") + _local4].togreen();
}
}
if ((!_local6) || (TwigsMap[_local5][_local4].mark == undefined)) {
this[(("TW_" + _local5) + "_") + _local4].toyellow();
}
if (TwigsMap[_local5][_local4].flower > 0) {
this[(("TW_" + _local5) + "_") + _local4].F.nfl._visible = true;
this[(("TW_" + _local5) + "_") + _local4].F.rfl._visible = false;
this[(("TW_" + _local5) + "_") + _local4].F.gfl._visible = false;
}
}
_local4++;
}
_local5++;
}
_local5 = 0;
while (_local5 < _root.BLOCKNUMY) {
_local4 = 0;
while (_local4 < _root.BLOCKNUMX) {
if ((TwigsMap[_local5][_local4].ttype > 0) && (!TwigsMap[_local5][_local4].tlock)) {
if (TwigsMap[_local5][_local4].mark != undefined) {
_local6 = false;
k = 0;
while (k < _local8.length) {
if (_local8[k] == TwigsMap[_local5][_local4].mark) {
_local6 = true;
}
k++;
}
if (_local6) {
this[(("TW_" + _local5) + "_") + _local4].main = false;
if ((!_local12) && (TwigsMap[_local5][_local4].flower != 0)) {
this[(("TW_" + _local5) + "_") + _local4].main = true;
_local12 = true;
}
this[(("TW_" + _local5) + "_") + _local4].tored();
if (this[(("TW_" + _local5) + "_") + _local4].SkipToRed) {
addflag = true;
addcnt = this[(("TW_" + _local5) + "_") + _local4].Cnt;
}
}
}
}
_local4++;
}
_local5++;
}
if (addflag) {
addflag = undefined;
_local5 = 0;
while (_local5 < _root.BLOCKNUMY) {
_local4 = 0;
while (_local4 < _root.BLOCKNUMX) {
if ((TwigsMap[_local5][_local4].ttype > 0) && (!TwigsMap[_local5][_local4].tlock)) {
if (TwigsMap[_local5][_local4].mark != undefined) {
_local6 = false;
k = 0;
while (k < _local8.length) {
if (_local8[k] == TwigsMap[_local5][_local4].mark) {
_local6 = true;
}
k++;
}
if (_local6 && (this[(("TW_" + _local5) + "_") + _local4].Cnt == 0)) {
this[(("TW_" + _local5) + "_") + _local4].Cnt = addcnt;
}
}
}
_local4++;
}
_local5++;
}
}
}
function checknb(xn, yn) {
var _local1 = new Object();
if (TwigsMap[yn][xn].tdir.r && (TwigsMap[yn][xn + 1].tdir.l)) {
_local1.r = true;
} else {
_local1.r = false;
}
if (TwigsMap[yn][xn].tdir.l && (TwigsMap[yn][xn - 1].tdir.r)) {
_local1.l = true;
} else {
_local1.l = false;
}
if (TwigsMap[yn][xn].tdir.u && (TwigsMap[yn - 1][xn].tdir.d)) {
_local1.u = true;
} else {
_local1.u = false;
}
if (TwigsMap[yn][xn].tdir.d && (TwigsMap[yn + 1][xn].tdir.u)) {
_local1.d = true;
} else {
_local1.d = false;
}
return(_local1);
}
function afterkill(sender) {
var _local4;
var _local3;
var _local5;
sender.removeMovieClip();
_local4 = 0;
while (_local4 < _root.BLOCKNUMY) {
_local3 = 0;
while (_local3 < _root.BLOCKNUMX) {
copyobj(TwigsMap[_local4][_local3], tTwigsMap[_local4][_local3]);
_local3++;
}
_local4++;
}
_local4 = _root.BLOCKNUMY - 1;
while (_local4 >= 0) {
_local3 = 0;
while (_local3 < _root.BLOCKNUMX) {
if (tTwigsMap[_local4][_local3].ttype == -1) {
_local5 = _local4 - 1;
while (_local5 > 0) {
if (tTwigsMap[_local5][_local3].ttype > 0) {
break;
}
_local5--;
}
if (tTwigsMap[_local5][_local3].ttype > 0) {
copyobj(tTwigsMap[_local5][_local3], tTwigsMap[_local4][_local3]);
tTwigsMap[_local5][_local3].ttype = -1;
if (this[(("TW_" + _local5) + "_") + _local3] != undefined) {
this[(("TW_" + _local5) + "_") + _local3]._name = (("TW_" + _local4) + "_") + _local3;
this[(("TW_" + _local4) + "_") + _local3].yn = _local4;
this[(("TW_" + _local4) + "_") + _local3].tdata = TwigsMap[_local4][_local3];
this[(("T_" + _local4) + "_") + _local3].slow = true;
}
}
} else {
tTwigsMap[_local4][_local3].ttype = 0;
}
_local3++;
}
_local4--;
}
_local4 = 0;
while (_local4 < _root.BLOCKNUMY) {
_local3 = 0;
while (_local3 < _root.BLOCKNUMX) {
if (tTwigsMap[_local4][_local3].ttype == -1) {
NewTwigs[_local4][_local3] = 1;
} else {
NewTwigs[_local4][_local3] = 0;
}
if (tTwigsMap[_local4][_local3].ttype > 0) {
copyobj(tTwigsMap[_local4][_local3], OldTwigs[_local4][_local3]);
} else {
OldTwigs[_local4][_local3].ttype = 0;
}
_local3++;
}
_local4++;
}
creatematrix(NewTwigs, true);
refreshtmap();
createtwigs(TwigsMap, tTwigsMap);
_local4 = 0;
while (_local4 < _root.BLOCKNUMY) {
_local3 = 0;
while (_local3 < _root.BLOCKNUMX) {
if (OldTwigs[_local4][_local3].ttype > 0) {
copyobj(OldTwigs[_local4][_local3], tTwigsMap[_local4][_local3]);
}
_local3++;
}
_local4++;
}
refreshtmap();
_local4 = 0;
while (_local4 < _root.BLOCKNUMY) {
_local3 = 0;
while (_local3 < _root.BLOCKNUMX) {
if (OldTwigs[_local4][_local3].ttype > 0) {
this[(("TW_" + _local4) + "_") + _local3].tmove();
}
_local3++;
}
_local4++;
}
}
function copyobj(s, d) {
for (var _local4 in s) {
var _local1 = new Object();
_local1 = s[_local4];
if (_local1 instanceof Object) {
d[_local4] = new Object();
copyobj(_local1, d[_local4]);
} else {
d[_local4] = s[_local4];
}
}
}
var BSX = 40;
var BSY = 40;
var DX = 4;
var DY = 2;
var YSTEP = 28;
var RSTEP = 30;
var TWSSTEP = 20;
var TWHSTEP = 20;
var LIFETIME = 15;
var FLASHTIME = 3;
var KSTEP = 10;
var FlProb = 250;
var OnlyfProb = 25;
var TwProb = [20, 40, 60, 62, 92, 100];
var TwDir = [[[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]], [[1, 0, 1, 0], [0, 1, 0, 1], [1, 0, 1, 0], [0, 1, 0, 1]], [[1, 1, 1, 0], [0, 1, 1, 1], [1, 0, 1, 1], [1, 1, 0, 1]], [[1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1]], [[0, 1, 1, 0], [0, 0, 1, 1], [1, 0, 0, 1], [1, 1, 0, 0]]];
var Status;
var BeginF;
var Cnt;
var FLCnt;
var TwigsMap = new Array(_root.BLOCKNUMY);
var i = 0;
while (i < _root.BLOCKNUMY) {
TwigsMap[i] = new Array(_root.BLOCKNUMX);
var j = 0;
while (j < _root.BLOCKNUMX) {
TwigsMap[i][j] = new Object();
j++;
}
i++;
}
var tTwigsMap = new Array(_root.BLOCKNUMY);
var i = 0;
while (i < _root.BLOCKNUMY) {
tTwigsMap[i] = new Array(_root.BLOCKNUMX);
var j = 0;
while (j < _root.BLOCKNUMX) {
tTwigsMap[i][j] = new Object();
j++;
}
i++;
}
var NewTwigs = new Array(_root.BLOCKNUMY);
var i = 0;
while (i < _root.BLOCKNUMY) {
NewTwigs[i] = new Array(_root.BLOCKNUMX);
i++;
}
var OldTwigs = new Array(_root.BLOCKNUMY);
var i = 0;
while (i < _root.BLOCKNUMY) {
OldTwigs[i] = new Array(_root.BLOCKNUMX);
var j = 0;
while (j < _root.BLOCKNUMX) {
OldTwigs[i][j] = new Object();
OldTwigs.tdir = new Object();
j++;
}
i++;
}
Symbol 631 MovieClip Frame 1
function clear() {
WinFlag = false;
this.onEnterFrame = undefined;
for (var _local3 in this) {
var _local2 = new Object();
_local2 = this[_local3];
if (_local2 instanceof MovieClip) {
removeMovieClip(_local2);
}
}
}
function showeffect(yn, xn, btype) {
this.attachMovie(("_block" + btype) + "_", (("EB_" + yn) + "_") + xn, this.getNextHighestDepth());
if (btype == 2) {
this[(("EB_" + yn) + "_") + xn].stop();
}
this[(("EB_" + yn) + "_") + xn]._x = DX + (xn * BSX);
this[(("EB_" + yn) + "_") + xn]._y = DY + (yn * BSY);
this[(("EB_" + yn) + "_") + xn].Cnt = 0;
this[(("EB_" + yn) + "_") + xn].OldX = this[(("EB_" + yn) + "_") + xn]._x;
this[(("EB_" + yn) + "_") + xn].OldY = this[(("EB_" + yn) + "_") + xn]._y;
if (Math.floor(Math.random() * 2) == 0) {
this[(("EB_" + yn) + "_") + xn].Dir = -1;
} else {
this[(("EB_" + yn) + "_") + xn].Dir = 1;
}
this[(("EB_" + yn) + "_") + xn].SX = 4 + (Math.random() * 4);
this[(("EB_" + yn) + "_") + xn].SY = 3 + (Math.random() * 4);
this[(("EB_" + yn) + "_") + xn].RSpd = 2 + (Math.random() * 2);
this[(("EB_" + yn) + "_") + xn].Cnt = 0;
this[(("EB_" + yn) + "_") + xn].onEnterFrame = ef_showeffect;
}
function ef_showeffect() {
var _local3;
if (this.Cnt < 40) {
this._x = this.OldX + ((this.Dir * this.Cnt) * this.SX);
_local3 = Math.abs(this.Cnt - 5);
this._y = this.OldY + (((_local3 * _local3) - 25) / this.SY);
if (this.Cnt > 10) {
this._alpha = this._alpha - 3.4;
}
this._rotation = this._rotation + (this.Dir * this.RSpd);
} else {
this.removeMovieClip();
if (WinFlag) {
_parent.allblocks();
}
}
this.Cnt++;
}
var BSX = 40;
var BSY = 40;
var DX = 25;
var DY = 23;
var WinFlag = false;
Symbol 632 MovieClip Frame 1
function clear() {
this.onEnterFrame = undefined;
for (var _local3 in this) {
var _local2 = new Object();
_local2 = this[_local3];
if (_local2 instanceof MovieClip) {
removeMovieClip(_local2);
}
}
}
function showeffect(yn, xn) {
if (this[(("EF_" + yn) + "_") + xn] != undefined) {
this[(("EF_" + yn) + "_") + xn].removeMovieClip();
}
this.attachMovie(("_flower" + _parent.twigs.TwigsMap[yn][xn].flower) + "_", (("EF_" + yn) + "_") + xn, this.getNextHighestDepth());
this[(("EF_" + yn) + "_") + xn].nfl._visible = true;
this[(("EF_" + yn) + "_") + xn].rfl._visible = false;
this[(("EF_" + yn) + "_") + xn].gfl._visible = false;
this[(("EF_" + yn) + "_") + xn]._x = DX + (xn * BSX);
this[(("EF_" + yn) + "_") + xn]._y = DY + (yn * BSY);
this[(("EF_" + yn) + "_") + xn].Cnt = 0;
this[(("EF_" + yn) + "_") + xn].onEnterFrame = ef_showeffect;
}
function ef_showeffect() {
if (this.Cnt < 4) {
this._xscale = this._xscale + 20;
this._yscale = this._xscale;
} else if (this.Cnt < 12) {
this._xscale = this._xscale - 5;
this._yscale = this._xscale;
this._rotation = this._rotation - 8;
} else if (this.Cnt < 24) {
this._xscale = this._xscale + 26;
this._yscale = this._xscale;
this._rotation = this._rotation + 7;
this._alpha = this._alpha - 12;
} else {
this.onEnterFrame = undefined;
this.removeMovieClip();
}
this.Cnt++;
}
var BSX = 40;
var BSY = 40;
var DX = 25;
var DY = 23;
Symbol 635 MovieClip Frame 1
ca.useHandCursor = false;
ca.onRelease = function () {
if (_parent.Lock != true) {
var _local5 = Math.floor((this._xmouse - _root.gamedy.twigs.DX) / _root.gamedy.twigs.BSX);
var _local4 = Math.floor((this._ymouse - _root.gamedy.twigs.DY) / _root.gamedy.twigs.BSY);
_root.gamedy.twigs.rotatetw(_local5, _local4);
}
};
Symbol 651 MovieClip Frame 1
stop();
Symbol 651 MovieClip Frame 2
stop();
Symbol 651 MovieClip Frame 3
stop();
Symbol 651 MovieClip Frame 4
stop();
Symbol 651 MovieClip Frame 5
stop();
Symbol 663 MovieClip Frame 1
var go;
this.useHandCursor = false;
this.onPress = function () {
if (target == "NEXTLEVEL") {
_parent.nextlevel();
}
if (target == "REPLAY") {
go = true;
}
};
Symbol 666 MovieClip Frame 1
function wondshow() {
Mouse.hide();
_parent.WondF = true;
this._x = -1 * this._width;
this._y = -1 * this._height;
this._visible = true;
this.onEnterFrame = ef_wondshow;
}
function ef_wondshow() {
this._x = _parent._xmouse;
this._y = _parent._ymouse;
}
function wondreset() {
Mouse.show();
this.onEnterFrame = undefined;
this._visible = false;
_parent.WondF = false;
}
Symbol 667 MovieClip Frame 1
function init(level) {
var _local3;
var _local2;
_local3 = 0;
while (_local3 < _root.BLOCKNUMY) {
_local2 = 0;
while (_local2 < _root.BLOCKNUMX) {
_root.LevelMap[_local3][_local2] = _root["LD_LevelMap" + level][_local3][_local2];
_local2++;
}
_local3++;
}
wondcur.wondreset();
if (_root.RetryF) {
_root.CurrentScore = _root.OldScore;
_root.Lives = _root.OldLives;
_root.Wonds = _root.OldWonds;
} else {
_root.OldScore = _root.CurrentScore;
_root.OldLives = _root.Lives;
_root.OldWonds = _root.Wonds;
}
savedata();
WinF = false;
levelcomplete._visible = false;
leveln.gotoAndStop(level);
leveln._visible = false;
timeup._visible = false;
gameover._visible = false;
anykey._visible = false;
helpm._visible = false;
time._visible = true;
time.init();
board.blocks.clear();
blockeffect.clear();
twigs.clear();
board.gotoAndStop(level);
backgr.gotoAndStop("pic" + level);
_root.CurrentLevel = level;
wondsbox.text = _root.Wonds;
livesbox.text = _root.Lives;
scorebox.text = _root.CurrentScore;
}
function start() {
_root.mentorappSnd.start();
board.blocks.show();
twigs.show();
}
function allblocks() {
WinF = true;
time.stopt();
endlevelanim();
}
function endlevelanim() {
Cnt = 0;
clickarea.removeMovieClip();
timeup._visible = false;
levelcomplete._visible = true;
levelcomplete._alpha = 0;
this.onEnterFrame = ef_endlevelanim;
_root.levelcompletedSnd.start();
}
function ef_endlevelanim() {
Cnt++;
if (Cnt < 80) {
if (levelcomplete._alpha <= 94) {
levelcomplete._alpha = levelcomplete._alpha + 6;
} else {
levelcomplete._alpha = 100;
}
if (twigs._alpha >= 8) {
twigs._alpha = twigs._alpha - 8;
blockeffect._alpha = blockeffect._alpha - 8;
flowereffect._alpha = flowereffect._alpha - 8;
} else {
twigs._alpha = 0;
}
} else if (Cnt < 100) {
if (Cnt == 92) {
livesbox._visible = false;
wondsbox._visible = false;
scorebox._visible = false;
}
if (interf._alpha >= 8) {
levelcomplete._alpha = levelcomplete._alpha - 8;
interf._alpha = interf._alpha - 8;
time._alpha = time._alpha - 8;
board._alpha = board._alpha - 8;
} else {
levelcomplete._alpha = 0;
interf._alpha = 0;
time._alpha = 0;
board._alpha = 0;
}
} else {
backgr.play();
_root.showpicSnd.start();
this.onEnterFrame = undefined;
}
}
function nextlevel() {
anykey._visible = false;
_root.shadow.show();
this.onEnterFrame = ef_nextlevel;
}
function ef_nextlevel() {
if (_root.shadow.Status == "_READY") {
this._parent.onEnterFrame = undefined;
_root.nlflag = true;
if ((_root.CurrentLevel == _root.GD_LEVELS) && (_root.NextLevel == _root.GD_LEVELS)) {
_root.CompletedF = true;
}
if ((_root.CurrentLevel == _root.NextLevel) && (_root.NextLevel < _root.GD_LEVELS)) {
_root.NextLevel++;
}
if (_root.CurrentLevel < _root.GD_LEVELS) {
_root.CurrentLevel++;
}
savedata();
_root.gotoAndStop("Menu");
}
}
function timesup() {
clickarea.removeMovieClip();
anykey._visible = true;
timeup._visible = true;
timeup._alpha = 0;
Cnt = 0;
this.onEnterFrame = ef_timeup;
_root.timeoutSnd.start();
}
function ef_timeup() {
if (Cnt < 10) {
} else if (Cnt < 30) {
timeup._alpha = timeup._alpha + 5;
} else if (Cnt < 115) {
} else if (Cnt < 135) {
timeup._alpha = timeup._alpha - 5;
} else {
timeup._visible = false;
timeup._alpha = 100;
if (_root.Lives == 0) {
this.onEnterFrame = undefined;
gameoverf();
} else {
_root.Lives--;
_root.OldLives = _root.Lives;
_root.shadow.show();
this.onEnterFrame = ef_retry;
}
}
Cnt++;
}
function ef_retry() {
if (_root.shadow.Status == "_READY") {
this.onEnterFrame = undefined;
_root.RetryF = true;
_root.gotoAndPlay("Game");
}
}
function gameoverf() {
WinF = true;
clickarea.removeMovieClip();
gameover._visible = true;
gameover._alpha = 0;
anykey._visible = true;
anykey.go = false;
anykey.target = "REPLAY";
Cnt = 0;
this.onEnterFrame = ef_gameover;
}
function ef_gameover() {
if (Cnt < 10) {
} else if (Cnt < 30) {
gameover._alpha = gameover._alpha + 5;
} else if (Cnt < 35) {
} else if (Cnt < 55) {
gameover._alpha = gameover._alpha - 5;
} else {
gameover._visible = false;
anykey._visible = false;
gameover._alpha = 100;
_root.shadow.show();
this.onEnterFrame = ef_aftergameover;
}
if ((Cnt < 30) || (anykey.go)) {
Cnt++;
}
}
function ef_aftergameover() {
if (_root.shadow.Status == "_READY") {
this._parent.onEnterFrame = undefined;
_root.nlflag = true;
_root.Lives = _root.GD_LIVES;
_root.OldLives = _root.GD_LIVES;
_root.Wonds = _root.GD_WONDS;
_root.OldWonds = _root.GD_WONDS;
_root.CurrentScore = 0;
_root.OldScore = 0;
_root.CurrentLevel = 1;
savedata();
_root.gotoAndStop("Menu");
}
}
function scoreforblock(type) {
if (WinF) {
return(undefined);
}
_root.CurrentScore = _root.CurrentScore + 9;
scorebox.text = _root.CurrentScore;
}
function scorefortwig() {
if (WinF) {
return(undefined);
}
_root.CurrentScore++;
scorebox.text = _root.CurrentScore;
}
function savedata() {
_root.inf.showhelp = _root.Showhelp;
_root.inf.nlevel = _root.NextLevel;
_root.inf.level = _root.CurrentLevel;
_root.inf.lives = _root.Lives;
_root.inf.wonds = _root.Wonds;
_root.inf.score = _root.CurrentScore;
_root.inf.completedf = _root.CompletedF;
_root.so.data.content = _root.inf;
}
function wond() {
if (WondF) {
wondcur.wondreset();
} else if (_parent.Wonds > 0) {
wondcur.wondshow();
}
}
var Cnt;
var WinF;
var WondF;
Symbol 672 MovieClip Frame 1
this.onEnterFrame = function () {
var _local2;
var _local3 = -1 + (Math.random() * 4);
if (Math.random() > 0.3) {
_local2 = 1;
} else {
_local2 = -1;
}
this._rotation = this._rotation + ((2 + (Math.random() * 6)) * _local2);
this._alpha = this._alpha + _local3;
if (this._alpha < 50) {
this._alpha = 50;
}
};
Symbol 689 MovieClip Frame 1
function ef_menu2() {
if (_root.shadow.Status == "_READY") {
onEnterFrame = undefined;
_root.gotoAndStop("Menu");
}
}
menu2.onRollOver = function () {
_root.M22Snd.start();
};
dload.onRollOver = function () {
_root.M21Snd.start();
};
menu2.onRelease = function () {
_root.MCSnd.start();
_root.shadow.show();
onEnterFrame = ef_menu2;
};
dload.onPress = function () {
_root.MCSnd.start();
_root.GotoDownload();
};