Frame 1
stop();
if (_root.rooty() == 23) {
_root.back = function () {
_level0.gotoAndStop(4);
};
} else {
_root.back = function () {
getURL ("http://www.komix-games.com");
};
}
Instance of Symbol 42 MovieClip "b" in Frame 1
onClipEvent (enterFrame) {
e = 0;
while (e < 5) {
_root.b["c" + e].gotoAndStop(_root.growp[e] + 1);
e++;
}
}
Frame 2
stop();
levn = 1;
maxl = 3;
so = SharedObject.getLocal("so");
if (so.data.l == undefined) {
maxl = 3;
} else {
maxl = so.data.l;
}
so.flush();
Frame 3
_root.work = 0;
Instance of Symbol 92 MovieClip "a" in Frame 3
onClipEvent (load) {
if (_root.lev == 1) {
_root.growp = [12, 0, 0, 0, 0];
xp = [0, 0, 0];
yp = [100, 200, 300];
sorter = [0, 0, 0];
} else if (_root.lev == 2) {
_root.growp = [14, 1, 0, 0, 0];
xp = [-70, -30, 30, 70];
yp = [200, 100, 100, 200];
sorter = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
} else if (_root.lev == 3) {
_root.growp = [12, 0, 2, 0, 0, 0];
xp = [180, 90, -90, -180];
yp = [120, 210, 210, 120];
sorter = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
} else if (_root.lev == 4) {
_root.growp = [4, 0, 2, 4, 2];
xp = [-200, 150];
yp = [100, 100];
sorter = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
} else if (_root.lev == 5) {
_root.growp = [14, 0, 4, 0, 0];
xp = [-200, -120, -40, 40, 120, 200, -200, -120, -40, 40, 120, 200];
yp = [290, 290, 290, 290, 290, 290, 100, 100, 100, 100, 100, 100];
sorter = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
} else if (_root.lev == 6) {
_root.growp = [14, 1, 2, 0, 0];
xp = [0, 0, 0, 0];
yp = [80, 160, 240, 320];
sorter = [1, 0, 1, 0];
} else if (_root.lev == 7) {
_root.growp = [14, 0, 4, 0, 0];
xp = [-40, 40, -110, 110];
yp = [200, 200, 250, 250];
sorter = [0, 0, 0, 0];
} else if (_root.lev == 8) {
_root.growp = [14, 0, 10, 3, 3];
xp = [75, 40];
yp = [120, 190];
sorter = [1, 0];
} else if (_root.lev == 9) {
_root.growp = [14, 0, 1, 0, 0];
xp = [-200, -200];
yp = [220, 100];
sorter = [2, 0];
} else if (_root.lev == 10) {
_root.growp = [14, 0, 4, 0, 0];
xp = [-100, -170];
yp = [285, 100];
sorter = [2, 0];
} else if (_root.lev == 11) {
_root.growp = [20, 0, 10, 0, 0];
xp = [139];
yp = [320];
sorter = [0, 0];
} else if (_root.lev == 12) {
_root.growp = [20, 0, 10, 3, 3];
xp = [53.5, -53.5, -149, 199];
yp = [240, 195, 240, 235];
sorter = [0, 0, 0, 0];
} else if (_root.lev == 14) {
_root.growp = [8, 0, 3, 3, 3];
xp = [-57, -175, -136, -53, -33, 57, 243];
yp = [73, 113, 235, 235, 263, 263, 163];
sorter = [0, 0, 0, 1, 0, 1, 0];
} else if (_root.lev == 15) {
_root.growp = [20, 0, 4, 3, 3];
xp = [-149, -220, -220, -220, -206, -144, 144, -76, 0, 171, 13, 106, 220];
yp = [240, 318, 228, 166, 78, 78, 228, 166, 78, 78, 197, 280, 166];
sorter = [2, 0, 1, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0];
} else if (_root.lev == 13) {
_root.growp = [20, 5, 10, 3, 3];
xp = [216, -216, 115, -115, 82, -82, 110, -110, 0];
yp = [269, 269, 307, 307, 228, 228, 145, 145, 189];
sorter = [0, 0, 0, 0];
} else if (_root.lev == 16) {
_root.growp = [10, 1, 4, 3, 2];
xp = [24, -24, 65, -12, 30, -51, -90, -181, -138, 0, 131, 164, 248, 91, 30, 0, -51, -105, -181, 154, -12, -153];
yp = [43, 43, 108, 112, 150, 137, 131, 166, 178, 192, 152, 207, 292, 223, 247, 250, 241, 259, 285, 278, 310, 307];
sorter = [1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1];
}
for (e in xp) {
namer = "s" + e;
if (e != 0) {
duplicateMovieClip ("_root.s.s0", namer, e);
}
_root.s[namer]._x = xp[e];
_root.s[namer]._y = -yp[e];
_root.s[namer].d.gotoAndPlay(Math.round((39 / xp.length) * e) + 1);
_root.s[namer].gotoAndPlay((sorter[e] * 2) + 1);
}
power = function (v1) {
if (_root.growp[v1] > 0) {
it = v1;
return(true);
}
};
_root.but = -1;
co = (p = (comp = 0));
arr = new Array();
newp = function (v1, v2, v3) {
if (split > 0) {
newp2(v1, v2, v3 + split);
newp2(v1, v2, v3 - split);
}
if (_root.ok == 0) {
if (((split >= 0) or ((split == -1) && (v1 < -1))) or ((split == -2) && (v1 > 1))) {
newp2(v1, v2, v3);
}
}
};
newp2 = function (v4, v5, v6) {
plant = true;
z = 0;
while (z < 10) {
v7 = (v4 + ((Math.sin(v6) * z) * 2.5)) + _x;
v8 = (v5 - ((Math.cos(v6) * z) * 2.5)) + _y;
if (_root.w.hitTest(v7, v8, true) or _root.f.hitTest(v7, v8, true)) {
plant = false;
}
z++;
}
if (plant) {
if (((Math.abs(v6) <= 90) && (Math.abs(v4) < 300)) && (Math.abs(v5) < 400)) {
_root.ok++;
co++;
namer = "" + co;
duplicateMovieClip (0, namer, co);
_root.a[namer]._x = v4;
_root.a[namer]._y = v5;
_root.a[namer]._rotation = _root.a[namer]._rotation + v6;
g = true;
v6 = v6 * (Math.PI/180);
gx[co] = v4 + (Math.sin(v6) * 12.5);
gy[co] = (-v5) + (Math.cos(v6) * 12.5);
}
}
};
_root.gen = 0;
_root.grow = -1;
gx = new Array();
gy = new Array();
}
onClipEvent (enterFrame) {
if (_root.work == 0) {
if (p) {
if ((Key.isDown(49) or Key.isDown(97)) or (_root.but == 0)) {
if (power(0)) {
_root.grow = _root.gen;
split = 0;
_root.but = -1;
p = false;
}
} else if ((Key.isDown(50) or Key.isDown(98)) or (_root.but == 1)) {
if (power(1)) {
split = 22.5;
_root.grow = _root.gen;
_root.but = -1;
p = false;
}
} else if ((Key.isDown(51) or Key.isDown(99)) or (_root.but == 2)) {
if (power(2)) {
split = 45;
_root.grow = _root.gen;
_root.but = -1;
p = false;
}
} else if ((Key.isDown(52) or Key.isDown(100)) or (_root.but == 3)) {
if (power(3)) {
split = -1;
_root.grow = _root.gen;
_root.but = -1;
p = false;
}
} else if ((Key.isDown(53) or Key.isDown(101)) or (_root.but == 4)) {
if (power(4)) {
split = -2;
_root.grow = _root.gen;
_root.but = -1;
p = false;
}
}
} else {
p = true;
if ((Key.isDown(49) or Key.isDown(97)) or (_root.but == 0)) {
p = false;
} else if ((Key.isDown(50) or Key.isDown(98)) or (_root.but == 1)) {
p = false;
} else if ((Key.isDown(51) or Key.isDown(99)) or (_root.but == 2)) {
p = false;
} else if ((Key.isDown(52) or Key.isDown(100)) or (_root.but == 3)) {
p = false;
} else if ((Key.isDown(53) or Key.isDown(101)) or (_root.but == 4)) {
p = false;
}
}
if (_root.grow >= _root.gen) {
_root.growp[it]--;
_root.gen++;
if (sound1.duration == sound1.position) {
sound1 = new Sound(this);
sound1.attachSound(("Grow-Tree" + (1 + random(3))) + ".mp3");
sound1.start(0, 0);
}
for (e in arr) {
tellTarget (_root.a["" + arr[e]]) {
if (g.c) {
_root.ok = 0;
_root.a.newp(_x + (Math.sin((_rotation / 180) * Math.PI) * 25.5), _y - (Math.cos((_rotation / 180) * Math.PI) * 25.5), _rotation);
if (_root.ok > 0) {
g.c = false;
this.cacheAsBitmap = true;
}
}
};
}
}
comp = comp + 0.5;
comp = Math.max(0, comp);
for (e in xp) {
namer = "s" + e;
v1 = _root.s[namer]._currentframe;
if (v1 == 1) {
comp--;
}
if ((v1 / 2) != Math.round(v1 / 2)) {
v1 = (v1 / 2) - 0.5;
if (_root.a.hitTest(_x + xp[e], _y - yp[e], true)) {
_root.s[namer].play();
if (v1 == 0) {
enfi = 100;
for (a in gx) {
xenf = gx[a] - xp[e];
yenf = gy[a] - yp[e];
enf = Math.sqrt((xenf * xenf) + (yenf * yenf));
if (enf < enfi) {
enfi = enf;
nam = "" + a;
_root.s[namer]._rotation = _root.a[nam]._rotation;
_root.s[namer]._x = gx[a];
_root.s[namer]._y = -gy[a];
}
}
} else if (v1 == 1) {
_root.f.newp(xp[e], -yp[e]);
} else if (v1 == 2) {
_root.work--;
}
}
}
}
if (comp > 5) {
if (_root.lev == 16) {
_root.gotoAndStop("comp2");
} else {
_root.gotoAndStop("comp");
}
}
if (_root.f.hitTest(_x, _y, true)) {
for (e in xp) {
namer = "s" + e;
v1 = _root.s[namer]._currentframe;
if ((v1 / 2) == Math.round(v1 / 2)) {
_root.s[namer].prevFrame();
_root.s[namer]._rotation = 0;
}
}
_root.gotoAndStop("over");
}
}
}
Instance of Symbol 164 MovieClip "f" in Frame 3
onClipEvent (enterFrame) {
newp = function (v1, v2) {
e++;
namer = "g" + e;
duplicateMovieClip ("g0", namer, e + 100000);
_root.f[namer]._x = v1;
_root.f[namer]._y = v2;
};
newp2 = function (v1, v2) {
a++;
namer = "w" + a;
duplicateMovieClip ("w0", namer, a);
_root.f[namer]._x = v1;
_root.f[namer]._y = v2;
};
}
onClipEvent (load) {
a = 0;
e = 0;
}
Frame 5
gotoAndStop ("game");
Frame 6
so = SharedObject.getLocal("so");
if ((so.data.l < (_root.lev + 3)) or (so.data.l == undefined)) {
so.data.l = _root.lev + 3;
}
so.flush();
theScore = _root.lev;
if (theScore > theBestLocalScore) {
theBestLocalScore = theScore;
record = new LoadVars();
record.params = "23908_1148950793";
record.score = theScore;
record.sendAndLoad("record.php", record, "POST");
record.onLoad = function () {
if (((this.recordid + "") == "undefined") || (this.recordid < 0)) {
trace("Score not recorded, " + this.error);
}
if (((this.result + "") != "undefined") || (this.result > 0)) {
trace((("Your rank : " + this.result) + " / ") + this.total);
}
};
}
Symbol 8 MovieClip Frame 1
gotoAndStop(random(3) + 1);
Symbol 33 MovieClip Frame 1
stop();
Symbol 33 MovieClip Frame 2
stop();
Symbol 37 Button
on (release) {
_root.but = 1;
}
Symbol 38 Button
on (release) {
_root.but = 0;
}
Symbol 39 Button
on (release) {
_root.but = 2;
}
Symbol 40 Button
on (release) {
_root.but = 3;
}
Symbol 41 Button
on (release) {
_root.but = 4;
}
Symbol 46 Button
on (release) {
_root.back();
}
Symbol 51 Button
on (release) {
getURL ("http://www.newgrounds.com");
}
Symbol 57 Button
on (release) {
_root.nextFrame();
}
Symbol 63 Button
on (release) {
getURL ("http://www.newgrounds.com", "_blank");
}
Symbol 67 Button
on (release) {
_root.back();
}
Symbol 70 Button
on (release) {
_root.lev = _currentframe - 1;
_root.gotoAndStop("game");
}
Symbol 81 MovieClip Frame 1
_root.levn++;
if (_root.levn < _root.maxl) {
gotoAndStop(_root.levn);
} else {
stop();
}
Symbol 90 MovieClip Frame 5
stop();
c = true;
Symbol 91 MovieClip Frame 1
_root.a.arr.push(_name * 1);
Symbol 141 MovieClip Frame 1
gotoAndPlay(random(25) + 1);
Symbol 141 MovieClip Frame 21
gotoAndPlay(2 + random(5));
Symbol 143 MovieClip Frame 11
stop();
Symbol 146 MovieClip Frame 1
onEnterFrame = function () {
_rotation = (_rotation + 3);
};
Symbol 147 MovieClip Frame 1
stop();
Symbol 147 MovieClip Frame 2
stop();
Symbol 147 MovieClip Frame 3
stop();
Symbol 147 MovieClip Frame 4
stop();
Symbol 147 MovieClip Frame 5
stop();
Symbol 147 MovieClip Frame 6
ybew = -3;
Symbol 147 MovieClip Frame 8
ybew = ybew + 0.3;
_y = (_y + ybew);
if (_y > 0) {
_y = 0;
gotoAndStop (9);
_root.work++;
}
gotoAndPlay (7);
Symbol 147 MovieClip Frame 9
_root.a.newp2(_x, 0);
this.unloadMovie();
Symbol 156 MovieClip Frame 1
gotoAndStop(_root.lev);
Symbol 161 MovieClip Frame 1
if (_name != "g0") {
_root.work--;
_rotation = (random(20) - 10);
}
Symbol 161 MovieClip Frame 5
if (_name != "g0") {
e = 0.1;
while (e < 6.28) {
v1 = _x - (Math.sin(e) * 35);
v2 = _y - (Math.cos(e) * 35);
if (_root.a.hitTest(v1 + _root.a._x, v2 + _root.a._y, true) && (!_root.f.hitTest(v1 + _root.a._x, v2 + _root.a._y, true))) {
_root.f.newp(v1, v2);
e = e + 0.628;
}
e = e + 0.314;
}
_root.f.newp2(_x, _y);
}
Symbol 161 MovieClip Frame 30
if (_name != "g0") {
stop();
_root.work++;
this.unload();
}
Symbol 163 MovieClip Frame 1
this.cacheAsBitmap = true;
Instance of Symbol 161 MovieClip "g0" in Symbol 164 MovieClip Frame 1
onClipEvent (load) {
gotoAndPlay (1);
this.cacheAsBitmap = false;
}
Symbol 166 Button
on (release) {
_root.gotoAndStop("start");
}
Symbol 168 Button
on (release) {
_root.gotoAndStop("restartgame");
}
Symbol 174 Button
on (release) {
_parent.gotoAndStop("restartgame");
}
Symbol 180 Button
on (release) {
_root.gotoAndStop("game");
_root.lev++;
}
Symbol 182 Button
on (release) {
_root.gotoAndStop(1);
}