Frame 1
_quality = "high";
var preProgress = 20;
Frame 2
var loaded = Math.floor((getBytesLoaded() / getBytesTotal()) * 10);
if (preProgress > 0) {
preProgress--;
} else {
progress.gotoAndStop(2 + loaded);
}
Frame 3
if (loaded < 10) {
gotoAndPlay (2);
}
Frame 4
stopAllSounds();
Frame 5
stop();
Frame 7
_quality = "medium";
var selfDestruct = false;
stopAllSounds();
Instance of Symbol 129 MovieClip in Frame 7
onClipEvent (load) {
if (_name != "gemma") {
this.duplicateMovieClip("gemma", 7000);
_visible = false;
} else {
var dX = 0;
var dY = 0;
var power = 0;
var broomSpeed = 0;
var broomX = 0;
var broomY = 0;
var x1 = new Array(42, 42, 42, 420, 420, 420);
var x2 = new Array(349, 349, 349, 727, 727, 727);
var y1 = new Array(61, 133, 205, 61, 133, 205);
var y2 = new Array(117, 189, 261, 117, 189, 261);
var oldS;
}
stop();
}
onClipEvent (enterFrame) {
if (_name != "gemma") {
return(undefined);
}
if (_parent.selfDestruct) {
this.removeMovieClip();
}
broomSpeed = 0;
if (Key.isDown(32)) {
if (power < 10) {
power = power + 2;
}
} else if (power > 0) {
broomX = _x + (8 * Math.sin((_rotation / 2) / Math.PI));
broomY = _y - (8 * Math.cos((_rotation / 2) / Math.PI));
broomSpeed = power;
power = 0;
if (broomSpeed < 8) {
_parent.soundSwish1.gotoAndPlay(2);
} else {
_parent.soundSwish2.gotoAndPlay(2);
}
var i = 0;
while (i < 32) {
var k = eval ("_parent.kid" + i);
if (k._currentframe == 4) {
if (((k._y > broomY) && ((k._y - broomY) < 70)) && (Math.abs(k._x - broomX) < 18)) {
_parent.soundOw.gotoAndPlay(2);
}
}
i++;
}
}
if (Key.isDown(38)) {
dY = dY - 2;
} else if (Key.isDown(40)) {
dY = dY + 2;
} else {
dY = dY * 0.75;
}
if (Key.isDown(37)) {
dX = dX - 2;
} else if (Key.isDown(39)) {
dX = dX + 2;
} else {
dX = dX * 0.75;
}
if (dX < -7) {
dX = -7;
}
if (dX > 7) {
dX = 7;
}
if (dY < -7) {
dY = -7;
}
if (dY > 7) {
dY = 7;
}
if (Math.abs(dX) < 0.2) {
dX = 0;
}
if (Math.abs(dY) < 0.2) {
dY = 0;
}
var oldX = _x;
var oldY = _y;
_x = (_x + dX);
_y = (_y + dY);
if (_x > 745) {
_x = 745;
} else if (_x < 25) {
_x = 25;
}
if (_y > 278) {
_y = 278;
} else if (_y < 42) {
_y = 42;
}
var i = 0;
while (i < x1.length) {
if ((((_x > x1[i]) && (_x < x2[i])) && (_y > y1[i])) && (_y < y2[i])) {
if (!((oldY > y1[i]) && (oldY < y2[i]))) {
if (oldY > ((y1[i] + y2[i]) / 2)) {
_y = y2[i];
} else {
_y = y1[i];
}
dY = 0;
} else if (!((oldX > x1[i]) && (oldX < x2[i]))) {
if (oldX > ((x1[i] + x2[i]) / 2)) {
_x = x2[i];
} else {
_x = x1[i];
}
if ((!Key.isDown(38)) && (!Key.isDown(40))) {
if (_y > ((y1[i] + y2[i]) / 2)) {
dY++;
} else {
dY--;
}
}
dX = 0;
} else {
_x = oldX;
_y = oldY;
dX = dX / 2;
dY = dY / 2;
}
i = x1.length;
}
i++;
}
var i = 0;
while (i < 32) {
var k = eval ("_parent.kid" + i);
if (k._currentframe == 4) {
if (((k._y > _y) && ((k._y - _y) < 70)) && (Math.abs(k._x - _x) < 18)) {
_x = oldX;
dX = 0;
}
}
i++;
}
if ((dX >= 0) && (dY < 0)) {
_rotation = ((90 * Math.abs(dX)) / (Math.abs(dX) + Math.abs(dY)));
} else if ((dX < 0) && (dY < 0)) {
_rotation = (360 - ((90 * Math.abs(dX)) / (Math.abs(dX) + Math.abs(dY))));
} else if ((dX < 0) && (dY >= 0)) {
_rotation = (180 + ((90 * Math.abs(dX)) / (Math.abs(dX) + Math.abs(dY))));
} else if ((dX >= 0) && (dY >= 0)) {
_rotation = (180 - ((90 * Math.abs(dX)) / (Math.abs(dX) + Math.abs(dY))));
}
var d = Math.abs(dX);
if (Math.abs(dY) > d) {
d = Math.abs(dY);
}
var s = (1 + (Math.floor((_x + _y) / 10) % 4));
if (s != oldS) {
if (s == 2) {
_parent.soundFootstep1.gotoAndPlay(2);
} else if (s == 4) {
_parent.soundFootstep2.gotoAndPlay(2);
}
}
oldS = s;
if (power > 0) {
this.gotoAndStop(5 + Math.floor(power / 2));
} else if (broomSpeed > 0) {
this.gotoAndStop(11);
} else {
this.gotoAndStop(s);
}
_rotation = (_rotation + ((d / 2) * Math.sin((_x + _y) / 10)));
}
Instance of Symbol 135 MovieClip "rubbish" in Frame 7
onClipEvent (load) {
if (_name == "rubbish") {
return(undefined);
}
var x1 = new Array(42, 42, 42, 420, 420, 420);
var x2 = new Array(349, 349, 349, 727, 727, 727);
var y1 = new Array(61, 133, 205, 61, 133, 205);
var y2 = new Array(117, 189, 261, 117, 189, 261);
var sweepX;
var sweepY;
}
onClipEvent (enterFrame) {
function soundFX() {
var _local1 = _parent;
if (((Math.abs(dX) + Math.abs(dY)) + Math.abs(dZ)) > 5) {
if (_currentframe == 3) {
_local1.soundCan.gotoAndPlay(2);
}
if ((_currentframe == 1) || (_currentframe == 5)) {
_local1.soundBag1.gotoAndPlay(2);
} else {
_local1.soundBag2.gotoAndPlay(2);
}
}
}
if (_name == "rubbish") {
return(undefined);
}
if (_parent.selfDestruct) {
this.removeMovieClip();
}
var oldX = _x;
var oldY = _y;
var distSq = (((_x - _parent.gemma._x) * (_x - _parent.gemma._x)) + ((_y - _parent.gemma._y) * (_y - _parent.gemma._y)));
if (distSq < 144) {
if (_x < _parent.gemma._x) {
dX--;
} else {
dX++;
}
if (_y < _parent.gemma._y) {
dY--;
} else {
dY++;
}
sweepX = _x;
sweepY = _y;
}
dZ = dZ - 2;
var oldDX = dX;
var oldDY = dY;
_x = (_x + dX);
_y = (_y + dY);
z = z + dZ;
if (z < 0) {
soundFX();
z = 0;
dZ = (-dZ) / 2;
dX = dX * 0.6;
if (Math.abs(dX) < 0.2) {
dX = 0;
}
dY = dY * 0.6;
if (Math.abs(dY) < 0.2) {
dY = 0;
}
dR = dR * (-1 + (2 * Math.random()));
}
if ((_parent.gemma.broomSpeed != 0) && (z < 3)) {
var distSq = (((_x - _parent.gemma.broomX) * (_x - _parent.gemma.broomX)) + ((_y - _parent.gemma.broomY) * (_y - _parent.gemma.broomY)));
if (distSq < 440) {
var r = (((_parent.gemma._rotation + ((2 * _parent.gemma.broomSpeed) * (-1 + (2 * Math.random())))) + 360) % 360);
r = ((r / 360) * 2) * Math.PI;
dX = dX + (_parent.gemma.broomSpeed * Math.sin(r));
dY = dY - (_parent.gemma.broomSpeed * Math.cos(r));
dZ = 1.5 * _parent.gemma.broomSpeed;
dR = (3 * _parent.gemma.broomSpeed) * (-1 + (2 * Math.random()));
sweepX = _x;
sweepY = _y;
soundFX();
}
}
var i = 0;
while (i < x1.length) {
if ((((_x > x1[i]) && (_x < x2[i])) && (_y > y1[i])) && (_y < y2[i])) {
if (_y > ((y1[i] + (2 * y2[i])) / 3)) {
if (z < 20) {
if ((((oldX > x1[i]) && (oldX < x2[i])) && (oldY > y1[i])) && (oldY < y2[i])) {
z = 20;
dZ = (-dZ) / 2;
dX = dX / 2;
dY = (dY / 2) + 1;
dR = ((dR / 2) - 1) + (2 * Math.random());
} else {
_x = oldX;
_y = oldY;
if ((oldX >= x2[i]) || (oldX <= x1[i])) {
dX = (-dX) / 2;
dY = dY * 0.8;
if (Math.abs(dX) < 1) {
if (dX < 0) {
dX--;
} else {
dX++;
}
}
} else {
dX = dX * 0.8;
dY = (-dY) / 2;
if (Math.abs(dY) < 1) {
if (dY < 0) {
dY--;
} else {
dY++;
}
}
}
dZ = dZ / 2;
dR = (2 * (Math.abs(dX) + Math.abs(dY))) * (-1 + (2 * Math.random()));
}
}
} else if (z < 10) {
if ((((oldX > x1[i]) && (oldX < x2[i])) && (oldY > y1[i])) && (oldY < y2[i])) {
z = 10;
dZ = (-dZ) / 2;
dX = dX / 2;
dY = (dY / 2) - 1;
dR = ((dR / 2) - 1) + (2 * Math.random());
} else {
_x = oldX;
_y = oldY;
if ((oldX >= x2[i]) || (oldX <= x1[i])) {
dX = (-dX) / 2;
dY = dY * 0.8;
if (Math.abs(dX) < 1) {
if (dX < 0) {
dX--;
} else {
dX++;
}
}
} else {
dX = dX * 0.8;
dY = (-dY) / 2;
if (Math.abs(dY) < 1) {
if (dY < 0) {
dY--;
} else {
dY++;
}
}
}
dZ = dZ / 2;
dR = (2 * (Math.abs(dX) + Math.abs(dY))) * (-1 + (2 * Math.random()));
}
}
i = x1.length;
}
i++;
}
if (_x < 17) {
_x = 17;
dX = (-dX) / 2;
} else if (_x > 753) {
_x = 753;
dX = (-dX) / 2;
}
if (_y < 37) {
_y = 37;
dY = (-dY) / 2;
} else if (_y > 288) {
_y = 288;
dY = (-dY) / 2;
}
_xscale = (95 + (z / 2));
_yscale = (95 + (z / 2));
_rotation = (_rotation + dR);
var hitBin = false;
if ((_x > 747) && (_y < 67)) {
hitBin = _parent.bin1;
} else if ((_x < 23) && (_y < 67)) {
hitBin = _parent.bin4;
} else if ((_x > 720) && (_y > 281)) {
hitBin = _parent.bin2;
} else if ((_x < 50) && (_y > 281)) {
hitBin = _parent.bin3;
}
if (hitBin != false) {
soundFX();
var points = (1 + Math.floor(0.5 * Math.sqrt(((hitBin._x - sweepX) * (hitBin._x - sweepX)) + ((hitBin._y - sweepY) * (hitBin._y - sweepY)))));
if (points > 75) {
_parent.soundHey.gotoAndPlay(2);
}
_parent.indicators.score = _parent.indicators.score + points;
_parent.environment.rubbishPresent--;
hitBin.gotoAndPlay(2);
_parent.environment.pointsNumber++;
_parent.points.duplicateMovieClip("points" + _parent.environment.pointsNumber, 7000 + _parent.environment.pointsNumber);
var p = eval ("_parent.points" + _parent.environment.pointsNumber);
p._x = hitBin._x;
p._y = hitBin._y;
p.dX = (-oldDX) / 2;
p.dY = (-oldDY) / 2;
p.points = points;
this.removeMovieClip();
}
}
Instance of Symbol 139 MovieClip "points" in Frame 7
onClipEvent (enterFrame) {
if (_name == "points") {
return(undefined);
}
if (_parent.selfDestruct) {
this.removeMovieClip();
}
if (_alpha > 0) {
_alpha = (_alpha - 4);
} else {
this.removeMovieClip();
}
_x = (_x + dX);
_y = (_y + dY);
}
Instance of Symbol 141 MovieClip "environment" in Frame 7
onClipEvent (load) {
var rubbishNumber = 0;
var rubbishEase = 205;
var rubbishTimer = 20;
var rubbishPresent = 0;
var pointsNumber = 0;
}
onClipEvent (enterFrame) {
if (Math.random() < 0.4) {
var kid = eval ("_parent.kid" + Math.floor(Math.random() * 31.99));
kid.gotoAndStop(1 + Math.floor(3.15 * Math.random()));
if (kid._currentframe == 4) {
if (((Math.abs(kid._x - _parent.gemma._x) < 50) && ((kid._y - _parent.gemma._y) < 70)) && (kid._y > _parent.gemma._y)) {
kid.gotoAndStop(3);
}
}
}
rubbishTimer--;
if (rubbishTimer <= 0) {
if (rubbishEase > 50) {
rubbishEase = rubbishEase - 2;
}
rubbishTimer = rubbishEase;
rubbishNumber++;
rubbishPresent++;
var kid = eval ("_parent.kid" + Math.floor(Math.random() * 31.99));
_parent.rubbish.duplicateMovieClip("rubbish" + rubbishNumber, 1000 + rubbishNumber);
var r = eval ("_parent.rubbish" + rubbishNumber);
r._x = (kid._x - 2) + (4 * Math.random());
r._y = (kid._y - 16) + (4 * Math.random());
r.gotoAndStop(1 + Math.floor(4.99 * Math.random()));
r.dX = -2 + (4 * Math.random());
r.dY = Math.random();
r.dZ = 0;
r.z = 10;
r.dR = -10 + (20 * Math.random());
r._rotation = 360 * Math.random();
}
}
Instance of Symbol 143 MovieClip "masterProjection" in Frame 7
onClipEvent (load) {
if (this._name != "projection") {
this.duplicateMovieClip("projection", 9000);
this.stop();
this._visible = false;
}
}
onClipEvent (enterFrame) {
if (_parent.selfDestruct) {
this.removeMovieClip();
}
}
Instance of Symbol 151 MovieClip in Frame 7
onClipEvent (load) {
if (_name != "indicators") {
this.duplicateMovieClip("indicators", 8000);
this._visible = false;
} else {
var score = 0;
var dirtLevel = 0;
}
}
onClipEvent (enterFrame) {
dirtLevel = ((49 * dirtLevel) + _parent.environment.rubbishPresent) / 50;
dirtometer.gotoAndStop(1 + Math.floor(12 * dirtLevel));
if (dirtometer._currentframe > 201) {
_parent.score = score;
_parent.gotoAndPlay(_parent._currentframe + 1);
_parent.selfDestruct = true;
this.removeMovieClip();
}
}
Frame 8
stop();
Frame 9
_quality = "high";
stopAllSounds();
Frame 23
stop();
Symbol 12 MovieClip Frame 1
stop();
Symbol 36 Button
on (release) {
gotoAndPlay (7);
}
Symbol 41 Button
on (release) {
gotoAndStop (6);
}
Symbol 61 MovieClip Frame 1
stop();
Symbol 85 MovieClip Frame 1
stop();
Symbol 93 MovieClip Frame 1
stop();
Symbol 101 MovieClip Frame 1
stop();
Symbol 109 MovieClip Frame 1
stop();
Symbol 117 MovieClip Frame 1
stop();
Symbol 135 MovieClip Frame 1
stop();
Symbol 149 MovieClip Frame 1
stop();
Symbol 154 MovieClip Frame 1
stop();
Symbol 156 MovieClip Frame 1
stop();
Symbol 158 MovieClip Frame 1
stop();
Symbol 160 MovieClip Frame 1
stop();
Symbol 163 MovieClip Frame 1
stop();
Symbol 165 MovieClip Frame 1
stop();
Symbol 167 MovieClip Frame 1
stop();
Symbol 169 MovieClip Frame 1
stop();
Symbol 171 MovieClip Frame 1
stop();
Symbol 181 Button
on (release) {
gotoAndPlay (4);
}