Frame 2
stop();
Frame 3
gotoAndStop ("nitrome");
Frame 5
_root.sf = new com.nitrome.game.SaveFunctions();
_root.pm = new com.nitrome.miraclegrow.PauseManager();
_global.last_played_level = 0;
stop();
Frame 12
_root.music_controller.startMenuMusic();
Frame 13
stop();
Frame 23
stop();
Frame 33
stop();
Frame 43
stop();
Frame 53
stop();
Instance of Symbol 857 MovieClip "comHighscores" in Frame 53
//component parameters
onClipEvent (construct) {
scoreLocation = "_root.score";
gamename = "feedme";
saveScore = false;
scoreIsTime = false;
scoreReversed = false;
negativeScoreAllowed = false;
}
Frame 63
_root.score = _root.sf.getTotalScore();
stop();
Instance of Symbol 857 MovieClip "comHighscores" in Frame 63
//component parameters
onClipEvent (construct) {
scoreLocation = "_root.score";
gamename = "feedme";
saveScore = true;
scoreIsTime = false;
scoreReversed = false;
negativeScoreAllowed = false;
}
Frame 73
stop();
Frame 83
_root.game_holder.gotoAndStop(_global.selected_level + 1);
if (_global.selected_level == 1) {
_root.game_holder._y = -380;
_root.game_holder.plant_pot.init(150, 650);
_global.max_level_time = 240000 /* 0x03A980 */;
} else if (_global.selected_level == 2) {
_root.game_holder.plant_pot.init(100, 200);
_global.max_level_time = 240000 /* 0x03A980 */;
} else if (_global.selected_level == 3) {
_root.game_holder._y = -20;
_root.game_holder.plant_pot.init(100, 360);
_global.max_level_time = 240000 /* 0x03A980 */;
} else if (_global.selected_level == 4) {
_root.game_holder.plant_pot.init(150, 200);
_global.max_level_time = 240000 /* 0x03A980 */;
} else if (_global.selected_level == 5) {
_root.game_holder._y = -420;
_root.game_holder.plant_pot.init(100, 750);
_global.max_level_time = 240000 /* 0x03A980 */;
} else if (_global.selected_level == 6) {
_root.game_holder._x = -480;
_root.game_holder.plant_pot.init(900, 150);
_global.max_level_time = 240000 /* 0x03A980 */;
} else if (_global.selected_level == 7) {
_root.game_holder._y = -600;
_root.game_holder.plant_pot.init(450, 900);
_global.max_level_time = 240000 /* 0x03A980 */;
} else if (_global.selected_level == 8) {
_root.game_holder.plant_pot.init(100, 100);
_global.max_level_time = 240000 /* 0x03A980 */;
} else if (_global.selected_level == 9) {
_root.game_holder._y = -240;
_root.game_holder.plant_pot.init(100, 600);
_global.max_level_time = 240000 /* 0x03A980 */;
} else if (_global.selected_level == 10) {
_root.game_holder._x = -480;
_root.game_holder.plant_pot.init(750, 100);
_global.max_level_time = 360000 /* 0x057E40 */;
} else if (_global.selected_level == 11) {
_root.game_holder.plant_pot.init(60, 300);
_global.max_level_time = 240000 /* 0x03A980 */;
} else if (_global.selected_level == 12) {
_root.game_holder._x = -440;
_root.game_holder.plant_pot.init(900, 150);
_global.max_level_time = 240000 /* 0x03A980 */;
} else if (_global.selected_level == 13) {
_root.game_holder._x = -150;
_root.game_holder._y = -700;
_root.game_holder.plant_pot.init(410, 950);
_global.max_level_time = 240000 /* 0x03A980 */;
} else if (_global.selected_level == 14) {
_root.game_holder.plant_pot.init(50, 150);
_global.max_level_time = 240000 /* 0x03A980 */;
} else if (_global.selected_level == 15) {
_root.game_holder.plant_pot.init(100, 120);
_global.max_level_time = 240000 /* 0x03A980 */;
}
_root.timer.startTimer(_global.max_level_time);
stop();
Frame 93
_global.selected_level++;
_global.game_paused = false;
delete _root.game_holder;
_root.gotoAndStop("game");
Frame 102
_global.game_paused = false;
delete _root.game_holder;
_root.gotoAndStop("game");
Symbol 1174 MovieClip [__Packages.com.nitrome.game.SimpleButton] Frame 0
class com.nitrome.game.SimpleButton extends MovieClip
{
var gotoAndStop;
function SimpleButton () {
super();
}
function onRollOver() {
gotoAndStop("_over");
}
function onRollOut() {
gotoAndStop("_up");
}
}
Symbol 1175 MovieClip [__Packages.com.nitrome.miraclegrow.BackToMapButton] Frame 0
class com.nitrome.miraclegrow.BackToMapButton extends com.nitrome.game.SimpleButton
{
function BackToMapButton () {
super();
}
function onPress() {
_root.popup.hidePopUp();
_root.music_controller.fadeOutGameMusic();
_root.tt.doTween("LEVEL_SELECT");
}
}
Symbol 1176 MovieClip [__Packages.com.nitrome.miraclegrow.Insect] Frame 0
class com.nitrome.miraclegrow.Insect extends MovieClip
{
var onEnterFrame, _visible;
function Insect () {
super();
}
function beEaten() {
alive = false;
delete onEnterFrame;
_visible = false;
}
function getAlive() {
return(alive);
}
function getPoisonous() {
return(poisonous);
}
function pauseGame() {
delete onEnterFrame;
pauseAnimation();
}
function restartGame() {
onEnterFrame = function () {
this.doEnterFrame();
};
restartAnimation();
}
function doEnterFrame() {
}
function pauseAnimation() {
}
function restartAnimation() {
}
var alive = true;
var poisonous = false;
}
Symbol 1177 MovieClip [__Packages.com.nitrome.miraclegrow.Bee] Frame 0
class com.nitrome.miraclegrow.Bee extends com.nitrome.miraclegrow.Insect
{
var id, _name, xmax, _x, xmin, ymax, _y, ymin, realx, realy, origx, origy, onEnterFrame, poisonous, speed, x, y, targx, targy, diffx, diffy, y_speed, attacking_count, gotoAndStop, gotoAndPlay, stop, play;
function Bee () {
super();
id = Number(_name.slice(4));
xmax = _x + xmax_list[id];
xmin = _x - xmin_list[id];
ymax = _y + ymax_list[id];
ymin = _y - ymin_list[id];
realx = _x;
realy = _y;
origx = _x;
origy = _y;
onEnterFrame = function () {
this.doEnterFrame();
};
}
function doEnterFrame() {
if (attacking == false) {
poisonous = false;
if (getDistance(x, y, targx, targy) > speed) {
x = x + diffx;
y = y + diffy;
} else {
x = targx;
y = targy;
reset();
}
realx = x;
realy = y;
_x = x - ((x - _x) / 1.05);
_y = y - ((y - _y) / 1.05);
if (_y < origy) {
var _local2 = random(100) + 1;
if (_local2 == 88) {
y_speed = 2;
attacking_count = 0;
attacking = true;
gotoAndStop("angry");
}
}
} else {
poisonous = true;
_y = _y + y_speed;
y_speed = y_speed * 1.1;
attacking_count++;
if ((_y >= (ymax + 50)) || (attacking_count >= 30)) {
gotoAndPlay("flying");
attacking = false;
}
}
}
function reset() {
x = realx;
y = realy;
speed = 9;
targx = xmin + (Math.random() * (xmax - xmin));
targy = ymin + (Math.random() * (ymax - ymin));
var _local3 = getDistance(x, y, targx, targy);
var _local2 = speed / _local3;
diffx = (targx - x) * _local2;
diffy = (targy - y) * _local2;
}
function getDistance(x, y, x1, y1) {
var _local2;
var _local3;
_local2 = x1 - x;
_local3 = y1 - y;
return(hyp(_local2, _local3));
}
function hyp(a, b) {
return(Math.sqrt((a * a) + (b * b)));
}
function pauseAnimation() {
stop();
}
function restartAnimation() {
play();
}
var angle = -1.55;
var a = 0;
var attacking = false;
var xmin_list = new Array(0, 200, 100, 100, 100, 100, 100, 100);
var xmax_list = new Array(0, 200, 100, 100, 100, 100, 100, 100);
var ymax_list = new Array(0, 0, 0, 0, 0, 0, 0, 0);
var ymin_list = new Array(0, 30, 62, 62, 100, 100, 100, 100);
}
Symbol 1178 MovieClip [__Packages.com.nitrome.miraclegrow.Butterfly] Frame 0
class com.nitrome.miraclegrow.Butterfly extends com.nitrome.miraclegrow.Insect
{
var init_interval, id, _name, xmax, _x, xmin, ymax, _y, ymin, realx, realy, onEnterFrame, alive, speed, x, y, targx, targy, diffx, diffy, stop, play;
function Butterfly () {
super();
init_interval = setInterval(this, "init", 200);
}
function init() {
clearInterval(init_interval);
id = Number(_name.slice(5));
xmax = _x + 100;
xmin = _x - 100;
ymax = _y + 50;
ymin = _y - 50;
realx = _x;
realy = _y;
onEnterFrame = function () {
this.doEnterFrame();
};
}
function doEnterFrame() {
if (alive == true) {
if (getDistance(x, y, targx, targy) > speed) {
x = x + diffx;
y = y + diffy;
} else {
x = targx;
y = targy;
reset();
}
realx = x;
realy = y;
_x = x - ((x - _x) / 1.05);
_y = y - ((y - _y) / 1.05);
}
}
function reset() {
x = realx;
y = realy;
speed = 9;
targx = xmin + (Math.random() * (xmax - xmin));
targy = ymin + (Math.random() * (ymax - ymin));
var _local3 = getDistance(x, y, targx, targy);
var _local2 = speed / _local3;
diffx = (targx - x) * _local2;
diffy = (targy - y) * _local2;
}
function getDistance(x, y, x1, y1) {
var _local2;
var _local3;
_local2 = x1 - x;
_local3 = y1 - y;
return(hyp(_local2, _local3));
}
function hyp(a, b) {
return(Math.sqrt((a * a) + (b * b)));
}
function pauseAnimation() {
stop();
}
function restartAnimation() {
play();
}
var angle = -1.55;
var a = 0;
}
Symbol 1179 MovieClip [__Packages.com.nitrome.miraclegrow.Caterpillar] Frame 0
class com.nitrome.miraclegrow.Caterpillar extends com.nitrome.miraclegrow.Insect
{
var id, _name, xmin, xmax, dir, speed, onEnterFrame, _x, gotoAndStop, anim;
function Caterpillar () {
super();
id = Number(_name.slice(4));
xmin = xmin_list[id];
xmax = xmax_list[id];
dir = dir_list[id];
speed = speed_list[id];
onEnterFrame = function () {
this.doEnterFrame();
};
}
function doEnterFrame() {
if (alive == true) {
if (dir == 1) {
_x = _x + speed;
if (_x >= xmax) {
dir = -1;
displayDir();
}
} else if (dir == -1) {
_x = _x - speed;
if (_x <= xmin) {
dir = 1;
displayDir();
}
}
}
}
function displayDir() {
if (dir == 1) {
gotoAndStop("walk_right");
} else if (dir == -1) {
gotoAndStop("walk_left");
}
}
function pauseAnimation() {
anim.stop();
}
function restartAnimation() {
anim.play();
}
var alive = true;
var xmin_list = new Array(0, 35, 277, 165);
var xmax_list = new Array(0, 260, 672, 375);
var dir_list = new Array(0, -1, -1, -1);
var speed_list = new Array(0, 0.5, 0.5, 0.5);
}
Symbol 1180 MovieClip [__Packages.com.nitrome.miraclegrow.ContinueButton] Frame 0
class com.nitrome.miraclegrow.ContinueButton extends com.nitrome.game.SimpleButton
{
function ContinueButton () {
super();
}
function onPress() {
_root.pm.restartGame();
}
}
Symbol 1181 MovieClip [__Packages.com.nitrome.miraclegrow.ConveyorBelt] Frame 0
class com.nitrome.miraclegrow.ConveyorBelt extends MovieClip
{
var id, _name, speed;
function ConveyorBelt () {
super();
init();
}
function init() {
id = Number(_name.slice(9));
speed = speed_list[id];
}
function getSpeed() {
return(speed);
}
var speed_list = new Array(0, 2, -2, 2, -2, 2, -2, 2, 2, 2, -2, -2);
}
Symbol 1182 MovieClip [__Packages.com.nitrome.miraclegrow.CreditsButton] Frame 0
class com.nitrome.miraclegrow.CreditsButton extends com.nitrome.game.SimpleButton
{
function CreditsButton () {
super();
}
function onPress() {
_root.tt.doTween("CREDITS");
}
}
Symbol 1183 MovieClip [__Packages.com.nitrome.miraclegrow.VerticalPlatform] Frame 0
class com.nitrome.miraclegrow.VerticalPlatform extends MovieClip
{
var id, _name, speed, dir, ma, mi, can_land, _y;
function VerticalPlatform () {
super();
init();
}
function init() {
id = Number(_name.slice(5));
speed = speed_list[id];
dir = dir_list[id];
ma = max_list[id];
mi = min_list[id];
can_land = can_land_list[id];
}
function getCanLand() {
if (can_land == 1) {
return(true);
}
return(false);
}
function getIsStopped() {
return(false);
}
function main() {
if (dir == 1) {
if ((_y + speed) >= ma) {
var _local2 = ma - _y;
_y = ma;
dir = -1;
return(_local2);
}
_y = _y + speed;
return(speed);
}
if (dir == -1) {
if ((_y - speed) <= mi) {
var _local2 = _y - mi;
_y = mi;
dir = 1;
return(-_local2);
}
_y = _y - speed;
return(-speed);
}
}
var speed_list = new Array(0, 1, 1, 2, 2, 1, 2, 1);
var dir_list = new Array(0, 1, 1, -1, 1, -1, 1, -1);
var max_list = new Array(0, 990, 40, -50, -150, -280, -280, -368);
var min_list = new Array(0, 523, -390, -480, -580, -710, -720, -678);
var can_land_list = new Array(0, 1, 0, 0, 0, 0, 0, 0);
}
Symbol 1184 MovieClip [__Packages.com.nitrome.miraclegrow.Dragonfly] Frame 0
class com.nitrome.miraclegrow.Dragonfly extends com.nitrome.miraclegrow.Insect
{
var init_interval, id, _name, xmax, _x, xmin, ymax, _y, ymin, realx, realy, onEnterFrame, alive, speed, x, y, targx, targy, diffx, diffy, gotoAndStop, anim;
function Dragonfly () {
super();
init_interval = setInterval(this, "init", 200);
}
function init() {
clearInterval(init_interval);
id = Number(_name.slice(5));
xmax = _x + 300;
xmin = _x - 300;
ymax = _y + 25;
ymin = _y - 25;
realx = _x;
realy = _y;
onEnterFrame = function () {
this.doEnterFrame();
};
}
function doEnterFrame() {
if (alive == true) {
if (getDistance(x, y, targx, targy) > speed) {
x = x + diffx;
y = y + diffy;
} else {
x = targx;
y = targy;
reset();
}
realx = x;
realy = y;
_x = x - ((x - _x) / 1.05);
_y = y - ((y - _y) / 1.05);
}
}
function reset() {
x = realx;
y = realy;
speed = 9;
targx = xmin + (Math.random() * (xmax - xmin));
targy = ymin + (Math.random() * (ymax - ymin));
var _local3 = getDistance(x, y, targx, targy);
var _local2 = speed / _local3;
diffx = (targx - x) * _local2;
diffy = (targy - y) * _local2;
if (targx > _x) {
gotoAndStop("fly_right");
} else {
gotoAndStop("fly_left");
}
}
function getDistance(x, y, x1, y1) {
var _local2;
var _local3;
_local2 = x1 - x;
_local3 = y1 - y;
return(hyp(_local2, _local3));
}
function hyp(a, b) {
return(Math.sqrt((a * a) + (b * b)));
}
function pauseAnimation() {
anim.stop();
}
function restartAnimation() {
anim.play();
}
var angle = -1.55;
var a = 0;
}
Symbol 1185 MovieClip [__Packages.com.nitrome.miraclegrow.EnergyBar] Frame 0
class com.nitrome.miraclegrow.EnergyBar extends MovieClip
{
var gotoAndStop;
function EnergyBar () {
super();
}
function doHit() {
hits_left--;
_root.hit_sfx.gotoAndPlay(2);
doDisplay();
}
function doDisplay() {
gotoAndStop(String("lives_" + hits_left));
}
function getHitsLeft() {
return(hits_left);
}
var hits_left = 5;
}
Symbol 1186 MovieClip [__Packages.com.nitrome.miraclegrow.FallingTomato] Frame 0
class com.nitrome.miraclegrow.FallingTomato extends MovieClip
{
var id, _name, max_length, speed, offset, original_y, _y, start_interval, ytween, splat_interval, gotoAndStop, reset_interval, anim;
function FallingTomato () {
super();
id = Number(_name.slice(4));
max_length = max_length_list[id];
speed = speed_list[id];
offset = offset_list[id];
original_y = _y;
waiting_to_start = true;
start_interval = setInterval(this, "startToFall", offset);
}
function startToFall() {
clearInterval(start_interval);
waiting_to_start = false;
falling = true;
ytween = new mx.transitions.Tween(this, "_y", mx.transitions.easing.Regular.easeIn, _y, _y + max_length, speed, true);
splat_interval = setInterval(this, "doSplat", speed * 1000);
}
function doSplat() {
clearInterval(splat_interval);
falling = false;
splat_or_regrow = true;
gotoAndStop("splat");
}
function reposition() {
ytween.stop();
ytween = new mx.transitions.Tween();
delete ytween;
_y = original_y;
}
function reset() {
gotoAndStop("attached");
splat_or_regrow = false;
waiting_to_reset = true;
reset_interval = setInterval(this, "doReset", 2000);
}
function doReset() {
clearInterval(reset_interval);
startToFall();
}
function doPause() {
if (waiting_to_start == true) {
clearInterval(start_interval);
} else if (falling == true) {
ytween.stop();
clearInterval(splat_interval);
} else if (splat_or_regrow == true) {
anim.stop();
} else if (waiting_to_reset == true) {
clearInterval(reset_interval);
}
}
function doContinue() {
if (waiting_to_start == true) {
start_interval = setInterval(this, "startToFall", offset);
} else if (falling == true) {
var _local2 = ytween.__get__time();
ytween.resume();
splat_interval = setInterval(this, "doSplat", _local2 * 1000);
} else if (splat_or_regrow == true) {
anim.play();
} else if (waiting_to_reset == true) {
reset_interval = setInterval(this, "doReset", 2000);
}
}
function getXDistance(x1, x2) {
if (x1 > x2) {
return(x1 - x2);
}
if (x2 > x1) {
return(x2 - x1);
}
return(0);
}
function getYDistance(y1, y2) {
if (y1 > y2) {
return(y1 - y2);
}
if (y2 > y1) {
return(y2 - y1);
}
return(0);
}
var max_length_list = new Array(0, 100, 95, 95, 95, 95, 95, 95, 110, 110, 110, 110, 110, 110, 110, 110, 95, 95, 95, 95, 95, 95);
var offset_list = new Array(0, 0, 3000, 2500, 2000, 1500, 1000, 500, 0, 1000, 2000, 3200, 2100, 7500, 55, 1600, 200, 0, 3500, 4150, 1700, 5800);
var speed_list = new Array(0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
var waiting_to_start = false;
var falling = false;
var splat_or_regrow = false;
var waiting_to_reset = false;
}
Symbol 1187 MovieClip [__Packages.mx.transitions.OnEnterFrameBeacon] Frame 0
class mx.transitions.OnEnterFrameBeacon
{
function OnEnterFrameBeacon () {
}
static function init() {
var _local4 = _global.MovieClip;
if (!_root.__OnEnterFrameBeacon) {
mx.transitions.BroadcasterMX.initialize(_local4);
var _local3 = _root.createEmptyMovieClip("__OnEnterFrameBeacon", 9876);
_local3.onEnterFrame = function () {
_global.MovieClip.broadcastMessage("onEnterFrame");
};
}
}
static var version = "1.1.0.52";
}
Symbol 1188 MovieClip [__Packages.mx.transitions.BroadcasterMX] Frame 0
class mx.transitions.BroadcasterMX
{
var _listeners;
function BroadcasterMX () {
}
static function initialize(o, dontCreateArray) {
if (o.broadcastMessage != undefined) {
delete o.broadcastMessage;
}
o.addListener = mx.transitions.BroadcasterMX.prototype.addListener;
o.removeListener = mx.transitions.BroadcasterMX.prototype.removeListener;
if (!dontCreateArray) {
o._listeners = new Array();
}
}
function addListener(o) {
removeListener(o);
if (broadcastMessage == undefined) {
broadcastMessage = mx.transitions.BroadcasterMX.prototype.broadcastMessage;
}
return(_listeners.push(o));
}
function removeListener(o) {
var _local2 = _listeners;
var _local3 = _local2.length;
while (_local3--) {
if (_local2[_local3] == o) {
_local2.splice(_local3, 1);
if (!_local2.length) {
broadcastMessage = undefined;
}
return(true);
}
}
return(false);
}
function broadcastMessage() {
var _local5 = String(arguments.shift());
var _local4 = _listeners.concat();
var _local6 = _local4.length;
var _local3 = 0;
while (_local3 < _local6) {
_local4[_local3][_local5].apply(_local4[_local3], arguments);
_local3++;
}
}
static var version = "1.1.0.52";
}
Symbol 1189 MovieClip [__Packages.mx.transitions.Tween] Frame 0
class mx.transitions.Tween
{
var obj, prop, begin, useSeconds, _listeners, addListener, prevTime, _time, looping, _duration, broadcastMessage, isPlaying, _fps, prevPos, _pos, change, _intervalID, _startTime;
function Tween (obj, prop, func, begin, finish, duration, useSeconds) {
mx.transitions.OnEnterFrameBeacon.init();
if (!arguments.length) {
return;
}
this.obj = obj;
this.prop = prop;
this.begin = begin;
position = (begin);
this.duration = (duration);
this.useSeconds = useSeconds;
if (func) {
this.func = func;
}
this.finish = (finish);
_listeners = [];
addListener(this);
start();
}
function set time(t) {
prevTime = _time;
if (t > duration) {
if (looping) {
rewind(t - _duration);
update();
broadcastMessage("onMotionLooped", this);
} else {
if (useSeconds) {
_time = _duration;
update();
}
stop();
broadcastMessage("onMotionFinished", this);
}
} else if (t < 0) {
rewind();
update();
} else {
_time = t;
update();
}
//return(time);
}
function get time() {
return(_time);
}
function set duration(d) {
_duration = (((d == null) || (d <= 0)) ? (_global.Infinity) : (d));
//return(duration);
}
function get duration() {
return(_duration);
}
function set FPS(fps) {
var _local2 = isPlaying;
stopEnterFrame();
_fps = fps;
if (_local2) {
startEnterFrame();
}
//return(FPS);
}
function get FPS() {
return(_fps);
}
function set position(p) {
setPosition(p);
//return(position);
}
function setPosition(p) {
prevPos = _pos;
obj[prop] = (_pos = p);
broadcastMessage("onMotionChanged", this, _pos);
updateAfterEvent();
}
function get position() {
return(getPosition());
}
function getPosition(t) {
if (t == undefined) {
t = _time;
}
return(func(t, begin, change, _duration));
}
function set finish(f) {
change = f - begin;
//return(finish);
}
function get finish() {
return(begin + change);
}
function continueTo(finish, duration) {
begin = position;
this.finish = (finish);
if (duration != undefined) {
this.duration = (duration);
}
start();
}
function yoyo() {
continueTo(begin, time);
}
function startEnterFrame() {
if (_fps == undefined) {
_global.MovieClip.addListener(this);
} else {
_intervalID = setInterval(this, "onEnterFrame", 1000 / _fps);
}
isPlaying = true;
}
function stopEnterFrame() {
if (_fps == undefined) {
_global.MovieClip.removeListener(this);
} else {
clearInterval(_intervalID);
}
isPlaying = false;
}
function start() {
rewind();
startEnterFrame();
broadcastMessage("onMotionStarted", this);
}
function stop() {
stopEnterFrame();
broadcastMessage("onMotionStopped", this);
}
function resume() {
fixTime();
startEnterFrame();
broadcastMessage("onMotionResumed", this);
}
function rewind(t) {
_time = ((t == undefined) ? 0 : (t));
fixTime();
update();
}
function fforward() {
time = (_duration);
fixTime();
}
function nextFrame() {
if (useSeconds) {
time = ((getTimer() - _startTime) / 1000);
} else {
time = (_time + 1);
}
}
function onEnterFrame() {
nextFrame();
}
function prevFrame() {
if (!useSeconds) {
time = (_time - 1);
}
}
function toString() {
return("[Tween]");
}
function fixTime() {
if (useSeconds) {
_startTime = getTimer() - (_time * 1000);
}
}
function update() {
position = (getPosition(_time));
}
static var version = "1.1.0.52";
static var __initBeacon = mx.transitions.OnEnterFrameBeacon.init();
static var __initBroadcaster = mx.transitions.BroadcasterMX.initialize(mx.transitions.Tween.prototype, true);
function func(t, b, c, d) {
return(((c * t) / d) + b);
}
}
Symbol 1190 MovieClip [__Packages.mx.transitions.easing.Regular] Frame 0
class mx.transitions.easing.Regular
{
function Regular () {
}
static function easeIn(t, b, c, d) {
t = t / d;
return(((c * t) * t) + b);
}
static function easeOut(t, b, c, d) {
t = t / d;
return((((-c) * t) * (t - 2)) + b);
}
static function easeInOut(t, b, c, d) {
t = t / (d / 2);
if (t < 1) {
return((((c / 2) * t) * t) + b);
}
t--;
return((((-c) / 2) * ((t * (t - 2)) - 1)) + b);
}
static var version = "1.1.0.52";
}
Symbol 1191 MovieClip [__Packages.com.nitrome.miraclegrow.Fly] Frame 0
class com.nitrome.miraclegrow.Fly extends com.nitrome.miraclegrow.Insect
{
var init_interval, id, _name, xmax, _x, xmin, ymax, _y, ymin, realx, realy, onEnterFrame, alive, speed, x, y, targx, targy, diffx, diffy, stop, play;
function Fly () {
super();
init_interval = setInterval(this, "init", 200);
}
function init() {
clearInterval(init_interval);
id = Number(_name.slice(4));
xmax = _x + 100;
xmin = _x - 100;
ymax = _y + 100;
ymin = _y - 100;
realx = _x;
realy = _y;
onEnterFrame = function () {
this.doEnterFrame();
};
}
function doEnterFrame() {
if (alive == true) {
if (getDistance(x, y, targx, targy) > speed) {
x = x + diffx;
y = y + diffy;
} else {
x = targx;
y = targy;
reset();
}
realx = x;
realy = y;
_x = x - ((x - _x) / 1.15);
_y = y - ((y - _y) / 1.15);
}
}
function reset() {
x = realx;
y = realy;
speed = 20;
targx = xmin + (Math.random() * (xmax - xmin));
targy = ymin + (Math.random() * (ymax - ymin));
var _local3 = getDistance(x, y, targx, targy);
var _local2 = speed / _local3;
diffx = (targx - x) * _local2;
diffy = (targy - y) * _local2;
}
function getDistance(x, y, x1, y1) {
var _local2;
var _local3;
_local2 = x1 - x;
_local3 = y1 - y;
return(hyp(_local2, _local3));
}
function hyp(a, b) {
return(Math.sqrt((a * a) + (b * b)));
}
function pauseAnimation() {
stop();
}
function restartAnimation() {
play();
}
var angle = -1.55;
var a = 0;
}
Symbol 1192 MovieClip [__Packages.com.nitrome.game.GameResetButton] Frame 0
class com.nitrome.game.GameResetButton extends MovieClip
{
var useHandCursor, gotoAndStop;
function GameResetButton () {
super();
}
function onRollOver() {
if (done_reset == false) {
useHandCursor = true;
gotoAndStop("_over");
} else {
useHandCursor = false;
gotoAndStop("game_reset");
}
}
function onRollOut() {
if (done_reset == false) {
gotoAndStop("_up");
} else {
gotoAndStop("game_reset");
}
}
function onPress() {
if (done_reset == false) {
_root.sf.resetAll();
done_reset = true;
gotoAndStop("game_reset");
} else {
gotoAndStop("game_reset");
}
}
function onRelease() {
if (done_reset == false) {
gotoAndStop("_over");
} else {
gotoAndStop("game_reset");
}
}
function onReleaseOutside() {
if (done_reset == false) {
gotoAndStop("_up");
} else {
gotoAndStop("game_reset");
}
}
var done_reset = false;
}
Symbol 1193 MovieClip [__Packages.com.nitrome.miraclegrow.Grasshopper] Frame 0
class com.nitrome.miraclegrow.Grasshopper extends com.nitrome.miraclegrow.Insect
{
var id, _name, xmin, xmax, dir, speed, onEnterFrame, _x, gotoAndStop, anim;
function Grasshopper () {
super();
id = Number(_name.slice(6));
xmin = xmin_list[id];
xmax = xmax_list[id];
dir = dir_list[id];
speed = speed_list[id];
onEnterFrame = function () {
this.doEnterFrame();
};
}
function doEnterFrame() {
if (alive == true) {
if (moving == true) {
if (dir == 1) {
_x = _x + speed;
if (_x >= xmax) {
dir = -1;
displayDir();
}
} else if (dir == -1) {
_x = _x - speed;
if (_x <= xmin) {
dir = 1;
displayDir();
}
}
}
}
}
function startMoving() {
moving = true;
}
function stopMoving() {
moving = false;
}
function displayDir() {
if (dir == 1) {
gotoAndStop("bounce_right");
} else if (dir == -1) {
gotoAndStop("bounce_left");
}
}
function pauseAnimation() {
anim.stop();
}
function restartAnimation() {
anim.play();
}
var alive = true;
var xmin_list = new Array(0, 1008, 0);
var xmax_list = new Array(0, 1348, 0);
var dir_list = new Array(0, 1, 0);
var speed_list = new Array(0, 1, 1);
var moving = false;
}
Symbol 1194 MovieClip [__Packages.com.nitrome.miraclegrow.HelpButton] Frame 0
class com.nitrome.miraclegrow.HelpButton extends com.nitrome.game.SimpleButton
{
function HelpButton () {
super();
}
function onPress() {
_root.tt.doTween("HELP");
}
}
Symbol 1195 MovieClip [__Packages.com.nitrome.miraclegrow.HorizontalPlatform] Frame 0
class com.nitrome.miraclegrow.HorizontalPlatform extends MovieClip
{
var id, _name, speed, dir, ma, mi, _x;
function HorizontalPlatform () {
super();
init();
}
function init() {
id = Number(_name.slice(6));
speed = speed_list[id];
dir = dir_list[id];
ma = max_list[id];
mi = min_list[id];
}
function getIsStopped() {
return(false);
}
function main() {
if (dir == 1) {
if ((_x + speed) >= ma) {
var _local2 = ma - _x;
_x = ma;
dir = -1;
return(_local2);
}
_x = _x + speed;
return(speed);
}
if (dir == -1) {
if ((_x - speed) <= mi) {
var _local2 = _x - mi;
_x = mi;
dir = 1;
return(-_local2);
}
_x = _x - speed;
return(-speed);
}
}
var speed_list = new Array(0, 1, 1, 1, 1, 1, 1, 1, 1);
var dir_list = new Array(0, 1, -1, 1, -1, 1, 1, 1, 1);
var max_list = new Array(0, 797, 715, 1304, 1374, 554, 685, 998, 593);
var min_list = new Array(0, 547, 177, 114, 186, 114, 375, 776, 283);
}
Symbol 1196 MovieClip [__Packages.com.nitrome.miraclegrow.Ladybird] Frame 0
class com.nitrome.miraclegrow.Ladybird extends com.nitrome.miraclegrow.Insect
{
var init_interval, id, _name, xmax, _x, xmin, ymax, _y, ymin, realx, realy, onEnterFrame, alive, speed, x, y, targx, targy, diffx, diffy, stop, play;
function Ladybird () {
super();
init_interval = setInterval(this, "init", 250);
}
function init() {
clearInterval(init_interval);
id = Number(_name.slice(5));
xmax = _x + 50;
xmin = _x - 50;
ymax = _y + 50;
ymin = _y - 50;
realx = _x;
realy = _y;
onEnterFrame = function () {
this.doEnterFrame();
};
}
function doEnterFrame() {
if (alive == true) {
if (getDistance(x, y, targx, targy) > speed) {
x = x + diffx;
y = y + diffy;
} else {
x = targx;
y = targy;
reset();
}
realx = x;
realy = y;
_x = x - ((x - _x) / 1.05);
_y = y - ((y - _y) / 1.05);
}
}
function reset() {
x = realx;
y = realy;
speed = 9;
targx = xmin + (Math.random() * (xmax - xmin));
targy = ymin + (Math.random() * (ymax - ymin));
var _local3 = getDistance(x, y, targx, targy);
var _local2 = speed / _local3;
diffx = (targx - x) * _local2;
diffy = (targy - y) * _local2;
}
function getDistance(x, y, x1, y1) {
var _local2;
var _local3;
_local2 = x1 - x;
_local3 = y1 - y;
return(hyp(_local2, _local3));
}
function hyp(a, b) {
return(Math.sqrt((a * a) + (b * b)));
}
function pauseAnimation() {
stop();
}
function restartAnimation() {
play();
}
var angle = -1.55;
var a = 0;
}
Symbol 1197 MovieClip [__Packages.com.nitrome.miraclegrow.LevelSelectButton] Frame 0
class com.nitrome.miraclegrow.LevelSelectButton extends MovieClip
{
var init_interval, id, _name, gotoAndStop, _x, _y, useHandCursor;
function LevelSelectButton () {
super();
init_interval = setInterval(this, "init", 200);
}
function init() {
clearInterval(init_interval);
id = Number(_name.slice(6));
if (_root.sf.getLevelUnlocked(id) == true) {
current_state = ACTIVE;
gotoAndStop("_up");
if (_global.last_played_level == 0) {
if ((_root.sf.getLevelUnlocked(15) == true) && (id == 1)) {
_global.selected_level = id;
_root.map_plant._x = _x;
_root.map_plant._y = _y;
current_state = SAT_ON;
_root.level_name_panel.displayLevel(id);
_root.level_score_panel.displayScore(id);
} else if (id == 15) {
} else if (_root.sf.getLevelUnlocked(id + 1) == false) {
_global.selected_level = id;
_root.map_plant._x = _x;
_root.map_plant._y = _y;
current_state = SAT_ON;
_root.level_name_panel.displayLevel(id);
_root.level_score_panel.displayScore(id);
}
} else if (_global.last_played_level == id) {
_global.selected_level = id;
_root.map_plant._x = _x;
_root.map_plant._y = _y;
current_state = SAT_ON;
_root.level_name_panel.displayLevel(id);
_root.level_score_panel.displayScore(id);
}
}
}
function onRollOver() {
if (current_state == ACTIVE) {
useHandCursor = true;
gotoAndStop("_over");
} else if (current_state == OFF) {
useHandCursor = false;
gotoAndStop("_off");
} else if (current_state == SAT_ON) {
useHandCursor = false;
gotoAndStop("_up");
}
}
function onRollOut() {
if (current_state == ACTIVE) {
gotoAndStop("_up");
} else if (current_state == OFF) {
gotoAndStop("_off");
} else if (current_state == SAT_ON) {
gotoAndStop("_up");
}
}
function onPress() {
if (current_state == OFF) {
gotoAndStop("_off");
} else if (current_state == ACTIVE) {
_root["level_" + _global.selected_level].setStateActive();
_global.selected_level = id;
_root.map_plant._x = _x;
_root.map_plant._y = _y;
_root.level_name_panel.displayLevel(id);
_root.level_score_panel.displayScore(id);
current_state = SAT_ON;
gotoAndStop("_up");
} else if (current_state == SAT_ON) {
_global.selected_level = id;
gotoAndStop("_up");
}
}
function setStateActive() {
current_state = ACTIVE;
gotoAndStop("_up");
}
var current_state = 0;
var OFF = 0;
var ACTIVE = 1;
var SAT_ON = 2;
}
Symbol 1198 MovieClip [__Packages.com.nitrome.miraclegrow.NeckLengthDisplay] Frame 0
class com.nitrome.miraclegrow.NeckLengthDisplay extends MovieClip
{
var length_text, pot, head, plant_neck_stretch;
function NeckLengthDisplay () {
super();
drawNeck();
}
function displayLength(l) {
len = l;
length_text.text = String(l);
head._x = pot._x + (l - 26);
length_text._x = head._x + 28;
drawNeck();
}
function drawNeck() {
plant_neck_stretch._width = (head._x - pot._x) + 5;
}
function getNeckLength() {
return(len);
}
var len = 100;
}
Symbol 1199 MovieClip [__Packages.com.nitrome.loading.FileLoader] Frame 0
class com.nitrome.loading.FileLoader extends MovieClip
{
var _visible, getURL;
function FileLoader () {
super();
_visible = false;
var _local6 = false;
var _local4 = 0;
while (_local4 < urls.length) {
var _local5 = urls[_local4];
if (_root._url.substr(0, _local5.length) == _local5) {
_local6 = true;
}
_local4++;
}
_local4 = 1;
while (_local4 <= 30) {
var _local5 = "miniclip.com";
if (_root._url.substr(_local4, _local5.length) == _local5) {
_local6 = true;
}
_local4++;
}
if (_local6 == true) {
_visible = false;
} else {
trace("problem with url: " + _root._url);
_visible = true;
(getURL("http://www.nitrome.com/games/feedme", "_blank"));// not popped
}
}
var done_check = false;
var urls = new Array("http://www.nitrome.com", "http://nitrome.com", "http://www.miniclip.com", "http://www.miniclip.co.uk", "http://www.miniclip", "http://miniclip.com", "http://miniclip");
}
Symbol 1200 MovieClip [__Packages.com.nitrome.game.NoClicks] Frame 0
class com.nitrome.game.NoClicks extends MovieClip
{
var useHandCursor;
function NoClicks () {
super();
useHandCursor = false;
}
function onRollOver() {
useHandCursor = false;
}
function onPress() {
}
}
Symbol 1201 MovieClip [__Packages.com.nitrome.miraclegrow.OptionsButton] Frame 0
class com.nitrome.miraclegrow.OptionsButton extends com.nitrome.game.SimpleButton
{
function OptionsButton () {
super();
}
function onPress() {
_root.tt.doTween("OPTIONS");
}
}
Symbol 1202 MovieClip [__Packages.com.nitrome.game.OptionsSoundToggle] Frame 0
class com.nitrome.game.OptionsSoundToggle extends MovieClip
{
var gotoAndStop;
function OptionsSoundToggle () {
super();
if (_root.sf.getSoundOn() == false) {
gotoAndStop("sound_off_up");
}
}
function onRollOver() {
updateGraphic(true);
}
function onRollOut() {
updateGraphic(false);
}
function onPress() {
_root.sound_toggle.toggleSound();
updateGraphic(true);
_root.sound_toggle.updateGraphic(false);
}
function updateGraphic(mouse_is_over) {
if (mouse_is_over == true) {
if (_root.sound_toggle.getSoundOn() == true) {
gotoAndStop("sound_on_over");
} else if (_root.sound_toggle.getSoundOn() == false) {
gotoAndStop("sound_off_over");
}
} else if (mouse_is_over == false) {
if (_root.sound_toggle.getSoundOn() == true) {
gotoAndStop("sound_on_up");
} else if (_root.sound_toggle.getSoundOn() == false) {
gotoAndStop("sound_off_up");
}
}
}
}
Symbol 1203 MovieClip [__Packages.com.nitrome.miraclegrow.PauseButton] Frame 0
class com.nitrome.miraclegrow.PauseButton extends com.nitrome.game.SimpleButton
{
function PauseButton () {
super();
}
function onPress() {
_root.pm.pauseGame(false);
}
}
Symbol 1204 MovieClip [__Packages.com.nitrome.miraclegrow.PlantPot] Frame 0
class com.nitrome.miraclegrow.PlantPot extends MovieClip
{
var map, stone_map, mud_map, level_w, level_h, screen_w, screen_h, xmax, xmin, ymax, ymin, _x, _y, loop_interval, hold_count_amount, plant_x_tween, plant_y_tween, plant_check_interval, saved_x_speed, d_x, d_y, hold_count, _alpha, level_end_interval;
function PlantPot () {
super();
}
function init(x_pos, y_pos) {
map = _root.game_holder.map;
stone_map = _root.game_holder.stone_map;
mud_map = _root.game_holder.mud_map;
level_w = _root.game_holder.map._width;
level_h = _root.game_holder.map._height;
screen_w = 550;
screen_h = 400;
xmax = 0;
xmin = (-level_w) + screen_w;
ymax = 0;
ymin = (-level_h) + screen_h;
_x = x_pos;
_y = y_pos;
_root.neck_length_display.displayLength(max_neck_length);
loop_interval = setInterval(this, "loop", loop_speed);
}
function doMouseDown() {
if (level_ended == false) {
mouse_is_down = true;
holding_on = false;
hold_count_amount = 0;
grabbed_platform = "";
plant_x_tween.stop();
plant_y_tween.stop();
plant_x_tween = new mx.transitions.Tween();
plant_y_tween = new mx.transitions.Tween();
clearInterval(plant_check_interval);
if (y_speed > 0) {
y_speed = 0;
}
var _local3 = _root.game_holder._xmouse;
var _local4 = _root.game_holder._ymouse;
var _local7 = getDistance(_x, _y, _local3, _local4);
if (_local7 > max_neck_length) {
var _local6 = Math.atan2(_root.game_holder._ymouse - _y, _root.game_holder._xmouse - _x);
var _local5 = Math.round((_local6 * 180) / Math.PI);
_local3 = _x + (max_neck_length * Math.cos((_local5 * Math.PI) / 180));
_local4 = _y + (max_neck_length * Math.sin((_local5 * Math.PI) / 180));
}
plant_x_tween = new mx.transitions.Tween(_root.game_holder.plant_head, "_x", mx.transitions.easing.None.easeNone, _root.game_holder.plant_head._x, _local3, 12, false);
plant_y_tween = new mx.transitions.Tween(_root.game_holder.plant_head, "_y", mx.transitions.easing.None.easeNone, _root.game_holder.plant_head._y, _local4, 12, false);
plant_x_tween.onMotionFinished = function () {
clearInterval(this.plant_check_interval);
this.plant_x_tween = new mx.transitions.Tween(_root.game_holder.plant_head, "_x", mx.transitions.easing.Bounce.easeOut, _root.game_holder.plant_head._x, _root.game_holder.plant_pot._x, 12, false);
this.plant_y_tween = new mx.transitions.Tween(_root.game_holder.plant_head, "_y", mx.transitions.easing.Bounce.easeOut, _root.game_holder.plant_head._y, _root.game_holder.plant_pot._y - 20, 12, false);
};
plant_check_interval = setInterval(this, "checkPlant", 10);
}
}
function doMouseUp() {
if (level_ended == false) {
clearInterval(plant_check_interval);
plant_x_tween.stop();
plant_y_tween.stop();
plant_x_tween = new mx.transitions.Tween();
plant_y_tween = new mx.transitions.Tween();
mouse_is_down = false;
grabbed_platform = "";
_root.game_holder.plant_head.gotoAndStop("open");
if (holding_on == true) {
_root.game_holder.plant_pot.tweening_back = false;
x_speed = saved_x_speed;
} else {
tweening_back = true;
plant_x_tween = new mx.transitions.Tween(_root.game_holder.plant_head, "_x", mx.transitions.easing.Bounce.easeOut, _root.game_holder.plant_head._x, _root.game_holder.plant_pot._x, 12, false);
plant_y_tween = new mx.transitions.Tween(_root.game_holder.plant_head, "_y", mx.transitions.easing.Bounce.easeOut, _root.game_holder.plant_head._y, _root.game_holder.plant_pot._y - 20, 12, false);
plant_x_tween.onMotionFinished = function () {
_root.game_holder.plant_pot.tweening_back = false;
};
}
holding_on = false;
}
}
function checkPlant() {
if (map.hitTest(_root.game_holder._x + _root.game_holder.plant_head._x, _root.game_holder._y + _root.game_holder.plant_head._y, true) || (mud_map.hitTest(_root.game_holder._x + _root.game_holder.plant_head._x, _root.game_holder._y + _root.game_holder.plant_head._y, true))) {
clearInterval(plant_check_interval);
plant_x_tween.stop();
plant_y_tween.stop();
plant_x_tween = new mx.transitions.Tween();
plant_y_tween = new mx.transitions.Tween();
holding_on = true;
grabbed_platform = "";
sitting_platform = "";
_root.game_holder.plant_head.gotoAndStop("shut");
_root.bite_sfx.gotoAndPlay(2);
d_x = _root.game_holder.plant_head._x;
d_y = _root.game_holder.plant_head._y + min_neck_length;
if (d_x > _x) {
x_speed = (d_x - _x) / increments;
hold_count_amount = d_x - _x;
if (x_speed < 2) {
x_speed = 2;
}
swing_amount = Math.abs(x_speed);
} else if (d_x < _x) {
x_speed = -((_x - d_x) / increments);
hold_count_amount = _x - d_x;
if (x_speed > -2) {
x_speed = -2;
}
swing_amount = Math.abs(x_speed);
} else {
x_speed = 0;
hold_count_amount = 0;
}
if (d_y > _y) {
y_speed = (d_y - _y) / 15;
} else if (d_y < _y) {
y_speed = -((_y - d_y) / 15);
} else {
y_speed = 0;
}
hold_count = 0;
hold_count_amount = 8;
saved_x_speed = x_speed;
} else if (stone_map.hitTest(_root.game_holder._x + _root.game_holder.plant_head._x, _root.game_holder._y + _root.game_holder.plant_head._y, true)) {
clearInterval(plant_check_interval);
plant_x_tween.stop();
plant_y_tween.stop();
plant_x_tween = new mx.transitions.Tween();
plant_y_tween = new mx.transitions.Tween();
_root.game_holder.plant_head.gotoAndPlay("eat");
_root.bite_sfx.gotoAndPlay(2);
} else {
grabbed_platform = "";
var _local3 = 0;
while (_local3 <= horiz_platform_num) {
if (_root.game_holder["horiz_" + _local3].hitTest(_root.game_holder._x + _root.game_holder.plant_head._x, _root.game_holder._y + _root.game_holder.plant_head._y, true)) {
grabbed_platform = String("horiz_" + _local3);
break;
}
_local3++;
}
if (grabbed_platform == "") {
_local3 = 0;
while (_local3 <= vert_platform_num) {
if (_root.game_holder["vert_" + _local3].hitTest(_root.game_holder._x + _root.game_holder.plant_head._x, _root.game_holder._y + _root.game_holder.plant_head._y, true)) {
grabbed_platform = String("vert_" + _local3);
break;
}
_local3++;
}
}
if (grabbed_platform == "") {
_local3 = 0;
while (_local3 <= conveyor_num) {
if (_root.game_holder["conveyor_" + _local3].hitTest(_root.game_holder._x + _root.game_holder.plant_head._x, _root.game_holder._y + _root.game_holder.plant_head._y, true)) {
grabbed_platform = String("conveyor_" + _local3);
break;
}
_local3++;
}
}
if (grabbed_platform != "") {
sitting_platform = "";
clearInterval(plant_check_interval);
plant_x_tween.stop();
plant_y_tween.stop();
plant_x_tween = new mx.transitions.Tween();
plant_y_tween = new mx.transitions.Tween();
holding_on = true;
_root.game_holder.plant_head.gotoAndStop("shut");
_root.bite_sfx.gotoAndPlay(2);
d_x = _root.game_holder.plant_head._x;
d_y = _root.game_holder.plant_head._y + min_neck_length;
if (d_x > _x) {
x_speed = (d_x - _x) / increments;
hold_count_amount = d_x - _x;
hold_count_amount = hold_count_amount / 2;
if (x_speed < 2) {
x_speed = 2;
}
swing_amount = Math.abs(x_speed);
} else if (d_x < _x) {
x_speed = -((_x - d_x) / increments);
hold_count_amount = _x - d_x;
hold_count_amount = hold_count_amount / 2;
if (x_speed > -2) {
x_speed = -2;
}
swing_amount = Math.abs(x_speed);
} else {
x_speed = 0;
hold_count_amount = 0;
}
if (d_y > _y) {
y_speed = (d_y - _y) / 15;
} else if (d_y < _y) {
y_speed = -((_y - d_y) / 15);
} else {
y_speed = 0;
}
hold_count = 0;
saved_x_speed = x_speed;
} else {
var _local4 = checkEatInsect();
if (_local4 == false) {
_local3 = 1;
while (_local3 <= 3) {
if (_root.game_holder["can_" + _local3].hitTest(_root.game_holder._x + _root.game_holder.plant_head._x, _root.game_holder._y + _root.game_holder.plant_head._y, true)) {
if (_root.game_holder["can_" + _local3].getAvailable() == true) {
_root.game_holder.plant_head.gotoAndPlay("eat");
_root.bite_sfx.gotoAndPlay(2);
collectCan("can_" + _local3);
_root.collect_sfx.gotoAndPlay(2);
_local4 = true;
break;
}
}
_local3++;
}
}
}
}
}
function loop() {
_root.game_holder.plant_stem.main();
checkCollisions();
checkLevelEnd();
_x = _x + x_speed;
_y = _y + y_speed;
if (mouse_is_down == false) {
if (tweening_back == false) {
_root.game_holder.plant_head._x = _x;
_root.game_holder.plant_head._y = _y - min_neck_length;
}
var _local3 = getMouseAngle(_root.game_holder._x + _root.game_holder.plant_head._x, _root.game_holder._y + _root.game_holder.plant_head._y);
_root.game_holder.plant_head._rotation = _local3;
}
moveHorizontalPlatforms();
moveVerticalPlatforms();
moveConveyorBelts();
scrollLevel();
_root.game_holder.plant_stem.main();
if (flickering == false) {
_alpha = 100;
_root.game_holder.plant_head._alpha = 100;
_root.game_holder.plant_stem._alpha = 100;
checkForDanger();
} else if (flickering == true) {
flicker_count++;
if (flicker_count == 40) {
_alpha = 100;
_root.game_holder.plant_head._alpha = 100;
_root.game_holder.plant_stem._alpha = 100;
flickering = false;
} else if ((flicker_count % 4) == 0) {
_alpha = 10;
_root.game_holder.plant_head._alpha = 10;
_root.game_holder.plant_stem._alpha = 10;
} else {
_alpha = 100;
_root.game_holder.plant_head._alpha = 100;
_root.game_holder.plant_stem._alpha = 100;
}
}
if (holding_on == true) {
if ((grabbed_platform != "main") && (grabbed_platform != "")) {
d_x = _root.game_holder.plant_head._x;
if (grabbed_platform.indexOf("vert") != -1) {
d_y = _root.game_holder.plant_head._y + min_neck_length;
}
}
if (x_speed > 0) {
if (_x > (d_x + (hold_count_amount * swing_amount))) {
hold_count_amount = hold_count_amount / 2;
x_speed = x_speed * -1;
x_speed = x_speed * X_INERTIA_INAIR;
if (hold_count_amount < 1) {
x_speed = 0;
if (d_x > _x) {
if (!map.hitTest((_root.game_holder._x + d_x) + 8, _root.game_holder._y + _y, true)) {
_x = _root.game_holder.plant_head._x;
} else {
_x = _root.game_holder.plant_head._x - 8;
}
} else if (d_x < _x) {
if (!map.hitTest((_root.game_holder._x + d_x) - 8, _root.game_holder._y + _y, true)) {
_x = _root.game_holder.plant_head._x;
} else {
_x = _root.game_holder.plant_head._x + 8;
}
}
}
}
} else if (x_speed < 0) {
if (_x < (d_x - (hold_count_amount * swing_amount))) {
hold_count_amount = hold_count_amount / 2;
x_speed = x_speed * -1;
x_speed = x_speed * X_INERTIA_INAIR;
if (hold_count_amount < 1) {
x_speed = 0;
if (d_x > _x) {
if (!map.hitTest((_root.game_holder._x + d_x) + 8, _root.game_holder._y + _y, true)) {
_x = _root.game_holder.plant_head._x;
} else {
_x = _root.game_holder.plant_head._x - 8;
}
} else if (d_x < _x) {
if (!map.hitTest((_root.game_holder._x + d_x) - 8, _root.game_holder._y + _y, true)) {
_x = _root.game_holder.plant_head._x;
} else {
_x = _root.game_holder.plant_head._x + 8;
}
}
}
}
}
saved_x_speed = x_speed * 2;
} else if (sitting_platform == "mud") {
x_speed = x_speed * X_INERTIA_MUD;
} else {
x_speed = x_speed * X_INERTIA;
}
if (holding_on == true) {
if (y_speed > 0) {
if (_y >= d_y) {
_y = d_y;
y_speed = 0;
}
} else if (y_speed < 0) {
if (_y <= d_y) {
_y = d_y;
y_speed = 0;
}
} else if (y_speed == 0) {
}
}
y_speed = y_speed * Y_INERTIA;
if (Math.abs(x_speed) < 1) {
x_speed = 0;
}
if (y_speed != 0) {
if (holding_on == false) {
y_speed = y_speed + GRAVITY;
}
} else if (holding_on == false) {
if (!map.hitTest(_root.game_holder._x + _x, (_root.game_holder._y + _y) + 8, true)) {
y_speed = y_speed + GRAVITY;
}
}
_root.game_holder.plant_stem.main();
updateAfterEvent();
}
function checkEatInsect() {
var _local5 = 0;
while (_local5 <= insects.length) {
var _local4 = insects[_local5];
var _local3 = 1;
while (_local3 <= max_insect_num) {
if (_root.game_holder[(_local4 + "_") + _local3].hitTest(_root.game_holder._x + _root.game_holder.plant_head._x, _root.game_holder._y + _root.game_holder.plant_head._y, true)) {
if ((_root.game_holder[(_local4 + "_") + _local3].getAlive() == true) && (_root.game_holder[(_local4 + "_") + _local3].getPoisonous() == false)) {
_root.game_holder.plant_head.gotoAndPlay("eat");
_root.bite_sfx.gotoAndPlay(2);
_root.gulp_sfx.gotoAndPlay(2);
eatInsect((_local4 + "_") + _local3);
return(true);
}
}
_local3++;
}
_local5++;
}
return(false);
}
function eatInsect(s) {
max_neck_length = max_neck_length + 5;
_root.neck_length_display.displayLength(max_neck_length);
_root.game_holder[s].beEaten();
_root.game_holder.plant_stem.doEat();
}
function collectCan(s) {
_root.game_holder[s].beCollected();
}
function moveConveyorBelts() {
var _local3 = 0;
while (_local3 <= conveyor_num) {
if ((grabbed_platform == String("conveyor_" + _local3)) || (sitting_platform == String("conveyor_" + _local3))) {
var _local4 = _root.game_holder["conveyor_" + _local3].getSpeed();
if (sitting_platform == String("conveyor_" + _local3)) {
_x = _x + _local4;
_root.game_holder.plant_head._x = _root.game_holder.plant_head._x + _local4;
scrollLevelOnPlatformX(_local4);
} else if (grabbed_platform == String("conveyor_" + _local3)) {
if (_root.game_holder["conveyor_" + _local3].hitTest(_root.game_holder._x + _root.game_holder.plant_head._x, _root.game_holder._y + _root.game_holder.plant_head._y, true)) {
_x = _x + _local4;
_root.game_holder.plant_head._x = _root.game_holder.plant_head._x + _local4;
scrollLevelOnPlatformX(_local4);
} else {
grabbed_platform = "";
}
}
}
_local3++;
}
updateAfterEvent();
}
function moveHorizontalPlatforms() {
var _local5 = 0;
var _local3 = 0;
while (_local3 <= horiz_platform_num) {
if (_root.game_holder["horiz_" + _local3].getIsStopped() == false) {
var _local4 = _root.game_holder["horiz_" + _local3].main();
if ((grabbed_platform == String("horiz_" + _local3)) || (sitting_platform == String("horiz_" + _local3))) {
_x = _x + _local4;
_root.game_holder.plant_head._x = _root.game_holder.plant_head._x + _local4;
_local5 = _local5 + _local4;
}
}
_local3++;
}
horizontal_scroll_platform = _local5;
updateAfterEvent();
}
function moveVerticalPlatforms() {
var _local6 = 0;
var _local3 = 0;
while (_local3 <= vert_platform_num) {
if (_root.game_holder["vert_" + _local3].getIsStopped() == false) {
var _local4 = _root.game_holder["vert_" + _local3].main();
if ((grabbed_platform == String("vert_" + _local3)) || (sitting_platform == String("vert_" + _local3))) {
_y = _y + _local4;
_root.game_holder.plant_head._y = _root.game_holder.plant_head._y + _local4;
_local6 = _local6 + _local4;
}
}
if (_root.game_holder.danger["vert_" + _local3].getIsStopped() == false) {
var _local5 = _root.game_holder.danger["vert_" + _local3].main();
}
_local3++;
}
vertical_scroll_platform = _local6;
updateAfterEvent();
}
function scrollLevel() {
if ((x_speed > 0) && (getRealX() > 275)) {
if ((_root.game_holder._x - x_speed) > xmin) {
_root.game_holder._x = _root.game_holder._x - x_speed;
} else {
_root.game_holder._x = xmin;
}
} else if ((x_speed < 0) && (getRealX() < 275)) {
if ((_root.game_holder._x - x_speed) < xmax) {
_root.game_holder._x = _root.game_holder._x - x_speed;
} else {
_root.game_holder._x = xmax;
}
} else if (x_speed == 0) {
if (horizontal_scroll_platform != 0) {
scrollLevelOnPlatformX(horizontal_scroll_platform);
}
}
if ((y_speed > 0) && (getRealY() > 200)) {
if ((_root.game_holder._y - y_speed) > ymin) {
_root.game_holder._y = _root.game_holder._y - y_speed;
} else {
_root.game_holder._y = ymin;
}
} else if ((y_speed < 0) && (getRealY() < 200)) {
if ((_root.game_holder._y - y_speed) < ymax) {
_root.game_holder._y = _root.game_holder._y - y_speed;
} else {
_root.game_holder._y = ymax;
}
} else if (y_speed == 0) {
if (vertical_scroll_platform != 0) {
scrollLevelOnPlatformY(vertical_scroll_platform);
}
}
}
function scrollLevelOnPlatformX(speed) {
if ((speed > 0) && (getRealX() > 275)) {
if ((_root.game_holder._x - speed) > xmin) {
_root.game_holder._x = _root.game_holder._x - speed;
} else {
_root.game_holder._x = xmin;
}
} else if ((speed < 0) && (getRealX() < 275)) {
if ((_root.game_holder._x - speed) < xmax) {
_root.game_holder._x = _root.game_holder._x - speed;
} else {
_root.game_holder._x = xmax;
}
} else if (speed == 0) {
}
}
function scrollLevelOnPlatformY(speed) {
if ((speed > 0) && (getRealY() > 200)) {
if ((_root.game_holder._y - speed) > ymin) {
_root.game_holder._y = _root.game_holder._y - speed;
} else {
_root.game_holder._y = ymin;
}
} else if ((speed < 0) && (getRealY() < 200)) {
if ((_root.game_holder._y - speed) < ymax) {
_root.game_holder._y = _root.game_holder._y - speed;
} else {
_root.game_holder._y = ymax;
}
} else if (y_speed == 0) {
}
}
function getRealX() {
var _local3 = new Object();
_local3.x = _x;
_local3.y = _y;
_root.game_holder.localToGlobal(_local3);
return(_local3.x);
}
function getRealY() {
var _local3 = new Object();
_local3.x = _x;
_local3.y = _y;
_root.game_holder.localToGlobal(_local3);
return(_local3.y);
}
function checkLevelEnd() {
if (level_ended == false) {
if (_root.game_holder.level_end.collision.hitTest(this)) {
_root.game_holder.level_end.gotoAndPlay("open");
level_end_interval = setInterval(this, "endOfLevel", 2000);
_root.timer.stopTimer();
level_ended = true;
}
}
}
function pauseGame() {
clearInterval(loop_interval);
}
function restartGame() {
loop_interval = setInterval(this, "loop", loop_speed);
}
function doGameOver() {
clearInterval(level_end_interval);
clearInterval(loop_interval);
plant_x_tween.stop();
plant_y_tween.stop();
plant_x_tween = new mx.transitions.Tween();
plant_y_tween = new mx.transitions.Tween();
clearInterval(plant_check_interval);
_root.pm.pauseGame(true);
}
function endOfLevel() {
clearInterval(level_end_interval);
clearInterval(loop_interval);
plant_x_tween.stop();
plant_y_tween.stop();
plant_x_tween = new mx.transitions.Tween();
plant_y_tween = new mx.transitions.Tween();
clearInterval(plant_check_interval);
_root.pm.pauseGame(true);
if ((_global.selected_level == 15) && (_root.sf.getShownEnd() == false)) {
_root.popup.showPopUp("game_complete");
} else {
_root.popup.showPopUp("level_complete");
}
}
function checkForDanger() {
var _local6 = false;
var _local3 = 1;
while (_local3 <= 52) {
var _local5 = (_root.game_holder._x + _root.game_holder.plant_head._x) + _root.game_holder.plant_head["point" + _local3]._x;
var _local4 = (_root.game_holder._y + _root.game_holder.plant_head._y) + _root.game_holder.plant_head["point" + _local3]._y;
if (isNaN(_local5) || (isNaN(_local4))) {
} else if (_root.game_holder.danger.hitTest(_local5, _local4, true)) {
_local6 = true;
break;
}
_local3++;
}
if (_local6 == false) {
_local3 = 1;
while (_local3 <= 40) {
var _local5 = (_root.game_holder._x + _root.game_holder.plant_pot._x) + _root.game_holder.plant_pot["point" + _local3]._x;
var _local4 = (_root.game_holder._y + _root.game_holder.plant_pot._y) + _root.game_holder.plant_pot["point" + _local3]._y;
if (isNaN(_local5) || (isNaN(_local4))) {
} else if (_root.game_holder.danger.hitTest(_local5, _local4, true)) {
_local6 = true;
break;
}
_local3++;
}
}
if (_local6 == true) {
_root.energy_bar.doHit();
checkHitsLeft();
} else {
checkPoisonousInsects();
}
}
function checkPoisonousInsects() {
var _local5 = false;
var _local6 = 0;
while (_local6 <= poisonous_insects.length) {
var _local4 = poisonous_insects[_local6];
var _local3 = 1;
while (_local3 <= max_insect_num) {
if (_root.game_holder[(_local4 + "_") + _local3].getPoisonous() == true) {
if (_root.game_holder[(_local4 + "_") + _local3].hitTest(_root.game_holder.plant_head)) {
_local5 = true;
break;
}
if (_root.game_holder[(_local4 + "_") + _local3].hitTest(this)) {
_local5 = true;
break;
}
}
_local3++;
}
if (_local5 == true) {
break;
}
_local6++;
}
if (_local5 == true) {
_root.energy_bar.doHit();
if (_local4 == "water") {
_root.game_holder[(_local4 + "_") + _local3].beHit();
}
checkHitsLeft();
}
}
function checkHitsLeft() {
if (_root.energy_bar.getHitsLeft() == 0) {
_root.popup.showPopUp("game_over_energy");
_root.timer.stopTimer();
doGameOver();
} else {
flicker_count = 0;
flickering = true;
}
}
function checkCollisions() {
if (y_speed > 0) {
checkCollisionDown();
} else if (y_speed < 0) {
checkCollisionUp();
} else {
checkBlockedIn();
}
if (x_speed > 0) {
checkCollisionRight();
} else if (x_speed < 0) {
checkCollisionLeft();
} else {
checkBlockedIn();
}
if ((sitting_platform != "main") && (sitting_platform != "mud")) {
var _local4 = false;
var _local3 = 0;
while (_local3 <= horiz_platform_num) {
if (_root.game_holder["horiz_" + _local3].hitTest(_root.game_holder._x + _x, (_root.game_holder._y + _y) + 8, true)) {
_local4 = true;
break;
}
_local3++;
}
if (_local4 == false) {
_local3 = 0;
while (_local3 <= vert_platform_num) {
if (_root.game_holder["vert_" + _local3].hitTest(_root.game_holder._x + _x, (_root.game_holder._y + _y) + 8, true)) {
_local4 = true;
break;
}
_local3++;
}
}
if (_local4 == false) {
_local3 = 0;
while (_local3 <= conveyor_num) {
if (_root.game_holder["conveyor_" + _local3].hitTest(_root.game_holder._x + _x, (_root.game_holder._y + _y) + 8, true)) {
_local4 = true;
break;
}
_local3++;
}
}
if (_local4 == false) {
sitting_platform = "main";
}
}
}
function checkBlockedIn() {
if (map.hitTest(_root.game_holder._x + _x, (_root.game_holder._y + _y) + 8, true)) {
if (map.hitTest(_root.game_holder._x + _x, (_root.game_holder._y + _y) - 8, true)) {
if (map.hitTest((_root.game_holder._x + _x) + 8, _root.game_holder._y + _y, true)) {
if (map.hitTest((_root.game_holder._x + _x) - 8, _root.game_holder._y + _y, true)) {
_y++;
if (_y > level_h) {
_y = _y - 50;
}
}
}
}
}
}
function checkCollisionDown() {
if (map.hitTest(_root.game_holder._x + _x, (_root.game_holder._y + _y) + 8, true)) {
y_speed = y_speed - 1;
if (y_speed <= 3) {
sitting_platform = "main";
adjustToPlatform();
y_speed = 0;
}
y_speed = y_speed * -1;
} else if (stone_map.hitTest(_root.game_holder._x + _x, (_root.game_holder._y + _y) + 8, true)) {
y_speed = y_speed - 1;
if (y_speed <= 3) {
sitting_platform = "stone";
adjustToStonePlatform();
y_speed = 0;
}
y_speed = y_speed * -1;
} else if (mud_map.hitTest(_root.game_holder._x + _x, (_root.game_holder._y + _y) + 8, true)) {
y_speed = y_speed - 1;
if (y_speed <= 3) {
sitting_platform = "mud";
adjustToMudPlatform();
y_speed = 0;
}
y_speed = y_speed * -1;
} else {
var _local4 = false;
var _local3 = 0;
while (_local3 <= horiz_platform_num) {
if (_root.game_holder["horiz_" + _local3].hitTest(_root.game_holder._x + _x, (_root.game_holder._y + _y) + 8, true)) {
y_speed = y_speed - 1;
if (y_speed <= 5) {
sitting_platform = "horiz";
adjustToMovingPlatform("horiz_" + _local3);
y_speed = 0;
}
y_speed = y_speed * -1;
_local4 = true;
break;
}
_local3++;
}
if (_local4 == false) {
_local3 = 0;
while (_local3 <= vert_platform_num) {
if (_root.game_holder["vert_" + _local3].hitTest(_root.game_holder._x + _x, (_root.game_holder._y + _y) + 8, true) && (_root.game_holder["vert_" + _local3].getCanLand() == true)) {
y_speed = y_speed - 1;
if (y_speed <= 5) {
sitting_platform = "vert";
adjustToMovingPlatform("vert_" + _local3);
y_speed = 0;
}
y_speed = y_speed * -1;
_local4 = true;
break;
}
_local3++;
}
}
if (_local4 == false) {
_local3 = 0;
while (_local3 <= conveyor_num) {
if (_root.game_holder["conveyor_" + _local3].hitTest(_root.game_holder._x + _x, (_root.game_holder._y + _y) + 8, true)) {
y_speed = y_speed - 1;
if (y_speed <= 5) {
sitting_platform = "conveyor";
adjustToMovingPlatform("conveyor_" + _local3);
y_speed = 0;
}
y_speed = y_speed * -1;
_local4 = true;
break;
}
_local3++;
}
}
if (_local4 == false) {
sitting_platform = "";
}
}
}
function checkCollisionUp() {
if (map.hitTest(_root.game_holder._x + _x, (_root.game_holder._y + _y) - 8, true)) {
y_speed = y_speed * -1;
} else if (stone_map.hitTest(_root.game_holder._x + _x, (_root.game_holder._y + _y) - 8, true)) {
y_speed = y_speed * -1;
}
}
function checkCollisionRight() {
if (map.hitTest((_root.game_holder._x + _x) + 8, _root.game_holder._y + _y, true)) {
x_speed = x_speed * -1;
} else if (stone_map.hitTest((_root.game_holder._x + _x) + 8, _root.game_holder._y + _y, true)) {
x_speed = x_speed * -1;
} else {
var _local4 = false;
var _local3 = 0;
while (_local3 <= horiz_platform_num) {
if (_root.game_holder["horiz_" + _local3].hitTest((_root.game_holder._x + _x) + 8, _root.game_holder._y + _y, true)) {
x_speed = x_speed * -1;
_local4 = true;
break;
}
_local3++;
}
if (_local4 == false) {
_local3 = 0;
while (_local3 <= vert_platform_num) {
if (_root.game_holder["vert_" + _local3].hitTest((_root.game_holder._x + _x) + 8, _root.game_holder._y + _y, true) && (_root.game_holder["vert_" + _local3].getCanLand() == true)) {
x_speed = x_speed * -1;
_local4 = true;
break;
}
_local3++;
}
}
if (_local4 == false) {
_local3 = 0;
while (_local3 <= conveyor_num) {
if (_root.game_holder["conveyor_" + _local3].hitTest((_root.game_holder._x + _x) + 8, _root.game_holder._y + _y, true)) {
x_speed = x_speed * -1;
_local4 = true;
break;
}
_local3++;
}
}
}
}
function checkCollisionLeft() {
if (map.hitTest((_root.game_holder._x + _x) - 8, _root.game_holder._y + _y, true)) {
x_speed = x_speed * -1;
} else if (stone_map.hitTest((_root.game_holder._x + _x) - 8, _root.game_holder._y + _y, true)) {
x_speed = x_speed * -1;
} else {
var _local4 = false;
var _local3 = 0;
while (_local3 <= horiz_platform_num) {
if (_root.game_holder["horiz_" + _local3].hitTest((_root.game_holder._x + _x) - 8, _root.game_holder._y + _y, true)) {
x_speed = x_speed * -1;
_local4 = true;
break;
}
_local3++;
}
if (_local4 == false) {
_local3 = 0;
while (_local3 <= vert_platform_num) {
if (_root.game_holder["vert_" + _local3].hitTest((_root.game_holder._x + _x) - 8, _root.game_holder._y + _y, true) && (_root.game_holder["vert_" + _local3].getCanLand() == true)) {
x_speed = x_speed * -1;
_local4 = true;
break;
}
_local3++;
}
}
if (_local4 == false) {
_local3 = 0;
while (_local3 <= conveyor_num) {
if (_root.game_holder["conveyor_" + _local3].hitTest((_root.game_holder._x + _x) - 8, _root.game_holder._y + _y, true)) {
x_speed = x_speed * -1;
_local4 = true;
break;
}
_local3++;
}
}
}
}
function adjustToPlatform() {
var _local3 = 0;
while (_local3 <= 16) {
if (!map.hitTest(_root.game_holder._x + _x, ((_root.game_holder._y + _y) + 8) - _local3, true)) {
_y = _y - (_local3 - 2);
sitting_platform = "main";
break;
}
_local3++;
}
}
function adjustToStonePlatform() {
var _local3 = 0;
while (_local3 <= 16) {
if (!stone_map.hitTest(_root.game_holder._x + _x, ((_root.game_holder._y + _y) + 8) - _local3, true)) {
_y = _y - (_local3 - 2);
sitting_platform = "main";
break;
}
_local3++;
}
}
function adjustToMudPlatform() {
var _local3 = 0;
while (_local3 <= 16) {
if (!mud_map.hitTest(_root.game_holder._x + _x, ((_root.game_holder._y + _y) + 8) - _local3, true)) {
_y = _y - (_local3 - 3);
sitting_platform = "mud";
break;
}
_local3++;
}
}
function adjustToMovingPlatform(p) {
var _local3 = 0;
while (_local3 <= 16) {
if (_root.game_holder[p].hitTest(_root.game_holder._x + _x, ((_root.game_holder._y + _y) + 8) - _local3, true)) {
_y = _y - _local3;
sitting_platform = p;
break;
}
_local3++;
}
}
function getMouseAngle(x1, y1) {
var _local2 = Math.atan2(_root._ymouse - y1, _root._xmouse - x1);
var _local3 = Math.round((_local2 * 180) / Math.PI);
return(_local3 + 90);
}
function getXDistance(x1, x2) {
if (x1 > x2) {
return(x1 - x2);
}
if (x2 > x1) {
return(x2 - x1);
}
return(0);
}
function getYDistance(y1, y2) {
if (y1 > y2) {
return(y1 - y2);
}
if (y2 > y1) {
return(y2 - y1);
}
return(0);
}
function getDistance(x1, y1, x2, y2) {
var _local2 = getXDistance(x1, x2);
var _local3 = getYDistance(y1, y2);
var _local4 = Math.sqrt((_local2 * _local2) + (_local3 * _local3));
return(_local4);
}
var GRAVITY = 0.3;
var Y_INERTIA = 0.96;
var X_INERTIA = 0.85;
var X_INERTIA_MUD = 0.95;
var X_INERTIA_INAIR = 0.98;
var pot_width = 16;
var pot_height = 16;
var x_speed = 0;
var y_speed = 2;
var max_neck_length = 100;
var min_neck_length = 20;
var current_neck_length = 20;
var mouse_is_down = false;
var holding_on = false;
var tweening_back = false;
var grabbed_platform = "";
var sitting_platform = "";
var horiz_platform_num = 8;
var vert_platform_num = 7;
var conveyor_num = 11;
var max_insect_num = 20;
var insects = new Array("fly", "cat", "bee", "spider", "wood", "butter", "lady", "grass", "dragon", "snail");
var poisonous_insects = new Array("bee", "spider", "wood", "water");
var flickering = false;
var flicker_count = 0;
var level_ended = false;
var vertical_scroll_platform = 0;
var horizontal_scroll_platform = 0;
var swing_amount = 5;
var increments = 18;
var loop_speed = 20;
}
Symbol 1205 MovieClip [__Packages.mx.transitions.easing.None] Frame 0
class mx.transitions.easing.None
{
function None () {
}
static function easeNone(t, b, c, d) {
return(((c * t) / d) + b);
}
static function easeIn(t, b, c, d) {
return(((c * t) / d) + b);
}
static function easeOut(t, b, c, d) {
return(((c * t) / d) + b);
}
static function easeInOut(t, b, c, d) {
return(((c * t) / d) + b);
}
static var version = "1.1.0.52";
}
Symbol 1206 MovieClip [__Packages.mx.transitions.easing.Bounce] Frame 0
class mx.transitions.easing.Bounce
{
function Bounce () {
}
static function easeOut(t, b, c, d) {
t = t / d;
if (t < 0.363636363636364) {
return((c * ((7.5625 * t) * t)) + b);
}
if (t < 0.727272727272727) {
t = t - 0.545454545454545;
return((c * (((7.5625 * t) * t) + 0.75)) + b);
}
if (t < 0.909090909090909) {
t = t - 0.818181818181818;
return((c * (((7.5625 * t) * t) + 0.9375)) + b);
}
t = t - 0.954545454545455;
return((c * (((7.5625 * t) * t) + 0.984375)) + b);
}
static function easeIn(t, b, c, d) {
return((c - easeOut(d - t, 0, c, d)) + b);
}
static function easeInOut(t, b, c, d) {
if (t < (d / 2)) {
return((easeIn(t * 2, 0, c, d) * 0.5) + b);
}
return(((easeOut((t * 2) - d, 0, c, d) * 0.5) + (c * 0.5)) + b);
}
static var version = "1.1.0.52";
}
Symbol 1207 MovieClip [__Packages.com.nitrome.miraclegrow.PlantPress] Frame 0
class com.nitrome.miraclegrow.PlantPress extends MovieClip
{
function PlantPress () {
super();
}
function onPress() {
_root.game_holder.plant_pot.doMouseDown();
}
function onRelease() {
_root.game_holder.plant_pot.doMouseUp();
}
}
Symbol 1208 MovieClip [__Packages.com.nitrome.miraclegrow.PlantStem] Frame 0
class com.nitrome.miraclegrow.PlantStem extends MovieClip
{
var ball_outline, ball_inner, loop_interval, clear, lineStyle, moveTo, lineTo;
function PlantStem () {
super();
ball_outline._visible = false;
ball_inner._visible = false;
loop_interval = setInterval(this, "main", 5);
}
function main() {
if (eating == true) {
eat_percent = eat_percent + eat_increment;
if (eat_percent > 100) {
eating = false;
} else {
var _local3 = calculatePosition(eat_percent);
}
} else {
ball_inner._visible = false;
ball_outline._visible = false;
}
clear();
lineStyle(4, 0, 100);
moveTo(_root.game_holder.plant_pot._x, _root.game_holder.plant_pot._y - pot_offset);
lineTo(_root.game_holder.plant_head._x, _root.game_holder.plant_head._y - head_offset);
if (eating == true) {
ball_outline._x = _local3.x;
ball_outline._y = _local3.y;
ball_outline._visible = true;
}
lineStyle(2, 9422603, 100);
lineTo(_root.game_holder.plant_pot._x, _root.game_holder.plant_pot._y - pot_offset);
if (eating == true) {
ball_inner._x = _local3.x;
ball_inner._y = _local3.y;
ball_inner._visible = true;
}
updateAfterEvent();
}
function calculatePosition(percent) {
var _local6 = _root.game_holder.plant_pot._x;
var _local4 = _root.game_holder.plant_head._x;
var _local5 = _root.game_holder.plant_pot._y - pot_offset;
var _local3 = _root.game_holder.plant_head._y - head_offset;
var _local12 = getXDistance(_local6, _local4);
var _local13 = getYDistance(_local5, _local3);
var _local10 = (_local12 / 100) * percent;
var _local11 = (_local13 / 100) * percent;
var _local7;
if (_local4 > _local6) {
_local7 = _local4 - _local10;
} else if (_local4 < _local6) {
_local7 = _local4 + _local10;
} else if (_local4 == _local6) {
_local7 = _local4;
}
var _local8;
if (_local3 > _local5) {
_local8 = _local3 - _local11;
} else if (_local3 < _local5) {
_local8 = _local3 + _local11;
} else if (_local3 == _local5) {
_local8 = _local3;
}
var _local9 = new Object();
_local9.x = _local7;
_local9.y = _local8;
return(_local9);
}
function doEat() {
eat_percent = 0;
eating = true;
}
function getXDistance(x1, x2) {
if (x1 > x2) {
return(x1 - x2);
}
if (x2 > x1) {
return(x2 - x1);
}
return(0);
}
function getYDistance(y1, y2) {
if (y1 > y2) {
return(y1 - y2);
}
if (y2 > y1) {
return(y2 - y1);
}
return(0);
}
var eating = false;
var eat_percent = 0;
var eat_increment = 1;
var pot_offset = 7;
var head_offset = 2;
}
Symbol 1209 MovieClip [__Packages.com.nitrome.miraclegrow.PlayButton] Frame 0
class com.nitrome.miraclegrow.PlayButton extends com.nitrome.game.SimpleButton
{
function PlayButton () {
super();
}
function onPress() {
_root.tt.doTween("LEVEL_SELECT");
}
}
Symbol 1210 MovieClip [__Packages.com.nitrome.miraclegrow.PlayNextLevelButton] Frame 0
class com.nitrome.miraclegrow.PlayNextLevelButton extends com.nitrome.game.SimpleButton
{
function PlayNextLevelButton () {
super();
}
function onPress() {
_root.popup.hidePopUp();
_global.last_played_level = _global.selected_level + 1;
_root.tt.doTween("PLAY_NEXT_LEVEL");
}
}
Symbol 1211 MovieClip [__Packages.com.nitrome.miraclegrow.SubmitScoreButton] Frame 0
class com.nitrome.miraclegrow.SubmitScoreButton extends com.nitrome.game.SimpleButton
{
function SubmitScoreButton () {
super();
}
function onPress() {
_root.popup.hidePopUp();
_root.music_controller.fadeOutGameMusic();
_root.sf.setLastSavedScore(_global.total_score);
trace("we are saving: " + _global.total_score);
_root.tt.doTween("SUBMIT_SCORE");
}
}
Symbol 1212 MovieClip [__Packages.com.nitrome.miraclegrow.RetryLevelButton] Frame 0
class com.nitrome.miraclegrow.RetryLevelButton extends com.nitrome.game.SimpleButton
{
function RetryLevelButton () {
super();
}
function onPress() {
_root.popup.hidePopUp();
_global.last_played_level = _global.selected_level;
_root.tt.doTween("RETRY_LEVEL");
}
}
Symbol 1213 MovieClip [__Packages.com.nitrome.game.ScoreCounter] Frame 0
class com.nitrome.game.ScoreCounter extends MovieClip
{
var score_target, score_increment, current_value, count_interval, gotoAndPlay, gotoAndStop, _parent, score;
function ScoreCounter () {
super();
}
function doCount(score, increment) {
score_target = score;
score_increment = increment;
current_value = 0;
displayText();
count_interval = setInterval(this, "tick", 20);
gotoAndPlay(2);
}
function tick() {
if ((current_value + score_increment) < score_target) {
current_value = current_value + score_increment;
displayText();
} else {
current_value = score_target;
displayText();
gotoAndStop(6);
clearInterval(count_interval);
_parent.play();
}
}
function displayText() {
score.text = String(current_value);
}
}
Symbol 1214 MovieClip [__Packages.com.nitrome.game.HighScoreDisplay] Frame 0
class com.nitrome.game.HighScoreDisplay extends MovieClip
{
var score, score_text;
function HighScoreDisplay () {
super();
}
function displayScore(n) {
score = _root.sf.getLevelScore(n);
var _local6 = String(score);
if (zero_fill == 0) {
score_text.text = _local6;
} else {
var _local7 = _local6.length;
if (_local7 > zero_fill) {
score_text.text = _local6;
} else {
var _local5 = zero_fill - _local7;
var _local4 = "";
var _local3 = 1;
while (_local3 <= _local5) {
_local4 = _local4 + "0";
_local3++;
}
_local4 = _local4 + _local6;
score_text.text = _local4;
}
}
}
var zero_fill = 8;
}
Symbol 1215 MovieClip [__Packages.com.nitrome.game.TotalHighScoreDisplay] Frame 0
class com.nitrome.game.TotalHighScoreDisplay extends MovieClip
{
var score, score_text;
function TotalHighScoreDisplay () {
super();
score = _root.sf.getTotalScore();
displayScore();
}
function displayScore() {
var _local5 = String(score);
if (zero_fill == 0) {
score_text.text = _local5;
} else {
var _local6 = _local5.length;
if (_local6 > zero_fill) {
score_text.text = _local5;
} else {
var _local4 = zero_fill - _local6;
var _local3 = "";
var _local2 = 1;
while (_local2 <= _local4) {
_local3 = _local3 + "0";
_local2++;
}
_local3 = _local3 + _local5;
score_text.text = _local3;
}
}
}
var zero_fill = 8;
}
Symbol 1216 MovieClip [__Packages.com.nitrome.miraclegrow.NextButton] Frame 0
class com.nitrome.miraclegrow.NextButton extends com.nitrome.game.SimpleButton
{
var _parent;
function NextButton () {
super();
}
function onPress() {
_parent.gotoAndStop("finish");
}
}
Symbol 1217 MovieClip [__Packages.com.nitrome.miraclegrow.PopUp] Frame 0
class com.nitrome.miraclegrow.PopUp extends MovieClip
{
var popup_type, gotoAndPlay, popup_holder;
function PopUp () {
super();
}
function showPopUp(s) {
popup_type = s;
gotoAndPlay("in");
}
function displayPopUp() {
popup_holder.gotoAndStop(popup_type);
}
function hidePopUp() {
gotoAndPlay("out");
}
}
Symbol 1218 MovieClip [__Packages.com.nitrome.game.OptionsQualityToggle] Frame 0
class com.nitrome.game.OptionsQualityToggle extends MovieClip
{
var _quality, gotoAndStop;
function OptionsQualityToggle () {
super();
init();
}
function init() {
quality_value = _root.sf.getGameQuality();
updateGraphic(false);
}
function toggleQuality() {
if (quality_value == "high") {
_root.sf.setGameQuality("medium");
_quality = "MEDIUM";
quality_value = "medium";
} else if (quality_value == "medium") {
_root.sf.setGameQuality("low");
_quality = "LOW";
quality_value = "low";
} else if (quality_value == "low") {
_root.sf.setGameQuality("high");
_quality = "HIGH";
quality_value = "high";
}
}
function onRollOver() {
updateGraphic(true);
}
function onRollOut() {
updateGraphic(false);
}
function onPress() {
toggleQuality();
updateGraphic(true);
}
function updateGraphic(mouse_is_over) {
if (mouse_is_over == true) {
if (quality_value == "high") {
gotoAndStop("quality_high_over");
} else if (quality_value == "medium") {
gotoAndStop("quality_medium_over");
} else if (quality_value == "low") {
gotoAndStop("quality_low_over");
}
} else if (mouse_is_over == false) {
if (quality_value == "high") {
gotoAndStop("quality_high_up");
} else if (quality_value == "medium") {
gotoAndStop("quality_medium_up");
} else if (quality_value == "low") {
gotoAndStop("quality_low_up");
}
}
}
var quality_value = "high";
}
Symbol 1219 MovieClip [__Packages.com.nitrome.miraclegrow.Snail] Frame 0
class com.nitrome.miraclegrow.Snail extends com.nitrome.miraclegrow.Insect
{
var id, _name, xmin, xmax, dir, speed, onEnterFrame, _x, gotoAndStop, anim;
function Snail () {
super();
id = Number(_name.slice(6));
xmin = xmin_list[id];
xmax = xmax_list[id];
dir = dir_list[id];
speed = speed_list[id];
displayDir();
onEnterFrame = function () {
this.doEnterFrame();
};
}
function doEnterFrame() {
if (alive == true) {
if (dir == 1) {
_x = _x + speed;
if (_x >= xmax) {
dir = -1;
displayDir();
}
} else if (dir == -1) {
_x = _x - speed;
if (_x <= xmin) {
dir = 1;
displayDir();
}
}
}
}
function displayDir() {
if (dir == 1) {
gotoAndStop("walk_right");
} else if (dir == -1) {
gotoAndStop("walk_left");
}
}
function pauseAnimation() {
anim.stop();
}
function restartAnimation() {
anim.play();
}
var alive = true;
var xmin_list = new Array(0, 71, 460);
var xmax_list = new Array(0, 412, 713);
var dir_list = new Array(0, 1, 1);
var speed_list = new Array(0, 0.5, 0.5);
}
Symbol 1220 MovieClip [__Packages.com.nitrome.game.SoundToggle] Frame 0
class com.nitrome.game.SoundToggle extends MovieClip
{
var gotoAndStop;
function SoundToggle () {
super();
init();
}
function init() {
sound_on = _root.sf.getSoundOn();
updateGraphic(false);
}
function toggleSound() {
if (sound_on == true) {
turnSoundOff();
} else if (sound_on == false) {
turnSoundOn();
}
}
function updateGraphic(mouse_is_over) {
if (mouse_is_over == true) {
if (sound_on == true) {
gotoAndStop("sound_on_over");
} else if (sound_on == false) {
gotoAndStop("sound_off_over");
}
} else if (mouse_is_over == false) {
if (sound_on == true) {
gotoAndStop("sound_on_up");
} else if (sound_on == false) {
gotoAndStop("sound_off_up");
}
}
}
function getSoundOn() {
return(sound_on);
}
function turnSoundOn() {
sound_on = true;
_root.sf.setSoundOn(true);
_root.music_controller.turnMusicOn();
}
function turnSoundOff() {
sound_on = false;
_root.sf.setSoundOn(false);
_root.music_controller.turnMusicOff();
}
function onRollOver() {
updateGraphic(true);
}
function onRollOut() {
updateGraphic(false);
}
function onPress() {
toggleSound();
updateGraphic(true);
_root.options_sound_toggle.updateGraphic(false);
}
var sound_on = true;
}
Symbol 1221 MovieClip [__Packages.com.nitrome.miraclegrow.Spider] Frame 0
class com.nitrome.miraclegrow.Spider extends com.nitrome.miraclegrow.Insect
{
var id, _name, max_length, x_dis, y_dis, poisonous, inner_spider, onEnterFrame, _x, _y, target_y, ytween, back_up_interval, end_dangling_interval, alive, _visible, clear, lineStyle, moveTo, lineTo;
function Spider () {
super();
id = Number(_name.slice(7));
max_length = max_length_list[id];
x_dis = max_x_dis_list[id];
y_dis = max_y_dis_list[id];
poisonous = true;
inner_spider.gotoAndStop("angry");
onEnterFrame = function () {
this.doEnterFrame();
};
}
function doEnterFrame() {
if (dangling == false) {
clearString();
if (getXDistance(_root.game_holder.plant_pot._x, _x) <= x_dis) {
if ((getYDistance(_root.game_holder.plant_pot._y, _y) <= y_dis) && (_root.game_holder.plant_pot._y > _y)) {
poisonous = true;
target_y = inner_spider._y + max_length;
ytween = new mx.transitions.Tween(inner_spider, "_y", mx.transitions.easing.Elastic.easeInOut, inner_spider._y, inner_spider._y + max_length, 3, true);
back_up_interval = setInterval(this, "goBackUp", 4000);
dangling = true;
}
}
} else {
drawString();
}
}
function pauseGame() {
delete onEnterFrame;
ytween.stop();
clearInterval(back_up_interval);
clearInterval(end_dangling_interval);
}
function restartGame() {
if (dangling == true) {
if (moving_back_up == true) {
ytween.resume();
end_dangling_interval = setInterval(this, "endDangling", 4000);
} else {
ytween.resume();
back_up_interval = setInterval(this, "goBackUp", 4000);
}
}
onEnterFrame = function () {
this.doEnterFrame();
};
}
function beEaten() {
clearInterval(back_up_interval);
clearInterval(end_dangling_interval);
alive = false;
delete onEnterFrame;
_visible = false;
}
function goBackUp() {
clearInterval(back_up_interval);
poisonous = false;
inner_spider.gotoAndStop("edible");
target_y = inner_spider._y - max_length;
ytween = new mx.transitions.Tween(inner_spider, "_y", mx.transitions.easing.None.easeNone, inner_spider._y, inner_spider._y - max_length, 3, true);
moving_back_up = true;
end_dangling_interval = setInterval(this, "endDangling", 4000);
}
function endDangling() {
inner_spider.gotoAndStop("angry");
clearInterval(end_dangling_interval);
dangling = false;
moving_back_up = false;
}
function drawString() {
clear();
lineStyle(1, 0, 100);
moveTo(0, 0);
lineTo(inner_spider._x, inner_spider._y);
}
function clearString() {
clear();
}
function getXDistance(x1, x2) {
if (x1 > x2) {
return(x1 - x2);
}
if (x2 > x1) {
return(x2 - x1);
}
return(0);
}
function getYDistance(y1, y2) {
if (y1 > y2) {
return(y1 - y2);
}
if (y2 > y1) {
return(y2 - y1);
}
return(0);
}
var max_length_list = new Array(0, 100, 100, 360, 100, 100, 100);
var max_x_dis_list = new Array(0, 100, 100, 50, 100, 100, 100);
var max_y_dis_list = new Array(0, 200, 200, 420, 200, 200, 200);
var dangling = false;
var moving_back_up = false;
}
Symbol 1222 MovieClip [__Packages.mx.transitions.easing.Elastic] Frame 0
class mx.transitions.easing.Elastic
{
function Elastic () {
}
static function easeIn(t, b, c, d, a, p) {
if (t == 0) {
return(b);
}
t = t / d;
if (t == 1) {
return(b + c);
}
if (!p) {
p = d * 0.3;
}
if ((!a) || (a < Math.abs(c))) {
a = c;
var _local7 = p / 4;
} else {
var _local7 = (p / (Math.PI*2)) * Math.asin(c / a);
}
t = t - 1;
return((-((a * Math.pow(2, 10 * t)) * Math.sin((((t * d) - _local7) * (Math.PI*2)) / p))) + b);
}
static function easeOut(t, b, c, d, a, p) {
if (t == 0) {
return(b);
}
t = t / d;
if (t == 1) {
return(b + c);
}
if (!p) {
p = d * 0.3;
}
if ((!a) || (a < Math.abs(c))) {
a = c;
var _local7 = p / 4;
} else {
var _local7 = (p / (Math.PI*2)) * Math.asin(c / a);
}
return((((a * Math.pow(2, -10 * t)) * Math.sin((((t * d) - _local7) * (Math.PI*2)) / p)) + c) + b);
}
static function easeInOut(t, b, c, d, a, p) {
if (t == 0) {
return(b);
}
t = t / (d / 2);
if (t == 2) {
return(b + c);
}
if (!p) {
p = d * 0.45;
}
if ((!a) || (a < Math.abs(c))) {
a = c;
var _local7 = p / 4;
} else {
var _local7 = (p / (Math.PI*2)) * Math.asin(c / a);
}
if (t < 1) {
t = t - 1;
return((-0.5 * ((a * Math.pow(2, 10 * t)) * Math.sin((((t * d) - _local7) * (Math.PI*2)) / p))) + b);
}
t = t - 1;
return(((((a * Math.pow(2, -10 * t)) * Math.sin((((t * d) - _local7) * (Math.PI*2)) / p)) * 0.5) + c) + b);
}
static var version = "1.1.0.52";
}
Symbol 1223 MovieClip [__Packages.com.nitrome.game.Timer] Frame 0
class com.nitrome.game.Timer extends MovieClip
{
var eventMillisecs, onEnterFrame, msecs, secs, mins, secs_s, mins_s, msecs_s, mins_0, mins_1, secs_0, secs_1, msecs_0, msecs_1, msecs_2, time_left;
function Timer () {
super();
}
function startTimer(ms_to_time) {
var _local3 = new Date();
var _local2 = _local3.getTime();
var _local4 = _local2 + ms_to_time;
eventMillisecs = _local4;
onEnterFrame = timeLoop;
}
function timeLoop() {
var _local2 = new Date();
var _local3 = _local2.getTime();
msecs = eventMillisecs - _local3;
secs = Math.floor(msecs / 1000);
mins = Math.floor(secs / 60);
while (secs >= 60) {
secs = secs - 60;
}
time_limit_left = msecs;
if (msecs <= 0) {
stopTimer();
} else {
secs_s = String(secs);
mins_s = String(mins);
msecs_s = String(msecs % 1000);
if (secs_s.length == 1) {
secs_s = "0" + secs_s;
}
if (mins_s.length == 1) {
mins_s = "0" + mins_s;
}
if (msecs_s.length == 1) {
msecs_s = "00" + msecs_s;
} else if (msecs_s.length == 2) {
msecs_s = "0" + msecs_s;
}
mins_0.gotoAndStop(1 + Number(mins_s.charAt(0)));
mins_1.gotoAndStop(1 + Number(mins_s.charAt(1)));
secs_0.gotoAndStop(1 + Number(secs_s.charAt(0)));
secs_1.gotoAndStop(1 + Number(secs_s.charAt(1)));
msecs_0.gotoAndStop(1 + Number(msecs_s.charAt(0)));
msecs_1.gotoAndStop(1 + Number(msecs_s.charAt(1)));
msecs_2.gotoAndStop(1 + Number(msecs_s.charAt(2)));
}
}
function stopTimer() {
delete onEnterFrame;
time_left = msecs;
if (time_left <= 0) {
mins_0.gotoAndStop(1);
mins_1.gotoAndStop(1);
secs_0.gotoAndStop(1);
secs_1.gotoAndStop(1);
msecs_0.gotoAndStop(1);
msecs_1.gotoAndStop(1);
msecs_2.gotoAndStop(1);
doGameOver();
}
}
function getTimeLeft() {
return(time_left);
}
function doGameOver() {
_root.game_holder.plant_pot.doGameOver();
_root.popup.showPopUp("game_over_time");
}
function pauseTimer() {
delete onEnterFrame;
}
function restartTimer() {
var _local3 = new Date();
var _local2 = _local3.getTime();
var _local4 = _local2 + time_limit_left;
eventMillisecs = _local4;
onEnterFrame = timeLoop;
}
var time_limit_left = 30000;
}
Symbol 1224 MovieClip [__Packages.com.nitrome.miraclegrow.TransitionTween] Frame 0
class com.nitrome.miraclegrow.TransitionTween extends MovieClip
{
var task, gotoAndPlay;
function TransitionTween () {
super();
}
function doTween(task) {
this.task = task;
gotoAndPlay(2);
}
function performTask() {
if (task == "LEVEL_SELECT") {
_root.gotoAndStop("levels");
} else if (task == "HELP") {
_root.gotoAndStop("help");
} else if (task == "OPTIONS") {
_root.gotoAndStop("options");
} else if (task == "VIEW_HIGH_SCORES") {
_root.gotoAndStop("view_high_scores");
} else if (task == "CREDITS") {
_root.gotoAndStop("credits");
} else if (task == "MENU") {
_root.gotoAndStop("menu");
} else if (task == "GAME") {
_root.gotoAndStop("game");
} else if (task == "PLAY_NEXT_LEVEL") {
_root.gotoAndPlay("next_level");
} else if (task == "SUBMIT_SCORE") {
_root.gotoAndStop("submit_high_score");
} else if (task == "RETRY_LEVEL") {
_root.gotoAndPlay("retry_level");
}
}
}
Symbol 1225 MovieClip [__Packages.com.nitrome.miraclegrow.ViewHighScoresButton] Frame 0
class com.nitrome.miraclegrow.ViewHighScoresButton extends com.nitrome.game.SimpleButton
{
function ViewHighScoresButton () {
super();
}
function onPress() {
_root.tt.doTween("VIEW_HIGH_SCORES");
}
}
Symbol 1226 MovieClip [__Packages.com.nitrome.miraclegrow.WateringCan] Frame 0
class com.nitrome.miraclegrow.WateringCan extends MovieClip
{
var id, _name, gotoAndStop;
function WateringCan () {
super();
id = Number(_name.slice(4));
}
function setDimmed() {
gotoAndStop("dimmed");
}
function getAvailable() {
return(isAvailable);
}
function beCollected() {
gotoAndStop("collected");
_root.watering_can_display.displayCollected(id);
isAvailable = false;
}
var isAvailable = true;
}
Symbol 1227 MovieClip [__Packages.com.nitrome.miraclegrow.WateringCanDisplay] Frame 0
class com.nitrome.miraclegrow.WateringCanDisplay extends MovieClip
{
var dimmed_interval;
function WateringCanDisplay () {
super();
var _local6 = _root.sf.getLevelCans(_global.selected_level);
var _local5 = _local6.split(",");
if (_local5[0] == "1") {
displayCollected(1);
}
if (_local5[1] == "1") {
displayCollected(2);
}
if (_local5[2] == "1") {
displayCollected(3);
}
dimmed_interval = setInterval(this, "setDimmed", 250);
}
function setDimmed() {
clearInterval(dimmed_interval);
if (collected_1 == true) {
_root.game_holder.can_1.setDimmed();
}
if (collected_2 == true) {
_root.game_holder.can_2.setDimmed();
}
if (collected_3 == true) {
_root.game_holder.can_3.setDimmed();
}
}
function displayCollected(n) {
this["collected_" + n] = true;
this["symbol_" + n].gotoAndStop("filled");
}
function getCansCollected() {
var _local2 = "";
if (collected_1 == true) {
_local2 = _local2 + "1,";
} else {
_local2 = _local2 + "0,";
}
if (collected_2 == true) {
_local2 = _local2 + "1,";
} else {
_local2 = _local2 + "0,";
}
if (collected_3 == true) {
_local2 = _local2 + "1";
} else {
_local2 = _local2 + "0";
}
return(_local2);
}
var collected_1 = false;
var collected_2 = false;
var collected_3 = false;
}
Symbol 1228 MovieClip [__Packages.com.nitrome.miraclegrow.Watermelon] Frame 0
class com.nitrome.miraclegrow.Watermelon extends com.nitrome.miraclegrow.Insect
{
var init_interval, id, _name, dir, gotoAndStop, poisonous, onEnterFrame, _x, _y, anim, restart_interval;
function Watermelon () {
super();
_global.game_paused = false;
init_interval = setInterval(this, "init", 200);
}
function init() {
clearInterval(init_interval);
id = Number(_name.slice(6));
dir = dir_list[id];
y_speed = 2;
x_speed = 5;
x_speed = x_speed * dir;
if (dir == 1) {
gotoAndStop("roll_right");
} else if (dir == -1) {
gotoAndStop("roll_left");
}
poisonous = true;
rolling = true;
onEnterFrame = function () {
this.doEnterFrame();
};
}
function doEnterFrame() {
if (y_speed > 0) {
checkCollisionDown();
}
if (x_speed > 0) {
checkCollisionRight();
} else if (x_speed < 0) {
checkCollisionLeft();
}
_x = _x + x_speed;
_y = _y + y_speed;
checkCollisionThorns();
if (y_speed != 0) {
y_speed = y_speed + GRAVITY;
} else if (!_root.game_holder.map.hitTest(_root.game_holder._x + _x, (_root.game_holder._y + _y) + 18.5, true)) {
y_speed = y_speed + GRAVITY;
}
}
function pauseGame() {
if (splatting == false) {
anim.stop();
}
delete onEnterFrame;
clearInterval(restart_interval);
clearInterval(init_interval);
}
function restartGame() {
if (splatting == false) {
anim.play();
}
if (rolling == true) {
onEnterFrame = function () {
this.doEnterFrame();
};
} else if (rolling == false) {
if (growing == false) {
restart_interval = setInterval(this, "restart", 4000);
}
}
}
function beHit() {
poisonous = false;
rolling = true;
growing = false;
splatting = true;
gotoAndStop("splat");
}
function restart() {
if (_global.game_paused == false) {
splatting = false;
clearInterval(restart_interval);
_x = _root.game_holder.watermelon_start_point._x;
_y = _root.game_holder.watermelon_start_point._y;
growing = true;
gotoAndStop("grow");
}
}
function beginRolling() {
if (_global.game_paused == false) {
growing = false;
y_speed = 2;
x_speed = 5;
gotoAndStop("roll_right");
poisonous = true;
rolling = true;
onEnterFrame = function () {
this.doEnterFrame();
};
}
}
function checkCollisionThorns() {
if (_global.game_paused == false) {
if (x_speed > 0) {
if (_root.game_holder.danger.hitTest((_root.game_holder._x + _x) + 18.5, _root.game_holder._y + _y, true)) {
splatting = true;
gotoAndStop("splat");
poisonous = false;
rolling = false;
growing = false;
delete onEnterFrame;
restart_interval = setInterval(this, "restart", 4000);
}
} else if (x_speed < 0) {
if (_root.game_holder.danger.hitTest((_root.game_holder._x + _x) - 18.5, _root.game_holder._y + _y, true)) {
splatting = true;
gotoAndStop("splat");
poisonous = false;
rolling = false;
growing = false;
delete onEnterFrame;
restart_interval = setInterval(this, "restart", 4000);
}
}
}
}
function adjustToPlatform() {
var _local3 = 0;
while (_local3 <= 16) {
if (!_root.game_holder.map.hitTest(_root.game_holder._x + _x, ((_root.game_holder._y + _y) + 18.5) - _local3, true)) {
_y = _y - (_local3 - 2);
break;
}
_local3++;
}
}
function checkCollisionDown() {
if (_root.game_holder.map.hitTest(_root.game_holder._x + _x, (_root.game_holder._y + _y) + 18.5, true)) {
adjustToPlatform();
y_speed = 0;
}
}
function checkCollisionLeft() {
if (_root.game_holder.map.hitTest((_root.game_holder._x + _x) - 18.5, _root.game_holder._y + _y, true)) {
x_speed = x_speed * -1;
}
}
function checkCollisionRight() {
if (_root.game_holder.map.hitTest((_root.game_holder._x + _x) + 18.5, _root.game_holder._y + _y, true)) {
x_speed = x_speed * -1;
}
}
var dir_list = new Array(0, 1, -1, 1, -1);
var y_speed = 2;
var x_speed = 5;
var GRAVITY = 1;
var rolling = false;
var growing = false;
var splatting = false;
}
Symbol 1229 MovieClip [__Packages.com.nitrome.miraclegrow.Woodlouse] Frame 0
class com.nitrome.miraclegrow.Woodlouse extends com.nitrome.miraclegrow.Insect
{
var id, _name, xmin, xmax, dir, speed, onEnterFrame, _x, _y, poisonous, gotoAndStop, anim;
function Woodlouse () {
super();
id = Number(_name.slice(5));
xmin = xmin_list[id];
xmax = xmax_list[id];
dir = dir_list[id];
speed = speed_list[id];
displayDir();
onEnterFrame = function () {
this.doEnterFrame();
};
}
function doEnterFrame() {
if (alive == true) {
if (rolling == false) {
if ((getXDistance(_x, _root.game_holder.plant_pot._x) <= 50) && (getYDistance(_y, _root.game_holder.plant_pot._y) <= 50)) {
poisonous = true;
speed = 2;
if (_root.game_holder.plant_pot._x > _x) {
dir = 1;
} else {
dir = -1;
}
rolling = true;
}
} else if (rolling == true) {
if ((getXDistance(_x, _root.game_holder.plant_pot._x) > 50) || (getYDistance(_y, _root.game_holder.plant_pot._y) > 50)) {
poisonous = false;
speed = 0.5;
rolling = false;
}
}
if (dir == 1) {
_x = _x + speed;
if (_x >= xmax) {
dir = -1;
}
} else if (dir == -1) {
_x = _x - speed;
if (_x <= xmin) {
dir = 1;
}
}
displayDir();
}
}
function displayDir() {
if (dir == 1) {
if (rolling == true) {
gotoAndStop("roll_right");
} else {
gotoAndStop("move_right");
}
} else if (dir == -1) {
if (rolling == true) {
gotoAndStop("roll_left");
} else {
gotoAndStop("move_left");
}
}
}
function getXDistance(x1, x2) {
if (x1 > x2) {
return(x1 - x2);
}
if (x2 > x1) {
return(x2 - x1);
}
return(0);
}
function getYDistance(y1, y2) {
if (y1 > y2) {
return(y1 - y2);
}
if (y2 > y1) {
return(y2 - y1);
}
return(0);
}
function getDistance(x1, y1, x2, y2) {
var _local2 = getXDistance(x1, x2);
var _local3 = getYDistance(y1, y2);
var _local4 = Math.sqrt((_local2 * _local2) + (_local3 * _local3));
return(_local4);
}
function pauseAnimation() {
anim.stop();
}
function restartAnimation() {
anim.play();
}
var alive = true;
var xmin_list = new Array(0, 974, 71, 71);
var xmax_list = new Array(0, 1418, 814, 814);
var dir_list = new Array(0, 1, 1, -1);
var speed_list = new Array(0, 0.5, 0.5, 0.5);
var rolling = false;
}
Symbol 1230 MovieClip [__Packages.com.nitrome.miraclegrow.StoppingHorizontalPlatform] Frame 0
class com.nitrome.miraclegrow.StoppingHorizontalPlatform extends MovieClip
{
var stopped_interval, id, _name, speed, dir, ma, mi, st, _x;
function StoppingHorizontalPlatform () {
super();
init();
}
function init() {
clearInterval(stopped_interval);
isStopped = false;
id = Number(_name.slice(6));
speed = speed_list[id];
dir = dir_list[id];
ma = max_list[id];
mi = min_list[id];
st = stopping_list[id];
}
function pauseGame() {
clearInterval(stopped_interval);
}
function restartGame() {
if (isStopped == true) {
if (dir == 1) {
stopped_interval = setInterval(this, "restart", st, -1);
} else if (dir == -1) {
stopped_interval = setInterval(this, "restart", st, 1);
}
}
}
function getIsStopped() {
return(isStopped);
}
function main() {
if (isStopped == false) {
if (dir == 1) {
if ((_x + speed) >= ma) {
var _local2 = ma - _x;
_x = ma;
stopped_interval = setInterval(this, "restart", st, -1);
isStopped = true;
return(_local2);
}
_x = _x + speed;
return(speed);
}
if (dir == -1) {
if ((_x - speed) <= mi) {
var _local2 = _x - mi;
_x = mi;
stopped_interval = setInterval(this, "restart", st, 1);
isStopped = true;
return(-_local2);
}
_x = _x - speed;
return(-speed);
}
} else {
return(0);
}
updateAfterEvent();
}
function restart(dir) {
this.dir = dir;
isStopped = false;
}
var speed_list = new Array(0, 1, 1, 1, 1, 1);
var dir_list = new Array(0, 1, -1, 1, 1, -1);
var max_list = new Array(0, 872, 454, 514, 507, 448);
var min_list = new Array(0, 693, 288, 294, 214, 114);
var stopping_list = new Array(0, 10000, 10000, 5000, 5000, 5000);
var isStopped = false;
}
Symbol 1231 MovieClip [__Packages.com.nitrome.miraclegrow.StoppingVerticalPlatform] Frame 0
class com.nitrome.miraclegrow.StoppingVerticalPlatform extends MovieClip
{
var can_land, stopped_interval, dir, st, id, _name, speed, ma, mi, _y;
function StoppingVerticalPlatform () {
super();
init();
}
function getIsStopped() {
return(isStopped);
}
function getCanLand() {
if (can_land == 1) {
return(true);
}
return(false);
}
function pauseGame() {
clearInterval(stopped_interval);
}
function restartGame() {
if (isStopped == true) {
if (dir == 1) {
stopped_interval = setInterval(this, "restart", st, -1);
} else if (dir == -1) {
stopped_interval = setInterval(this, "restart", st, 1);
}
}
}
function init() {
clearInterval(stopped_interval);
isStopped = false;
id = Number(_name.slice(5));
speed = speed_list[id];
dir = dir_list[id];
ma = max_list[id];
mi = min_list[id];
st = stopping_list[id];
can_land = can_land_list[id];
}
function main() {
if (isStopped == false) {
if (dir == 1) {
if ((_y + speed) >= ma) {
var _local2 = ma - _y;
_y = ma;
stopped_interval = setInterval(this, "restart", st, -1);
isStopped = true;
return(_local2);
}
_y = _y + speed;
return(speed);
}
if (dir == -1) {
if ((_y - speed) <= mi) {
var _local2 = _y - mi;
_y = mi;
stopped_interval = setInterval(this, "restart", st, 1);
isStopped = true;
return(-_local2);
}
_y = _y - speed;
return(-speed);
}
} else {
return(0);
}
updateAfterEvent();
}
function restart(dir) {
this.dir = dir;
isStopped = false;
}
var speed_list = new Array(0, 1, 1, 1, 1, 1, 1, 1, 1, 1);
var dir_list = new Array(0, -1, -1, -1, -1, -1, 1, 1, 1, 1);
var max_list = new Array(0, 500, 325, 373, 373, 373, 1008, 970, 970, 970);
var min_list = new Array(0, 325, 145, 229, 229, 229, 650, 810, 810, 566);
var stopping_list = new Array(0, 5000, 10000, 10000, 10000, 10000, 10000, 5000, 5000, 5000);
var isStopped = false;
var can_land_list = new Array(0, 1, 1, 1, 1, 1, 1, 1, 1, 1);
}
Symbol 1232 MovieClip [__Packages.com.nitrome.miraclegrow.LevelNamePanel] Frame 0
class com.nitrome.miraclegrow.LevelNamePanel extends MovieClip
{
var name_text;
function LevelNamePanel () {
super();
}
function displayLevel(n) {
name_text.text = level_names[n - 1];
var _local5 = _root.sf.getLevelCans(_global.selected_level);
var _local4 = _local5.split(",");
if (_local4[0] == "1") {
displayCollected(1);
} else {
displayNotCollected(1);
}
if (_local4[1] == "1") {
displayCollected(2);
} else {
displayNotCollected(2);
}
if (_local4[2] == "1") {
displayCollected(3);
} else {
displayNotCollected(3);
}
}
function displayCollected(n) {
this["symbol_" + n].gotoAndStop("filled");
}
function displayNotCollected(n) {
this["symbol_" + n].gotoAndStop("empty");
}
var level_names = new Array("1 - entrance hall", "2 - plum run", "3 - dragonfly alley", "4 - orange orchard", "5 - pineapple factory", "6 - beetroot juice", "7 - the pit", "8 - tulip dome", "9 - melon kong", "10 - flower power", "11 - tomato nursery", "12 - transporter room", "13 - cactus climb", "14 - thorny pavillion", "15 - rose enclosure");
}
Symbol 1233 MovieClip [__Packages.com.nitrome.miraclegrow.PlayLevelButton] Frame 0
class com.nitrome.miraclegrow.PlayLevelButton extends com.nitrome.game.SimpleButton
{
function PlayLevelButton () {
super();
}
function onPress() {
_root.music_controller.fadeOutMenuMusic();
_global.last_played_level = _global.selected_level;
_root.tt.doTween("GAME");
}
}
Symbol 1234 MovieClip [__Packages.com.nitrome.miraclegrow.BackButton] Frame 0
class com.nitrome.miraclegrow.BackButton extends com.nitrome.game.SimpleButton
{
function BackButton () {
super();
}
function onPress() {
_root.tt.doTween("MENU");
}
}
Symbol 1235 MovieClip [__Packages.com.nitrome.game.SaveFunctions] Frame 0
class com.nitrome.game.SaveFunctions
{
function SaveFunctions () {
}
function getShownEnd() {
var _local1 = SharedObject.getLocal("gamedata");
var _local2 = false;
for (var _local3 in _local1.data) {
_local2 = true;
}
if (_local2 == true) {
if (_local1.data.shownend != undefined) {
if (_local1.data.shownend == "yes") {
return(true);
}
return(false);
}
return(false);
}
return(false);
}
function setShownEnd() {
var _local1 = SharedObject.getLocal("gamedata");
_local1.data.shownend = "yes";
_local1.flush();
}
function setLastSavedScore(score) {
var _local1 = SharedObject.getLocal("gamedata");
_local1.data.lastsavedscore = score;
_local1.flush();
}
function getLastSavedScore() {
var _local1 = SharedObject.getLocal("gamedata");
var _local2 = false;
for (var _local3 in _local1.data) {
_local2 = true;
}
if (_local2 == true) {
if (_local1.data.lastsavedscore != undefined) {
return(_local1.data.lastsavedscore);
}
return(0);
}
return(0);
}
function saveLevelScore(level_number, score) {
var _local1 = SharedObject.getLocal("gamedata");
var _local2 = false;
for (var _local3 in _local1.data) {
_local2 = true;
}
var _local4;
if (_local2 == true) {
if (_local1.data.level_scores != undefined) {
_local4 = _local1.data.level_scores;
} else {
_local4 = "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0";
}
} else {
_local4 = "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0";
}
var _local5 = _local4.split(",");
_local5[level_number] = score;
var _local6 = _local5.toString();
_local1.data.level_scores = _local6;
_local1.flush();
}
function getLevelScore(level_number) {
var _local1 = SharedObject.getLocal("gamedata");
var _local2 = false;
for (var _local3 in _local1.data) {
_local2 = true;
}
var _local5;
if (_local2 == true) {
if (_local1.data.level_scores != undefined) {
_local5 = _local1.data.level_scores;
var _local4 = _local5.split(",");
return(Number(_local4[level_number]));
}
return(0);
}
return(0);
}
function getTotalScore() {
var _local3 = SharedObject.getLocal("gamedata");
var _local4 = false;
for (var _local7 in _local3.data) {
_local4 = true;
}
var _local8;
if (_local4 == true) {
if (_local3.data.level_scores != undefined) {
_local8 = _local3.data.level_scores;
var _local6 = _local8.split(",");
var _local5 = 0;
var _local2 = 1;
while (_local2 <= total_level_number) {
_local5 = _local5 + Number(_local6[_local2]);
_local2++;
}
return(_local5);
}
return(0);
}
return(0);
}
function setLevelUnlocked(level_number) {
var _local1 = SharedObject.getLocal("gamedata");
var _local2 = false;
for (var _local3 in _local1.data) {
_local2 = true;
}
var _local4;
if (_local2 == true) {
if (_local1.data.levels_unlocked != undefined) {
_local4 = _local1.data.levels_unlocked;
} else {
_local4 = "0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0";
}
} else {
_local4 = "0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0";
}
var _local5 = _local4.split(",");
_local5[level_number] = "1";
var _local6 = _local5.toString();
_local1.data.levels_unlocked = _local6;
_local1.flush();
}
function getLevelUnlocked(level_number) {
var _local1 = SharedObject.getLocal("gamedata");
var _local2 = false;
for (var _local3 in _local1.data) {
_local2 = true;
}
var _local4;
if (_local2 == true) {
if (_local1.data.levels_unlocked != undefined) {
_local4 = _local1.data.levels_unlocked;
} else {
_local4 = "0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0";
}
} else {
_local4 = "0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0";
}
var _local5 = _local4.split(",");
if (_local5[level_number] == "1") {
return(true);
}
return(false);
}
function getGameComplete() {
var _local3 = SharedObject.getLocal("gamedata");
var _local4 = false;
for (var _local7 in _local3.data) {
_local4 = true;
}
var _local8;
if (_local4 == true) {
if (_local3.data.levels_unlocked != undefined) {
_local8 = _local3.data.levels_unlocked;
var _local6 = _local8.split(",");
var _local5 = 0;
var _local2 = 1;
while (_local2 <= total_level_number) {
if (_local6[_local2] == "1") {
_local5++;
}
_local2++;
}
if (_local5 >= 30) {
return(true);
}
return(false);
}
return(false);
}
return(false);
}
function saveLevelCans(l, c1, c2, c3) {
var _local4 = SharedObject.getLocal("gamedata");
var _local5 = false;
for (var _local7 in _local4.data) {
_local5 = true;
}
var _local8;
if (_local5 == true) {
if (_local4.data.level_cans != undefined) {
_local8 = _local4.data.level_cans;
} else {
_local8 = "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";
}
} else {
_local8 = "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 _local2 = _local8.split(":");
var _local9 = _local2[l];
var _local6 = _local9.split(",");
if (c1 == "1") {
_local6[0] = 1;
}
if (c2 == "1") {
_local6[1] = 1;
}
if (c3 == "1") {
_local6[2] = 1;
}
var _local10 = String((((_local6[0] + ",") + _local6[1]) + ",") + _local6[2]);
_local2[l] = _local10;
var _local3 = "";
var _local1 = 0;
while (_local1 < _local2.length) {
_local3 = _local3 + _local2[_local1];
if (_local1 != (_local2.length - 1)) {
_local3 = _local3 + ":";
}
_local1++;
}
_local4.data.level_cans = _local3;
_local4.flush();
}
function getLevelCans(l) {
var _local1 = SharedObject.getLocal("gamedata");
var _local2 = false;
for (var _local3 in _local1.data) {
_local2 = true;
}
if (_local2 == true) {
if (_local1.data.level_cans != undefined) {
var _local4 = _local1.data.level_cans;
var _local5 = _local4.split(":");
var _local6 = _local5[l];
return(_local6);
}
return("0,0,0");
}
return("0,0,0");
}
function setSoundOn(b) {
var _local1 = SharedObject.getLocal("gamedata");
_local1.data.soundon = b;
_local1.flush();
}
function getSoundOn() {
var _local1 = SharedObject.getLocal("gamedata");
var _local2 = false;
for (var _local3 in _local1.data) {
_local2 = true;
}
if (_local2 == true) {
if (_local1.data.soundon != undefined) {
return(_local1.data.soundon);
}
return(true);
}
return(true);
}
function setGameQuality(s) {
var _local1 = SharedObject.getLocal("gamedata");
_local1.data.qualityvalue = s;
_local1.flush();
}
function getGameQuality() {
var _local1 = SharedObject.getLocal("gamedata");
var _local2 = false;
for (var _local3 in _local1.data) {
_local2 = true;
}
if (_local2 == true) {
if (_local1.data.qualityvalue != undefined) {
return(_local1.data.qualityvalue);
}
return("high");
}
return("high");
}
function resetAll() {
var _local1 = SharedObject.getLocal("gamedata");
_local1.clear();
_local1.flush();
}
var total_level_number = 15;
}
Symbol 1236 MovieClip [__Packages.com.nitrome.miraclegrow.PauseManager] Frame 0
class com.nitrome.miraclegrow.PauseManager
{
function PauseManager () {
_global.game_paused = false;
}
function pauseGame(end_of_level) {
_root.timer.pauseTimer();
_root.game_holder.plant_pot.pauseGame();
var _local6 = 0;
while (_local6 <= insects.length) {
var _local5 = insects[_local6];
var _local4 = 1;
while (_local4 <= max_insect_num) {
if (_root.game_holder[(_local5 + "_") + _local4].getAlive() == true) {
_root.game_holder[(_local5 + "_") + _local4].pauseGame();
}
_local4++;
}
_local6++;
}
_local6 = 1;
while (_local6 <= 11) {
_root.game_holder["vert_" + _local6].pauseGame();
_root.game_holder.danger["vert_" + _local6].pauseGame();
_root.game_holder["horiz_" + _local6].pauseGame();
_local6++;
}
_root.game_holder.can_1.anim.stop();
_root.game_holder.can_2.anim.stop();
_root.game_holder.can_3.anim.stop();
_root.game_holder.level_end.stop();
_local6 = 1;
while (_local6 <= 21) {
_root.game_holder.danger["tom_" + _local6].doPause();
_local6++;
}
_root.game_holder.plant_head.head_anim.stop();
_root.game_holder.plant_head.eye_anim.stop();
if (end_of_level == false) {
_root.popup.showPopUp("game_paused");
}
_global.game_paused = true;
}
function restartGame() {
_root.popup.hidePopUp();
_root.game_holder.plant_pot.restartGame();
var _local6 = 0;
while (_local6 < insects.length) {
var _local5 = insects[_local6];
var _local4 = 1;
while (_local4 <= max_insect_num) {
if (_root.game_holder[(_local5 + "_") + _local4].getAlive() == true) {
_root.game_holder[(_local5 + "_") + _local4].restartGame();
}
_local4++;
}
_local6++;
}
_local6 = 1;
while (_local6 <= 11) {
_root.game_holder["vert_" + _local6].restartGame();
_root.game_holder.danger["vert_" + _local6].restartGame();
_root.game_holder["horiz_" + _local6].restartGame();
_local6++;
}
_root.game_holder.can_1.anim.play();
_root.game_holder.can_2.anim.play();
_root.game_holder.can_3.anim.play();
_root.game_holder.level_end.play();
_local6 = 1;
while (_local6 <= 21) {
_root.game_holder.danger["tom_" + _local6].doContinue();
_local6++;
}
_root.game_holder.plant_head.head_anim.play();
_root.game_holder.plant_head.eye_anim.play();
_root.timer.restartTimer();
_global.game_paused = false;
}
var insects = new Array("fly", "cat", "bee", "spider", "wood", "butter", "lady", "grass", "dragon", "snail", "water");
var max_insect_num = 15;
}
Symbol 1237 MovieClip [__Packages.com.nitrome.game.MusicController] Frame 0
class com.nitrome.game.MusicController extends MovieClip
{
var menu_sound, game_sound;
function MusicController () {
super();
menu_sound = new Sound();
game_sound = new Sound();
}
function turnMusicOn() {
volume_level = 100;
menu_sound.setVolume(100);
game_sound.setVolume(100);
}
function turnMusicOff() {
volume_level = 0;
menu_sound.setVolume(0);
game_sound.setVolume(0);
}
function startMenuMusic() {
game_sound.stop();
menu_sound = new Sound();
if (_root.sf.getSoundOn() == false) {
menu_sound.setVolume(0);
volume_level = 0;
} else {
menu_sound.setVolume(100);
volume_level = 100;
}
fading_out_game = false;
fading_out_menu = false;
menu_sound.attachSound("menu_music");
menu_sound.start();
menu_sound.onSoundComplete = function () {
this.start();
};
}
function startGameMusic() {
menu_sound.stop();
game_sound = new Sound();
if (_root.sf.getSoundOn() == false) {
game_sound.setVolume(0);
volume_level = 0;
} else {
game_sound.setVolume(100);
volume_level = 100;
}
fading_out_game = false;
fading_out_menu = false;
game_sound.attachSound("game_music");
game_sound.start();
game_sound.onSoundComplete = function () {
this.start();
};
}
function fadeOutMenuMusic() {
volume_level = 100;
fading_out_menu = true;
fading_out_game = false;
}
function fadeOutGameMusic() {
volume_level = 100;
fading_out_game = true;
fading_out_menu = false;
}
function onEnterFrame() {
if (fading_out_menu == true) {
volume_level = volume_level - 10;
if (_root.sf.getSoundOn() == true) {
menu_sound.setVolume(volume_level);
}
if (volume_level == 0) {
startGameMusic();
fading_out_menu = false;
}
} else if (fading_out_game == true) {
volume_level = volume_level - 10;
if (_root.sf.getSoundOn() == true) {
game_sound.setVolume(volume_level);
}
if (volume_level == 0) {
startMenuMusic();
fading_out_game = false;
}
}
}
var fading_out_menu = false;
var fading_out_game = false;
var volume_level = 100;
}
Symbol 5 MovieClip Frame 1
this._visible = false;
Symbol 11 Button
on (release) {
getURL ("http://www.miniclip.com", "_blank");
}
Symbol 16 MovieClip Frame 2
if (_url.indexOf("http") > -1) {
if (_parent._parent._parent.loadAdNow) {
cacheBuster = getTimer() + random(999999);
showAd = "http://www.miniclip.com/swfcontent/push/didyouknow.swf?cacheBuster" + cacheBuster;
trace("Loading ad: " + showAd);
mcAd.loadMovie(showAd);
} else {
gotoAndPlay(_currentframe - 1);
}
}
Symbol 16 MovieClip Frame 4
if ((mcAd.getBytesTotal() != 0) && (mcAd.getBytesLoaded() == mcAd.getBytesTotal())) {
gotoAndStop ("showAd");
} else {
gotoAndPlay(_currentframe - 1);
}
Symbol 16 MovieClip Frame 12
stop();
Symbol 26 MovieClip Frame 1
stop();
Symbol 26 MovieClip Frame 100
stop();
Symbol 28 MovieClip Frame 1
stop();
Symbol 28 MovieClip Frame 12
_root.play();
_root.isFinished = true;
_parent.stop();
stop();
Symbol 32 Button
on (release) {
getURL ("http://www.miniclip.com/", "_blank");
}
Symbol 33 MovieClip Frame 2
_parent.mcAnimation.play();
stop();
Symbol 33 MovieClip Frame 13
_parent.gotoAndPlay("preload");
stop();
Symbol 49 MovieClip Frame 1
stop();
Symbol 49 MovieClip Frame 60
Symbol 49 MovieClip Frame 121
_parent.mcBackground.play();
stop();
Symbol 50 MovieClip Frame 1
loadAdNow = false;
_root.stop();
play();
Instance of Symbol 5 MovieClip "mcIntro" in Symbol 50 MovieClip Frame 1
onClipEvent (load) {
_visible = false;
}
Symbol 50 MovieClip Frame 2
xPos = _x;
yPos = _y;
mcBackground._x = mcBackground._x - xPos;
mcBackground._y = mcBackground._y - yPos;
mcAnimation._x = mcAnimation._x - xPos;
mcAnimation._y = mcAnimation._y - yPos;
var stageWidth = Stage.width;
var stageHeight = Stage.height;
var centerStageX = (stageWidth / 2);
var centerStageY = (stageHeight / 2);
mcBackground._width = stageWidth;
mcBackground._height = stageHeight;
mcAnimation._x = mcAnimation._x + centerStageX;
mcAnimation._y = mcAnimation._y + (centerStageY - (stageHeight / 10));
stop();
Instance of Symbol 28 MovieClip "mcLoadingAnimated" in Symbol 50 MovieClip Frame 2
onClipEvent (load) {
_visible = false;
}
Symbol 50 MovieClip Frame 3
var loadedPercent = int((_root.getBytesLoaded() / _root.getBytesTotal()) * 100);
if (loadedPercent == 100) {
_root.play();
stop();
} else {
loadAdNow = true;
mcLoadingAnimated._visible = true;
}
Symbol 50 MovieClip Frame 5
var loadedPercent = int((_root.getBytesLoaded() / _root.getBytesTotal()) * 100);
if (loadedPercent < 100) {
mcLoadingAnimated.mcLoading.gotoAndStop(loadedPercent);
mcLoadingAnimated.mcLoading.txtPercentLoaded1 = ("The game is loading (" + loadedPercent) + "%)";
mcLoadingAnimated.mcLoading.txtPercentLoaded2 = ("The game is loading (" + loadedPercent) + "%)";
gotoAndPlay(_currentframe - 1);
} else {
mcLoadingAnimated.play();
stop();
}
Symbol 70 MovieClip [back_button] Frame 1
#initclip 137
Object.registerClass("back_button", com.nitrome.miraclegrow.BackButton);
#endinitclip
stop();
Symbol 70 MovieClip [back_button] Frame 10
stop();
Symbol 75 MovieClip [back_to_map_button] Frame 1
#initclip 65
Object.registerClass("back_to_map_button", com.nitrome.miraclegrow.BackToMapButton);
#endinitclip
stop();
Symbol 75 MovieClip [back_to_map_button] Frame 10
stop();
Symbol 82 MovieClip [bee] Frame 1
#initclip 66
Object.registerClass("bee", com.nitrome.miraclegrow.Bee);
#endinitclip
Symbol 82 MovieClip [bee] Frame 4
gotoAndPlay ("flying");
Symbol 82 MovieClip [bee] Frame 5
stop();
Symbol 91 MovieClip [butterfly] Frame 1
#initclip 67
Object.registerClass("butterfly", com.nitrome.miraclegrow.Butterfly);
#endinitclip
Symbol 97 MovieClip [caterpillar] Frame 1
#initclip 68
Object.registerClass("caterpillar", com.nitrome.miraclegrow.Caterpillar);
#endinitclip
stop();
Symbol 97 MovieClip [caterpillar] Frame 17
stop();
Symbol 101 MovieClip [continue_button] Frame 1
#initclip 69
Object.registerClass("continue_button", com.nitrome.miraclegrow.ContinueButton);
#endinitclip
stop();
Symbol 101 MovieClip [continue_button] Frame 10
stop();
Symbol 129 MovieClip [conveyor_left] Frame 1
#initclip 70
Object.registerClass("conveyor_left", com.nitrome.miraclegrow.ConveyorBelt);
#endinitclip
Symbol 130 MovieClip [conveyor_left_small] Frame 1
#initclip 71
Object.registerClass("conveyor_left_small", com.nitrome.miraclegrow.ConveyorBelt);
#endinitclip
Symbol 134 MovieClip [conveyor] Frame 1
#initclip 72
Object.registerClass("conveyor", com.nitrome.miraclegrow.ConveyorBelt);
#endinitclip
Symbol 135 MovieClip [conveyor_right_small] Frame 1
#initclip 73
Object.registerClass("conveyor_right_small", com.nitrome.miraclegrow.ConveyorBelt);
#endinitclip
Symbol 139 MovieClip [credits_button] Frame 1
#initclip 74
Object.registerClass("credits_button", com.nitrome.miraclegrow.CreditsButton);
#endinitclip
stop();
Symbol 139 MovieClip [credits_button] Frame 10
stop();
Symbol 157 MovieClip [creeper_platform] Frame 1
#initclip 75
Object.registerClass("creeper_platform", com.nitrome.miraclegrow.VerticalPlatform);
#endinitclip
Symbol 163 MovieClip [dragonfly] Frame 1
#initclip 76
Object.registerClass("dragonfly", com.nitrome.miraclegrow.Dragonfly);
#endinitclip
stop();
Symbol 163 MovieClip [dragonfly] Frame 10
stop();
Symbol 171 MovieClip [energy_bar] Frame 1
#initclip 77
Object.registerClass("energy_bar", com.nitrome.miraclegrow.EnergyBar);
#endinitclip
stop();
Symbol 171 MovieClip [energy_bar] Frame 10
stop();
Symbol 171 MovieClip [energy_bar] Frame 20
stop();
Symbol 171 MovieClip [energy_bar] Frame 30
stop();
Symbol 171 MovieClip [energy_bar] Frame 40
stop();
Symbol 171 MovieClip [energy_bar] Frame 50
stop();
Symbol 193 MovieClip Frame 9
_parent.reposition();
Symbol 193 MovieClip Frame 67
_parent.reset();
stop();
Symbol 194 MovieClip [falling_tomato] Frame 1
#initclip 78
Object.registerClass("falling_tomato", com.nitrome.miraclegrow.FallingTomato);
#endinitclip
stop();
Symbol 194 MovieClip [falling_tomato] Frame 10
_root.splat_sfx.gotoAndPlay(2);
stop();
Symbol 201 MovieClip [fly] Frame 1
#initclip 79
Object.registerClass("fly", com.nitrome.miraclegrow.Fly);
#endinitclip
Symbol 206 MovieClip [game_reset_button] Frame 1
#initclip 80
Object.registerClass("game_reset_button", com.nitrome.game.GameResetButton);
#endinitclip
stop();
Symbol 206 MovieClip [game_reset_button] Frame 10
stop();
Symbol 206 MovieClip [game_reset_button] Frame 20
stop();
Symbol 215 MovieClip Frame 1
_parent.stopMoving();
play();
Symbol 215 MovieClip Frame 8
_parent.startMoving();
play();
Symbol 216 MovieClip [grasshopper] Frame 1
#initclip 81
Object.registerClass("grasshopper", com.nitrome.miraclegrow.Grasshopper);
#endinitclip
stop();
Symbol 216 MovieClip [grasshopper] Frame 10
stop();
Symbol 220 MovieClip [help_button] Frame 1
#initclip 82
Object.registerClass("help_button", com.nitrome.miraclegrow.HelpButton);
#endinitclip
stop();
Symbol 220 MovieClip [help_button] Frame 10
stop();
Symbol 239 MovieClip [horizontal_platform] Frame 1
#initclip 83
Object.registerClass("horizontal_platform", com.nitrome.miraclegrow.HorizontalPlatform);
#endinitclip
Symbol 252 MovieClip [ladybird] Frame 1
#initclip 84
Object.registerClass("ladybird", com.nitrome.miraclegrow.Ladybird);
#endinitclip
Symbol 258 MovieClip [level_button_1] Frame 1
#initclip 85
Object.registerClass("level_button_1", com.nitrome.miraclegrow.LevelSelectButton);
#endinitclip
stop();
Symbol 258 MovieClip [level_button_1] Frame 10
stop();
Symbol 258 MovieClip [level_button_1] Frame 19
stop();
Symbol 259 MovieClip [level_button_2] Frame 1
#initclip 86
Object.registerClass("level_button_2", com.nitrome.miraclegrow.LevelSelectButton);
#endinitclip
stop();
Symbol 259 MovieClip [level_button_2] Frame 10
stop();
Symbol 259 MovieClip [level_button_2] Frame 19
stop();
Symbol 260 MovieClip [level_button_3] Frame 1
#initclip 87
Object.registerClass("level_button_3", com.nitrome.miraclegrow.LevelSelectButton);
#endinitclip
stop();
Symbol 260 MovieClip [level_button_3] Frame 12
stop();
Symbol 260 MovieClip [level_button_3] Frame 21
stop();
Symbol 261 MovieClip [level_button_4] Frame 1
#initclip 88
Object.registerClass("level_button_4", com.nitrome.miraclegrow.LevelSelectButton);
#endinitclip
stop();
Symbol 261 MovieClip [level_button_4] Frame 12
stop();
Symbol 261 MovieClip [level_button_4] Frame 21
stop();
Symbol 262 MovieClip [level_button_5] Frame 1
#initclip 89
Object.registerClass("level_button_5", com.nitrome.miraclegrow.LevelSelectButton);
#endinitclip
stop();
Symbol 262 MovieClip [level_button_5] Frame 12
stop();
Symbol 262 MovieClip [level_button_5] Frame 21
stop();
Symbol 263 MovieClip [level_button_6] Frame 1
#initclip 90
Object.registerClass("level_button_6", com.nitrome.miraclegrow.LevelSelectButton);
#endinitclip
stop();
Symbol 263 MovieClip [level_button_6] Frame 12
stop();
Symbol 263 MovieClip [level_button_6] Frame 21
stop();
Symbol 264 MovieClip [level_button_7] Frame 1
#initclip 91
Object.registerClass("level_button_7", com.nitrome.miraclegrow.LevelSelectButton);
#endinitclip
stop();
Symbol 264 MovieClip [level_button_7] Frame 12
stop();
Symbol 264 MovieClip [level_button_7] Frame 21
stop();
Symbol 265 MovieClip [level_button_8] Frame 1
#initclip 92
Object.registerClass("level_button_8", com.nitrome.miraclegrow.LevelSelectButton);
#endinitclip
stop();
Symbol 265 MovieClip [level_button_8] Frame 12
stop();
Symbol 265 MovieClip [level_button_8] Frame 21
stop();
Symbol 266 MovieClip [level_button_9] Frame 1
#initclip 93
Object.registerClass("level_button_9", com.nitrome.miraclegrow.LevelSelectButton);
#endinitclip
stop();
Symbol 266 MovieClip [level_button_9] Frame 12
stop();
Symbol 266 MovieClip [level_button_9] Frame 21
stop();
Symbol 267 MovieClip [level_button_10] Frame 1
#initclip 94
Object.registerClass("level_button_10", com.nitrome.miraclegrow.LevelSelectButton);
#endinitclip
stop();
Symbol 267 MovieClip [level_button_10] Frame 12
stop();
Symbol 267 MovieClip [level_button_10] Frame 21
stop();
Symbol 268 MovieClip [level_button_11] Frame 1
#initclip 95
Object.registerClass("level_button_11", com.nitrome.miraclegrow.LevelSelectButton);
#endinitclip
stop();
Symbol 268 MovieClip [level_button_11] Frame 12
stop();
Symbol 268 MovieClip [level_button_11] Frame 21
stop();
Symbol 269 MovieClip [level_button_12] Frame 1
#initclip 96
Object.registerClass("level_button_12", com.nitrome.miraclegrow.LevelSelectButton);
#endinitclip
stop();
Symbol 269 MovieClip [level_button_12] Frame 12
stop();
Symbol 269 MovieClip [level_button_12] Frame 21
stop();
Symbol 270 MovieClip [level_button_13] Frame 1
#initclip 97
Object.registerClass("level_button_13", com.nitrome.miraclegrow.LevelSelectButton);
#endinitclip
stop();
Symbol 270 MovieClip [level_button_13] Frame 12
stop();
Symbol 270 MovieClip [level_button_13] Frame 21
stop();
Symbol 273 MovieClip [level_button_14] Frame 1
#initclip 98
Object.registerClass("level_button_14", com.nitrome.miraclegrow.LevelSelectButton);
#endinitclip
stop();
Symbol 273 MovieClip [level_button_14] Frame 13
stop();
Symbol 273 MovieClip [level_button_14] Frame 22
stop();
Symbol 274 MovieClip [level_button_15] Frame 1
#initclip 99
Object.registerClass("level_button_15", com.nitrome.miraclegrow.LevelSelectButton);
#endinitclip
stop();
Symbol 274 MovieClip [level_button_15] Frame 12
stop();
Symbol 274 MovieClip [level_button_15] Frame 21
stop();
Symbol 289 MovieClip [neck_length_display] Frame 1
#initclip 100
Object.registerClass("neck_length_display", com.nitrome.miraclegrow.NeckLengthDisplay);
#endinitclip
Symbol 293 MovieClip [loading_data_file] Frame 1
#initclip 101
Object.registerClass("loading_data_file", com.nitrome.loading.FileLoader);
#endinitclip
Symbol 295 MovieClip [no_clicks] Frame 1
#initclip 102
Object.registerClass("no_clicks", com.nitrome.game.NoClicks);
#endinitclip
Symbol 299 MovieClip [options_button] Frame 1
#initclip 103
Object.registerClass("options_button", com.nitrome.miraclegrow.OptionsButton);
#endinitclip
stop();
Symbol 299 MovieClip [options_button] Frame 10
stop();
Symbol 305 MovieClip [options_sound_toggle] Frame 1
#initclip 104
Object.registerClass("options_sound_toggle", com.nitrome.game.OptionsSoundToggle);
#endinitclip
stop();
Symbol 305 MovieClip [options_sound_toggle] Frame 10
stop();
Symbol 305 MovieClip [options_sound_toggle] Frame 20
stop();
Symbol 305 MovieClip [options_sound_toggle] Frame 30
stop();
Symbol 312 MovieClip [pause_button] Frame 1
#initclip 105
Object.registerClass("pause_button", com.nitrome.miraclegrow.PauseButton);
#endinitclip
stop();
Symbol 312 MovieClip [pause_button] Frame 10
stop();
Symbol 316 MovieClip [plant] Frame 1
#initclip 106
Object.registerClass("plant", com.nitrome.miraclegrow.PlantPot);
#endinitclip
Symbol 317 MovieClip [plant_press] Frame 1
#initclip 107
Object.registerClass("plant_press", com.nitrome.miraclegrow.PlantPress);
#endinitclip
Symbol 322 MovieClip [plant_stem] Frame 1
#initclip 108
Object.registerClass("plant_stem", com.nitrome.miraclegrow.PlantStem);
#endinitclip
Symbol 326 MovieClip [play_button] Frame 1
#initclip 109
Object.registerClass("play_button", com.nitrome.miraclegrow.PlayButton);
#endinitclip
stop();
Symbol 326 MovieClip [play_button] Frame 10
stop();
Symbol 330 MovieClip [play_next_level_button] Frame 1
#initclip 110
Object.registerClass("play_next_level_button", com.nitrome.miraclegrow.PlayNextLevelButton);
#endinitclip
stop();
Symbol 330 MovieClip [play_next_level_button] Frame 10
stop();
Symbol 336 MovieClip [submit_score_button] Frame 1
#initclip 111
Object.registerClass("submit_score_button", com.nitrome.miraclegrow.SubmitScoreButton);
#endinitclip
stop();
Symbol 336 MovieClip [submit_score_button] Frame 10
stop();
Symbol 343 MovieClip [retry_level_button] Frame 1
#initclip 112
Object.registerClass("retry_level_button", com.nitrome.miraclegrow.RetryLevelButton);
#endinitclip
stop();
Symbol 343 MovieClip [retry_level_button] Frame 10
stop();
Symbol 357 MovieClip [score_counter] Frame 1
#initclip 113
Object.registerClass("score_counter", com.nitrome.game.ScoreCounter);
#endinitclip
stop();
Symbol 357 MovieClip [score_counter] Frame 5
gotoAndPlay (2);
Symbol 357 MovieClip [score_counter] Frame 6
stop();
Symbol 360 MovieClip [score_counter_larger] Frame 1
#initclip 114
Object.registerClass("score_counter_larger", com.nitrome.game.ScoreCounter);
#endinitclip
stop();
Symbol 360 MovieClip [score_counter_larger] Frame 5
gotoAndPlay (2);
Symbol 360 MovieClip [score_counter_larger] Frame 6
stop();
Symbol 366 MovieClip [high_score_display] Frame 1
#initclip 115
Object.registerClass("high_score_display", com.nitrome.game.HighScoreDisplay);
#endinitclip
Symbol 369 MovieClip [total_high_score_display] Frame 1
#initclip 116
Object.registerClass("total_high_score_display", com.nitrome.game.TotalHighScoreDisplay);
#endinitclip
Symbol 370 MovieClip [submit_score_button_2] Frame 1
#initclip 117
Object.registerClass("submit_score_button_2", com.nitrome.miraclegrow.SubmitScoreButton);
#endinitclip
stop();
Symbol 370 MovieClip [submit_score_button_2] Frame 10
stop();
Symbol 371 MovieClip [back_to_map_button_2] Frame 1
#initclip 118
Object.registerClass("back_to_map_button_2", com.nitrome.miraclegrow.BackToMapButton);
#endinitclip
stop();
Symbol 371 MovieClip [back_to_map_button_2] Frame 10
stop();
Symbol 372 MovieClip Frame 10
counter_time.doCount(_global.time_bonus, 20);
stop();
Symbol 372 MovieClip Frame 20
counter_energy.doCount(_global.energy_bonus, 10);
stop();
Symbol 372 MovieClip Frame 30
counter_length.doCount(_global.length_bonus, 10);
stop();
Symbol 372 MovieClip Frame 41
counter_can.doCount(_global.can_bonus, 20);
stop();
Symbol 372 MovieClip Frame 51
counter_total.doCount(_global.level_score, 50);
stop();
Symbol 372 MovieClip Frame 55
if (_global.total_score > _root.sf.getLastSavedScore()) {
submit_score_button._visible = true;
} else {
submit_score_button._visible = false;
}
if (_global.selected_level < 15) {
play_next_level_button._visible = true;
} else {
play_next_level_button._visible = false;
}
level_score_display.displayScore(_global.selected_level);
stop();
Symbol 376 MovieClip [next_button_2] Frame 1
#initclip 119
Object.registerClass("next_button_2", com.nitrome.miraclegrow.NextButton);
#endinitclip
stop();
Symbol 376 MovieClip [next_button_2] Frame 10
stop();
Symbol 381 MovieClip Frame 10
counter_time.doCount(_global.time_bonus, 20);
stop();
Symbol 381 MovieClip Frame 20
counter_energy.doCount(_global.energy_bonus, 10);
stop();
Symbol 381 MovieClip Frame 30
counter_length.doCount(_global.length_bonus, 10);
stop();
Symbol 381 MovieClip Frame 41
counter_can.doCount(_global.can_bonus, 20);
stop();
Symbol 381 MovieClip Frame 51
counter_total.doCount(_global.level_score, 50);
stop();
Symbol 381 MovieClip Frame 55
level_score_display.displayScore(_global.selected_level);
stop();
Symbol 381 MovieClip Frame 62
if (_global.total_score > _root.sf.getLastSavedScore()) {
submit_score_button._visible = true;
} else {
submit_score_button._visible = false;
}
_root.sf.setShownEnd();
stop();
Symbol 382 MovieClip Frame 1
_global.total_score = _root.sf.getTotalScore();
if (_global.total_score > _root.sf.getLastSavedScore()) {
submit_score_button._visible = true;
} else {
submit_score_button._visible = false;
}
stop();
Symbol 382 MovieClip Frame 10
_global.total_score = _root.sf.getTotalScore();
if (_global.total_score > _root.sf.getLastSavedScore()) {
submit_score_button._visible = true;
} else {
submit_score_button._visible = false;
}
stop();
Symbol 382 MovieClip Frame 20
stop();
Symbol 382 MovieClip Frame 30
_global.time_bonus = Math.round(_root.timer.getTimeLeft() / 100);
_global.energy_bonus = _root.energy_bar.getHitsLeft() * 100;
_global.length_bonus = _root.neck_length_display.getNeckLength();
_global.can_bonus = 0;
var cans = _root.watering_can_display.getCansCollected();
var cans_array = cans.split(",");
if (cans_array[0] == "1") {
_global.can_bonus = _global.can_bonus + 500;
}
if (cans_array[1] == "1") {
_global.can_bonus = _global.can_bonus + 500;
}
if (cans_array[2] == "1") {
_global.can_bonus = _global.can_bonus + 500;
}
_global.level_score = ((_global.time_bonus + _global.energy_bonus) + _global.length_bonus) + _global.can_bonus;
if (_root.sf.getLevelScore(_global.selected_level) < _global.level_score) {
_root.sf.saveLevelScore(_global.selected_level, _global.level_score);
}
_root.sf.saveLevelCans(_global.selected_level, cans_array[0], cans_array[1], cans_array[2]);
_global.total_score = _root.sf.getTotalScore();
_root.sf.setLevelUnlocked(_global.selected_level + 1);
_global.last_played_level = _global.selected_level;
stop();
Symbol 382 MovieClip Frame 40
_global.time_bonus = Math.round(_root.timer.getTimeLeft() / 100);
_global.energy_bonus = _root.energy_bar.getHitsLeft() * 100;
_global.length_bonus = _root.neck_length_display.getNeckLength();
_global.can_bonus = 0;
var cans = _root.watering_can_display.getCansCollected();
var cans_array = cans.split(",");
if (cans_array[0] == "1") {
_global.can_bonus = _global.can_bonus + 500;
}
if (cans_array[1] == "1") {
_global.can_bonus = _global.can_bonus + 500;
}
if (cans_array[2] == "1") {
_global.can_bonus = _global.can_bonus + 500;
}
_global.level_score = ((_global.time_bonus + _global.energy_bonus) + _global.length_bonus) + _global.can_bonus;
if (_root.sf.getLevelScore(_global.selected_level) < _global.level_score) {
_root.sf.saveLevelScore(_global.selected_level, _global.level_score);
}
_root.sf.saveLevelCans(_global.selected_level, cans_array[0], cans_array[1], cans_array[2]);
_global.total_score = _root.sf.getTotalScore();
_root.sf.setLevelUnlocked(_global.selected_level + 1);
_global.last_played_level = _global.selected_level;
stop();
Symbol 383 MovieClip [popup_anim_clip] Frame 1
#initclip 120
Object.registerClass("popup_anim_clip", com.nitrome.miraclegrow.PopUp);
#endinitclip
stop();
Symbol 383 MovieClip [popup_anim_clip] Frame 2
this.displayPopUp();
Symbol 383 MovieClip [popup_anim_clip] Frame 15
stop();
Symbol 391 MovieClip [quality_toggle] Frame 1
#initclip 121
Object.registerClass("quality_toggle", com.nitrome.game.OptionsQualityToggle);
#endinitclip
stop();
Symbol 391 MovieClip [quality_toggle] Frame 10
stop();
Symbol 391 MovieClip [quality_toggle] Frame 20
stop();
Symbol 391 MovieClip [quality_toggle] Frame 30
stop();
Symbol 391 MovieClip [quality_toggle] Frame 40
stop();
Symbol 391 MovieClip [quality_toggle] Frame 50
stop();
Symbol 397 MovieClip [snail] Frame 1
#initclip 122
Object.registerClass("snail", com.nitrome.miraclegrow.Snail);
#endinitclip
stop();
Symbol 397 MovieClip [snail] Frame 13
stop();
Symbol 409 MovieClip [sound_toggle] Frame 1
#initclip 123
Object.registerClass("sound_toggle", com.nitrome.game.SoundToggle);
#endinitclip
stop();
Symbol 409 MovieClip [sound_toggle] Frame 10
stop();
Symbol 409 MovieClip [sound_toggle] Frame 20
stop();
Symbol 409 MovieClip [sound_toggle] Frame 30
stop();
Symbol 414 MovieClip Frame 1
stop();
Symbol 414 MovieClip Frame 10
stop();
Symbol 415 MovieClip [spider] Frame 1
#initclip 124
Object.registerClass("spider", com.nitrome.miraclegrow.Spider);
#endinitclip
Symbol 429 MovieClip Frame 1
stop();
Symbol 429 MovieClip Frame 2
stop();
Symbol 429 MovieClip Frame 3
stop();
Symbol 429 MovieClip Frame 4
stop();
Symbol 429 MovieClip Frame 5
stop();
Symbol 429 MovieClip Frame 6
stop();
Symbol 429 MovieClip Frame 7
stop();
Symbol 429 MovieClip Frame 8
stop();
Symbol 429 MovieClip Frame 9
stop();
Symbol 429 MovieClip Frame 10
stop();
Symbol 431 MovieClip [timer_display] Frame 1
#initclip 125
Object.registerClass("timer_display", com.nitrome.game.Timer);
#endinitclip
Symbol 433 MovieClip [transition_tween] Frame 1
#initclip 126
Object.registerClass("transition_tween", com.nitrome.miraclegrow.TransitionTween);
#endinitclip
stop();
Symbol 433 MovieClip [transition_tween] Frame 10
this.performTask();
Symbol 436 MovieClip [vertical_platform] Frame 1
#initclip 127
Object.registerClass("vertical_platform", com.nitrome.miraclegrow.VerticalPlatform);
#endinitclip
Symbol 440 MovieClip [view_high_scores_button] Frame 1
#initclip 128
Object.registerClass("view_high_scores_button", com.nitrome.miraclegrow.ViewHighScoresButton);
#endinitclip
stop();
Symbol 440 MovieClip [view_high_scores_button] Frame 10
stop();
Symbol 449 MovieClip Frame 17
stop();
Symbol 450 MovieClip [watering_can] Frame 1
#initclip 129
Object.registerClass("watering_can", com.nitrome.miraclegrow.WateringCan);
#endinitclip
stop();
Symbol 450 MovieClip [watering_can] Frame 10
stop();
Symbol 450 MovieClip [watering_can] Frame 20
stop();
Symbol 456 MovieClip Frame 1
stop();
Symbol 456 MovieClip Frame 10
stop();
Symbol 458 MovieClip [watering_can_display] Frame 1
#initclip 130
Object.registerClass("watering_can_display", com.nitrome.miraclegrow.WateringCanDisplay);
#endinitclip
Symbol 469 MovieClip Frame 15
_parent.beginRolling();
Symbol 483 MovieClip Frame 7
_root.splat_sfx.gotoAndPlay(2);
Symbol 483 MovieClip Frame 13
stop();
Symbol 484 MovieClip [watermelon] Frame 1
#initclip 131
Object.registerClass("watermelon", com.nitrome.miraclegrow.Watermelon);
#endinitclip
stop();
Symbol 484 MovieClip [watermelon] Frame 2
stop();
Symbol 484 MovieClip [watermelon] Frame 11
stop();
Symbol 484 MovieClip [watermelon] Frame 20
stop();
Symbol 484 MovieClip [watermelon] Frame 30
stop();
Symbol 501 MovieClip [woodlouse] Frame 1
#initclip 132
Object.registerClass("woodlouse", com.nitrome.miraclegrow.Woodlouse);
#endinitclip
stop();
Symbol 501 MovieClip [woodlouse] Frame 9
stop();
Symbol 501 MovieClip [woodlouse] Frame 17
stop();
Symbol 501 MovieClip [woodlouse] Frame 25
stop();
Symbol 504 MovieClip [horizontal_platform_thicker] Frame 1
#initclip 133
Object.registerClass("horizontal_platform_thicker", com.nitrome.miraclegrow.StoppingHorizontalPlatform);
#endinitclip
Symbol 505 MovieClip [vertical_platform_thicker] Frame 1
#initclip 134
Object.registerClass("vertical_platform_thicker", com.nitrome.miraclegrow.StoppingVerticalPlatform);
#endinitclip
Symbol 509 MovieClip [level_name_panel] Frame 1
#initclip 135
Object.registerClass("level_name_panel", com.nitrome.miraclegrow.LevelNamePanel);
#endinitclip
Symbol 514 MovieClip [play_level_button] Frame 1
#initclip 136
Object.registerClass("play_level_button", com.nitrome.miraclegrow.PlayLevelButton);
#endinitclip
stop();
Symbol 514 MovieClip [play_level_button] Frame 10
stop();
Symbol 516 MovieClip Frame 1
stop();
Symbol 518 MovieClip Frame 1
stop();
Symbol 538 MovieClip Frame 73
_root.bite_sfx.gotoAndPlay(2);
Symbol 538 MovieClip Frame 89
_root.collect_sfx.gotoAndPlay(2);
Symbol 538 MovieClip Frame 137
_root.gotoAndPlay("premenu");
Symbol 540 MovieClip Frame 1
stop();
Symbol 542 MovieClip Frame 1
stop();
Symbol 544 MovieClip Frame 1
stop();
Symbol 546 MovieClip Frame 1
stop();
Symbol 548 MovieClip Frame 1
stop();
Symbol 550 MovieClip [music_controller] Frame 1
#initclip 138
Object.registerClass("music_controller", com.nitrome.game.MusicController);
#endinitclip
Symbol 554 Button
on (release) {
getURL ("http://www.miniclip.com", "_blank");
}
Symbol 560 MovieClip Frame 4
_parent.gotoAndStop("static");
Symbol 578 MovieClip Frame 22
var rnd = (random(100) + 1);
if (rnd > 80) {
gotoAndPlay ("blink");
} else {
gotoAndPlay ("open");
}
Symbol 587 MovieClip Frame 10
stop();
Symbol 588 MovieClip Frame 1
stop();
Symbol 588 MovieClip Frame 7
stop();
Symbol 588 MovieClip Frame 14
stop();
Symbol 631 MovieClip Frame 16
gotoAndPlay ("walk_left");
Symbol 631 MovieClip Frame 32
gotoAndPlay ("walk_right");
Symbol 837 MovieClip Frame 1
this._visible = false;
Symbol 855 Button
on (release) {
gameURL = ("http://www.miniclip.com/" + gamename) + ".htm";
getURL (gameURL, "_blank");
}
Symbol 857 MovieClip Frame 1
System.security.allowDomain("www.miniclip.com");
Instance of Symbol 837 MovieClip "mcHighscores" in Symbol 857 MovieClip Frame 1
onClipEvent (load) {
_visible = false;
}
Symbol 857 MovieClip Frame 2
if ((((_url.indexOf("miniclip.com") == -1) && (_url.indexOf("miniclip.net") == -1)) && (_url.indexOf("miniclip.co.uk") == -1)) && (_url.indexOf("miniclips.com"))) {
gotoAndStop(_currentframe + 1);
} else {
var noCache = (getTimer() + random(100000));
mcTarget.loadMovie("http://www.miniclip.com/swfcontent/highscore.swf?noCache=" + noCache);
stop();
}
Symbol 857 MovieClip Frame 3
stop();
Symbol 861 MovieClip Frame 32
stop();
Symbol 868 MovieClip Frame 1
stop();
Symbol 868 MovieClip Frame 7
stop();
Symbol 868 MovieClip Frame 14
stop();
Symbol 939 MovieClip Frame 14
gotoAndPlay ("flashing");
Symbol 939 MovieClip Frame 27
stop();
Symbol 1173 MovieClip Frame 1
stop();
Symbol 1173 MovieClip Frame 2
stop();
Symbol 1173 MovieClip Frame 3
stop();
Symbol 1173 MovieClip Frame 4
stop();
Symbol 1173 MovieClip Frame 5
stop();
Symbol 1173 MovieClip Frame 6
stop();
Symbol 1173 MovieClip Frame 7
stop();
Symbol 1173 MovieClip Frame 8
stop();
Symbol 1173 MovieClip Frame 9
stop();
Symbol 1173 MovieClip Frame 10
stop();
Symbol 1173 MovieClip Frame 11
stop();
Symbol 1173 MovieClip Frame 12
stop();
Symbol 1173 MovieClip Frame 13
stop();
Symbol 1173 MovieClip Frame 14
stop();
Symbol 1173 MovieClip Frame 15
stop();
Symbol 1173 MovieClip Frame 16
stop();