Frame 1
stop();
bestands_grote = getBytesTotal();
onEnterFrame = function () {
al_geladen = getBytesLoaded();
procent = Math.round((al_geladen / bestands_grote) * 100);
hoeveel_procent.text = procent + "%";
laadbalk._xscale = procent;
if (bestands_grote == al_geladen) {
delete onEnterFrame;
gotoAndPlay (9);
}
};
Frame 9
stop();
Frame 10
function reset() {
bgsound.stop();
restore();
}
function quit() {
GameManager.getInstance().gameDone();
}
function shooter() {
onMouseDown = function () {
shootnow();
};
if ((l.deg == 360) || (l.deg == 180)) {
l.mov = l.mov * -1;
}
l.deg = l.deg + l.mov;
var rad = (l.deg * (Math.PI/180));
b.lx = (Math.cos(rad) * 60) + 320;
b.ly = (Math.sin(rad) * 60) + 450;
with (l) {
clear();
lineStyle(0, 16777215, 0);
moveTo(320, 450);
lineTo(b.lx, b.ly);
}
arro._x = b.lx;
arro._y = b.ly;
var dx = (b._x - b.lx);
var dy = (b._y - b.ly);
var rad = Math.atan2(dy, dx);
var deg = (rad * 57.2957795130823);
arro._rotation = deg - 90;
}
function newball() {
i++;
b = cont.attachMovie("ball", "ball" + i, i);
b._x = 320;
b._y = 450;
b.r = 10;
b.vx = 0;
b.vy = 0;
b.m = 1;
b.f = 1;
b.gotoAndStop(b.f);
b._rotation = random(30) - 15;
barray.push(b);
}
function shootnow() {
if (firstshot == false) {
firstshot = true;
tscreen.onEnterFrame = function () {
this._alpha = this._alpha - 1;
if (this._alpha < 10) {
delete this.onEnterFrame;
this.removeMovieClip();
}
};
}
if (((fsm == shooter) && (_xmouse < 520)) && (_xmouse > 120)) {
shootsound.start(0.01, 1);
b.vx = (-(b.lx - 320)) / 4;
b.vy = (-(b.ly - 450)) / 4;
fsm = moveball;
onMouseDown = function () {
};
with (l) {
clear();
}
}
}
function nothing() {
}
function moveball() {
findn();
b.vx = b.vx * friction;
b.vy = b.vy * friction;
if (((b._x - b.vx) < 130) || ((b._x - b.vx) > 510)) {
b.vx = b.vx * -1;
wallsound.start(0.01, 1);
}
if ((b._y - b.vy) < 15) {
b.vy = b.vy * -1;
wallsound.start(0.01, 1);
}
b._x = b._x - b.vx;
b._y = b._y - b.vy;
if ((b.vy < 0) && ((b._y + b.r) > 395)) {
bgsound.stop();
createexp(b);
b.removeMovieClip();
goscreen = _root.attachMovie("goscreen", "goscreen", 29000);
goscreen._x = 320;
goscreen._y = -100;
fsm = gomove;
onMouseDown = function () {
restore();
};
}
if ((Math.abs(b.vx) + Math.abs(b.vy)) < 0.2) {
calc();
b.m = 100000 /* 0x0186A0 */;
b.vx = 0;
b.vy = 0;
news = (nd / b.r) * 100;
fsm = grow2;
}
}
function findn() {
p = 0;
while (p < (barray.length - 1)) {
var _local2 = (b._x - b.vx) - barray[p]._x;
var _local1 = (b._y - b.vy) - barray[p]._y;
var _local3 = Math.sqrt((_local2 * _local2) + (_local1 * _local1)) - barray[p].r;
if (_local3 < nd) {
nd = _local3;
n = p;
}
p++;
}
checkColl(b, barray[n]);
n = -1;
nd = 10000;
}
function calc() {
p = 0;
while (p < (barray.length - 1)) {
var _local2 = b._x - barray[p]._x;
var _local1 = b._y - barray[p]._y;
var _local3 = Math.sqrt((_local2 * _local2) + (_local1 * _local1)) - barray[p].r;
if (_local3 < nd) {
n = p;
nd = _local3;
}
p++;
}
if ((b._x - 120) < nd) {
nd = b._x - 120;
wall = true;
}
if ((520 - b._x) < nd) {
nd = 520 - b._x;
wall = true;
}
if ((b._y - 5) < nd) {
nd = b._y - 5;
wall = true;
}
if ((395 - b._y) < nd) {
nd = 395 - b._y;
wall = true;
}
}
function grow2() {
var _local1 = news - b._xscale;
b._xscale = b._xscale + (_local1 / 5);
b._yscale = b._yscale + (_local1 / 5);
if (_local1 < 10) {
b._xscale = (b._yscale = news);
b.cacheAsBitmap = true;
b.r = nd;
newball();
fsm = shooter;
nd = 10000;
n = -1;
wall = false;
}
}
function checkColl(b1, b2) {
var _local7 = b2._x - b1._x;
var _local6 = b2._y - b1._y;
var _local5 = Math.sqrt((_local7 * _local7) + (_local6 * _local6));
if (_local5 < (b1.r + b2.r)) {
var _local8 = _local5 - (b1.r + b2.r);
var _local12 = _local7 / _local5;
var _local11 = _local6 / _local5;
b1._x = b1._x + (_local8 * _local12);
b1._y = b1._y + (_local8 * _local11);
b2.f++;
if (b2.f == 4) {
zero = _root.attachMovie("zero", "zero", _root.getNextHighestDepth());
zero._x = b2._x;
zero._y = b2._y;
zero._xscale = (zero._yscale = b2._xscale);
zero._rotation = b2._rotation;
_local12 = _local7 / _local5;
_local11 = _local6 / _local5;
var _local9 = Math.sqrt((b.vx * b.vx) + (b.vy * b.vy));
zero.vx = _local12 * _local9;
zero.vy = _local11 * _local9;
zero.rot = (Math.random() * 4) - 2;
zero.onEnterFrame = function () {
this.vy = this.vy + 0.2;
this._x = this._x + this.vx;
this._y = this._y + this.vy;
this._rotation = this._rotation + this.rot;
if (this._y > 1000) {
delete this.onEnterFrame;
this.removeMovieClip();
}
};
score++;
sco.text = score;
if (score > hisco.text) {
so.data.hi = score;
so.flush();
hisco.text = score;
}
}
var _local10 = Math.atan2(_local6, _local7);
cosa = Math.cos(_local10);
sina = Math.sin(_local10);
vx1p = (cosa * b1.vx) + (sina * b1.vy);
vy1p = (cosa * b1.vy) - (sina * b1.vx);
vx2p = (cosa * b2.vx) + (sina * b2.vy);
vy2p = (cosa * b2.vy) - (sina * b2.vx);
P = (vx1p * b1.m) + (vx2p * b2.m);
V = vx1p - vx2p;
vx1p = (P - (b2.m * V)) / (b1.m + b2.m);
vx2p = V + vx1p;
b1.vx = (cosa * vx1p) - (sina * vy1p);
b1.vy = (cosa * vy1p) + (sina * vx1p);
diff = ((b1.r + b2.r) - _local5) / 2;
cosd = cosa * diff;
sind = sina * diff;
if (b2.f == 4) {
createexp(b2);
b2.removeMovieClip();
barray.splice(n, 1);
return(undefined);
}
b2.gotoAndStop(b2.f);
createpart(b1, b2);
}
}
function createpart(b1, b2) {
cracksound.start(0.01, 1);
var _local8 = b2._x - b1._x;
var _local7 = b2._y - b1._y;
var _local6 = Math.atan2(_local7, _local8);
var _local4 = (Math.cos(_local6) * b1.r) + b1._x;
var _local3 = (Math.sin(_local6) * b1.r) + b1._y;
pc = 0;
while (pc < 10) {
part = _root.attachMovie("part", "part", _root.getNextHighestDepth());
part._x = _local4;
part._y = _local3;
part.vx = (Math.random() * 10) - 5;
part.vy = (Math.random() * 10) - 5;
part.gotoAndStop(random(2) + 1);
part.onEnterFrame = function () {
this.vy = this.vy + 0.1;
this._x = this._x + this.vx;
this._y = this._y + this.vy;
this._alpha = this._alpha - 1;
if (this._alpha < 10) {
delete this.onEnterFrame;
this.removeMovieClip();
}
};
pc++;
}
}
function createexp(b2) {
cracksound.start(0.01, 1);
pc = 0;
while (pc < 20) {
cut = _root.createEmptyMovieClip("cut", _root.getNextHighestDepth());
with (cut) {
lineStyle(0, 0, 0);
beginFill(16777215, 100);
lineTo(random(30) - 15, random(30) - 15);
lineTo(random(30) - 15, random(30) - 15);
endFill();
}
cut._x = b2._x;
cut._y = b2._y;
cut.vx = (Math.random() * 16) - 8;
cut.vy = (Math.random() * 16) - 8;
cut.rotspeed = Math.random(6) - 3;
cut.onEnterFrame = function () {
this._x = this._x + this.vx;
this._y = this._y + this.vy;
this._rotation = this._rotation + this.rotspeed;
this._alpha = this._alpha - 0.5;
if (this._alpha < 1) {
delete this.onEnterFrame;
this.removeMovieClip();
}
};
pc++;
}
}
function gomove() {
goscreen._y = goscreen._y - ((goscreen._y - 240) / 10);
}
function restore() {
score = 0;
sco.text = score;
goscreen.removeMovieClip();
i = 0;
while (i < barray.length) {
barray[i].removeMovieClip();
i++;
}
barray = [];
i = 10;
n = -1;
nd = 10000;
wall = false;
news = 0;
fsm = shooter;
newball();
bgsound.start(0.01, 9999);
onMouseDown = function () {
shootnow();
};
}
MovieClip.prototype.useHandCursor = false;
so = SharedObject.getLocal("hiscore");
_root.createEmptyMovieClip("bgsoundholder", 1);
bgsound = new Sound(bgsoundholder);
bgsound.attachSound("sound1");
bgsound.start(0.01, 9999);
bgsound.setVolume(50);
_root.createEmptyMovieClip("effectsoundholder", 2);
cracksound = new Sound(effectsoundholder);
cracksound.attachSound("sound2");
shootsound = new Sound(effectsoundholder);
shootsound.attachSound("sound3");
wallsound = new Sound(effectsoundholder);
wallsound.attachSound("sound4");
fsm = shooter;
var score = 0;
sco.text = score;
if (so.data.hi == undefined) {
hisco.text = 0;
} else {
hisco.text = so.data.hi;
}
var i = 10;
var friction = 0.975;
var n = -1;
var nd = 10000;
var wall = false;
var news = 0;
var barray = new Array();
var firstshot = false;
cont = _root.createEmptyMovieClip("cont", 10);
l = cont.createEmptyMovieClip("l", 2);
l.deg = 182;
l.mov = 2;
statief = _root.attachMovie("statief", "statief", 40000);
statief._x = 320;
statief._y = 395;
arro = _root.attachMovie("arrow", "arrow", 30000);
tscreen = _root.attachMovie("titlescreen", "titlescreen", 10000);
tscreen._x = 320;
tscreen._y = 200;
onMouseDown = function () {
shootnow();
};
_root.onEnterFrame = function () {
fsm();
};
newball();
stop();
Instance of Symbol 56 MovieClip in Frame 10
on (press) {
if (_root.bgsound.getVolume() == 50) {
_root.bgsound.setVolume(0);
_root.cracksound.setVolume(0);
} else {
_root.bgsound.setVolume(50);
_root.cracksound.setVolume(100);
}
}
Instance of Symbol 59 MovieClip in Frame 10
on (press) {
getURL ("http://www.gimme5games.com", "_blank");
}
Symbol 33 Button
on (release) {
getURL ("http://www.gimme5games.com", "_blank");
}
Symbol 38 Button
on (release) {
getURL ("http://www.gimme5games.com", "_blank");
}
Symbol 46 MovieClip [spl] Frame 220
this.removeMovieClip();
_root.gotoAndStop(10);