Frame 1
movieFile = "http://www.weebls-stuff.com/testy/stacker/bconstructive_05.swf";
loadMovie (movieFile, mc_holder);
mc_holder._visible = false;
var mc_sound = new Sound(mc_holder);
function reportevent(tag) {
trace("tag:" + tag);
switch (tag) {
case 1 :
trace("intro finished");
gotoAndStop ("gametitle");
break;
case 2 :
trace("play button");
mc_holder.gotoAndStop("frameblank");
gotoAndPlay ("gamestart");
break;
case 3 :
mc_holder.gotoAndStop("frameblank");
game_faster();
break;
case 4 :
trace("lost screen finished");
mc_holder.gotoAndStop("frameblank");
gotoAndStop ("gamescore");
break;
case 5 :
trace("win screen finished");
mc_holder.gotoAndStop("frameblank");
gotoAndStop ("gamescore");
}
}
Instance of Symbol 36 MovieClip "loadbar" in Frame 1
onClipEvent (load) {
stop();
}
Frame 2
bTotal = Number(mc_holder.getBytesTotal());
bLoaded = Number(mc_holder.getBytesLoaded());
if ((bTotal > 100) && (bLoaded > 0)) {
px = Math.round((bLoaded / bTotal) * 100);
loadbar.gotoAndStop(px);
if (px < 99) {
mc_sound.setVolume(0);
mc_holder.gotoAndStop(1);
mc_holder._visible = false;
loadbar._visible = true;
} else {
loadbar._visible = false;
trace("Loaded " + bLoaded);
mc_sound.setVolume(100);
mc_holder._visible = true;
mc_holder.gotoAndPlay(2);
mc_holder.play();
skip._x = 3;
stop();
}
}
Frame 3
gotoAndPlay (2);
Frame 4
stop();
trace("jump to title");
mc_holder.gotoAndPlay("frametitle");
Instance of Symbol 50 MovieClip "audio" in Frame 5
onClipEvent (load) {
_visible = false;
}
Frame 8
function junk_score(id) {
if (id == 1) {
sound_yay.start(0, 1);
gamescore = gamescore + 1;
} else {
sound_nope.start(0, 1);
gamescore = gamescore - 1;
}
}
function game_end() {
pile.arrow._visible = false;
sound_music1.stop();
sound_music2.stop();
sound_yay.setVolume(0);
sound_nope.setVolume(0);
gotoAndStop ("gameoutro");
}
function halfway_anim() {
sound_music1.stop();
sound_yay.setVolume(0);
sound_nope.setVolume(0);
gotoAndStop ("gamehurry");
}
function game_faster() {
gameSection = 2;
newtime = new Date();
starttime = (newtime.getTime() / 1000) - (timelimit - 20);
sound_music2.start(0, 99);
sound_yay.setVolume(100);
sound_nope.setVolume(100);
trace("speed: " + manmove);
manmove = manmove * 1.2;
trace("increased speed: " + manmove);
gotoAndPlay (10);
}
globalObjId = 1;
topjunk = null;
lockthrow = false;
wobblelist = [];
animstep = 1;
starttime = new Date();
starttime = starttime.getTime() / 1000;
manmove = 10;
speedup = 1.02;
gamescore = 0;
wobblemaster = 0.7;
gravity = 1.2;
gameSection = 1;
timelimit = 61;
var sound_music1 = new Sound(audio.music1);
sound_music1.attachSound("ingame.wav");
sound_music1.setVolume(100);
sound_music1.start(0, 99);
var sound_music2 = new Sound(audio.music2);
sound_music2.attachSound("ingame_fast.wav");
sound_music2.setVolume(100);
var sound_yay = new Sound(audio.yay);
sound_yay.attachSound("yay.wav");
sound_yay.setVolume(100);
var sound_nope = new Sound(audio.nope);
sound_nope.attachSound("nope.wav");
sound_nope.setVolume(100);
Frame 10
if (Key.isDown(38) || (Key.isDown(32))) {
boy.throwit();
}
Instance of Symbol 91 MovieClip "pile" in Frame 10
/* no clip actions */
Instance of Symbol 119 MovieClip "boy" in Frame 10
onClipEvent (enterFrame) {
_x = (_x + _root.manmove);
if (_x > 780) {
_root.manmove = -_root.manmove;
_xscale = -100;
ball._xscale = -100;
newitem();
}
if (_x < -140) {
_root.manmove = -_root.manmove;
_xscale = 100;
ball._xscale = 100;
newitem();
}
}
Frame 11
pile.wobblejunk();
animstep = animstep + ((wobblelist.length / 200) + 0.05);
newtime = new Date();
counter_time = timelimit - Math.ceil((newtime.getTime() / 1000) - starttime);
score = gamescore;
tidybar.gotoAndStop(score + 1);
if (counter_time <= 0) {
game_end();
} else if ((counter_time <= 20) && (gameSection == 1)) {
halfway_anim();
} else {
gotoAndPlay (10);
}
Frame 13
stop();
mc_holder.gotoAndPlay("framehurry");
Frame 14
stop();
if (score > 10) {
mc_holder.gotoAndPlay("framewin");
} else {
mc_holder.gotoAndPlay("framelose");
}
Frame 15
stop();
mc_holder.gotoAndStop("frameblank");
Symbol 42 Button
on (release) {
gotoAndStop ("gametitle");
}
Symbol 47 Button
on (release) {
getURL ("http://www.bconstructive.co.uk", "_blank");
}
Symbol 74 MovieClip Frame 1
stop();
Symbol 87 MovieClip Frame 1
stop();
Symbol 91 MovieClip Frame 1
function throwjunk(itemnum, tx, ty) {
trace("throwjunk!");
n = _root.globalObjId;
_root.globalObjId = n + 1;
var _local2 = new Object();
_local2.jx = tx;
_local2.jy = ty;
_local2.jspeed = 26;
_local2.jmode = 1;
_local2.active = true;
_local2.wobbleangle = 0;
_local2.itemnum = itemnum;
mc_junk.duplicateMovieClip("junk" + n, n + 5001, _local2);
}
function wobblejunk() {
junkpos = [];
n = 0;
while (n < (_root.wobblelist.length + 1)) {
junkpos.push([_root.wobblelist[n]._x, _root.wobblelist[n]._y]);
n++;
}
newjunkpos = [];
oldjunkpos = junkpos;
w = 1;
while (w < (junkpos.length + 1)) {
pivot = oldjunkpos.shift();
newjunkpos.push(pivot);
reducer = w / junkpos.length;
ang = ((_root.wobblelist[w].wobbleangle * reducer) * 2) * Math.sin(_root.animstep);
_root.wobblelist[w]._rotation = ang * 57.2957795130823;
fixd = _root.wobblelist[w].fixed_distance;
oldjunkpos = rotate_array_origin(oldjunkpos, ang, pivot, fixd);
w++;
}
n = 0;
while (n < (_root.wobblelist.length + 1)) {
_root.wobblelist[n]._x = newjunkpos[n][0];
_root.wobblelist[n]._y = newjunkpos[n][1];
n++;
}
arrow._x = _root.topjunk._x;
arrow._y = _root.topjunk._y - 30;
}
function move_array(p_array, px, py) {
n_array = [];
n = 0;
while (n < p_array.length) {
x = p_array[n][0];
y = p_array[n][1];
nx = x + px;
ny = y + py;
n_array.push([nx, ny]);
n++;
}
return(n_array);
}
function rotate_array(p_array, p_angle) {
n_array = [];
n = 0;
while (n < p_array.length) {
x = p_array[n][0];
y = p_array[n][1];
nx = (Math.cos(p_angle) * x) - (Math.sin(p_angle) * y);
ny = (Math.sin(p_angle) * x) + (Math.cos(p_angle) * y);
n_array.push([nx, ny]);
n++;
}
return(n_array);
}
function rotate_array_origin(p_array, p_angle, p_origin, fixed_distance) {
p_angle = p_angle - (Math.PI/2);
n_array = [];
x = p_array[0][0];
y = p_array[0][1];
radius = fixed_distance;
nx = p_origin[0] + (Math.cos(p_angle) * radius);
ny = p_origin[1] + (Math.sin(p_angle) * radius);
n_array.push([nx, ny]);
n = 1;
while (n < p_array.length) {
x = p_array[n][0];
y = p_array[n][1];
radius = dist_2_points(p_origin, p_array[n]);
nx = p_origin[0] + (Math.cos(p_angle) * radius);
ny = p_origin[1] + (Math.sin(p_angle) * radius);
n_array.push([nx, ny]);
n++;
}
return(n_array);
}
function dist_2_points(p1, p2) {
Distance = Math.sqrt(((p2[0] - p1[0]) * (p2[0] - p1[0])) + ((p2[1] - p1[1]) * (p2[1] - p1[1])));
return(Distance);
}
Instance of Symbol 87 MovieClip "mc_junk" in Symbol 91 MovieClip Frame 1
onClipEvent (load) {
gotoAndStop(itemnum);
if (jmode != null) {
_x = jx;
_y = jy;
_root.lockthrow = true;
} else {
trace("first junk");
_root.topjunk = this;
_root.wobblelist.push(this);
wobbleangle = 0;
}
hitbox._visible = false;
}
onClipEvent (enterFrame) {
if (jmode == 1) {
_y = (_y - jspeed);
jspeed = jspeed - _root.gravity;
if (jspeed < 0) {
if (this.hitbox.hitTest(_root.topjunk.hitbox)) {
jmode = 2;
jspeed = 0;
_y = (_root.topjunk._y - 12);
_root.lockthrow = false;
opp = _root.topjunk._x - _x;
adj = _root.topjunk._y - _y;
wobblemaker = this._parent._parent.wobblemaster + ((8 - ((_root.wobblelist.length / 2) % 6)) / 18);
wobbleangle = Math.atan(opp / adj) * wobblemaker;
trace("ang :" + wobbleangle);
_root.wobblelist.push(this);
fixd = Math.sqrt((opp * opp) + (adj * adj));
this.fixed_distance = fixd;
_root.topjunk = this;
this._parent._parent.junk_score(1);
}
if (_y > 345) {
trace("hit floor");
jmode = 0;
_root.lockthrow = false;
this._parent._parent.junk_score(-1);
}
}
} else if (jmode == 2) {
}
}
Symbol 119 MovieClip Frame 1
function throwit() {
trace("throw it:" + itemnum);
if (itemnum > 0) {
ball._visible = false;
if (_xscale == -100) {
tx = _x - 76;
} else {
tx = _x - 76;
}
_parent.pile.throwjunk(itemnum, tx, _y - 40);
itemnum = 0;
}
}
function newitem() {
if (itemnum < 1) {
ball._visible = true;
do {
itemnum = Math.floor(Math.random() * 14) + 2;
} while (itemnum == _parent.topjunk._currentframe);
ball.gotoAndStop(itemnum);
_root.manmove = _root.manmove * _root.speedup;
}
}
var itemnum;
itemnum = 0;
newitem();
Instance of Symbol 87 MovieClip "ball" in Symbol 119 MovieClip Frame 1
onClipEvent (load) {
hitbox._visible = false;
}
Symbol 119 MovieClip Frame 5
gotoAndPlay (4);
Symbol 127 Button
on (release) {
getURL ("http://www.bconstructive.co.uk", "_blank");
}
Symbol 130 Button
on (release) {
stopAllSounds();
gotoAndStop ("gametitle");
}