Frame 1
stop();
Instance of Symbol 142 MovieClip "loader" in Frame 1
onClipEvent (enterFrame) {
amountloaded = _parent.getBytesLoaded();
total = _parent.getBytesTotal();
this.gotoAndStop(int(100 * (amountloaded / total)));
if (amountloaded >= total) {
_parent.gotoAndStop("startmenu");
_root.drakeroomloaded = true;
trace("loadddd");
}
}
Frame 3
stop();
_root.countdown = 60;
firstgamepercent = 0;
secondgamescore = 0;
finalscore = 0;
Instance of Symbol 359 MovieClip in Frame 4
onClipEvent (load) {
_root.drakeroomloaded = false;
_root.joshroomloaded = false;
danceintroloadcalled = false;
danceexitloadcalled = false;
bmpintroloadcalled = false;
_root.oneplayer == "";
gametwointroplayed = false;
}
onClipEvent (enterFrame) {
if (_root.oneplayer == "josh") {
if (((_parent.room.roomtidyend.movieholder.getBytesLoaded() == _parent.room.roomtidyend.movieholder.getBytesTotal()) && (bmpintroloadcalled == false)) && (_parent.room.roomtidyend.movieholder.getBytesTotal() > 100)) {
_root.loadbmps.loadMovie("joshdancebmp.swf");
_parent.danceintro.movieholder.loadMovie("dancejoshin.swf");
danceintroloadcalled = true;
bmpintroloadcalled = true;
trace("load bmps");
trace(_parent.room.roomtidyend.movieholder.getBytesTotal());
}
if ((((_parent.danceintro.movieholder.getBytesLoaded() == _parent.danceintro.movieholder.getBytesTotal()) && (danceexitloadcalled == false)) && (danceintroloadcalled == true)) && (_parent.danceintro.movieholder.getBytesTotal() > 100)) {
_parent.danceexit.movieholder.loadMovie("dancejoshout.swf");
danceexitloadcalled = true;
trace("load dance exit");
trace(_parent.danceintro.movieholder.getBytesTotal());
}
}
if (_root.oneplayer == "drake") {
if (((_parent.room.roomtidyend.movieholder.getBytesLoaded() == _parent.room.roomtidyend.movieholder.getBytesTotal()) && (bmpintroloadcalled == false)) && (_parent.room.roomtidyend.movieholder.getBytesTotal() > 100)) {
_root.loadbmps.loadMovie("drakedancebmp.swf");
_parent.danceintro.movieholder.loadMovie("dancedrakein.swf");
bmpintroloadcalled = true;
trace("load bmps");
trace(_parent.room.roomtidyend.movieholder.getBytesTotal());
}
if ((((_parent.danceintro.movieholder.getBytesLoaded() == _parent.danceintro.movieholder.getBytesTotal()) && (danceexitloadcalled == false)) && (danceintroloadcalled == true)) && (_parent.danceintro.movieholder.getBytesTotal() > 100)) {
_parent.danceexit.movieholder.loadMovie("dancedrakeout.swf");
danceexitloadcalled = true;
trace("load dance exit");
trace(_parent.danceintro.movieholder.getBytesTotal());
}
}
if (_root.oneplayer == "two") {
if (((_parent.room.drakemovie.movieholder.getBytesLoaded() == _parent.room.drakemovie.movieholder.getBytesTotal()) && (bmpintroloadcalled == false)) && (_parent.room.drakemovie.movieholder.getBytesTotal() > 100)) {
_root.loadbmps.loadMovie("twodancebmp.swf");
_root.loadbmpstwo.loadMovie("twodancebmp2.swf");
_parent.danceintro.movieholder.loadMovie("dancedrakein.swf");
_parent.danceintrotwo.movieholder.loadMovie("dancejoshin.swf");
bmpintroloadcalled = true;
trace("load bmps");
trace(_parent.room.roomtidyend.movieholder.getBytesTotal());
}
if ((((_parent.danceintro.movieholder.getBytesLoaded() == _parent.danceintro.movieholder.getBytesTotal()) && (danceexitloadcalled == false)) && (danceintroloadcalled == true)) && (_parent.danceintro.movieholder.getBytesTotal() > 100)) {
danceexitloadcalled = true;
trace("load dance exit");
trace(_parent.danceintro.movieholder.getBytesTotal());
}
}
}
Frame 42
if (_root.oneplayer == "josh") {
instruc.gotoAndPlay("josh_intro");
} else if (_root.oneplayer == "drake") {
instruc.gotoAndPlay("drake_intro");
} else if (_root.firstgamewinner == "drake") {
instruc.gotoAndPlay("two_intro");
} else {
instruc.gotoAndPlay("two_intro_josh");
}
Frame 54
stop();
_root.jscore = 0;
_root.dscore = 0;
danceintro.play();
Frame 63
stop();
_root.jscore = 0;
_root.dscore = 0;
danceintro.play();
Frame 74
stop();
_root.jscore = 0;
_root.dscore = 0;
danceintro.play();
Frame 86
stop();
trace("im on joshees frame");
_root.jscore = 0;
_root.dscore = 0;
danceintrotwo.play();
Symbol 56 MovieClip [s] Frame 1
stop();
Symbol 56 MovieClip [s] Frame 21
stop();
Symbol 103 MovieClip [hitmedrake] Frame 1
stop();
Symbol 103 MovieClip [hitmedrake] Frame 21
stop();
Symbol 116 MovieClip [hitmejosh] Frame 1
stop();
Symbol 116 MovieClip [hitmejosh] Frame 21
stop();
Symbol 187 Button
on (release) {
gotoAndPlay ("one");
}
Symbol 188 Button
on (release) {
gotoAndPlay ("two");
}
Symbol 195 Button
on (release) {
this.play();
_root.oneplayer = "drake";
_root.pauseforvid = true;
}
on (rollOver) {
sDrake.start();
}
Symbol 198 Button
on (release) {
this.play();
_root.oneplayer = "josh";
_root.pauseforvid = true;
}
on (rollOver) {
sJosh.start();
}
Symbol 219 MovieClip Frame 1
stop();
Symbol 232 MovieClip Frame 1
stop();
Symbol 243 MovieClip Frame 1
stop();
_root.leftwindowopen = false;
Symbol 243 MovieClip Frame 5
_parent.meganopen();
Symbol 243 MovieClip Frame 39
stop();
_root.leftwindowopen = true;
Symbol 250 MovieClip Frame 1
stop();
Symbol 252 MovieClip Frame 1
messhold.gotoAndStop(_parent._parent._parent.charholding);
Symbol 252 MovieClip Frame 5
messhold.gotoAndStop(_parent._parent._parent.charholding);
Symbol 252 MovieClip Frame 10
messhold.gotoAndStop(_parent._parent._parent.charholding);
Symbol 252 MovieClip Frame 11
messhold.gotoAndStop(_parent._parent._parent.charholding);
Symbol 252 MovieClip Frame 15
messhold.gotoAndStop(_parent._parent._parent.charholding);
Symbol 252 MovieClip Frame 20
messhold.gotoAndStop(_parent._parent._parent.charholding);
Symbol 267 Button
on (release) {
nextFrame();
}
Symbol 287 Button
on (release) {
prevFrame();
}
Symbol 303 MovieClip Frame 1
_parent.meganopen();
Symbol 305 MovieClip Frame 1
stop();
Symbol 305 MovieClip Frame 2
stop();
Symbol 305 MovieClip Frame 3
stop();
Symbol 308 MovieClip Frame 1
stop();
Symbol 311 MovieClip Frame 1
stop();
Symbol 325 Button
on (release) {
stopAllSounds();
if (_root.oneplayer == "josh") {
_root.gotoAndStop("roomjosh");
} else {
_root.gotoAndStop("roomdrake");
}
}
Symbol 339 MovieClip Frame 1
messhold.gotoAndStop(_parent._parent._parent.typeinhand);
Symbol 339 MovieClip Frame 5
messhold.gotoAndStop(_parent._parent._parent.typeinhand);
Symbol 339 MovieClip Frame 10
messhold.gotoAndStop(_parent._parent._parent.typeinhand);
Symbol 339 MovieClip Frame 15
messhold.gotoAndStop(_parent._parent._parent.typeinhand);
Symbol 339 MovieClip Frame 20
messhold.gotoAndStop(_parent._parent._parent.typeinhand);
Symbol 354 MovieClip Frame 1
stop();
Symbol 354 MovieClip Frame 2
stop();
Symbol 354 MovieClip Frame 3
stop();
Symbol 355 Button
on (release) {
stopAllSounds();
_root.oneplayer = "two";
_root.pauseforvid = true;
_root.gotoAndStop("roomtwoplayer");
}
Symbol 356 MovieClip Frame 96
stop();
Symbol 356 MovieClip Frame 122
sJosh = new Sound();
sJosh.attachSound("fatjosh");
sDrake = new Sound();
sDrake.attachSound("gaydrake");
joshspoke = false;
drakespoke = false;
stop();
Symbol 356 MovieClip Frame 149
stop();
Symbol 356 MovieClip Frame 188
stop();
Symbol 363 MovieClip Frame 1
stop();
Symbol 377 Button
on (release) {
this.gotoAndPlay("out");
if (_root.secondgameover == false) {
_root.pauseforvid = false;
if (_root.oneplayer == "josh") {
_root.danceexit.movieholder.loadMovie("dancejoshout.swf");
} else {
_root.danceexit.movieholder.loadMovie("dancedrakeout.swf");
}
}
}
Symbol 380 Button
on (release) {
this.gotoAndPlay("out");
}
Symbol 381 MovieClip Frame 1
stop();
_root.pauseforvid = true;
Symbol 381 MovieClip Frame 2
_root.pauseforvid = true;
if (_root.secondgameover == true) {
stop();
if (_root.oneplayer == "josh") {
_root.popuptext.gotoAndPlay("playsong");
} else {
_root.popuptext.gotoAndPlay("answerall");
}
}
Symbol 381 MovieClip Frame 3
_root.pauseforvid = true;
Symbol 381 MovieClip Frame 30
stop();
Instance of Symbol 379 MovieClip in Symbol 381 MovieClip Frame 30
onClipEvent (enterFrame) {
if (_parent.movieholder.getBytesLoaded() == _parent.movieholder.getBytesTotal()) {
if (_parent.movieholder._currentframe < 3) {
_parent.movieholder.gotoAndPlay("playme");
}
gametwointroplayed = true;
trace(_parent.movieholder.getBytesTotal());
trace("play movie cause it has loaded");
}
}
Symbol 381 MovieClip Frame 48
this.removeMovieClip();
if (_root.secondgameover == false) {
if (_root.oneplayer == "josh") {
_root.popuptext.gotoAndPlay("impresskathy");
} else if (_root.oneplayer == "two") {
if (_root.firstgamewinner == "josh") {
_root.popuptext.gotoAndPlay("impresskathy");
} else {
_root.popuptext.gotoAndPlay("impressmic");
}
} else {
_root.popuptext.gotoAndPlay("impressmic");
}
} else {
_root.gameoverhigh.play();
}
stop();
Symbol 395 MovieClip Frame 1
stop();
_root.leftwindowopen = false;
Symbol 395 MovieClip Frame 5
_parent.meganopen();
Symbol 395 MovieClip Frame 39
stop();
_root.leftwindowopen = true;
Symbol 424 MovieClip Frame 1
stop();
_root.rightdooropen = false;
Symbol 424 MovieClip Frame 8
_parent.meganopen();
Symbol 424 MovieClip Frame 43
stop();
_root.rightdooropen = true;
Symbol 439 MovieClip Frame 1
messhold.gotoAndStop(_parent._parent._parent.charholding);
Symbol 440 MovieClip Frame 2
_parent.gotoAndStop("walk");
Symbol 441 MovieClip Frame 1
stop();
Symbol 441 MovieClip Frame 2
stop();
Symbol 441 MovieClip Frame 3
stop();
Symbol 443 MovieClip Frame 1
messhold.gotoAndStop(_parent._parent._parent.typeinhand);
Symbol 444 MovieClip Frame 2
_parent.gotoAndStop("walk");
Symbol 445 MovieClip Frame 1
stop();
Symbol 445 MovieClip Frame 2
stop();
Symbol 445 MovieClip Frame 3
stop();
Symbol 450 MovieClip Frame 528
_root.popuptext.gotoAndPlay("tidyup");
this.removeMovieClip();
stop();
Symbol 451 Button
on (release) {
this.gotoAndPlay("out");
_root.gotoAndStop("twoinstruction");
_root.pauseforvid = true;
}
Symbol 452 MovieClip Frame 1
stop();
if (_root.oneplayer == "josh") {
loadMovie ("rtjoshwin.swf", movieholder);
} else {
loadMovie ("rtdrakewin.swf", movieholder);
}
Symbol 452 MovieClip Frame 2
trace("second frame");
if (_root.oneplayer == "drake") {
_root.firstgamepercent = 100 - _parent.leftpercent;
if (_root.firstgamepercent > 50) {
this.gotoAndStop(1);
_root.grammy.play();
} else {
_root.popuptext.gotoAndPlay("micdate");
}
trace("drakes percent is " + _root.firstgamepercent);
} else {
_root.firstgamepercent = _parent.leftpercent;
if (_root.firstgamepercent > 50) {
this.gotoAndStop(1);
_root.grammy.play();
} else {
_root.popuptext.gotoAndPlay("kathyparty");
}
trace("moo " + _parent.leftpercent);
trace("josh percent is " + _root.firstgamepercent);
}
trace("RRAAAAAAAAAAAHHHHHHHHHH");
Symbol 452 MovieClip Frame 3
stop();
Symbol 452 MovieClip Frame 31
movieholder.gotoAndPlay("playme");
Symbol 452 MovieClip Frame 530
if (_root.oneplayer == "drake") {
firstgamepercent = 100 - leftpercent;
trace("drakes percent is " + firstgamepercent);
} else {
firstgamepercent = leftpercent;
trace("josh percent is " + firstgamepercent);
}
trace("RRAAAAAAAAAAAHHHHHHHHHH");
this.removeMovieClip();
_root.gotoAndStop("twoinstruction");
stop();
Symbol 453 MovieClip Frame 1
function runtimer() {
var _local1 = _root;
framecount--;
if (framecount < 0) {
seconds--;
framecount = framereset;
if (seconds == 0) {
delete _local1.onEnterFrame;
char.charbody.gotoAndStop("stand");
compchar.charbody.gotoAndStop("stand");
roomtidyend.play();
_local1.pauseforvid = true;
}
}
_local1.countdown = seconds;
}
function performaction() {
var _local1 = _root;
itempickedup = false;
if (char.proxchecker.hitTest(leftwindow) && (leftwindow._currentframe > 1)) {
leftwindow.gotoAndStop(1);
meganclose();
itempickedup = true;
} else if (charholding != "nothing") {
pcheck = checkProx("left");
if (pcheck != "") {
if ((charholding == "rubbish") || (charholding == "rubbish2")) {
if (pcheck == "leftbin") {
sCrumple.start();
charholding = "nothing";
_local1.itemholding.gotoAndStop(1);
itempickedup = true;
}
} else if ((charholding == "clothes") || (charholding == "clothes2")) {
if (pcheck == "wardrobe") {
sPaperturn.start();
charholding = "nothing";
_local1.itemholding.gotoAndStop(1);
itempickedup = true;
}
} else if ((charholding == "cds") && (pcheck == "leftrack")) {
sCds.start();
charholding = "nothing";
_local1.itemholding.gotoAndStop(1);
itempickedup = true;
}
}
} else if (charholding == "nothing") {
pickUpItem("left");
itempickedup = true;
}
if (itempickedup == false) {
if ((charholding == "rubbish") || (charholding == "rubbish2")) {
throwRubbish("char");
} else {
dropItem("left");
}
}
}
function openWindow(side) {
if (windowtimer < 1) {
if (side == "left") {
throwRubbish("leftwindow");
} else {
throwRubbish("rightdoor");
}
windowtimer = windowreset;
} else {
windowtimer--;
}
}
function checkProx(side) {
var _local1 = this;
if (side == "left") {
i = 0;
while (i < itemsinroom.length) {
itemname = itemsinroom[i];
if (itemname == "leftbin") {
if (char.proxchecker.hitTest(_local1[itemname])) {
return("leftbin");
}
} else if (itemname == "leftrack") {
if (char.proxchecker.hitTest(_local1[itemname])) {
return("leftrack");
}
} else if (itemname == "wardrobe") {
if (char.proxchecker.hitTest(_local1[itemname])) {
return("wardrobe");
}
}
i++;
}
}
return(undefined);
}
function moveRubbish() {
var _local1 = this;
r = 0;
while (r < rubbishballs.length) {
rname = "rubbish" + rubbishballs[r];
_local1[rname]._x = _local1[rname]._x + _local1[rname].xmov;
_local1[rname]._y = _local1[rname]._y + _local1[rname].ymov;
_local1[rname]._rotation = _local1[rname]._rotation + _local1[rname].rot;
if (_local1[rname]._y < startheight) {
_local1[rname].ymov = _local1[rname].ymov * -1;
} else if (_local1[rname]._y > maxheight) {
_local1[rname].ymov = _local1[rname].ymov * -1;
} else if (_local1[rname]._x < startwidth) {
_local1[rname].xmov = _local1[rname].xmov * -1;
} else if (_local1[rname]._x > maxright) {
_local1[rname].xmov = _local1[rname].xmov * -1;
}
_local1[rname].distancetravelled = _local1[rname].distancetravelled + _local1[rname].travelling;
if (_local1[rname].distancetravelled < _local1[rname].halfway) {
_local1[rname]._xscale = _local1[rname]._xscale + 2;
_local1[rname]._yscale = _local1[rname]._yscale + 2;
} else {
_local1[rname]._xscale = _local1[rname]._xscale - 2;
_local1[rname]._yscale = _local1[rname]._yscale - 2;
}
if (_local1[rname].distancetravelled > _local1[rname].totaldistance) {
newball = "mess" + depth;
attachMovie("mess", newball, depth);
_local1[newball]._x = _local1[rname]._x;
_local1[newball]._y = _local1[rname]._y;
_local1[newball]._rotation = _local1[rname]._rotation;
if (_local1[rname].plane == true) {
_local1[newball].gotoAndStop("rubbish2");
_local1[newball].messtype = "rubbish2";
_local1[newball].mframe = "rubbish2";
} else {
_local1[newball].gotoAndStop("rubbish");
_local1[newball].messtype = "rubbish";
_local1[newball].mframe = "rubbish";
}
if (_local1[rname]._x > maxwidth) {
messonright.push(depth);
} else {
messonleft.push(depth);
}
_local1[rname].removeMovieClip();
rubbishballs.splice(r, 1);
depth++;
}
r++;
}
if (rubbishballs.length == 0) {
rubbishinplay = false;
}
}
function throwRubbish(from) {
var _local1 = this;
var _local2 = from;
rubbish = "rubbish" + depth;
attachMovie("mess", rubbish, depth);
_local1[rubbish].gotoAndStop("rubbish");
_local1[rubbish].plane = false;
if (_local2 == "char") {
if (charholding == "rubbish2") {
_local1[rubbish].gotoAndStop("rubbish2");
_local1[rubbish].plane = true;
}
}
if (_local2 == "compchar") {
if (typeinhand == "rubbish2") {
_local1[rubbish].gotoAndStop("rubbish2");
_local1[rubbish].plane = true;
}
}
if (_local2 == "char") {
rangle = ((char._rotation / 360) * 2) * Math.PI;
rubtargetx = rspeed * Math.sin(rangle);
rubtargety = (-rspeed) * Math.cos(rangle);
_local1[rubbish]._x = char._x;
_local1[rubbish]._y = char._y;
_local1[rubbish].totaldistance = random(100) + 250;
if (_local1[rubbish].plane == false) {
_local1[rubbish].rot = random(20) - 10;
} else {
_local1[rubbish]._rotation = char._rotation;
}
charholding = "nothing";
char.charbody.gotoAndStop("throw");
_root.itemholding.gotoAndStop(1);
} else if (_local2 == "compchar") {
rangle = (((compchar._rotation / 360) * 2) * Math.PI) - 90;
rubtargetx = rspeed * Math.sin(rangle);
rubtargety = (-rspeed) * Math.cos(rangle);
_local1[rubbish]._x = compchar._x;
_local1[rubbish]._y = compchar._y;
_local1[rubbish].totaldistance = random(100) + 250;
if (_local1[rubbish].plane == false) {
_local1[rubbish].rot = random(20) - 10;
} else {
_local1[rubbish]._rotation = compchar._rotation - 90;
}
compchar.charbody.gotoAndStop("throw");
itemgoingto = "";
typeinhand = "";
_root.itemholdingright.gotoAndStop(1);
} else {
_local1[rubbish].rot = random(20) - 10;
if (_local2 == "leftwindow") {
_local1[rubbish]._x = leftwindow._x + (leftwindow._width / 2);
_local1[rubbish]._y = leftwindow._y;
windowangle = random(135) - 180;
rangle = ((windowangle / 360) * 2) * Math.PI;
rubtargetx = rspeed * Math.sin(rangle);
rubtargety = (-rspeed) * Math.cos(rangle);
} else {
_local1[rubbish]._x = rightdoor._x;
_local1[rubbish]._y = rightdoor._y + (rightdoor._height / 2);
windowangle = random(100) - 90;
rangle = ((windowangle / 360) * 2) * Math.PI;
rubtargetx = rspeed * Math.sin(rangle);
rubtargety = (-rspeed) * Math.cos(rangle);
}
_local1[rubbish].totaldistance = random(300) + 50;
}
_local1[rubbish].angle = rangle;
_local1[rubbish].xmov = rubtargetx;
_local1[rubbish].ymov = rubtargety;
dtravelled = Math.sqrt((rubtargetx * rubtargetx) + (rubtargety * rubtargety));
_local1[rubbish].travelling = dtravelled;
if (_local1[rubbish].travelling < 0) {
_local1[rubbish].travelling = _local1[rubbish].travelling * -1;
}
_local1[rubbish].distancetravelled = 0;
_local1[rubbish].halfway = _local1[rubbish].totaldistance / 2;
rubbishinplay = true;
rubbishballs.push(depth);
sThrow.start();
depth++;
}
function dropItem(side) {
var _local1 = this;
sDrop.start();
messtodrop = charholding;
messname = "mess" + depth;
attachMovie("mess", messname, depth);
_local1[messname].gotoAndStop(charholding);
_local1[messname]._x = char._x;
_local1[messname]._y = char._y;
_local1[messname]._rotation = random(360);
_local1[messname].messtype = charholding;
if (side == "left") {
messonleft.push(depth);
} else {
messonright.push(depth);
}
depth++;
charholding = "nothing";
_root.itemholding.gotoAndStop(1);
}
function pickUpItem(side) {
var _local1 = this;
var _local2 = _root;
if (side == "left") {
arraypointer = messonleft;
} else {
arraypointer = messonright;
}
m = 0;
while (m < arraypointer.length) {
messname = "mess" + arraypointer[m];
if (_local1[messname].hitTest(char.pickupspot)) {
sPickup.start();
_local2.itemholding.gotoAndStop(2);
_local2.itemholding.item.gotoAndStop(_local1[messname].messtype);
charholding = _local1[messname].messtype;
charitemholdingframe = _local1[messname].mframe;
_local1[messname].removeMovieClip();
arraypointer.splice(m, 1);
return;
}
m++;
}
}
function createMess(side) {
var _local1 = this;
if (side == "left") {
mtop = startheight;
mbottom = maxheight;
mleft = startwidth;
mright = maxwidth;
messonleft.push(depth);
} else {
mtop = startheight;
mbottom = maxheight;
mleft = maxwidth;
mright = maxright;
messonright.push(depth);
}
positionfound = false;
newname = "mess" + depth;
_local1.attachMovie("mess", newname, depth);
mtype = random(5) + 1;
myframe = mtype;
if (mtype == 1) {
messis = "rubbish";
}
if (mtype == 2) {
messis = "clothes";
}
if (mtype == 3) {
messis = "cds";
}
if (mtype == 4) {
messis = "rubbish2";
}
if (mtype == 5) {
messis = "clothes2";
}
_local1[newname].gotoAndStop(myframe);
_local1[newname]._rotation = random(360);
while (positionfound == false) {
xpos = random(int(mright - mleft)) + mleft;
ypos = random(int(mbottom - mtop)) + mtop;
messtop = ypos;
messbottom = ypos + _local1[newname]._height;
messleft = xpos;
messright = xpos + _local1[newname]._width;
onitem = false;
i = 0;
while (i < itemsinroom.length) {
itemaddress = itemsinroom[i];
itemheight = _local1[itemaddress]._height;
itemwidth = _local1[itemaddress]._width;
itemx = _local1[itemaddress]._x;
itemy = _local1[itemaddress]._y;
itemtop = itemy;
itembottom = itemy + itemheight;
itemleft = itemx;
itemright = itemx + itemwidth;
if ((((messbottom > itemtop) && (messtop < itembottom)) && (messright > itemleft)) && (messleft < itemright)) {
onitem = true;
}
i++;
}
if (onitem == false) {
positionfound = true;
}
}
_local1[newname]._x = xpos;
_local1[newname]._y = ypos;
_local1[newname].messtype = messis;
_local1[newname].messnumber = depth;
depth++;
}
function controlChar(charaddress) {
var _local1 = this;
var _local2 = charaddress;
touching = 0;
chartargetx = _local2._x;
chartargety = _local2._y;
positionchange = false;
sidealign = false;
if (k(kR)) {
_local2._rotation = _local2._rotation + rotationspeed;
} else if (k(kL)) {
_local2._rotation = _local2._rotation - rotationspeed;
}
if (k(kU)) {
angle = ((_local2._rotation / 360) * 2) * Math.PI;
chartargetx = chartargetx + (walkspeed * Math.sin(angle));
chartargety = chartargety + ((-walkspeed) * Math.cos(angle));
positionchange = true;
} else if (k(kD)) {
angle = ((_local2._rotation / 360) * 2) * Math.PI;
chartargetx = chartargetx - (walkspeed * Math.sin(angle));
chartargety = chartargety - ((-walkspeed) * Math.cos(angle));
positionchange = true;
}
if (positionchange == true) {
canmovex = true;
canmovey = true;
chartop = chartargety - (charheight / 2);
charbottom = chartargety + (charheight / 2);
charleft = chartargetx - (charwidth / 2);
charright = chartargetx + (charwidth / 2);
outboundary = false;
if ((chartop < startheight) || (charbottom > maxheight)) {
canmovey = false;
dontmove = false;
dontmove = checkitemsagain("nowt");
if (dontmove == "nob") {
canmovex = false;
} else if (char._y < (startheight + 100)) {
}
outboundary = true;
}
if ((charleft < startwidth) || (charright > maxwidth)) {
canmovex = false;
dontmove = false;
dontmove = checkitemsagain("nowt");
if (dontmove == "nob") {
canmovey = false;
} else if (char._x < (startwidth + 100)) {
}
outboundary = true;
}
settoedge = false;
i = 0;
while (i < itemsinroom.length) {
itemaddress = itemsinroom[i];
itemheight = _local1[itemaddress]._height;
itemwidth = _local1[itemaddress]._width;
itemx = _local1[itemaddress]._x;
itemy = _local1[itemaddress]._y;
itemtop = itemy;
itembottom = itemy + itemheight;
itemleft = itemx;
itemright = itemx + itemwidth;
if ((((charbottom > itemtop) && (chartop < itembottom)) && (charright > itemleft)) && (charleft < itemright)) {
touching++;
canmovey = false;
canmovex = false;
whotouchedme++;
charycentre = chartargety;
charxcentre = chartargetx;
dontmove = false;
dontmove = checkitemsagain(_local1[itemaddress]._name);
if ((((outboundary == false) && (settoedge == false)) && (whotouchedmelast < 2)) && (dontmove != "nob")) {
chartop = char._y - (charheight / 2);
charbottom = char._y + (charheight / 2);
charleft = char._x - (charwidth / 2);
charright = char._x + (charwidth / 2);
if ((((charbottom > itemtop) && (chartop < itembottom)) && (sidealign == false)) && (touching < 2)) {
canmovey = true;
settoedge = true;
if (char._x < itemx) {
sidealign = true;
} else {
sidealign = true;
}
} else if ((((charright > itemleft) && (charleft < itemright)) && (sidealign == false)) && (touching < 2)) {
canmovex = true;
settoedge = true;
if (char._y < itemy) {
sidealign = true;
} else {
sidealign = true;
}
}
}
}
i++;
}
whotouchedmelast = whotouchedme;
whotouchedme = 0;
if (touching > 1) {
canmovex = false;
canmovey = false;
}
if (canmovex == true) {
_local2._x = chartargetx;
char.charbody.gotoAndStop("walk");
}
if (canmovey == true) {
_local2._y = chartargety;
char.charbody.gotoAndStop("walk");
} else if (canmovex == false) {
}
} else {
char.charbody.gotoAndStop("stand");
}
}
function checkitemsagain(notthis) {
var _local1 = this;
var _local2 = notthis;
i = 0;
while (i < itemsinroom.length) {
thitemaddress = itemsinroom[i];
thitemheight = _local1[thitemaddress]._height;
thitemwidth = _local1[thitemaddress]._width;
thitemx = _local1[thitemaddress]._x;
thitemy = _local1[thitemaddress]._y;
thitemtop = thitemy;
thitembottom = thitemy + thitemheight;
thitemleft = thitemx;
thitemright = thitemx + thitemwidth;
if (((((charbottom > thitemtop) && (chartop < thitembottom)) && (charright > thitemleft)) && (charleft < thitemright)) && (_local2 != _local1[thitemaddress]._name)) {
return("nob");
}
i++;
}
return(undefined);
}
function rubbishMeter() {
var _local1 = _root;
totalamount = messonleft.length + messonright.length;
leftpercent = (messonleft.length / totalamount) * 100;
pixpercent = (rml / 100) * leftpercent;
_local1.leftp = int(leftpercent) + "%";
_local1.rightp = (100 - int(leftpercent)) + "%";
_local1.rubbishmeter.meterbar._x = pixpercent;
_local1.rubbishmeter.barmask._x = pixpercent;
}
stop();
startwidth = 0;
startheight = 0;
maxheight = floor._height;
maxright = floor._width;
maxwidth = boundary._x;
charheight = char.charbody._height;
charwidth = charheight;
char.swapDepths(10000);
rotationspeed = 10;
walkspeed = 8;
charholding = "nothing";
itemsinroom = [];
messonleft = [];
messonright = [];
rubbishinplay = false;
rubbishballs = [];
var k = Key.isDown;
var kU = 38;
var kD = 40;
var kL = 37;
var kR = 39;
var kS = 32;
rml = _root.rubbishmeter._width;
_root.rubbishmeter.meterbar._x = 0;
depth = 10;
messspawned = false;
numbertogenerate = 20;
spacetimer = 0;
spacereset = 5;
rthrowdistance = 120;
rpeak = 50;
rspeed = 5;
seconds = 60;
framecount = 0;
framereset = 30;
_root.onEnterFrame = function () {
var _local1 = _root;
if (_local1.pauseforvid == false) {
controlChar(char);
displayfaces();
if (messspawned == false) {
n = 0;
while (n < numbertogenerate) {
createMess("left");
createMess("right");
n++;
}
messspawned = true;
}
mrcomputer();
if (rubbishinplay == true) {
moveRubbish();
}
if (spacetimer < 0) {
if (k(kS)) {
performaction();
spacetimer = spacereset;
}
}
spacetimer--;
rubbishMeter();
runtimer();
if (random(700) == 1) {
if (leftwindow._currentframe == 1) {
leftwindow.play();
}
}
if (random(900) == 1) {
if (rightdoor._currentframe == 1) {
rightdoor.play();
}
}
if (_local1.leftwindowopen == true) {
openWindow("left");
}
if (_local1.rightdooropen == true) {
openWindow("right");
}
}
};
windowtimer = 0;
windowreset = 30;
whotouchedme = 0;
whotouchedmelast = 0;
touching = 0;
sidealign = false;
function mrcomputer() {
trace(currenttask);
if (currenttask == "search") {
compchar.charbody.gotoAndStop("stand");
if (_root.rightdooropen == true) {
if (random(2) == 1) {
currenttask = "shutdoor";
}
} else {
decidedirection();
if (cangletimer > 660) {
itemgoingto = "";
cangletimer = 0;
turndirection = "";
}
}
} else if (currenttask == "move") {
movecount--;
if (movecount < 0) {
currenttask = "search";
movecount = movereset;
}
movecomputer();
} else if (currenttask == "pickup") {
movecount = movereset;
collectthegoods();
} else if (currenttask == "aimrubbish") {
compchar.charbody.gotoAndStop("stand");
aimrubbish();
} else if (currenttask == "storeitem") {
compchar.charbody.gotoAndStop("stand");
findsomewhere();
} else if (currenttask == "putitaway") {
putitaway();
} else if (currenttask == "shutdoor") {
movecount = movereset;
compchar.charbody.gotoAndStop("stand");
finddoor();
} else if (currenttask == "shutitdamnit") {
shutthedoor();
} else if (currenttask == "middleman") {
movecount = movereset;
gettothemiddlebitch();
}
}
function shutthedoor() {
turndirection = "";
cxmov = dxmov;
cymov = dymov;
movecomputer();
compchar.char.body.gotoAndStop("walk");
if (compchar.proxchecker.hitTest(this[dtarget])) {
dtarget = "";
rightdoor.gotoAndStop(1);
meganclose();
currenttask = "search";
itemgoingto == "";
dtarget == "";
cangle = 999;
dangle = 999;
numfound == false;
typeinhand = "";
}
}
function gettothemiddlebitch() {
var _local1 = this;
if (middleanglecalced == false) {
mtarget = "middleman";
mxdiff = compchar._x - _local1[mtarget]._x;
mydiff = compchar._y - _local1[mtarget]._y;
mangle = Math.atan2(mydiff, mxdiff);
mangle = (mangle * 180) / Math.PI;
middleanglecalced == true;
}
if (movingtomiddle == true) {
mangle = ((compchar._rotation / 360) * 2) * Math.PI;
mxmov = (compspeed * Math.cos(mangle)) * -1;
mymov = (compspeed * Math.sin(mangle)) * -1;
compchar._x = compchar._x + mxmov;
compchar._y = compchar._y + mymov;
if (compchar.hitTest(_local1[mtarget])) {
movingtomiddle = false;
middleanglecalced = false;
currenttask = taskstored;
if (currenttask == "search") {
itemgoingto = "";
cangletimer = 0;
}
stuckcount = 0;
taskstored = "";
mangle = 999;
turndirection == "";
}
} else {
if (turndirection == "") {
turndirection = bestturn(compchar._rotation, mangle);
}
trace("middle lookin for =" + mangle);
trace(compchar._rotation);
if (turndirection == "clock") {
compchar._rotation = compchar._rotation + comprotspeed;
} else {
compchar._rotation = compchar._rotation - comprotspeed;
}
if ((compchar._rotation > (mangle - 8)) && (compchar._rotation < (mangle + 8))) {
movingtomiddle = true;
}
}
}
function finddoor() {
dtarget = "rightdoor";
xdiff = compchar._x - this[dtarget]._x;
ydiff = compchar._y - this[dtarget]._y;
dangle = Math.atan2(ydiff, xdiff);
dangle = (dangle * 180) / Math.PI;
if ((compchar._rotation > (dangle - 8)) && (compchar._rotation < (dangle + 8))) {
dangle = ((compchar._rotation / 360) * 2) * Math.PI;
dxmov = (compspeed * Math.cos(dangle)) * -1;
dymov = (compspeed * Math.sin(dangle)) * -1;
currenttask = "shutitdamnit";
dangle = 999;
turndirection == "";
} else {
if (turndirection == "") {
turndirection = bestturn(compchar._rotation, dangle);
dangletimer = 0;
}
if (turndirection == "clock") {
compchar._rotation = compchar._rotation + comprotspeed;
dangletimer = dangletimer + comprotspeed;
} else {
compchar._rotation = compchar._rotation - comprotspeed;
dangletimer = dangletimer + comprotspeed;
}
if (dangletimer > 560) {
dangletimer = 0;
taskstored = currenttask;
currenttask = "middleman";
}
}
}
function putitaway() {
turndirection = "";
movecomputer();
if (compchar.proxchecker.hitTest(this[ctarget])) {
if (ctarget == "cdcentre") {
sCds.start();
} else {
sPaperturn.start();
}
ctarget = "";
_root.itemholdingright.gotoAndStop(1);
itemgoingto = "";
typeinhand = "nothing";
currenttask = "search";
}
trace("put it away");
}
function findsomewhere() {
if (typeinhand == "cds") {
ctarget = "cdcentre";
} else {
ctarget = "wardcentre";
}
xdiff = compchar._x - this[ctarget]._x;
ydiff = compchar._y - this[ctarget]._y;
cangle = Math.atan2(ydiff, xdiff);
cangle = (cangle * 180) / Math.PI;
if ((compchar._rotation > (cangle - 8)) && (compchar._rotation < (cangle + 8))) {
cangle = ((compchar._rotation / 360) * 2) * Math.PI;
cxmov = (compspeed * Math.cos(cangle)) * -1;
cymov = (compspeed * Math.sin(cangle)) * -1;
currenttask = "putitaway";
cangle = 999;
} else {
if (turndirection == "") {
turndirection = bestturn(compchar._rotation, cangle);
}
if (turndirection == "clock") {
compchar._rotation = compchar._rotation + comprotspeed;
cangletimer = cangletimer + comprotspeed;
} else {
compchar._rotation = compchar._rotation - comprotspeed;
cangletimer = cangletimer - comprotspeed;
}
}
}
function aimrubbish() {
turndirection = "";
if ((compchar._rotation > -10) && (compchar._rotation < 10)) {
throwRubbish("compchar");
cangle = 999;
currenttask = "search";
} else {
if (turndirection == "") {
turndirection = bestturn(compchar._rotation, -180);
}
if (turndirection == "clock") {
compchar._rotation = compchar._rotation + comprotspeed;
cangletimer = cangletimer + comprotspeed;
} else {
compchar._rotation = compchar._rotation - comprotspeed;
cangletimer = cangletimer - comprotspeed;
}
}
}
function searchagain() {
}
function collectthegoods() {
var _local1 = this;
turndirection = "";
typeinhand = _local1[itemgoingto].messtype;
p = 0;
while (p < messonright.length) {
if (messonright[p] == _local1[itemgoingto].messnumber) {
erasenum = p;
}
p++;
}
sPickup.start();
messonright.splice(erasenum, 1);
_local1[itemgoingto].removeMovieClip();
_root.itemholdingright.gotoAndStop(2);
_root.itemholdingright.item.gotoAndStop(typeinhand);
if ((typeinhand == "rubbish") || (typeinhand == "rubbish2")) {
currenttask = "aimrubbish";
} else {
currenttask = "storeitem";
}
}
function movecomputer() {
var _local1 = this;
turndirection = "";
compchar.charbody.gotoAndStop("walk");
compcanmovex = true;
compcanmovey = true;
cpredictedx = compchar._x + cxmov;
cpredictedy = compchar._y + cymov;
compcharheight = compchar.charbody._height;
compcharwidth = compchar.charbody._width;
compchartop = cpredictedy - (compcharheight / 2);
compcharbottom = cpredictedy + (compcharheight / 2);
compcharleft = cpredictedx - (compcharheight / 2);
compcharright = cpredictedx + (compcharheight / 2);
compoutboundary = false;
compsettoedge = false;
i = 0;
while (i < itemsinroom.length) {
citemaddress = itemsinroom[i];
citemheight = _local1[citemaddress]._height;
citemwidth = _local1[citemaddress]._width;
citemx = _local1[citemaddress]._x;
citemy = _local1[citemaddress]._y;
citemtop = citemy;
citembottom = citemy + citemheight;
citemleft = citemx;
citemright = citemx + citemwidth;
if ((((compcharbottom > citemtop) && (compchartop < citembottom)) && (compcharright > citemleft)) && (compcharleft < citemright)) {
compcanmovey = false;
compcanmovex = false;
compdontmove = false;
if ((compoutboundary == false) && (compsettoedge == false)) {
newcompchartop = compchar._y - (charheight / 2);
newcompcharbottom = compchar._y + (charheight / 2);
newcompcharleft = compchar._x - (charwidth / 2);
newcompcharright = compchar._x + (charwidth / 2);
if ((newcompcharbottom > citemtop) && (newcompchartop < citembottom)) {
compcanmovey = true;
compsettoedge = true;
finditem = true;
} else if ((newcompcharright > citemleft) && (newcompcharleft < citemright)) {
compcanmovex = true;
compsettoedge = true;
finditem = true;
}
}
}
i++;
}
if (((compcanmovex == true) && (compcanmovey == false)) && (currenttask == "putitaway")) {
compbeensliding = true;
} else if (((compcanmovex == false) && (compcanmovey == true)) && (currenttask == "putitaway")) {
compbeensliding = true;
}
if ((((compcanmovex == true) && (compcanmovey == true)) && (compbeensliding == true)) && (currenttask == "putitaway")) {
compbeensliding = false;
currenttask = "storeitem";
}
if (((compcanmovex == true) && (compcanmovey == false)) && (currenttask == "pickup")) {
compbeenslidingsearch = true;
} else if (((compcanmovex == false) && (compcanmovey == true)) && (currenttask == "pickup")) {
compbeenslidingsearch = true;
}
if ((((compcanmovex == true) && (compcanmovey == true)) && (compbeenslidingsearch == true)) && (currenttask == "pickup")) {
compbeenslidingsearch = false;
currenttask = "search";
}
if (compcanmovex == true) {
compchar._x = compchar._x + cxmov;
}
if (compcanmovey == true) {
compchar._y = compchar._y + cymov;
}
if ((compcanmovey == false) && (compcanmovex == false)) {
if (typeinhand == "nothing") {
currenttask = "search";
} else {
currenttask = "storeitem";
}
stuckcount++;
} else if ((((compcanmovex == false) && (cymov < 1)) && (cymov > -1)) && (currenttask == "putitaway")) {
currenttask = "storeitem";
stuckcount++;
} else if ((((cxmov < 1) && (cxmov > -1)) && (compcanmovey == false)) && (currenttask == "putitaway")) {
currenttask = "storeitem";
stuckcount++;
} else if ((((compcanmovex == false) && (cymov < 1)) && (cymov > -1)) && (currenttask == "move")) {
currenttask = "search";
stuckcount++;
} else if ((((cxmov < 1) && (cxmov > -1)) && (compcanmovey == false)) && (currenttask == "move")) {
currenttask = "search";
stuckcount++;
} else {
stuckcount = 0;
}
if (stuckcount > 3) {
taskstored = currenttask;
currenttask = "middleman";
}
if (compchar.pickupspot.hitTest(_local1[itemgoingto])) {
currenttask = "pickup";
}
}
function decidedirection() {
var _local1 = this;
if ((itemgoingto == "") || (cangle == 999)) {
findme = random(messonright.length);
itemgoingto = "mess" + messonright[findme];
xdiff = compchar._x - _local1[itemgoingto]._x;
ydiff = compchar._y - _local1[itemgoingto]._y;
cangle = Math.atan2(ydiff, xdiff);
cangle = (cangle * 180) / Math.PI;
numfound = true;
if (isNaN(cangle) == true) {
numfound = false;
itemgoingto = "";
}
}
i = 0;
while (i < itemsinroom.length) {
citemaddress = itemsinroom[i];
citemheight = _local1[citemaddress]._height;
citemwidth = _local1[citemaddress]._width;
citemx = _local1[citemaddress]._x;
citemy = _local1[citemaddress]._y;
citemtop = citemy;
citembottom = citemy + citemheight;
citemleft = citemx;
citemright = citemx + citemwidth;
if ((((_local1[itemgoingto]._y > citemtop) && (_local1[itemgoingto]._y < citembottom)) && (_local1[itemgoingto]._x > citemleft)) && (_local1[itemgoingto]._x < citemright)) {
itemgoingto = "";
numfound = false;
}
i++;
}
if ((((_local1[itemgoingto]._y < startheight) || (_local1[itemgoingto]._y > maxheight)) || (_local1[itemgoingto]._x > maxright)) || (_local1[itemgoingto]._x < maxwidth)) {
itemgoingto = "";
numfound = false;
}
if (((compchar._rotation > (cangle - 8)) && (compchar._rotation < (cangle + 8))) && (numfound == true)) {
cangle = ((compchar._rotation / 360) * 2) * Math.PI;
cxmov = (compspeed * Math.cos(cangle)) * -1;
cymov = (compspeed * Math.sin(cangle)) * -1;
currenttask = "move";
cangletimer = 0;
} else if ((messonright.length > 0) && (numfound == true)) {
if (turndirection == "") {
turndirection = bestturn(compchar._rotation, cangle);
}
if (turndirection == "clock") {
compchar._rotation = compchar._rotation + comprotspeed;
cangletimer = cangletimer + comprotspeed;
} else {
compchar._rotation = compchar._rotation - comprotspeed;
cangletimer = cangletimer - comprotspeed;
}
}
}
function bestturn(currentangle, targetangle) {
var _local1 = currentangle;
var _local2 = targetangle;
if (_local1 < 0) {
_local1 = _local1 * -1;
_local1 = _local1 + 180;
}
if (_local2 < 0) {
_local2 = _local2 * -1;
_local2 = _local2 + 180;
}
if (_local2 > _local1) {
clockdif = _local2 - _local1;
} else {
clockdif = _local1 - _local2;
}
anticlockdif = 360 - clockdif;
if (anticlockdif < clockdif) {
return("anticlock");
}
return("clock");
}
compchar.swapDepths(10001);
compspeed = 8;
comprotspeed = 9;
itemgoingto = "";
typeinhand = "";
cxmov = 0;
cymov = 0;
currenttask = "search";
ctarget = "";
compholding = "";
compbeensliding = false;
compbeenslidingsearch = false;
cangletimer = 0;
turndirection = "";
findputaway = false;
finditem = false;
movecount = 0;
movereset = 80;
stuckcount = 0;
taskstored = "";
movingtomiddle = false;
middleanglecalced = false;
dtarget = "";
numfound = true;
function meganopen() {
stemp = random(2);
if (stemp == 1) {
sHeyGuys.start();
} else {
sWhyareyouinourroom.start();
}
}
function meganclose() {
stemp = random(2);
if (stemp == 1) {
sIhateher.start();
} else {
sMegan.start();
}
sdoor.start();
}
function picksound() {
r = random(5);
if (r == 1) {
sGroundyou.start();
} else if (r == 2) {
sOhman.start();
} else if (r == 3) {
sScream.start();
} else if (r == 4) {
sEvil.start();
} else {
sIgotit.start();
}
}
function displayfaces() {
var _local1 = _parent;
if (leftpercent < 20) {
_local1.drakemov.gotoAndStop("loosingloads");
_local1.joshmov.gotoAndStop("winningloads");
if (timesincelastsound < 0) {
timesincelastsound = timereset + random(200);
}
} else if (leftpercent < 45) {
_local1.drakemov.gotoAndStop("loosing");
_local1.joshmov.gotoAndStop("winning");
if (timesincelastsound < 0) {
picksound();
timesincelastsound = timereset + random(200);
}
} else if (leftpercent < 55) {
_local1.drakemov.gotoAndStop("equal");
_local1.joshmov.gotoAndStop("equal");
if (timesincelastsound < 0) {
picksound();
timesincelastsound = timereset + random(200);
}
} else if (leftpercent < 80) {
_local1.drakemov.gotoAndStop("winning");
_local1.joshmov.gotoAndStop("loosing");
if (timesincelastsound < 0) {
picksound();
timesincelastsound = timereset + random(200);
}
} else {
_local1.drakemov.gotoAndStop("winningloads");
_local1.joshmov.gotoAndStop("loosingloads");
if (timesincelastsound < 0) {
picksound();
timesincelastsound = timereset + random(200);
}
}
timesincelastsound--;
}
timereset = 120;
timesincelastsound = timereset;
sEvil = new Sound();
sEvil.attachSound("evil");
sGroundyou = new Sound();
sGroundyou.attachSound("groundyou");
sHeyguys = new Sound();
sHeyguys.attachSound("heyguys");
sIgotit = new Sound();
sIgotit.attachSound("igotit");
sIhateher = new Sound();
sIhateher.attachSound("ihateher");
sMegan = new Sound();
sMegan.attachSound("megan");
sOhman = new Sound();
sOhman.attachSound("ohman");
sScream = new Sound();
sScream.attachSound("scream");
sdoor = new Sound();
sdoor.attachSound("doorclose");
sCrumple = new Sound();
sCrumple.attachSound("crumple");
sCds = new Sound();
sCds.attachSound("cds");
sThrow = new Sound();
sThrow.attachSound("throw");
sPickup = new Sound();
sPickup.attachSound("pickup");
sDrop = new Sound();
sDrop.attachSound("drop");
sPaperturn = new Sound();
sPaperturn.attachSound("paperturn");
sWhyareyouinourroom = new Sound();
sWhyareyouinourroom.attachSound("whyareyouinourroom");
Instance of Symbol 387 MovieClip "invis2" in Symbol 453 MovieClip Frame 1
onClipEvent (load) {
_parent.itemsinroom.push("invis2");
}
Instance of Symbol 389 MovieClip "border6" in Symbol 453 MovieClip Frame 1
onClipEvent (load) {
_parent.itemsinroom.push("border6");
}
Instance of Symbol 279 MovieClip "leftrack" in Symbol 453 MovieClip Frame 1
onClipEvent (load) {
_parent.itemsinroom.push("leftrack");
}
Instance of Symbol 296 MovieClip "bed" in Symbol 453 MovieClip Frame 1
onClipEvent (load) {
_parent.itemsinroom.push("bed");
}
Instance of Symbol 281 MovieClip "leftbin" in Symbol 453 MovieClip Frame 1
onClipEvent (load) {
_parent.itemsinroom.push("leftbin");
}
Instance of Symbol 395 MovieClip "leftwindow" in Symbol 453 MovieClip Frame 1
/* no clip actions */
Instance of Symbol 279 MovieClip "rightrack" in Symbol 453 MovieClip Frame 1
onClipEvent (load) {
_parent.itemsinroom.push("rightrack");
}
Instance of Symbol 281 MovieClip "rightbin" in Symbol 453 MovieClip Frame 1
onClipEvent (load) {
_parent.itemsinroom.push("rightbin");
}
Instance of Symbol 405 MovieClip "bedtwo" in Symbol 453 MovieClip Frame 1
onClipEvent (load) {
_parent.itemsinroom.push("bedtwo");
}
Instance of Symbol 411 MovieClip "chest" in Symbol 453 MovieClip Frame 1
onClipEvent (load) {
_parent.itemsinroom.push("chest");
}
Instance of Symbol 413 MovieClip "doorinvis" in Symbol 453 MovieClip Frame 1
onClipEvent (load) {
_parent.itemsinroom.push("doorinvis");
}
Instance of Symbol 417 MovieClip "amp" in Symbol 453 MovieClip Frame 1
onClipEvent (load) {
_parent.itemsinroom.push("amp");
}
Instance of Symbol 424 MovieClip "rightdoor" in Symbol 453 MovieClip Frame 1
onClipEvent (load) {
_parent.itemsinroom.push("rightdoor");
}
Instance of Symbol 426 MovieClip "border5" in Symbol 453 MovieClip Frame 1
onClipEvent (load) {
_parent.itemsinroom.push("border5");
}
Instance of Symbol 428 MovieClip "bound" in Symbol 453 MovieClip Frame 1
onClipEvent (load) {
_parent.itemsinroom.push("bound");
}
Instance of Symbol 430 MovieClip "keepout" in Symbol 453 MovieClip Frame 1
onClipEvent (load) {
_parent.itemsinroom.push("keepout");
}
Instance of Symbol 273 MovieClip "wardrobe" in Symbol 453 MovieClip Frame 1
onClipEvent (load) {
_parent.itemsinroom.push("wardrobe");
}
Instance of Symbol 448 MovieClip "cdcentre" in Symbol 453 MovieClip Frame 1
/* no clip actions */
Instance of Symbol 448 MovieClip "wardcentre" in Symbol 453 MovieClip Frame 1
/* no clip actions */
Instance of Symbol 450 MovieClip in Symbol 453 MovieClip Frame 1
onClipEvent (load) {
this.swapDepths(10010);
}
Instance of Symbol 452 MovieClip "roomtidyend" in Symbol 453 MovieClip Frame 1
onClipEvent (load) {
this.swapDepths(10018);
}
Symbol 453 MovieClip Frame 5
function mrcomputer() {
if (currenttask == "search") {
compchar.charbody.gotoAndStop("stand");
if (_root.rightdooropen == true) {
if (random(3) == 1) {
currenttask = "shutdoor";
}
} else {
decidedirection();
if (cangletimer > 360) {
itemgoingto = "";
cangletimer = 0;
turndirection = "";
}
}
} else if (currenttask == "move") {
movecomputer();
} else if (currenttask == "pickup") {
collectthegoods();
} else if (currenttask == "aimrubbish") {
aimrubbish();
} else if (currenttask == "storeitem") {
findsomewhere();
} else if (currenttask == "putitaway") {
putitaway();
} else if (currenttask == "shutdoor") {
finddoor();
} else if (currenttask == "shutitdamnit") {
shutthedoor();
}
}
function shutthedoor() {
turndirection = "";
compchar._x = compchar._x + dxmov;
compchar._y = compchar._y + dymov;
compchar.char.body.gotoAndStop("walk");
if (compchar.proxchecker.hitTest(this[dtarget])) {
dtarget = "";
rightdoor.gotoAndStop(1);
currenttask = "search";
itemgoingto == "";
dtarget == "";
cangle = 999;
dangle = 999;
numfound == false;
typeinhand = "";
}
}
function finddoor() {
if (dtarget == "") {
dtarget = "rightdoor";
xdiff = compchar._x - this[dtarget]._x;
ydiff = compchar._y - this[dtarget]._y;
dangle = Math.atan2(ydiff, xdiff);
dangle = (dangle * 180) / Math.PI;
}
if ((compchar._rotation > (dangle - 5)) && (compchar._rotation < (dangle + 5))) {
dangle = ((compchar._rotation / 360) * 2) * Math.PI;
dxmov = (compspeed * Math.cos(dangle)) * -1;
dymov = (compspeed * Math.sin(dangle)) * -1;
currenttask = "shutitdamnit";
dangle = 999;
turndirection == "";
} else {
if (turndirection == "") {
turndirection = bestturn(compchar._rotation, dangle);
}
if (turndirection == "clock") {
compchar._rotation = compchar._rotation + comprotspeed;
dangletimer = dangletimer + comprotspeed;
} else {
compchar._rotation = compchar._rotation - comprotspeed;
dangletimer = dangletimer - comprotspeed;
}
}
}
function putitaway() {
turndirection = "";
compchar._x = compchar._x + cxmov;
compchar._y = compchar._y + cymov;
if (compchar.proxchecker.hitTest(this[ctarget])) {
ctarget = "";
_root.itemholdingright.gotoAndStop(1);
itemgoingto = "";
typeinhand = "nothing";
currenttask = "search";
}
}
function findsomewhere() {
if (ctarget == "") {
if (typeinhand == "cds") {
ctarget = "rightrack";
} else {
ctarget = "wardrobe";
}
xdiff = compchar._x - this[ctarget]._x;
ydiff = compchar._y - this[ctarget]._y;
cangle = Math.atan2(ydiff, xdiff);
cangle = (cangle * 180) / Math.PI;
}
if ((compchar._rotation > (cangle - 5)) && (compchar._rotation < (cangle + 5))) {
cangle = ((compchar._rotation / 360) * 2) * Math.PI;
cxmov = (compspeed * Math.cos(cangle)) * -1;
cymov = (compspeed * Math.sin(cangle)) * -1;
currenttask = "putitaway";
cangle = 999;
} else {
if (turndirection == "") {
turndirection = bestturn(compchar._rotation, cangle);
}
if (turndirection == "clock") {
compchar._rotation = compchar._rotation + comprotspeed;
cangletimer = cangletimer + comprotspeed;
} else {
compchar._rotation = compchar._rotation - comprotspeed;
cangletimer = cangletimer - comprotspeed;
}
}
}
function aimrubbish() {
turndirection = "";
if ((compchar._rotation > -10) && (compchar._rotation < 10)) {
throwRubbish("compchar");
cangle = 999;
currenttask = "search";
} else {
compchar._rotation = compchar._rotation + comprotspeed;
}
}
function collectthegoods() {
var _local1 = this;
turndirection = "";
typeinhand = _local1[itemgoingto].messtype;
p = 0;
while (p < messonright.length) {
if (messonright[p] == _local1[itemgoingto].messnumber) {
erasenum = p;
}
p++;
}
messonright.splice(erasenum, 1);
_local1[itemgoingto].removeMovieClip();
_root.itemholdingright.gotoAndStop(2);
_root.itemholdingright.item.gotoAndStop(typeinhand);
if ((typeinhand == "rubbish") || (typeinhand == "rubbish2")) {
currenttask = "aimrubbish";
} else {
currenttask = "storeitem";
}
}
function movecomputer() {
turndirection = "";
compchar._x = compchar._x + cxmov;
compchar._y = compchar._y + cymov;
if (compchar.pickupspot.hitTest(this[itemgoingto])) {
currenttask = "pickup";
}
}
function decidedirection() {
var _local1 = this;
if ((itemgoingto == "") || (cangle == 999)) {
findme = random(messonright.length);
itemgoingto = "mess" + messonright[findme];
xdiff = compchar._x - _local1[itemgoingto]._x;
ydiff = compchar._y - _local1[itemgoingto]._y;
cangle = Math.atan2(ydiff, xdiff);
cangle = (cangle * 180) / Math.PI;
numfound = true;
if (isNaN(cangle) == true) {
numfound = false;
itemgoingto = "";
}
}
i = 0;
while (i < itemsinroom.length) {
itemaddress = itemsinroom[i];
itemheight = _local1[itemaddress]._height;
itemwidth = _local1[itemaddress]._width;
itemx = _local1[itemaddress]._x;
itemy = _local1[itemaddress]._y;
itemtop = itemy;
itembottom = itemy + itemheight;
itemleft = itemx;
itemright = itemx + itemwidth;
if ((((_local1[itemgoingto]._y > itemtop) && (_local1[itemgoingto]._y < itembottom)) && (_local1[itemgoingto]._x > itemleft)) && (_local1[itemgoingto]._x < itemright)) {
itemgoingto = "";
numfound = false;
}
i++;
}
if ((((_local1[itemgoingto]._y < startheight) || (_local1[itemgoingto]._y > maxheight)) || (_local1[itemgoingto]._x > maxright)) || (_local1[itemgoingto]._x < maxwidth)) {
itemgoingto = "";
numfound = false;
}
if (((compchar._rotation > (cangle - 5)) && (compchar._rotation < (cangle + 5))) && (numfound == true)) {
cangle = ((compchar._rotation / 360) * 2) * Math.PI;
cxmov = (compspeed * Math.cos(cangle)) * -1;
cymov = (compspeed * Math.sin(cangle)) * -1;
currenttask = "move";
} else if ((messonright.length > 0) && (numfound == true)) {
if (turndirection == "") {
turndirection = bestturn(compchar._rotation, cangle);
}
if (turndirection == "clock") {
compchar._rotation = compchar._rotation + comprotspeed;
cangletimer = cangletimer + comprotspeed;
} else {
compchar._rotation = compchar._rotation - comprotspeed;
cangletimer = cangletimer - comprotspeed;
}
}
}
function bestturn(currentangle, targetangle) {
var _local1 = currentangle;
var _local2 = targetangle;
if (_local1 < 0) {
_local1 = _local1 * -1;
_local1 = _local1 + 180;
}
if (_local2 < 0) {
_local2 = _local2 * -1;
_local2 = _local2 + 180;
}
if (_local2 > _local1) {
clockdif = _local2 - _local1;
} else {
clockdif = _local1 - _local2;
}
anticlockdif = 360 - clockdif;
if (anticlockdif < clockdif) {
return("anticlock");
}
return("clock");
}
compchar.swapDepths(10001);
compspeed = 8;
comprotspeed = 6;
itemgoingto = "";
typeinhand = "";
cxmov = 0;
cymov = 0;
currenttask = "search";
ctarget = "";
compholding = "";
cangletimer = 0;
turndirection = "";
dtarget = "";
numfound = true;
Symbol 467 Button
on (release) {
_root.gotoAndStop("startmenu");
}
Symbol 468 MovieClip Frame 1
stop();
Symbol 468 MovieClip Frame 16
stop();
Symbol 470 MovieClip Frame 1
playx = 9;
playy = 11;
stop();
Symbol 470 MovieClip Frame 2
trace("show movie is playin");
Symbol 470 MovieClip Frame 31
holder.play();
stop();
Symbol 470 MovieClip Frame 39
_parent.dancegame.loadNextMovie();
Symbol 470 MovieClip Frame 44
_root.pauseforvid = false;
Symbol 487 MovieClip Frame 1
stop();
Symbol 487 MovieClip Frame 100
stop();
this.gotoAndStop(1);
_root.pauseforvid = false;
Symbol 487 MovieClip Frame 199
stop();
this.gotoAndStop(1);
if (_root.oneplayer == "two") {
if (_root.room.joshmovie._currentframe == 2) {
_root.room.joshmovie.play();
} else {
_root.room.drakemovie.play();
}
} else {
_root.room.roomtidyend.play();
}
Symbol 487 MovieClip Frame 300
stop();
this.gotoAndStop(1);
if (_root.oneplayer == "two") {
if (_root.room.joshmovie._currentframe == 2) {
_root.room.joshmovie.play();
} else {
_root.room.drakemovie.play();
}
} else {
_root.room.roomtidyend.play();
}
Symbol 487 MovieClip Frame 400
stop();
gametwointroplayed = true;
if (_root.secondgameover == true) {
_root.gameoverhigh.play();
}
if (_root.oneplayer == "josh") {
_root.danceexit.movieholder.loadMovie("dancejoshout.swf");
} else {
_root.danceexit.movieholder.loadMovie("dancedrakeout.swf");
}
_root.pauseforvid = false;
this.gotoAndStop(1);
Symbol 487 MovieClip Frame 500
stop();
gametwointroplayed = true;
if (_root.secondgameover == true) {
_root.gameoverhigh.play();
}
if (_root.oneplayer == "josh") {
_root.danceexit.movieholder.loadMovie("dancejoshout.swf");
} else {
_root.danceexit.movieholder.loadMovie("dancedrakeout.swf");
}
_root.pauseforvid = false;
this.gotoAndStop(1);
Symbol 487 MovieClip Frame 599
Symbol 487 MovieClip Frame 699
trace("exit all");
stop();
_root.danceexit.play();
this.gotoAndStop(1);
Symbol 487 MovieClip Frame 801
stop();
trace("exit play");
if (_root.oneplayer == "two") {
_root.danceexittwo.play();
} else {
_root.danceexit.play();
}
this.gotoAndStop(1);
Symbol 494 MovieClip Frame 1
function runtimer() {
var _local1 = _root;
framecount--;
if (framecount < 0) {
seconds--;
framecount = framereset;
if (seconds == 0) {
delete _local1.onEnterFrame;
char.charbody.gotoAndStop("stand");
compchar.charbody.gotoAndStop("stand");
roomtidyend.play();
_local1.pauseforvid = true;
}
}
_local1.countdown = seconds;
}
function performaction() {
var _local1 = _root;
itempickedup = false;
if (char.proxchecker.hitTest(rightdoor) && (rightdoor._currentframe > 1)) {
rightdoor.gotoAndStop(1);
meganclose();
itempickedup = true;
} else if (charholdingleft != "nothing") {
pcheck = checkProx("left");
if (pcheck != "") {
if ((charholdingleft == "rubbish") || (charholdingleft == "rubbish2")) {
if (pcheck == "leftbin") {
sCrumple.start();
charholdingleft = "nothing";
_local1.itemholdingrightright.gotoAndStop(1);
itempickedup = true;
}
} else if ((charholdingleft == "clothes") || (charholdingleft == "clothes2")) {
if (pcheck == "wardrobe") {
sPaperturn.start();
charholdingleft = "nothing";
_local1.itemholdingright.gotoAndStop(1);
itempickedup = true;
}
} else if ((charholdingleft == "cds") && (pcheck == "rightrack")) {
sCds.start();
charholdingleft = "nothing";
_local1.itemholdingright.gotoAndStop(1);
itempickedup = true;
}
}
} else if (charholdingleft == "nothing") {
pickUpItem("right");
itempickedup = true;
}
if (itempickedup == false) {
if ((charholdingleft == "rubbish") || (charholdingleft == "rubbish2")) {
throwRubbish("char");
} else {
dropItem("right");
}
}
}
function openWindow(side) {
if (windowtimer < 1) {
if (side == "left") {
throwRubbish("leftwindow");
} else {
throwRubbish("rightdoor");
}
windowtimer = windowreset;
} else {
windowtimer--;
}
}
function checkProx(side) {
var _local1 = this;
if (side == "left") {
i = 0;
while (i < itemsinroom.length) {
itemname = itemsinroom[i];
if (itemname == "leftbin") {
if (char.proxchecker.hitTest(_local1[itemname])) {
return("leftbin");
}
} else if (itemname == "rightrack") {
if (char.proxchecker.hitTest(_local1[itemname])) {
return("rightrack");
}
} else if (itemname == "wardrobe") {
if (char.proxchecker.hitTest(_local1[itemname])) {
return("wardrobe");
}
}
i++;
}
}
return(undefined);
}
function moveRubbish() {
var _local1 = this;
r = 0;
while (r < rubbishballs.length) {
rname = "rubbish" + rubbishballs[r];
_local1[rname]._x = _local1[rname]._x + _local1[rname].xmov;
_local1[rname]._y = _local1[rname]._y + _local1[rname].ymov;
_local1[rname]._rotation = _local1[rname]._rotation + _local1[rname].rot;
if (_local1[rname]._y < startheight) {
_local1[rname].ymov = _local1[rname].ymov * -1;
} else if (_local1[rname]._y > maxheight) {
_local1[rname].ymov = _local1[rname].ymov * -1;
} else if (_local1[rname]._x < startwidth) {
_local1[rname].xmov = _local1[rname].xmov * -1;
} else if (_local1[rname]._x > maxright) {
_local1[rname].xmov = _local1[rname].xmov * -1;
}
_local1[rname].distancetravelled = _local1[rname].distancetravelled + _local1[rname].travelling;
if (_local1[rname].distancetravelled < _local1[rname].halfway) {
_local1[rname]._xscale = _local1[rname]._xscale + 2;
_local1[rname]._yscale = _local1[rname]._yscale + 2;
} else {
_local1[rname]._xscale = _local1[rname]._xscale - 2;
_local1[rname]._yscale = _local1[rname]._yscale - 2;
}
if (_local1[rname].distancetravelled > _local1[rname].totaldistance) {
newball = "mess" + depth;
attachMovie("mess", newball, depth);
_local1[newball]._x = _local1[rname]._x;
_local1[newball]._y = _local1[rname]._y;
_local1[newball]._rotation = _local1[rname]._rotation;
if (_local1[rname].plane == true) {
_local1[newball].gotoAndStop("rubbish2");
_local1[newball].messtype = "rubbish2";
_local1[newball].mframe = "rubbish2";
} else {
_local1[newball].gotoAndStop("rubbish");
_local1[newball].messtype = "rubbish";
_local1[newball].mframe = "rubbish";
}
if (_local1[rname]._x > maxwidth) {
messonright.push(depth);
} else {
messonleft.push(depth);
}
_local1[rname].removeMovieClip();
rubbishballs.splice(r, 1);
depth++;
}
r++;
}
if (rubbishballs.length == 0) {
rubbishinplay = false;
}
}
function throwRubbish(from) {
var _local1 = this;
var _local2 = from;
rubbish = "rubbish" + depth;
attachMovie("mess", rubbish, depth);
_local1[rubbish].gotoAndStop("rubbish");
_local1[rubbish].plane = false;
if (_local2 == "char") {
if (charholdingleft == "rubbish2") {
_local1[rubbish].gotoAndStop("rubbish2");
_local1[rubbish].plane = true;
}
}
if (_local2 == "compchar") {
if (charholdingcomp == "rubbish2") {
_local1[rubbish].gotoAndStop("rubbish2");
_local1[rubbish].plane = true;
}
}
if (_local2 == "char") {
rangle = ((char._rotation / 360) * 2) * Math.PI;
rubtargetx = rspeed * Math.sin(rangle);
rubtargety = (-rspeed) * Math.cos(rangle);
_local1[rubbish]._x = char._x;
_local1[rubbish]._y = char._y;
_local1[rubbish].totaldistance = random(100) + 250;
if (_local1[rubbish].plane == false) {
_local1[rubbish].rot = random(20) - 10;
} else {
_local1[rubbish]._rotation = char._rotation;
}
charholdingleft = "nothing";
char.charbody.gotoAndStop("throw");
_root.itemholdingright.gotoAndStop(1);
} else if (_local2 == "compchar") {
rangle = (((compchar._rotation / 360) * 2) * Math.PI) - 90;
rubtargetx = rspeed * Math.sin(rangle);
rubtargety = (-rspeed) * Math.cos(rangle);
_local1[rubbish]._x = compchar._x;
_local1[rubbish]._y = compchar._y;
_local1[rubbish].totaldistance = random(100) + 250;
if (_local1[rubbish].plane == false) {
_local1[rubbish].rot = random(20) - 10;
} else {
_local1[rubbish]._rotation = compchar._rotation - 90;
}
compchar.charbody.gotoAndStop("throw");
itemgoingto = "";
charholdingcomp = "";
_root.itemholding.gotoAndStop(1);
} else {
_local1[rubbish].rot = random(20) - 10;
if (_local2 == "leftwindow") {
_local1[rubbish]._x = leftwindow._x + (leftwindow._width / 2);
_local1[rubbish]._y = leftwindow._y;
windowangle = random(135) - 180;
rangle = ((windowangle / 360) * 2) * Math.PI;
rubtargetx = rspeed * Math.sin(rangle);
rubtargety = (-rspeed) * Math.cos(rangle);
} else {
_local1[rubbish]._x = rightdoor._x;
_local1[rubbish]._y = rightdoor._y;
windowangle = random(40);
rangle = ((windowangle / 360) * 2) * Math.PI;
rubtargetx = rspeed * Math.sin(rangle);
rubtargety = (-rspeed) * Math.cos(rangle);
}
_local1[rubbish].totaldistance = random(300) + 50;
}
_local1[rubbish].angle = rangle;
_local1[rubbish].xmov = rubtargetx;
_local1[rubbish].ymov = rubtargety;
dtravelled = Math.sqrt((rubtargetx * rubtargetx) + (rubtargety * rubtargety));
_local1[rubbish].travelling = dtravelled;
if (_local1[rubbish].travelling < 0) {
_local1[rubbish].travelling = _local1[rubbish].travelling * -1;
}
_local1[rubbish].distancetravelled = 0;
_local1[rubbish].halfway = _local1[rubbish].totaldistance / 2;
rubbishinplay = true;
rubbishballs.push(depth);
sThrow.start();
depth++;
}
function dropItem(side) {
var _local1 = this;
sDrop.start();
messtodrop = charholdingleft;
messname = "mess" + depth;
attachMovie("mess", messname, depth);
_local1[messname].gotoAndStop(charholdingleft);
_local1[messname]._x = char._x;
_local1[messname]._y = char._y;
_local1[messname]._rotation = random(360);
_local1[messname].messtype = charholdingleft;
if (side == "left") {
messonleft.push(depth);
} else {
messonright.push(depth);
}
depth++;
charholdingleft = "nothing";
_root.itemholdingright.gotoAndStop(1);
}
function pickUpItem(side) {
var _local1 = this;
var _local2 = _root;
if (side == "left") {
arraypointer = messonleft;
} else {
arraypointer = messonright;
}
m = 0;
while (m < arraypointer.length) {
messname = "mess" + arraypointer[m];
if (_local1[messname].hitTest(char.pickupspot)) {
sPickup.start();
_local2.itemholdingright.gotoAndStop(2);
_local2.itemholdingright.item.gotoAndStop(_local1[messname].messtype);
charholdingleft = _local1[messname].messtype;
charitemholdingrightframe = _local1[messname].mframe;
_local1[messname].removeMovieClip();
arraypointer.splice(m, 1);
return;
}
m++;
}
}
function createMess(side) {
var _local1 = this;
if (side == "left") {
mtop = startheight;
mbottom = maxheight;
mleft = startwidth;
mright = maxwidth;
messonleft.push(depth);
} else {
mtop = startheight;
mbottom = maxheight;
mleft = maxwidth;
mright = maxright;
messonright.push(depth);
}
positionfound = false;
newname = "mess" + depth;
_local1.attachMovie("mess", newname, depth);
mtype = random(5) + 1;
myframe = mtype;
if (mtype == 1) {
messis = "rubbish";
}
if (mtype == 2) {
messis = "clothes";
}
if (mtype == 3) {
messis = "cds";
}
if (mtype == 4) {
messis = "rubbish2";
}
if (mtype == 5) {
messis = "clothes2";
}
_local1[newname].gotoAndStop(myframe);
_local1[newname]._rotation = random(360);
while (positionfound == false) {
xpos = random(int(mright - mleft)) + mleft;
ypos = random(int(mbottom - mtop)) + mtop;
messtop = ypos;
messbottom = ypos + _local1[newname]._height;
messleft = xpos;
messright = xpos + _local1[newname]._width;
onitem = false;
i = 0;
while (i < itemsinroom.length) {
itemaddress = itemsinroom[i];
itemheight = _local1[itemaddress]._height;
itemwidth = _local1[itemaddress]._width;
itemx = _local1[itemaddress]._x;
itemy = _local1[itemaddress]._y;
itemtop = itemy;
itembottom = itemy + itemheight;
itemleft = itemx;
itemright = itemx + itemwidth;
if ((((messbottom > itemtop) && (messtop < itembottom)) && (messright > itemleft)) && (messleft < itemright)) {
onitem = true;
}
i++;
}
if (onitem == false) {
positionfound = true;
}
}
_local1[newname]._x = xpos;
_local1[newname]._y = ypos;
_local1[newname].messtype = messis;
_local1[newname].messnumber = depth;
depth++;
}
function controlChar(charaddress) {
var _local1 = this;
var _local2 = charaddress;
touching = 0;
chartargetx = _local2._x;
chartargety = _local2._y;
positionchange = false;
sidealign = false;
if (k(kR)) {
_local2._rotation = _local2._rotation + rotationspeed;
} else if (k(kL)) {
_local2._rotation = _local2._rotation - rotationspeed;
}
if (k(kU)) {
angle = ((_local2._rotation / 360) * 2) * Math.PI;
chartargetx = chartargetx + (walkspeed * Math.sin(angle));
chartargety = chartargety + ((-walkspeed) * Math.cos(angle));
positionchange = true;
} else if (k(kD)) {
angle = ((_local2._rotation / 360) * 2) * Math.PI;
chartargetx = chartargetx - (walkspeed * Math.sin(angle));
chartargety = chartargety - ((-walkspeed) * Math.cos(angle));
positionchange = true;
}
if (positionchange == true) {
canmovex = true;
canmovey = true;
chartop = chartargety - (charheight / 2);
charbottom = chartargety + (charheight / 2);
charleft = chartargetx - (charwidth / 2);
charright = chartargetx + (charwidth / 2);
outboundary = false;
if ((chartop < startheight) || (charbottom > maxheight)) {
canmovey = false;
dontmove = false;
dontmove = checkitemsagain("nowt");
if (dontmove == "nob") {
canmovex = false;
} else if (char._y < (startheight + 100)) {
}
outboundary = true;
}
if ((charleft < maxwidth) || (charright > maxright)) {
canmovex = false;
dontmove = false;
dontmove = checkitemsagain("nowt");
if (dontmove == "nob") {
canmovey = false;
}
outboundary = true;
}
settoedge = false;
i = 0;
while (i < itemsinroom.length) {
itemaddress = itemsinroom[i];
itemheight = _local1[itemaddress]._height;
itemwidth = _local1[itemaddress]._width;
itemx = _local1[itemaddress]._x;
itemy = _local1[itemaddress]._y;
itemtop = itemy;
itembottom = itemy + itemheight;
itemleft = itemx;
itemright = itemx + itemwidth;
if ((((charbottom > itemtop) && (chartop < itembottom)) && (charright > itemleft)) && (charleft < itemright)) {
touching++;
canmovey = false;
canmovex = false;
whotouchedme++;
charycentre = chartargety;
charxcentre = chartargetx;
dontmove = false;
dontmove = checkitemsagain(_local1[itemaddress]._name);
if ((((outboundary == false) && (settoedge == false)) && (whotouchedmelast < 2)) && (dontmove != "nob")) {
chartop = char._y - (charheight / 2);
charbottom = char._y + (charheight / 2);
charleft = char._x - (charwidth / 2);
charright = char._x + (charwidth / 2);
if ((((charbottom > itemtop) && (chartop < itembottom)) && (sidealign == false)) && (touching < 2)) {
canmovey = true;
settoedge = true;
if (char._x < itemx) {
sidealign = true;
} else {
sidealign = true;
}
} else if ((((charright > itemleft) && (charleft < itemright)) && (sidealign == false)) && (touching < 2)) {
canmovex = true;
settoedge = true;
if (char._y < itemy) {
sidealign = true;
} else {
sidealign = true;
}
}
}
}
i++;
}
whotouchedmelast = whotouchedme;
whotouchedme = 0;
if (touching > 1) {
canmovex = false;
canmovey = false;
}
if (canmovex == true) {
_local2._x = chartargetx;
char.charbody.gotoAndStop("walk");
}
if (canmovey == true) {
_local2._y = chartargety;
char.charbody.gotoAndStop("walk");
} else if (canmovex == false) {
}
} else {
char.charbody.gotoAndStop("stand");
}
}
function checkitemsagain(notthis) {
var _local1 = this;
var _local2 = notthis;
i = 0;
while (i < itemsinroom.length) {
thitemaddress = itemsinroom[i];
thitemheight = _local1[thitemaddress]._height;
thitemwidth = _local1[thitemaddress]._width;
thitemx = _local1[thitemaddress]._x;
thitemy = _local1[thitemaddress]._y;
thitemtop = thitemy;
thitembottom = thitemy + thitemheight;
thitemleft = thitemx;
thitemright = thitemx + thitemwidth;
if (((((charbottom > thitemtop) && (chartop < thitembottom)) && (charright > thitemleft)) && (charleft < thitemright)) && (_local2 != _local1[thitemaddress]._name)) {
return("nob");
}
i++;
}
return(undefined);
}
function rubbishMeter() {
var _local1 = _root;
totalamount = messonleft.length + messonright.length;
leftpercent = (messonleft.length / totalamount) * 100;
_local1.lp = leftpercent;
pixpercent = (rml / 100) * leftpercent;
_local1.leftp = int(leftpercent) + "%";
_local1.rightp = (100 - int(leftpercent)) + "%";
_local1.rubbishmeter.meterbar._x = pixpercent;
_local1.rubbishmeter.barmask._x = pixpercent;
}
stop();
startwidth = 0;
startheight = 0;
maxheight = floor._height;
maxright = floor._width;
maxwidth = boundary._x;
charheight = char.charbody._height;
charwidth = charheight;
char.swapDepths(10000);
rotationspeed = 10;
walkspeed = 6;
charholdingleft = "nothing";
itemsinroom = [];
messonleft = [];
messonright = [];
rubbishinplay = false;
rubbishballs = [];
var k = Key.isDown;
var kU = 38;
var kD = 40;
var kL = 37;
var kR = 39;
var kS = 32;
rml = _root.rubbishmeter._width;
_root.rubbishmeter.meterbar._x = 0;
depth = 10;
messspawned = false;
numbertogenerate = 20;
spacetimer = 0;
spacereset = 5;
rthrowdistance = 120;
rpeak = 50;
rspeed = 5;
seconds = 60;
framecount = 0;
framereset = 30;
_root.onEnterFrame = function () {
var _local1 = _root;
if (_local1.pauseforvid == false) {
controlChar(char);
displayfaces();
if (messspawned == false) {
n = 0;
while (n < numbertogenerate) {
createMess("left");
createMess("right");
n++;
}
messspawned = true;
}
mrcomputer();
if (rubbishinplay == true) {
moveRubbish();
}
if (spacetimer < 0) {
if (k(kS)) {
performaction();
spacetimer = spacereset;
}
}
spacetimer--;
rubbishMeter();
runtimer();
if (random(200) == 1) {
if (leftwindow._currentframe == 1) {
leftwindow.play();
}
}
if (random(900) == 1) {
if (rightdoor._currentframe == 1) {
rightdoor.play();
}
}
if (_local1.leftwindowopen == true) {
openWindow("left");
}
if (_local1.rightdooropen == true) {
openWindow("right");
}
typeinhand = charholdingleft;
charholding = charholdingcomp;
}
};
windowtimer = 0;
windowreset = 30;
whotouchedme = 0;
whotouchedmelast = 0;
touching = 0;
sidealign = false;
function mrcomputer() {
trace(currenttask);
if (currenttask == "search") {
compchar.charbody.gotoAndStop("stand");
if (_root.leftwindowopen == true) {
if (random(2) == 1) {
currenttask = "shutdoor";
}
} else {
decidedirection();
if (cangletimer > 560) {
itemgoingto = "";
cangletimer = 0;
turndirection = "";
}
}
} else if (currenttask == "move") {
movecomputer();
} else if (currenttask == "pickup") {
collectthegoods();
} else if (currenttask == "aimrubbish") {
compchar.charbody.gotoAndStop("stand");
aimrubbish();
} else if (currenttask == "storeitem") {
compchar.charbody.gotoAndStop("stand");
findsomewhere();
} else if (currenttask == "putitaway") {
putitaway();
} else if (currenttask == "shutdoor") {
compchar.charbody.gotoAndStop("stand");
finddoor();
} else if (currenttask == "shutitdamnit") {
shutthedoor();
} else if (currenttask == "middleman") {
gettothemiddlebitch();
}
}
function shutthedoor() {
turndirection = "";
cxmov = dxmov;
cymov = dymov;
movecomputer();
compchar.char.body.gotoAndStop("walk");
if (compchar.doorchecker.hitTest(this[dtarget])) {
dtarget = "";
leftwindow.gotoAndStop(1);
meganclose();
currenttask = "search";
itemgoingto == "";
dtarget == "";
cangle = 999;
dangle = 999;
numfound == false;
charholdingcomp = "";
}
}
function gettothemiddlebitch() {
var _local1 = this;
if (middleanglecalced == false) {
mtarget = "middleman";
mxdiff = compchar._x - _local1[mtarget]._x;
mydiff = compchar._y - _local1[mtarget]._y;
mangle = Math.atan2(mydiff, mxdiff);
mangle = (mangle * 180) / Math.PI;
middleanglecalced == true;
}
if (movingtomiddle == true) {
mangle = ((compchar._rotation / 360) * 2) * Math.PI;
mxmov = (compspeed * Math.cos(mangle)) * -1;
mymov = (compspeed * Math.sin(mangle)) * -1;
compchar._x = compchar._x + mxmov;
compchar._y = compchar._y + mymov;
if (compchar.hitTest(_local1[mtarget])) {
movingtomiddle = false;
middleanglecalced = false;
currenttask = taskstored;
if (currenttask == "search") {
itemgoingto = "";
cangletimer = 0;
}
stuckcount = 0;
taskstored = "";
mangle = 999;
turndirection == "";
}
} else {
if (turndirection == "") {
turndirection = bestturn(compchar._rotation, mangle);
}
trace("middle lookin for =" + mangle);
if (turndirection == "clock") {
compchar._rotation = compchar._rotation + comprotspeed;
} else {
compchar._rotation = compchar._rotation - comprotspeed;
}
if ((compchar._rotation > (mangle - 8)) && (compchar._rotation < (mangle + 8))) {
movingtomiddle = true;
}
}
}
function finddoor() {
dtarget = "doorcentre";
xdiff = compchar._x - this[dtarget]._x;
ydiff = compchar._y - this[dtarget]._y;
dangle = Math.atan2(ydiff, xdiff);
dangle = (dangle * 180) / Math.PI;
if ((compchar._rotation > (dangle - 8)) && (compchar._rotation < (dangle + 8))) {
dangle = ((compchar._rotation / 360) * 2) * Math.PI;
dxmov = (compspeed * Math.cos(dangle)) * -1;
dymov = (compspeed * Math.sin(dangle)) * -1;
currenttask = "shutitdamnit";
dangle = 999;
turndirection == "";
} else {
if (turndirection == "") {
turndirection = bestturn(compchar._rotation, dangle);
dangletimer = 0;
}
if (turndirection == "clock") {
compchar._rotation = compchar._rotation + comprotspeed;
dangletimer = dangletimer + comprotspeed;
} else {
compchar._rotation = compchar._rotation - comprotspeed;
dangletimer = dangletimer + comprotspeed;
}
if (dangletimer > 560) {
dangletimer = 0;
taskstored = currenttask;
currenttask = "middleman";
}
}
}
function putitaway() {
turndirection = "";
movecomputer();
if (compchar.proxchecker.hitTest(this[ctarget])) {
if (ctarget == "cdcentre") {
sCds.start();
} else {
sPaperturn.start();
}
ctarget = "";
_root.itemholding.gotoAndStop(1);
itemgoingto = "";
charholdingcomp = "nothing";
currenttask = "search";
}
trace("put it away");
}
function findsomewhere() {
trace(charholdingcomp);
if (charholdingcomp == "cds") {
ctarget = "cdcentre";
} else {
ctarget = "wardcentre";
}
xdiff = compchar._x - this[ctarget]._x;
ydiff = compchar._y - this[ctarget]._y;
cangle = Math.atan2(ydiff, xdiff);
cangle = (cangle * 180) / Math.PI;
if ((compchar._rotation > (cangle - 8)) && (compchar._rotation < (cangle + 8))) {
cangle = ((compchar._rotation / 360) * 2) * Math.PI;
cxmov = (compspeed * Math.cos(cangle)) * -1;
cymov = (compspeed * Math.sin(cangle)) * -1;
currenttask = "putitaway";
cangle = 999;
} else {
if (turndirection == "") {
turndirection = bestturn(compchar._rotation, cangle);
}
if (turndirection == "clock") {
compchar._rotation = compchar._rotation + comprotspeed;
cangletimer = cangletimer + comprotspeed;
} else {
compchar._rotation = compchar._rotation - comprotspeed;
cangletimer = cangletimer - comprotspeed;
}
}
}
function aimrubbish() {
turndirection = "";
if ((compchar._rotation > 170) && (compchar._rotation < 190)) {
throwRubbish("compchar");
cangle = 999;
currenttask = "search";
} else {
if (turndirection == "") {
turndirection = bestturn(compchar._rotation, 50);
}
if (turndirection == "clock") {
compchar._rotation = compchar._rotation + comprotspeed;
cangletimer = cangletimer + comprotspeed;
} else {
compchar._rotation = compchar._rotation - comprotspeed;
cangletimer = cangletimer - comprotspeed;
}
}
}
function searchagain() {
}
function collectthegoods() {
var _local1 = this;
turndirection = "";
charholdingcomp = _local1[itemgoingto].messtype;
p = 0;
while (p < messonleft.length) {
if (messonleft[p] == _local1[itemgoingto].messnumber) {
erasenum = p;
}
p++;
}
sPickup.start();
messonleft.splice(erasenum, 1);
_local1[itemgoingto].removeMovieClip();
_root.itemholding.gotoAndStop(2);
_root.itemholding.item.gotoAndStop(charholdingcomp);
if ((charholdingcomp == "rubbish") || (charholdingcomp == "rubbish2")) {
currenttask = "aimrubbish";
} else {
currenttask = "storeitem";
}
}
function movecomputer() {
var _local1 = this;
turndirection = "";
compchar.charbody.gotoAndStop("walk");
compcanmovex = true;
compcanmovey = true;
cpredictedx = compchar._x + cxmov;
cpredictedy = compchar._y + cymov;
compcharheight = compchar.charbody._height;
compcharwidth = compchar.charbody._width;
compchartop = cpredictedy - (compcharheight / 2);
compcharbottom = cpredictedy + (compcharheight / 2);
compcharleft = cpredictedx - (compcharheight / 2);
compcharright = cpredictedx + (compcharheight / 2);
trace(compcharheight);
compoutboundary = false;
compsettoedge = false;
i = 0;
while (i < itemsinroom.length) {
citemaddress = itemsinroom[i];
citemheight = _local1[citemaddress]._height;
citemwidth = _local1[citemaddress]._width;
citemx = _local1[citemaddress]._x;
citemy = _local1[citemaddress]._y;
citemtop = citemy;
citembottom = citemy + citemheight;
citemleft = citemx;
citemright = citemx + citemwidth;
if ((((compcharbottom > citemtop) && (compchartop < citembottom)) && (compcharright > citemleft)) && (compcharleft < citemright)) {
compcanmovey = false;
compcanmovex = false;
compdontmove = false;
if ((compoutboundary == false) && (compsettoedge == false)) {
newcompchartop = compchar._y - (charheight / 2);
newcompcharbottom = compchar._y + (charheight / 2);
newcompcharleft = compchar._x - (charwidth / 2);
newcompcharright = compchar._x + (charwidth / 2);
if ((newcompcharbottom > citemtop) && (newcompchartop < citembottom)) {
compcanmovey = true;
compsettoedge = true;
finditem = true;
} else if ((newcompcharright > citemleft) && (newcompcharleft < citemright)) {
compcanmovex = true;
compsettoedge = true;
finditem = true;
}
}
}
i++;
}
if (((compcanmovex == true) && (compcanmovey == false)) && (currenttask == "putitaway")) {
compbeensliding = true;
} else if (((compcanmovex == false) && (compcanmovey == true)) && (currenttask == "putitaway")) {
compbeensliding = true;
}
if ((((compcanmovex == true) && (compcanmovey == true)) && (compbeensliding == true)) && (currenttask == "putitaway")) {
compbeensliding = false;
currenttask = "storeitem";
}
if (((compcanmovex == true) && (compcanmovey == false)) && (currenttask == "pickup")) {
compbeenslidingsearch = true;
} else if (((compcanmovex == false) && (compcanmovey == true)) && (currenttask == "pickup")) {
compbeenslidingsearch = true;
}
if ((((compcanmovex == true) && (compcanmovey == true)) && (compbeenslidingsearch == true)) && (currenttask == "pickup")) {
compbeenslidingsearch = false;
currenttask = "search";
}
if (compcanmovex == true) {
compchar._x = compchar._x + cxmov;
}
if (compcanmovey == true) {
compchar._y = compchar._y + cymov;
}
if ((compcanmovey == false) && (compcanmovex == false)) {
if (charholdingcomp == "nothing") {
currenttask = "search";
} else {
currenttask = "storeitem";
}
stuckcount++;
} else if ((((compcanmovex == false) && (cymov < 1)) && (cymov > -1)) && (currenttask == "putitaway")) {
currenttask = "storeitem";
stuckcount++;
} else if ((((cxmov < 1) && (cxmov > -1)) && (compcanmovey == false)) && (currenttask == "putitaway")) {
currenttask = "storeitem";
stuckcount++;
} else if ((((compcanmovex == false) && (cymov < 1)) && (cymov > -1)) && (currenttask == "move")) {
currenttask = "search";
stuckcount++;
} else if ((((cxmov < 1) && (cxmov > -1)) && (compcanmovey == false)) && (currenttask == "move")) {
currenttask = "search";
stuckcount++;
} else {
stuckcount = 0;
}
if (stuckcount > 3) {
taskstored = currenttask;
currenttask = "middleman";
}
if (compchar.pickupspot.hitTest(_local1[itemgoingto])) {
currenttask = "pickup";
}
}
function decidedirection() {
var _local1 = this;
if ((itemgoingto == "") || (cangle == 999)) {
cangletimer = 0;
findme = random(messonleft.length);
itemgoingto = "mess" + messonleft[findme];
xdiff = compchar._x - _local1[itemgoingto]._x;
ydiff = compchar._y - _local1[itemgoingto]._y;
cangle = Math.atan2(ydiff, xdiff);
cangle = (cangle * 180) / Math.PI;
numfound = true;
if (isNaN(cangle) == true) {
numfound = false;
itemgoingto = "";
}
}
i = 0;
while (i < itemsinroom.length) {
citemaddress = itemsinroom[i];
citemheight = _local1[citemaddress]._height;
citemwidth = _local1[citemaddress]._width;
citemx = _local1[citemaddress]._x;
citemy = _local1[citemaddress]._y;
citemtop = citemy;
citembottom = citemy + citemheight;
citemleft = citemx;
citemright = citemx + citemwidth;
if ((((_local1[itemgoingto]._y > citemtop) && (_local1[itemgoingto]._y < citembottom)) && (_local1[itemgoingto]._x > citemleft)) && (_local1[itemgoingto]._x < citemright)) {
itemgoingto = "";
numfound = false;
trace("on object");
}
i++;
}
if ((((_local1[itemgoingto]._y < startheight) || (_local1[itemgoingto]._y > maxheight)) || (_local1[itemgoingto]._x > maxwidth)) || (_local1[itemgoingto]._x < startwidth)) {
itemgoingto = "";
numfound = false;
trace("on object");
}
if (((compchar._rotation > (cangle - 8)) && (compchar._rotation < (cangle + 8))) && (numfound == true)) {
cangle = ((compchar._rotation / 360) * 2) * Math.PI;
cxmov = (compspeed * Math.cos(cangle)) * -1;
cymov = (compspeed * Math.sin(cangle)) * -1;
currenttask = "move";
} else if ((messonleft.length > 0) && (numfound == true)) {
if (turndirection == "") {
turndirection = bestturn(compchar._rotation, cangle);
}
if (turndirection == "clock") {
compchar._rotation = compchar._rotation + comprotspeed;
cangletimer = cangletimer + comprotspeed;
} else {
compchar._rotation = compchar._rotation - comprotspeed;
cangletimer = cangletimer - comprotspeed;
}
}
}
function bestturn(currentangle, targetangle) {
var _local1 = currentangle;
var _local2 = targetangle;
if (_local1 < 0) {
_local1 = _local1 * -1;
_local1 = _local1 + 180;
}
if (_local2 < 0) {
_local2 = _local2 * -1;
_local2 = _local2 + 180;
}
if (_local2 > _local1) {
clockdif = _local2 - _local1;
} else {
clockdif = _local1 - _local2;
}
anticlockdif = 360 - clockdif;
if (anticlockdif < clockdif) {
return("anticlock");
}
return("clock");
}
compchar.swapDepths(10001);
compspeed = 8;
comprotspeed = 9;
itemgoingto = "";
charholdingcomp = "";
cxmov = 0;
cymov = 0;
currenttask = "search";
ctarget = "";
compholding = "";
compbeensliding = false;
compbeenslidingsearch = false;
cangletimer = 0;
turndirection = "";
findputaway = false;
finditem = false;
stuckcount = 0;
taskstored = "";
movingtomiddle = false;
middleanglecalced = false;
dtarget = "";
numfound = true;
function meganopen() {
stemp = random(2);
if (stemp == 1) {
sHeyGuys.start();
} else if (stemp == 2) {
sWhyareyouinourroom.start();
}
}
function meganclose() {
stemp = random(2);
if (stemp == 1) {
sIhateher.start();
} else if (stemp == 2) {
sMegan.start();
}
sdoor.start();
}
function picksound() {
sd = random(5);
if (sd == 1) {
sGroundyou.start();
} else if (sd == 2) {
sOhman.start();
} else if (sd == 3) {
sScream.start();
} else if (sd == 4) {
sEvil.start();
} else {
sIgotit.start();
}
}
function displayfaces() {
var _local1 = _parent;
if (leftpercent < 20) {
_local1.drakemov.gotoAndStop("loosingloads");
_local1.joshmov.gotoAndStop("winningloads");
if (timesincelastsound < 0) {
timesincelastsound = timereset + random(200);
}
} else if (leftpercent < 45) {
_local1.drakemov.gotoAndStop("loosing");
_local1.joshmov.gotoAndStop("winning");
if (timesincelastsound < 0) {
picksound();
timesincelastsound = timereset + random(200);
}
} else if (leftpercent < 55) {
_local1.drakemov.gotoAndStop("equal");
_local1.joshmov.gotoAndStop("equal");
if (timesincelastsound < 0) {
picksound();
timesincelastsound = timereset + random(200);
}
} else if (leftpercent < 80) {
_local1.drakemov.gotoAndStop("winning");
_local1.joshmov.gotoAndStop("loosing");
if (timesincelastsound < 0) {
picksound();
timesincelastsound = timereset + random(200);
}
} else {
_local1.drakemov.gotoAndStop("winningloads");
_local1.joshmov.gotoAndStop("loosingloads");
if (timesincelastsound < 0) {
picksound();
timesincelastsound = timereset + random(200);
}
}
timesincelastsound--;
}
timereset = 120;
timesincelastsound = timereset;
sEvil = new Sound();
sEvil.attachSound("evil");
sGroundyou = new Sound();
sGroundyou.attachSound("groundyou");
sHeyguys = new Sound();
sHeyguys.attachSound("heyguys");
sIgotit = new Sound();
sIgotit.attachSound("igotit");
sIhateher = new Sound();
sIhateher.attachSound("ihateher");
sMegan = new Sound();
sMegan.attachSound("megan");
sOhman = new Sound();
sOhman.attachSound("ohman");
sScream = new Sound();
sScream.attachSound("scream");
sWhyareyouinourroom = new Sound();
sWhyareyouinourroom.attachSound("whyareyouinourroom");
sCrumple = new Sound();
sCrumple.attachSound("crumple");
sThrow = new Sound();
sThrow.attachSound("throw");
sCds = new Sound();
sCds.attachSound("cds");
sdoor = new Sound();
sdoor.attachSound("doorclose");
sPickup = new Sound();
sPickup.attachSound("pickup");
sDrop = new Sound();
sDrop.attachSound("drop");
sPaperturn = new Sound();
sPaperturn.attachSound("paperturn");
Instance of Symbol 281 MovieClip "leftbin" in Symbol 494 MovieClip Frame 1
onClipEvent (load) {
_parent.itemsinroom.push("leftbin");
}
Instance of Symbol 395 MovieClip "leftwindow" in Symbol 494 MovieClip Frame 1
/* no clip actions */
Instance of Symbol 279 MovieClip "rightrack" in Symbol 494 MovieClip Frame 1
onClipEvent (load) {
_parent.itemsinroom.push("rightrack");
}
Instance of Symbol 281 MovieClip "rightbin" in Symbol 494 MovieClip Frame 1
onClipEvent (load) {
_parent.itemsinroom.push("rightbin");
}
Instance of Symbol 405 MovieClip "bedtwo" in Symbol 494 MovieClip Frame 1
onClipEvent (load) {
_parent.itemsinroom.push("bedtwo");
}
Instance of Symbol 413 MovieClip "doorinvis" in Symbol 494 MovieClip Frame 1
onClipEvent (load) {
_parent.itemsinroom.push("doorinvis");
}
Instance of Symbol 389 MovieClip "border6" in Symbol 494 MovieClip Frame 1
onClipEvent (load) {
_parent.itemsinroom.push("border6");
}
Instance of Symbol 417 MovieClip "amp" in Symbol 494 MovieClip Frame 1
onClipEvent (load) {
_parent.itemsinroom.push("amp");
}
Instance of Symbol 424 MovieClip "rightdoor" in Symbol 494 MovieClip Frame 1
onClipEvent (load) {
_parent.itemsinroom.push("rightdoor");
}
Instance of Symbol 279 MovieClip "leftrack" in Symbol 494 MovieClip Frame 1
onClipEvent (load) {
_parent.itemsinroom.push("leftrack");
}
Instance of Symbol 296 MovieClip "bed" in Symbol 494 MovieClip Frame 1
onClipEvent (load) {
_parent.itemsinroom.push("bed");
}
Instance of Symbol 411 MovieClip "chest" in Symbol 494 MovieClip Frame 1
onClipEvent (load) {
_parent.itemsinroom.push("chest");
}
Instance of Symbol 389 MovieClip "border7" in Symbol 494 MovieClip Frame 1
onClipEvent (load) {
_parent.itemsinroom.push("border7");
}
Instance of Symbol 273 MovieClip "wardrobe" in Symbol 494 MovieClip Frame 1
onClipEvent (load) {
_parent.itemsinroom.push("wardrobe");
}
Instance of Symbol 450 MovieClip in Symbol 494 MovieClip Frame 1
onClipEvent (load) {
this.swapDepths(10010);
}
Instance of Symbol 452 MovieClip "roomtidyend" in Symbol 494 MovieClip Frame 1
onClipEvent (load) {
this.swapDepths(10018);
}
Instance of Symbol 448 MovieClip "cdcentre" in Symbol 494 MovieClip Frame 1
/* no clip actions */
Instance of Symbol 448 MovieClip "wardcentre" in Symbol 494 MovieClip Frame 1
/* no clip actions */
Instance of Symbol 448 MovieClip "doorcentre" in Symbol 494 MovieClip Frame 1
/* no clip actions */
Instance of Symbol 491 MovieClip "wstuck" in Symbol 494 MovieClip Frame 1
onClipEvent (load) {
_parent.itemsinroom.push("wstuck");
}
Instance of Symbol 493 MovieClip "border9" in Symbol 494 MovieClip Frame 1
onClipEvent (load) {
_parent.itemsinroom.push("border9");
}
Symbol 494 MovieClip Frame 5
function mrcomputer() {
trace(messonleft[2]);
if (currenttask == "search") {
if (_root.leftwindowopen == true) {
if (random(3) == 1) {
trace("shut it");
currenttask = "shutdoor";
}
} else {
decidedirection();
if (cangletimer > 360) {
itemgoingto = "";
cangletimer = 0;
turndirection = "";
}
}
} else if (currenttask == "move") {
movecomputer();
} else if (currenttask == "pickup") {
collectthegoods();
} else if (currenttask == "aimrubbish") {
aimrubbish();
} else if (currenttask == "storeitem") {
findsomewhere();
} else if (currenttask == "putitaway") {
putitaway();
} else if (currenttask == "shutdoor") {
trace("find the damn door");
finddoor();
} else if (currenttask == "shutitdamnit") {
shutthedoor();
}
}
function shutthedoor() {
turndirection = "";
compchar._x = compchar._x + dxmov;
compchar._y = compchar._y + dymov;
if (compchar.proxchecker.hitTest(this[dtarget])) {
dtarget = "";
leftwindow.gotoAndStop(1);
currenttask = "search";
itemgoingto == "";
dtarget == "";
cangle = 999;
dangle = 999;
numfound == false;
typeinhandtwo = "";
}
}
function finddoor() {
if (dtarget == "") {
dtarget = "leftwindow";
xdiff = compchar._x - this[dtarget]._x;
ydiff = compchar._y - this[dtarget]._y;
dangle = Math.atan2(ydiff, xdiff);
dangle = (dangle * 180) / Math.PI;
}
if ((compchar._rotation > (dangle - 5)) && (compchar._rotation < (dangle + 5))) {
trace("found it");
dangle = ((compchar._rotation / 360) * 2) * Math.PI;
dxmov = (compspeed * Math.cos(dangle)) * -1;
dymov = (compspeed * Math.sin(dangle)) * -1;
currenttask = "shutitdamnit";
dangle = 999;
turndirection == "";
} else {
if (turndirection == "") {
turndirection = bestturn(compchar._rotation, dangle);
}
if (turndirection == "clock") {
compchar._rotation = compchar._rotation + comprotspeed;
dangletimer = dangletimer + comprotspeed;
} else {
compchar._rotation = compchar._rotation - comprotspeed;
dangletimer = dangletimer - comprotspeed;
}
}
}
function putitaway() {
turndirection = "";
compchar._x = compchar._x + cxmov;
compchar._y = compchar._y + cymov;
if (compchar.proxchecker.hitTest(this[ctarget])) {
ctarget = "";
_root.itemholding.gotoAndStop(1);
itemgoingto = "";
typeinhandtwo = "";
currenttask = "search";
}
}
function findsomewhere() {
if (ctarget == "") {
if (typeinhandtwo == "cds") {
ctarget = "leftrack";
} else {
ctarget = "wardrobe";
}
xdiff = compchar._x - this[ctarget]._x;
ydiff = compchar._y - this[ctarget]._y;
cangle = Math.atan2(ydiff, xdiff);
cangle = (cangle * 180) / Math.PI;
}
if ((compchar._rotation > (cangle - 5)) && (compchar._rotation < (cangle + 5))) {
trace("found it");
cangle = ((compchar._rotation / 360) * 2) * Math.PI;
cxmov = (compspeed * Math.cos(cangle)) * -1;
cymov = (compspeed * Math.sin(cangle)) * -1;
currenttask = "putitaway";
cangle = 999;
} else {
if (turndirection == "") {
turndirection = bestturn(compchar._rotation, cangle);
}
if (turndirection == "clock") {
compchar._rotation = compchar._rotation + comprotspeed;
cangletimer = cangletimer + comprotspeed;
} else {
compchar._rotation = compchar._rotation - comprotspeed;
cangletimer = cangletimer - comprotspeed;
}
}
}
function aimrubbish() {
turndirection = "";
if ((compchar._rotation < -170) || (compchar._rotation > 170)) {
throwRubbish("compchar");
cangle = 999;
currenttask = "search";
} else {
if (turndirection == "") {
turndirection = bestturn(compchar._rotation, 180);
}
if (turndirection == "clock") {
compchar._rotation = compchar._rotation + comprotspeed;
dangletimer = dangletimer + comprotspeed;
} else {
compchar._rotation = compchar._rotation - comprotspeed;
dangletimer = dangletimer - comprotspeed;
}
}
}
function collectthegoods() {
var _local1 = this;
turndirection = "";
typeinhandtwo = _local1[itemgoingto].messtype;
p = 0;
while (p < messonleft.length) {
if (messonleft[p] == _local1[itemgoingto].messnumber) {
erasenum = p;
}
p++;
}
messonleft.splice(erasenum, 1);
_local1[itemgoingto].removeMovieClip();
_root.itemholding.gotoAndStop(2);
_root.itemholding.item.gotoAndStop(typeinhandtwo);
trace(typeinhandtwo);
if (typeinhandtwo == "rubbish") {
currenttask = "aimrubbish";
} else {
currenttask = "storeitem";
}
}
function movecomputer() {
turndirection = "";
compchar._x = compchar._x + cxmov;
compchar._y = compchar._y + cymov;
if (compchar.pickupspot.hitTest(this[itemgoingto])) {
currenttask = "pickup";
}
}
function decidedirection() {
var _local1 = this;
if ((itemgoingto == "") || (cangle == 999)) {
findme = random(messonleft.length);
itemgoingto = "mess" + messonleft[findme];
xdiff = compchar._x - _local1[itemgoingto]._x;
ydiff = compchar._y - _local1[itemgoingto]._y;
cangle = Math.atan2(ydiff, xdiff);
cangle = (cangle * 180) / Math.PI;
numfound = true;
if (isNaN(cangle) == true) {
numfound = false;
itemgoingto = "";
}
}
i = 0;
while (i < itemsinroom.length) {
itemaddress = itemsinroom[i];
itemheight = _local1[itemaddress]._height;
itemwidth = _local1[itemaddress]._width;
itemx = _local1[itemaddress]._x;
itemy = _local1[itemaddress]._y;
itemtop = itemy;
itembottom = itemy + itemheight;
itemleft = itemx;
itemright = itemx + itemwidth;
if ((((_local1[itemgoingto]._y > itemtop) && (_local1[itemgoingto]._y < itembottom)) && (_local1[itemgoingto]._x > itemleft)) && (_local1[itemgoingto]._x < itemright)) {
itemgoingto = "";
numfound = false;
}
i++;
}
if ((((_local1[itemgoingto]._y < startheight) || (_local1[itemgoingto]._y > maxheight)) || (_local1[itemgoingto]._x > maxwidth)) || (_local1[itemgoingto]._x < startwidth)) {
itemgoingto = "";
numfound = false;
}
if (((compchar._rotation > (cangle - 5)) && (compchar._rotation < (cangle + 5))) && (numfound == true)) {
cangle = ((compchar._rotation / 360) * 2) * Math.PI;
cxmov = (compspeed * Math.cos(cangle)) * -1;
cymov = (compspeed * Math.sin(cangle)) * -1;
currenttask = "move";
} else if ((messonleft.length > 0) && (numfound == true)) {
if (turndirection == "") {
turndirection = bestturn(compchar._rotation, cangle);
}
if (turndirection == "clock") {
compchar._rotation = compchar._rotation + comprotspeed;
cangletimer = cangletimer + comprotspeed;
} else {
compchar._rotation = compchar._rotation - comprotspeed;
cangletimer = cangletimer - comprotspeed;
}
trace((("searching for " + cangle) + " current rot is ") + compchar._rotation);
}
}
function bestturn(currentangle, targetangle) {
var _local1 = currentangle;
var _local2 = targetangle;
if (_local1 < 0) {
_local1 = _local1 * -1;
_local1 = _local1 + 180;
}
if (_local2 < 0) {
_local2 = _local2 * -1;
_local2 = _local2 + 180;
}
if (_local2 > _local1) {
clockdif = _local2 - _local1;
} else {
clockdif = _local1 - _local2;
}
anticlockdif = 360 - clockdif;
if (anticlockdif < clockdif) {
return("anticlock");
}
return("clock");
}
compchar.swapDepths(10001);
compspeed = 8;
comprotspeed = 6;
itemgoingto = "";
typeinhandtwo = "";
cxmov = 0;
cymov = 0;
currenttask = "search";
ctarget = "";
compholding = "";
cangletimer = 0;
turndirection = "";
dtarget = "";
numfound = true;
Symbol 496 Button
on (release) {
this.gotoAndPlay("out");
if (_root.oneplayer == "two") {
_root.gotoAndStop("twoinstruction");
}
}
Symbol 497 MovieClip Frame 1
stop();
Symbol 497 MovieClip Frame 2
stop();
if (_root.firstgamewinner == "josh") {
_root.popuptext.gotoAndPlay("kathyparty");
trace("kathy");
} else {
_root.popuptext.gotoAndPlay("micdate");
trace("michelle");
}
Symbol 497 MovieClip Frame 30
movieholder.gotoAndPlay("playme");
Symbol 497 MovieClip Frame 33
stop();
Symbol 497 MovieClip Frame 51
this.removeMovieClip();
_root.gotoAndStop("twoinstruction");
trace("back to the staaartio");
stop();
Symbol 498 MovieClip Frame 1
function runtimer() {
var _local1 = _root;
framecount--;
if (framecount < 0) {
seconds--;
framecount = framereset;
if (seconds == 0) {
_local1.firstgamewinner = "";
if (leftpercent < 50) {
trace("fat boy wins");
_local1.firstgamewinner = "josh";
joshmovie.play();
} else {
trace("gay boy wins");
_local1.firstgamewinner = "drake";
drakemovie.play();
}
_local1.storeleft = leftpercent;
char.charbody.gotoAndStop("stand");
compchar.charbody.gotoAndStop("stand");
delete _local1.onEnterFrame;
}
}
_local1.countdown = seconds;
}
function performaction() {
var _local1 = _root;
itempickedup = false;
if (char.proxchecker.hitTest(leftwindow) && (leftwindow._currentframe > 1)) {
leftwindow.gotoAndStop(1);
meganclose();
itempickedup = true;
} else if (charholding != "nothing") {
pcheck = checkProx("left");
if (pcheck != "") {
if ((charholding == "rubbish") || (charholding == "rubbish2")) {
if (pcheck == "leftbin") {
sCrumple.start();
charholding = "nothing";
_local1.itemholding.gotoAndStop(1);
itempickedup = true;
}
} else if ((charholding == "clothes") || (charholding == "clothes2")) {
if (pcheck == "wardrobe") {
sPaperturn.start();
charholding = "nothing";
_local1.itemholding.gotoAndStop(1);
itempickedup = true;
}
} else if ((charholding == "cds") && (pcheck == "leftrack")) {
sCds.start();
charholding = "nothing";
_local1.itemholding.gotoAndStop(1);
itempickedup = true;
}
}
} else if (charholding == "nothing") {
pickUpItem("left");
itempickedup = true;
}
if (itempickedup == false) {
if ((charholding == "rubbish") || (charholding == "rubbish2")) {
throwRubbish("char");
} else {
dropItem("left");
}
}
}
function openWindow(side) {
if (windowtimer < 1) {
if (side == "left") {
throwRubbish("leftwindow");
} else {
throwRubbish("rightdoor");
}
windowtimer = windowreset;
} else {
windowtimer--;
}
}
function checkProx(side) {
var _local1 = this;
if (side == "left") {
i = 0;
while (i < itemsinroom.length) {
itemname = itemsinroom[i];
if (itemname == "leftbin") {
if (char.proxchecker.hitTest(_local1[itemname])) {
return("leftbin");
}
} else if (itemname == "leftrack") {
if (char.proxchecker.hitTest(_local1[itemname])) {
return("leftrack");
}
} else if (itemname == "wardrobe") {
if (char.proxchecker.hitTest(_local1[itemname])) {
return("wardrobe");
}
}
i++;
}
}
return(undefined);
}
function moveRubbish() {
var _local1 = this;
r = 0;
while (r < rubbishballs.length) {
rname = "rubbish" + rubbishballs[r];
_local1[rname]._x = _local1[rname]._x + _local1[rname].xmov;
_local1[rname]._y = _local1[rname]._y + _local1[rname].ymov;
_local1[rname]._rotation = _local1[rname]._rotation + _local1[rname].rot;
if (_local1[rname]._y < startheight) {
_local1[rname].ymov = _local1[rname].ymov * -1;
} else if (_local1[rname]._y > maxheight) {
_local1[rname].ymov = _local1[rname].ymov * -1;
} else if (_local1[rname]._x < startwidth) {
_local1[rname].xmov = _local1[rname].xmov * -1;
} else if (_local1[rname]._x > maxright) {
_local1[rname].xmov = _local1[rname].xmov * -1;
}
_local1[rname].distancetravelled = _local1[rname].distancetravelled + _local1[rname].travelling;
if (_local1[rname].distancetravelled < _local1[rname].halfway) {
_local1[rname]._xscale = _local1[rname]._xscale + 2;
_local1[rname]._yscale = _local1[rname]._yscale + 2;
} else {
_local1[rname]._xscale = _local1[rname]._xscale - 2;
_local1[rname]._yscale = _local1[rname]._yscale - 2;
}
if (_local1[rname].distancetravelled > _local1[rname].totaldistance) {
newball = "mess" + depth;
attachMovie("mess", newball, depth);
_local1[newball]._x = _local1[rname]._x;
_local1[newball]._y = _local1[rname]._y;
_local1[newball]._rotation = _local1[rname]._rotation;
if (_local1[rname].plane == true) {
_local1[newball].gotoAndStop("rubbish2");
_local1[newball].messtype = "rubbish2";
_local1[newball].mframe = "rubbish2";
} else {
_local1[newball].gotoAndStop("rubbish");
_local1[newball].messtype = "rubbish";
_local1[newball].mframe = "rubbish";
}
if (_local1[rname]._x > maxwidth) {
messonright.push(depth);
} else {
messonleft.push(depth);
}
_local1[rname].removeMovieClip();
rubbishballs.splice(r, 1);
depth++;
}
r++;
}
if (rubbishballs.length == 0) {
rubbishinplay = false;
}
}
function throwRubbish(from) {
var _local1 = this;
var _local2 = from;
rubbish = "rubbish" + depth;
attachMovie("mess", rubbish, depth);
_local1[rubbish].gotoAndStop("rubbish");
_local1[rubbish].plane = false;
if (_local2 == "char") {
if (charholding == "rubbish2") {
_local1[rubbish].gotoAndStop("rubbish2");
_local1[rubbish].plane = true;
}
}
if (_local2 == "chartwo") {
if (chartwoholding == "rubbish2") {
_local1[rubbish].gotoAndStop("rubbish2");
_local1[rubbish].plane = true;
}
}
if (_local2 == "char") {
rangle = ((char._rotation / 360) * 2) * Math.PI;
rubtargetx = rspeed * Math.sin(rangle);
rubtargety = (-rspeed) * Math.cos(rangle);
_local1[rubbish]._x = char._x;
_local1[rubbish]._y = char._y;
_local1[rubbish].totaldistance = random(100) + 250;
if (_local1[rubbish].plane == false) {
_local1[rubbish].rot = random(20) - 10;
} else {
_local1[rubbish]._rotation = char._rotation;
}
charholding = "nothing";
char.charbody.gotoAndStop("throw");
_root.itemholding.gotoAndStop(1);
} else if (_local2 == "chartwo") {
rangle = ((chartwo._rotation / 360) * 2) * Math.PI;
rubtargetx = rspeed * Math.sin(rangle);
rubtargety = (-rspeed) * Math.cos(rangle);
_local1[rubbish]._x = chartwo._x;
_local1[rubbish]._y = chartwo._y;
_local1[rubbish].totaldistance = random(100) + 250;
if (_local1[rubbish].plane == false) {
_local1[rubbish].rot = random(20) - 10;
} else {
_local1[rubbish]._rotation = chartwo._rotation;
}
chartwo.charbody.gotoAndStop("throw");
chartwoholding = "nothing";
_root.itemholdingright.gotoAndStop(1);
} else {
_local1[rubbish].rot = random(20) - 10;
if (_local2 == "leftwindow") {
_local1[rubbish]._x = leftwindow._x + (leftwindow._width / 2);
_local1[rubbish]._y = leftwindow._y;
windowangle = random(135) - 180;
rangle = ((windowangle / 360) * 2) * Math.PI;
rubtargetx = rspeed * Math.sin(rangle);
rubtargety = (-rspeed) * Math.cos(rangle);
} else {
_local1[rubbish]._x = rightdoor._x;
_local1[rubbish]._y = rightdoor._y;
windowangle = random(100) - 90;
rangle = ((windowangle / 360) * 2) * Math.PI;
rubtargetx = rspeed * Math.sin(rangle);
rubtargety = (-rspeed) * Math.cos(rangle);
}
_local1[rubbish].totaldistance = random(300) + 50;
}
_local1[rubbish].angle = rangle;
_local1[rubbish].xmov = rubtargetx;
_local1[rubbish].ymov = rubtargety;
dtravelled = Math.sqrt((rubtargetx * rubtargetx) + (rubtargety * rubtargety));
_local1[rubbish].travelling = dtravelled;
if (_local1[rubbish].travelling < 0) {
_local1[rubbish].travelling = _local1[rubbish].travelling * -1;
}
_local1[rubbish].distancetravelled = 0;
_local1[rubbish].halfway = _local1[rubbish].totaldistance / 2;
rubbishinplay = true;
rubbishballs.push(depth);
sThrow.start();
depth++;
}
function dropItem(side) {
var _local1 = this;
sDrop.start();
messtodrop = charholding;
messname = "mess" + depth;
attachMovie("mess", messname, depth);
_local1[messname].gotoAndStop(charholding);
_local1[messname]._x = char._x;
_local1[messname]._y = char._y;
_local1[messname]._rotation = random(360);
_local1[messname].messtype = charholding;
if (side == "left") {
messonleft.push(depth);
} else {
messonright.push(depth);
}
depth++;
charholding = "nothing";
_root.itemholding.gotoAndStop(1);
}
function pickUpItem(side) {
var _local1 = this;
var _local2 = _root;
if (side == "left") {
arraypointer = messonleft;
} else {
arraypointer = messonright;
}
m = 0;
while (m < arraypointer.length) {
messname = "mess" + arraypointer[m];
if (_local1[messname].hitTest(char.pickupspot)) {
_local2.itemholding.gotoAndStop(2);
sPickup.start();
_local2.itemholding.item.gotoAndStop(_local1[messname].messtype);
charholding = _local1[messname].messtype;
charitemholdingframe = _local1[messname].mframe;
_local1[messname].removeMovieClip();
arraypointer.splice(m, 1);
return;
}
m++;
}
}
function createMess(side) {
var _local1 = this;
if (side == "left") {
mtop = startheight;
mbottom = maxheight;
mleft = startwidth;
mright = maxwidth;
messonleft.push(depth);
} else {
mtop = startheight;
mbottom = maxheight;
mleft = maxwidth;
mright = maxright;
messonright.push(depth);
}
positionfound = false;
newname = "mess" + depth;
_local1.attachMovie("mess", newname, depth);
mtype = random(5) + 1;
myframe = mtype;
if (mtype == 1) {
messis = "rubbish";
}
if (mtype == 2) {
messis = "clothes";
}
if (mtype == 3) {
messis = "cds";
}
if (mtype == 4) {
messis = "rubbish2";
}
if (mtype == 5) {
messis = "clothes2";
}
_local1[newname].gotoAndStop(myframe);
_local1[newname]._rotation = random(360);
while (positionfound == false) {
xpos = random(int(mright - mleft)) + mleft;
ypos = random(int(mbottom - mtop)) + mtop;
messtop = ypos;
messbottom = ypos + _local1[newname]._height;
messleft = xpos;
messright = xpos + _local1[newname]._width;
onitem = false;
i = 0;
while (i < itemsinroom.length) {
itemaddress = itemsinroom[i];
itemheight = _local1[itemaddress]._height;
itemwidth = _local1[itemaddress]._width;
itemx = _local1[itemaddress]._x;
itemy = _local1[itemaddress]._y;
itemtop = itemy;
itembottom = itemy + itemheight;
itemleft = itemx;
itemright = itemx + itemwidth;
if ((((messbottom > itemtop) && (messtop < itembottom)) && (messright > itemleft)) && (messleft < itemright)) {
onitem = true;
}
i++;
}
if (onitem == false) {
positionfound = true;
}
}
_local1[newname]._x = xpos;
_local1[newname]._y = ypos;
_local1[newname].messtype = messis;
_local1[newname].messnumber = depth;
depth++;
}
function controlChar(charaddress) {
var _local1 = this;
var _local2 = charaddress;
touching = 0;
chartargetx = _local2._x;
chartargety = _local2._y;
positionchange = false;
sidealign = false;
if (Key.isDown(68)) {
_local2._rotation = _local2._rotation + rotationspeed;
} else if (Key.isDown(65)) {
_local2._rotation = _local2._rotation - rotationspeed;
}
if (Key.isDown(87)) {
angle = ((_local2._rotation / 360) * 2) * Math.PI;
chartargetx = chartargetx + (walkspeed * Math.sin(angle));
chartargety = chartargety + ((-walkspeed) * Math.cos(angle));
positionchange = true;
} else if (Key.isDown(83)) {
angle = ((_local2._rotation / 360) * 2) * Math.PI;
chartargetx = chartargetx - (walkspeed * Math.sin(angle));
chartargety = chartargety - ((-walkspeed) * Math.cos(angle));
positionchange = true;
}
if (positionchange == true) {
canmovex = true;
canmovey = true;
chartop = chartargety - (charheight / 2);
charbottom = chartargety + (charheight / 2);
charleft = chartargetx - (charwidth / 2);
charright = chartargetx + (charwidth / 2);
outboundary = false;
if ((chartop < startheight) || (charbottom > maxheight)) {
canmovey = false;
dontmove = false;
dontmove = checkitemsagain("nowt");
if (dontmove == "nob") {
canmovex = false;
} else if (char._y < (startheight + 100)) {
}
outboundary = true;
}
if ((charleft < startwidth) || (charright > maxwidth)) {
canmovex = false;
dontmove = false;
dontmove = checkitemsagain("nowt");
if (dontmove == "nob") {
canmovey = false;
} else if (char._x < (startwidth + 100)) {
}
outboundary = true;
}
settoedge = false;
i = 0;
while (i < itemsinroom.length) {
itemaddress = itemsinroom[i];
itemheight = _local1[itemaddress]._height;
itemwidth = _local1[itemaddress]._width;
itemx = _local1[itemaddress]._x;
itemy = _local1[itemaddress]._y;
itemtop = itemy;
itembottom = itemy + itemheight;
itemleft = itemx;
itemright = itemx + itemwidth;
if ((((charbottom > itemtop) && (chartop < itembottom)) && (charright > itemleft)) && (charleft < itemright)) {
touching++;
canmovey = false;
canmovex = false;
whotouchedme++;
charycentre = chartargety;
charxcentre = chartargetx;
dontmove = false;
dontmove = checkitemsagain(_local1[itemaddress]._name);
if ((((outboundary == false) && (settoedge == false)) && (whotouchedmelast < 2)) && (dontmove != "nob")) {
chartop = char._y - (charheight / 2);
charbottom = char._y + (charheight / 2);
charleft = char._x - (charwidth / 2);
charright = char._x + (charwidth / 2);
if ((((charbottom > itemtop) && (chartop < itembottom)) && (sidealign == false)) && (touching < 2)) {
canmovey = true;
settoedge = true;
if (char._x < itemx) {
sidealign = true;
} else {
sidealign = true;
}
} else if ((((charright > itemleft) && (charleft < itemright)) && (sidealign == false)) && (touching < 2)) {
canmovex = true;
settoedge = true;
if (char._y < itemy) {
sidealign = true;
} else {
sidealign = true;
}
}
}
}
i++;
}
whotouchedmelast = whotouchedme;
whotouchedme = 0;
if (touching > 1) {
canmovex = false;
canmovey = false;
}
if (canmovex == true) {
_local2._x = chartargetx;
char.charbody.gotoAndStop("walk");
}
if (canmovey == true) {
_local2._y = chartargety;
char.charbody.gotoAndStop("walk");
} else if (canmovex == false) {
}
} else {
char.charbody.gotoAndStop("stand");
}
}
function checkitemsagain(notthis) {
var _local1 = this;
var _local2 = notthis;
i = 0;
while (i < itemsinroom.length) {
thitemaddress = itemsinroom[i];
thitemheight = _local1[thitemaddress]._height;
thitemwidth = _local1[thitemaddress]._width;
thitemx = _local1[thitemaddress]._x;
thitemy = _local1[thitemaddress]._y;
thitemtop = thitemy;
thitembottom = thitemy + thitemheight;
thitemleft = thitemx;
thitemright = thitemx + thitemwidth;
if (((((charbottom > thitemtop) && (chartop < thitembottom)) && (charright > thitemleft)) && (charleft < thitemright)) && (_local2 != _local1[thitemaddress]._name)) {
return("nob");
}
i++;
}
return(undefined);
}
function rubbishMeter() {
var _local1 = _root;
totalamount = messonleft.length + messonright.length;
leftpercent = (messonleft.length / totalamount) * 100;
_local1.lp = leftpercent;
pixpercent = (rml / 100) * leftpercent;
_local1.leftp = int(leftpercent) + "%";
_local1.rightp = (100 - int(leftpercent)) + "%";
_local1.rubbishmeter.meterbar._x = pixpercent;
_local1.rubbishmeter.barmask._x = pixpercent;
}
startwidth = 0;
startheight = 0;
maxheight = floor._height;
maxright = floor._width;
maxwidth = boundary._x;
charheight = char.charbody._height;
charwidth = charheight;
char.swapDepths(10000);
rotationspeed = 10;
walkspeed = 6;
charholding = "nothing";
itemsinroom = [];
messonleft = [];
messonright = [];
rubbishinplay = false;
rubbishballs = [];
var k = Key.isDown;
var kU = 38;
var kD = 40;
var kL = 37;
var kR = 39;
var kS = 32;
var kF = 16;
rml = _root.rubbishmeter._width;
_root.rubbishmeter.meterbar._x = 0;
depth = 10;
messspawned = false;
numbertogenerate = 25;
spacetimer = 0;
spacereset = 5;
rthrowdistance = 120;
rpeak = 50;
rspeed = 5;
seconds = 60;
framecount = 0;
framereset = 30;
_root.onEnterFrame = function () {
var _local1 = _root;
if (_local1.pauseforvid == false) {
controlChar(char);
if (messspawned == false) {
n = 0;
while (n < numbertogenerate) {
createMess("left");
createMess("right");
n++;
}
messspawned = true;
}
controlChartwo(chartwo);
if (spacetwotimer < 0) {
if (k(kF)) {
trace("shiftttttttttt");
performactiontwo();
spacetwotimer = spacetworeset;
}
}
spacetwotimer--;
if (rubbishinplay == true) {
moveRubbish();
}
if (spacetimer < 0) {
if (k(kS)) {
performaction();
spacetimer = spacereset;
}
}
spacetimer--;
rubbishMeter();
runtimer();
if (random(1500) == 1) {
if (leftwindow._currentframe == 1) {
leftwindow.play();
}
}
if (random(500) == 1) {
if (rightdoor._currentframe == 1) {
rightdoor.play();
}
}
if (_local1.leftwindowopen == true) {
openWindow("left");
}
if (_local1.rightdooropen == true) {
openWindow("right");
}
typeinhand = chartwoholding;
displayfaces();
}
};
_root.firstgamewinner = "";
windowtimer = 0;
windowreset = 30;
whotouchedme = 0;
whotouchedmelast = 0;
touching = 0;
sidealign = false;
function performactiontwo() {
var _local1 = _root;
itempickeduptwo = false;
trace(chartwoholding);
if (chartwo.proxchecker.hitTest(rightdoor) && (rightdoor._currentframe > 1)) {
rightdoor.gotoAndStop(1);
meganclose();
itempickeduptwo = true;
} else if (chartwoholding != "nothing") {
pchecktwo = checkProxtwo("right");
trace(pchecktwo);
if ((pchecktwo != "") || (pchecktwo != undefined)) {
if ((chartwoholding == "rubbish") || (chartwoholding == "rubbish2")) {
if (pchecktwo == "leftbin") {
sCrumple.start();
chartwoholding = "nothing";
_local1.itemholdingright.gotoAndStop(1);
itempickeduptwo = true;
}
} else if ((chartwoholding == "clothes") || (chartwoholding == "clothes2")) {
if (pchecktwo == "wardrobe") {
sPaperturn.start();
chartwoholding = "nothing";
_local1.itemholdingright.gotoAndStop(1);
itempickeduptwo = true;
}
} else if ((chartwoholding == "cds") && (pchecktwo == "rightrack")) {
sCds.start();
chartwoholding = "nothing";
_local1.itemholdingright.gotoAndStop(1);
itempickeduptwo = true;
}
}
} else if (chartwoholding == "nothing") {
pickUpItemtwo("right");
itempickeduptwo = true;
}
if (itempickeduptwo == false) {
if ((chartwoholding == "rubbish") || (chartwoholding == "rubbish2")) {
trace("throw it biatch");
throwRubbish("chartwo");
} else {
dropItemtwo("right");
}
} else {
trace("item thing true");
}
}
function checkProxtwo(side) {
var _local1 = this;
i = 0;
while (i < itemsinroom.length) {
itemnametwo = itemsinroom[i];
if (itemnametwo == "rightbin") {
if (chartwo.proxchecker.hitTest(_local1[itemnametwo])) {
return("rightbin");
}
} else if (itemnametwo == "rightrack") {
if (chartwo.proxchecker.hitTest(_local1[itemnametwo])) {
trace("im next to the leftrack");
return("rightrack");
}
} else if (itemnametwo == "wardrobe") {
if (chartwo.proxchecker.hitTest(_local1[itemnametwo])) {
return("wardrobe");
}
}
i++;
}
return(undefined);
}
function dropItemtwo(side) {
var _local1 = this;
trace("drop meh");
sDrop.start();
messtodroptwo = chartwoholding;
messnametwo = "mess" + depth;
attachMovie("mess", messnametwo, depth);
_local1[messnametwo].gotoAndStop(chartwoholding);
_local1[messnametwo]._x = chartwo._x;
_local1[messnametwo]._y = chartwo._y;
_local1[messnametwo]._rotation = random(360);
_local1[messnametwo].messtype = chartwoholding;
if (side == "left") {
messonleft.push(depth);
} else {
messonright.push(depth);
}
depth++;
chartwoholding = "nothing";
_root.itemholdingright.gotoAndStop(1);
}
function pickUpItemtwo(side) {
var _local1 = this;
var _local2 = _root;
if (side == "left") {
arraypointer = messonleft;
} else {
arraypointer = messonright;
}
m = 0;
while (m < arraypointer.length) {
messnametwo = "mess" + arraypointer[m];
if (_local1[messnametwo].hitTest(chartwo.pickupspot)) {
_local2.itemholdingright.gotoAndStop(2);
sPickup.start();
_local2.itemholdingright.item.gotoAndStop(_local1[messnametwo].messtype);
chartwoholding = _local1[messnametwo].messtype;
charitemholdingtwoframe = _local1[messnametwo].mframe;
_local1[messnametwo].removeMovieClip();
arraypointer.splice(m, 1);
return;
}
m++;
}
}
function controlChartwo(charaddress) {
var _local1 = this;
var _local2 = charaddress;
touchingtwo = 0;
chartargetxtwo = _local2._x;
chartargetytwo = _local2._y;
positionchangetwo = false;
sidealigntwo = false;
if (k(kR)) {
_local2._rotation = _local2._rotation + rotationspeed;
} else if (k(kL)) {
_local2._rotation = _local2._rotation - rotationspeed;
}
if (k(kU)) {
angletwo = ((_local2._rotation / 360) * 2) * Math.PI;
chartargetxtwo = chartargetxtwo + (walkspeed * Math.sin(angletwo));
chartargetytwo = chartargetytwo + ((-walkspeed) * Math.cos(angletwo));
positionchangetwo = true;
} else if (k(kD)) {
angletwo = ((_local2._rotation / 360) * 2) * Math.PI;
chartargetxtwo = chartargetxtwo - (walkspeed * Math.sin(angletwo));
chartargetytwo = chartargetytwo - ((-walkspeed) * Math.cos(angletwo));
positionchangetwo = true;
}
if (positionchangetwo == true) {
canmovextwo = true;
canmoveytwo = true;
chartoptwo = chartargetytwo - (charheight / 2);
charbottomtwo = chartargetytwo + (charheight / 2);
charlefttwo = chartargetxtwo - (charwidth / 2);
charrighttwo = chartargetxtwo + (charwidth / 2);
outboundarytwo = false;
if ((chartoptwo < startheight) || (charbottomtwo > maxheight)) {
canmoveytwo = false;
dontmovetwo = false;
dontmovetwo = checkitemsagaintwo("nowt");
if (dontmovetwo == "nob") {
canmovextwo = false;
}
outboundarytwo = true;
}
if ((charlefttwo < maxwidth) || (charrighttwo > maxright)) {
canmovextwo = false;
dontmovetwo = false;
dontmovetwo = checkitemsagaintwo("nowt");
if (dontmovetwo == "nob") {
canmoveytwo = false;
}
outboundarytwo = true;
}
settoedge = false;
i = 0;
while (i < itemsinroom.length) {
itemaddresstwo = itemsinroom[i];
itemheighttwo = _local1[itemaddresstwo]._height;
itemwidthtwo = _local1[itemaddresstwo]._width;
itemxtwo = _local1[itemaddresstwo]._x;
itemytwo = _local1[itemaddresstwo]._y;
itemtoptwo = itemytwo;
itembottomtwo = itemytwo + itemheighttwo;
itemlefttwo = itemxtwo;
itemrighttwo = itemxtwo + itemwidthtwo;
if ((((charbottomtwo > itemtoptwo) && (chartoptwo < itembottomtwo)) && (charrighttwo > itemlefttwo)) && (charlefttwo < itemrighttwo)) {
touchingtwo++;
canmoveytwo = false;
canmovextwo = false;
whotouchedme++;
charycentre = chartargetytwo;
charxcentre = chartargetxtwo;
dontmovetwo = false;
dontmovetwo = checkitemsagaintwo(_local1[itemaddresstwo]._name);
if ((((outboundarytwo == false) && (settoedge == false)) && (whotouchedmelast < 2)) && (dontmovetwo != "nob")) {
chartoptwo = chartwo._y - (charheight / 2);
charbottomtwo = chartwo._y + (charheight / 2);
charlefttwo = chartwo._x - (charwidth / 2);
charrighttwo = chartwo._x + (charwidth / 2);
if ((((charbottomtwo > itemtoptwo) && (chartoptwo < itembottomtwo)) && (sidealigntwo == false)) && (touchingtwo < 2)) {
canmoveytwo = true;
settoedge = true;
if (char._x < itemxtwo) {
sidealigntwo = true;
} else {
sidealigntwo = true;
}
} else if ((((charrighttwo > itemlefttwo) && (charlefttwo < itemrighttwo)) && (sidealigntwo == false)) && (touchingtwo < 2)) {
canmovextwo = true;
settoedge = true;
if (char._y < itemytwo) {
sidealigntwo = true;
} else {
sidealigntwo = true;
}
}
}
}
i++;
}
if (touchingtwo > 1) {
canmovextwo = false;
canmoveytwo = false;
}
if (canmovextwo == true) {
_local2._x = chartargetxtwo;
chartwo.charbody.gotoAndStop("walk");
}
if (canmoveytwo == true) {
_local2._y = chartargetytwo;
chartwo.charbody.gotoAndStop("walk");
} else if (canmovextwo == false) {
}
} else {
chartwo.charbody.gotoAndStop("stand");
}
}
function checkitemsagaintwo(notthis) {
var _local1 = this;
var _local2 = notthis;
i = 0;
while (i < itemsinroom.length) {
thitemaddresstwo = itemsinroom[i];
thitemheighttwo = _local1[thitemaddresstwo]._height;
thitemwidthtwo = _local1[thitemaddresstwo]._width;
thitemxtwo = _local1[thitemaddresstwo]._x;
thitemytwo = _local1[thitemaddresstwo]._y;
thitemtoptwo = thitemytwo;
thitembottomtwo = thitemytwo + thitemheighttwo;
thitemlefttwo = thitemxtwo;
thitemrighttwo = thitemxtwo + thitemwidthtwo;
if (((((charbottomtwo > thitemtoptwo) && (chartoptwo < thitembottomtwo)) && (charrighttwo > thitemlefttwo)) && (charlefttwo < thitemrighttwo)) && (_local2 != _local1[thitemaddresstwo]._name)) {
return("nob");
}
i++;
}
return(undefined);
}
function rubbishMeter() {
var _local1 = _root;
totalamount = messonleft.length + messonright.length;
leftpercent = (messonleft.length / totalamount) * 100;
pixpercent = (rml / 100) * leftpercent;
_local1.leftp = int(leftpercent) + "%";
_local1.rightp = (100 - int(leftpercent)) + "%";
_local1.rubbishmeter.meterbar._x = pixpercent;
_local1.rubbishmeter.barmask._x = pixpercent;
}
charheight = char.charbody._height;
charwidth = charheight;
chartwo.swapDepths(10001);
rotationspeed = 10;
walkspeed = 6;
chartwoholding = "nothing";
itemsinroom = [];
messonleft = [];
messonright = [];
rubbishinplay = false;
rubbishballs = [];
var k = Key.isDown;
var kU = 38;
var kD = 40;
var kL = 37;
var kR = 39;
var kS = 32;
var kF = 16;
spacetwotimer = 0;
spacetworeset = 5;
rthrowdistance = 120;
rpeak = 50;
rspeed = 5;
touchingtwo = 0;
sidealigntwo = false;
function meganopen() {
stemp = random(2);
if (stemp == 1) {
sHeyGuys.start();
} else {
sWhyareyouinourroom.start();
}
}
function meganclose() {
stemp = random(2);
if (stemp == 1) {
sIhateher.start();
} else {
sMegan.start();
}
sdoor.start();
}
function picksound() {
r = random(5);
if (r == 1) {
sGroundyou.start();
} else if (r == 2) {
sOhman.start();
} else if (r == 3) {
sScream.start();
} else if (r == 4) {
sEvil.start();
} else {
sIgotit.start();
}
}
function displayfaces() {
var _local1 = _parent;
if (leftpercent < 20) {
_local1.drakemov.gotoAndStop("loosingloads");
_local1.joshmov.gotoAndStop("winningloads");
if (timesincelastsound < 0) {
timesincelastsound = timereset + random(200);
}
} else if (leftpercent < 45) {
_local1.drakemov.gotoAndStop("loosing");
_local1.joshmov.gotoAndStop("winning");
if (timesincelastsound < 0) {
picksound();
timesincelastsound = timereset + random(200);
}
} else if (leftpercent < 55) {
_local1.drakemov.gotoAndStop("equal");
_local1.joshmov.gotoAndStop("equal");
if (timesincelastsound < 0) {
picksound();
timesincelastsound = timereset + random(200);
}
} else if (leftpercent < 80) {
_local1.drakemov.gotoAndStop("winning");
_local1.joshmov.gotoAndStop("loosing");
if (timesincelastsound < 0) {
picksound();
timesincelastsound = timereset + random(200);
}
} else {
_local1.drakemov.gotoAndStop("winningloads");
_local1.joshmov.gotoAndStop("loosingloads");
if (timesincelastsound < 0) {
picksound();
timesincelastsound = timereset + random(200);
}
}
timesincelastsound--;
}
timereset = 120;
timesincelastsound = timereset;
sEvil = new Sound();
sEvil.attachSound("evil");
sGroundyou = new Sound();
sGroundyou.attachSound("groundyou");
sHeyguys = new Sound();
sHeyguys.attachSound("heyguys");
sIgotit = new Sound();
sIgotit.attachSound("igotit");
sIhateher = new Sound();
sIhateher.attachSound("ihateher");
sMegan = new Sound();
sMegan.attachSound("megan");
sOhman = new Sound();
sOhman.attachSound("ohman");
sScream = new Sound();
sScream.attachSound("scream");
sWhyareyouinourroom = new Sound();
sWhyareyouinourroom.attachSound("whyareyouinourroom");
sCrumple = new Sound();
sCrumple.attachSound("crumple");
sThrow = new Sound();
sThrow.attachSound("throw");
sCds = new Sound();
sCds.attachSound("cds");
sdoor = new Sound();
sdoor.attachSound("doorclose");
sPickup = new Sound();
sPickup.attachSound("pickup");
sDrop = new Sound();
sDrop.attachSound("drop");
sPaperturn = new Sound();
sPaperturn.attachSound("paperturn");
joshmovie.movieholder.loadMovie("rtjoshwin.swf");
drakemovie.movieholder.loadMovie("rtdrakewin.swf");
stop();
Instance of Symbol 279 MovieClip "leftrack" in Symbol 498 MovieClip Frame 1
onClipEvent (load) {
_parent.itemsinroom.push("leftrack");
}
Instance of Symbol 296 MovieClip "bed" in Symbol 498 MovieClip Frame 1
onClipEvent (load) {
_parent.itemsinroom.push("bed");
}
Instance of Symbol 281 MovieClip "leftbin" in Symbol 498 MovieClip Frame 1
onClipEvent (load) {
_parent.itemsinroom.push("leftbin");
}
Instance of Symbol 395 MovieClip "leftwindow" in Symbol 498 MovieClip Frame 1
/* no clip actions */
Instance of Symbol 279 MovieClip "rightrack" in Symbol 498 MovieClip Frame 1
onClipEvent (load) {
_parent.itemsinroom.push("rightrack");
}
Instance of Symbol 281 MovieClip "rightbin" in Symbol 498 MovieClip Frame 1
onClipEvent (load) {
_parent.itemsinroom.push("rightbin");
}
Instance of Symbol 424 MovieClip "rightdoor" in Symbol 498 MovieClip Frame 1
onClipEvent (load) {
_parent.itemsinroom.push("rightdoor");
}
Instance of Symbol 411 MovieClip "chest" in Symbol 498 MovieClip Frame 1
onClipEvent (load) {
_parent.itemsinroom.push("chest");
}
Instance of Symbol 413 MovieClip "doorinvis" in Symbol 498 MovieClip Frame 1
onClipEvent (load) {
_parent.itemsinroom.push("doorinvis");
}
Instance of Symbol 389 MovieClip "border6" in Symbol 498 MovieClip Frame 1
onClipEvent (load) {
_parent.itemsinroom.push("border6");
}
Instance of Symbol 417 MovieClip "amp" in Symbol 498 MovieClip Frame 1
onClipEvent (load) {
_parent.itemsinroom.push("amp");
}
Instance of Symbol 405 MovieClip "bedtwo" in Symbol 498 MovieClip Frame 1
onClipEvent (load) {
_parent.itemsinroom.push("bedtwo");
}
Instance of Symbol 273 MovieClip "wardrobe" in Symbol 498 MovieClip Frame 1
onClipEvent (load) {
_parent.itemsinroom.push("wardrobe");
}
Instance of Symbol 387 MovieClip "invis" in Symbol 498 MovieClip Frame 1
onClipEvent (load) {
_parent.itemsinroom.push("invis");
}
Instance of Symbol 450 MovieClip in Symbol 498 MovieClip Frame 1
onClipEvent (load) {
this.swapDepths(10010);
}
Instance of Symbol 497 MovieClip "drakemovie" in Symbol 498 MovieClip Frame 1
onClipEvent (load) {
this.swapDepths(14500);
}
Instance of Symbol 497 MovieClip "joshmovie" in Symbol 498 MovieClip Frame 1
onClipEvent (load) {
this.swapDepths(14501);
}
Symbol 498 MovieClip Frame 5
function c2performaction() {
var _local1 = _root;
c2itempickedup = false;
if (chartwo.proxchecker.hitTest(leftwindow)) {
leftwindow.gotoAndStop(1);
c2itempickedup = true;
} else if (chartwoholding != "") {
pcheck = c2checkProx("left");
if (pcheck != "") {
if ((chartwoholding == "rubbish") && (pcheck == "leftbin")) {
trace("store the rubbish!");
chartwoholding = "";
_local1.itemholding.gotoAndStop(1);
c2itempickedup = true;
} else if ((chartwoholding == "clothes") && (pcheck == "wardrobe")) {
trace("put the clothes away!");
chartwoholding = "";
_local1.itemholding.gotoAndStop(1);
c2itempickedup = true;
} else if ((chartwoholding == "cds") && (pcheck == "leftrack")) {
trace("store the cds");
chartwoholding = "";
_local1.itemholding.gotoAndStop(1);
c2itempickedup = true;
}
}
} else if (chartwoholding == "") {
c2pickUpItem("left");
c2itempickedup = true;
}
if (c2itempickedup == false) {
if (chartwoholding == "rubbish") {
throwRubbish("chartwo");
} else {
c2dropItem("left");
}
}
}
function c2checkProx(side) {
var _local1 = this;
if (side == "left") {
i = 0;
while (i < itemsinroom.length) {
itemname = itemsinroom[i];
if (itemname == "leftbin") {
if (chartwo.proxchecker.hitTest(_local1[itemname])) {
return("leftbin");
}
} else if (itemname == "leftrack") {
if (chartwo.proxchecker.hitTest(_local1[itemname])) {
return("leftrack");
}
} else if (itemname == "wardrobe") {
if (chartwo.proxchecker.hitTest(_local1[itemname])) {
return("wardrobe");
}
}
i++;
}
}
return(undefined);
}
function c2dropItem(side) {
var _local1 = this;
messtodrop = chartwoholding;
messname = "mess" + depth;
attachMovie("mess", messname, depth);
_local1[messname].gotoAndStop(messtodrop);
trace(chartwo._x);
_local1[messname]._x = chartwo._x;
_local1[messname]._y = chartwo._y;
_local1[messname]._rotation = random(360);
_local1[messname].messtype = chartwoholding;
if (side == "left") {
messonleft.push(depth);
} else {
messonright.push(depth);
}
depth++;
chartwoholding = "";
_root.itemholding.gotoAndStop(1);
}
function c2pickUpItem(side) {
var _local1 = this;
var _local2 = _root;
if (side == "left") {
arraypointer = messonleft;
} else {
arraypointer = messonright;
}
m = 0;
while (m < arraypointer.length) {
messname = "mess" + arraypointer[m];
if (_local1[messname].hitTest(chartwo.pickupspot)) {
chartwoholding = _local1[messname].messtype;
_local1[messname].removeMovieClip();
arraypointer.splice(m, 1);
_local2.itemholding.gotoAndStop(2);
_local2.itemholding.item.gotoAndStop(chartwoholding);
trace(chartwoholding);
return;
}
m++;
}
}
function controlchartwo(chartwoaddress) {
var _local1 = this;
var _local2 = chartwoaddress;
chartwotargetx = _local2._x;
chartwotargety = _local2._y;
positionchange = false;
if (Key.isDown(68)) {
_local2._rotation = _local2._rotation + rotationspeed;
} else if (Key.isDown(65)) {
_local2._rotation = _local2._rotation - rotationspeed;
}
if (Key.isDown(87)) {
angle = ((_local2._rotation / 360) * 2) * Math.PI;
chartwotargetx = chartwotargetx + (walkspeed * Math.sin(angle));
chartwotargety = chartwotargety + ((-walkspeed) * Math.cos(angle));
positionchange = true;
} else if (Key.isDown(83)) {
angle = ((_local2._rotation / 360) * 2) * Math.PI;
chartwotargetx = chartwotargetx - (walkspeed * Math.sin(angle));
chartwotargety = chartwotargety - ((-walkspeed) * Math.cos(angle));
positionchange = true;
}
if (positionchange == true) {
c2canmovex = true;
c2canmovey = true;
chartwotop = chartwotargety - (chartwoheight / 2);
chartwobottom = chartwotargety + (chartwoheight / 2);
chartwoleft = chartwotargetx - (chartwowidth / 2);
chartworight = chartwotargetx + (chartwowidth / 2);
outboundary = false;
if ((chartwotop < startheight) || (chartwobottom > maxheight)) {
c2canmovey = false;
outboundary = true;
if (chartwo._y < (startheight + 100)) {
chartwo._y = startheight + (chartwoheight / 2);
} else {
chartwo._y = maxheight - (chartwoheight / 2);
}
}
if ((chartwoleft < startwidth) || (chartworight > maxwidth)) {
c2canmovex = false;
outboundary = true;
if (chartwo._x < (startwidth + 100)) {
chartwo._x = startwidth + (chartwowidth / 2);
} else {
chartwo._x = maxwidth - (chartwowidth / 2);
trace(maxwidth);
}
}
settoedge = false;
i = 0;
while (i < itemsinroom.length) {
itemaddress = itemsinroom[i];
itemheight = _local1[itemaddress]._height;
itemwidth = _local1[itemaddress]._width;
itemx = _local1[itemaddress]._x;
itemy = _local1[itemaddress]._y;
itemtop = itemy;
itembottom = itemy + itemheight;
itemleft = itemx;
itemright = itemx + itemwidth;
if ((((chartwobottom > itemtop) && (chartwotop < itembottom)) && (chartworight > itemleft)) && (chartwoleft < itemright)) {
c2canmovey = false;
c2canmovex = false;
whotouchedme++;
chartwoycentre = chartwotargety;
chartwoxcentre = chartwotargetx;
if (((outboundary == false) && (settoedge == false)) && (whotouchedmelast < 2)) {
chartwotop = chartwo._y - (chartwoheight / 2);
chartwobottom = chartwo._y + (chartwoheight / 2);
chartwoleft = chartwo._x - (chartwowidth / 2);
chartworight = chartwo._x + (chartwowidth / 2);
if ((chartwobottom > itemtop) && (chartwotop < itembottom)) {
c2canmovey = true;
settoedge = true;
if (chartwo._x < itemx) {
chartwo._x = itemleft - (chartwowidth / 2);
} else {
chartwo._x = itemright + (chartwowidth / 2);
}
} else if ((chartworight > itemleft) && (chartwoleft < itemright)) {
c2canmovex = true;
settoedge = true;
if (chartwo._y < itemy) {
chartwo._y = itemtop - (chartwoheight / 2);
} else {
chartwo._y = itembottom + (chartwoheight / 2);
}
}
}
}
i++;
}
whotouchedmelast = whotouchedme;
whotouchedme = 0;
if (whotouchedmelast > 1) {
c2canmovex = false;
c2canmovey = false;
}
if (c2canmovex == true) {
_local2._x = chartwotargetx;
}
if (c2canmovey == true) {
_local2._y = chartwotargety;
}
}
}
chartwoheight = chartwo.charbody._height;
chartwowidth = chartwoheight;
chartwo.swapDepths(10000);
rotationspeed = 10;
walkspeed = 6;
chartwoholding = "";
c2spacetimer = 0;
c2spacereset = 5;
whotouchedme = 0;
whotouchedmelast = 0;
function runtimer() {
_root.countdown = seconds;
framecount--;
if (framecount < 0) {
seconds--;
framecount = framereset;
if (seconds == 0) {
_root.gotoAndStop("startmenu");
}
}
}
function performaction() {
var _local1 = _root;
itempickedup = false;
if (char.proxchecker.hitTest(rightdoor)) {
rightdoor.gotoAndStop(1);
itempickedup = true;
} else if (charholding != "") {
pcheck = checkProx("right");
if (pcheck != "") {
if ((charholding == "rubbish") && (pcheck == "rightbin")) {
trace("store the rubbish!");
charholding = "";
_local1.itemholdingright.gotoAndStop(1);
itempickedup = true;
} else if ((charholding == "clothes") && (pcheck == "wardrobe")) {
trace("put the clothes away!");
charholding = "";
_local1.itemholdingright.gotoAndStop(1);
itempickedup = true;
} else if ((charholding == "cds") && (pcheck == "rightrack")) {
trace("store the cds");
charholding = "";
_local1.itemholdingright.gotoAndStop(1);
itempickedup = true;
}
}
} else if (charholding == "") {
pickUpItem("right");
itempickedup = true;
}
if (itempickedup == false) {
if (charholding == "rubbish") {
throwRubbish("char");
} else {
dropItem("right");
}
}
}
function openWindow(side) {
if (windowtimer < 1) {
if (side == "left") {
throwRubbish("leftwindow");
} else {
throwRubbish("rightdoor");
}
windowtimer = windowreset;
} else {
windowtimer--;
}
}
function checkProx(side) {
var _local1 = this;
if (side == "left") {
i = 0;
while (i < itemsinroom.length) {
itemname = itemsinroom[i];
if (itemname == "leftbin") {
if (char.proxchecker.hitTest(_local1[itemname])) {
return("leftbin");
}
} else if (itemname == "leftrack") {
if (char.proxchecker.hitTest(_local1[itemname])) {
return("leftrack");
}
} else if (itemname == "wardrobe") {
if (char.proxchecker.hitTest(_local1[itemname])) {
return("wardrobe");
}
}
i++;
}
} else {
i = 0;
while (i < itemsinroom.length) {
itemname = itemsinroom[i];
if (itemname == "rightbin") {
if (char.proxchecker.hitTest(_local1[itemname])) {
return("rightbin");
}
} else if (itemname == "rightrack") {
if (char.proxchecker.hitTest(_local1[itemname])) {
return("rightrack");
}
} else if (itemname == "wardrobe") {
if (char.proxchecker.hitTest(_local1[itemname])) {
return("wardrobe");
}
}
i++;
}
}
return(undefined);
}
function moveRubbish() {
var _local1 = this;
r = 0;
while (r < rubbishballs.length) {
rname = "rubbish" + rubbishballs[r];
_local1[rname]._x = _local1[rname]._x + _local1[rname].xmov;
_local1[rname]._y = _local1[rname]._y + _local1[rname].ymov;
_local1[rname]._rotation = _local1[rname]._rotation + _local1[rname].rot;
if (_local1[rname]._y < startheight) {
_local1[rname].ymov = _local1[rname].ymov * -1;
} else if (_local1[rname]._y > maxheight) {
_local1[rname].ymov = _local1[rname].ymov * -1;
} else if (_local1[rname]._x < startwidth) {
_local1[rname].xmov = _local1[rname].xmov * -1;
} else if (_local1[rname]._x > maxright) {
_local1[rname].xmov = _local1[rname].xmov * -1;
}
_local1[rname].distancetravelled = _local1[rname].distancetravelled + _local1[rname].travelling;
if (_local1[rname].distancetravelled > _local1[rname].totaldistance) {
newball = "mess" + depth;
attachMovie("mess", newball, depth);
_local1[newball]._x = _local1[rname]._x;
_local1[newball]._y = _local1[rname]._y;
_local1[newball]._rotation = _local1[rname]._rotation;
_local1[newball].gotoAndStop("rubbish");
_local1[newball].messtype = "rubbish";
if (_local1[rname]._x > maxwidth) {
messonright.push(depth);
} else {
messonleft.push(depth);
}
_local1[rname].removeMovieClip();
rubbishballs.splice(r, 1);
depth++;
}
r++;
}
if (rubbishballs.length == 0) {
rubbishinplay = false;
}
}
function throwRubbish(from) {
var _local1 = this;
var _local2 = from;
var _local3 = _root;
rubbish = "rubbish" + depth;
attachMovie("mess", rubbish, depth);
_local1[rubbish].gotoAndStop("rubbish");
if (_local2 == "char") {
rangle = ((char._rotation / 360) * 2) * Math.PI;
rubtargetx = rspeed * Math.sin(rangle);
rubtargety = (-rspeed) * Math.cos(rangle);
_local1[rubbish]._x = char._x;
_local1[rubbish]._y = char._y;
_local1[rubbish].totaldistance = random(100) + 250;
_local1[rubbish].rot = random(20) - 10;
charholding = "";
_local3.itemholdingright.gotoAndStop(1);
} else if (_local2 == "chartwo") {
rangle = ((chartwo._rotation / 360) * 2) * Math.PI;
rubtargetx = rspeed * Math.sin(rangle);
rubtargety = (-rspeed) * Math.cos(rangle);
_local1[rubbish]._x = chartwo._x;
_local1[rubbish]._y = chartwo._y;
_local1[rubbish].totaldistance = random(100) + 250;
_local1[rubbish].rot = random(20) - 10;
chartwoholding = "";
_local3.itemholdingrightright.gotoAndStop(1);
} else if (_local2 == "compchar") {
rangle = (((compchar._rotation / 360) * 2) * Math.PI) - 90;
rubtargetx = rspeed * Math.sin(rangle);
rubtargety = (-rspeed) * Math.cos(rangle);
_local1[rubbish]._x = compchar._x;
_local1[rubbish]._y = compchar._y;
_local1[rubbish].totaldistance = random(100) + 250;
_local1[rubbish].rot = random(20) - 10;
itemgoingto = "";
typeinhand = "";
_local3.itemholdingrightright.gotoAndStop(1);
} else {
_local1[rubbish].rot = random(20) - 10;
if (_local2 == "leftwindow") {
_local1[rubbish]._x = leftwindow._x + (leftwindow._width / 2);
_local1[rubbish]._y = leftwindow._y;
windowangle = random(135) - 90;
rangle = ((windowangle / 360) * 2) * Math.PI;
rubtargetx = rspeed * Math.sin(rangle);
rubtargety = (-rspeed) * Math.cos(rangle);
} else {
_local1[rubbish]._x = rightdoor._x + (rightdoor._width / 2);
_local1[rubbish]._y = rightdoor._y;
windowangle = random(100) + 160;
rangle = ((windowangle / 360) * 2) * Math.PI;
rubtargetx = rspeed * Math.sin(rangle);
rubtargety = (-rspeed) * Math.cos(rangle);
}
_local1[rubbish].totaldistance = random(300) + 50;
}
_local1[rubbish].angle = rangle;
_local1[rubbish].xmov = rubtargetx;
_local1[rubbish].ymov = rubtargety;
dtravelled = Math.sqrt((rubtargetx * rubtargetx) + (rubtargety * rubtargety));
_local1[rubbish].travelling = dtravelled;
trace(dtravelled);
if (_local1[rubbish].travelling < 0) {
_local1[rubbish].travelling = _local1[rubbish].travelling * -1;
}
_local1[rubbish].distancetravelled = 0;
trace(_local1[rubbish].travelling);
rubbishinplay = true;
rubbishballs.push(depth);
depth++;
}
function dropItem(side) {
var _local1 = this;
messtodrop = charholding;
messname = "mess" + depth;
attachMovie("mess", messname, depth);
_local1[messname].gotoAndStop(messtodrop);
trace(char._x);
_local1[messname]._x = char._x;
_local1[messname]._y = char._y;
_local1[messname]._rotation = random(360);
_local1[messname].messtype = charholding;
if (side == "left") {
messonleft.push(depth);
} else {
messonright.push(depth);
}
depth++;
charholding = "";
_root.itemholdingright.gotoAndStop(1);
}
function pickUpItem(side) {
var _local1 = this;
var _local2 = _root;
if (side == "left") {
arraypointer = messonleft;
} else {
arraypointer = messonright;
}
m = 0;
while (m < arraypointer.length) {
messname = "mess" + arraypointer[m];
if (_local1[messname].hitTest(char.pickupspot)) {
charholding = _local1[messname].messtype;
_local1[messname].removeMovieClip();
arraypointer.splice(m, 1);
_local2.itemholdingright.gotoAndStop(2);
_local2.itemholdingright.item.gotoAndStop(charholding);
trace(charholding);
return;
}
m++;
}
}
function createMess(side) {
var _local1 = this;
if (side == "left") {
mtop = startheight;
mbottom = maxheight;
mleft = startwidth;
mright = maxwidth;
messonleft.push(depth);
} else {
mtop = startheight;
mbottom = maxheight;
mleft = maxwidth;
mright = maxright;
messonright.push(depth);
}
positionfound = false;
newname = "mess" + depth;
_local1.attachMovie("mess", newname, depth);
mtype = random(3) + 1;
if (mtype == 1) {
messis = "rubbish";
}
if (mtype == 2) {
messis = "clothes";
}
if (mtype == 3) {
messis = "cds";
}
_local1[newname].gotoAndStop(mtype);
_local1[newname]._rotation = random(360);
while (positionfound == false) {
xpos = random(int(mright - mleft)) + mleft;
ypos = random(int(mbottom - mtop)) + mtop;
messtop = ypos;
messbottom = ypos + _local1[newname]._height;
messleft = xpos;
messright = xpos + _local1[newname]._width;
onitem = false;
i = 0;
while (i < itemsinroom.length) {
itemaddress = itemsinroom[i];
itemheight = _local1[itemaddress]._height;
itemwidth = _local1[itemaddress]._width;
itemx = _local1[itemaddress]._x;
itemy = _local1[itemaddress]._y;
itemtop = itemy;
itembottom = itemy + itemheight;
itemleft = itemx;
itemright = itemx + itemwidth;
if ((((messbottom > itemtop) && (messtop < itembottom)) && (messright > itemleft)) && (messleft < itemright)) {
onitem = true;
}
i++;
}
if (onitem == false) {
positionfound = true;
}
}
_local1[newname]._x = xpos;
_local1[newname]._y = ypos;
_local1[newname].messtype = messis;
_local1[newname].messnumber = depth;
depth++;
}
function controlChar(charaddress) {
var _local1 = this;
var _local2 = charaddress;
chartargetx = _local2._x;
chartargety = _local2._y;
positionchange = false;
if (k(kR)) {
_local2._rotation = _local2._rotation + rotationspeed;
} else if (k(kL)) {
_local2._rotation = _local2._rotation - rotationspeed;
}
if (k(kU)) {
angle = ((_local2._rotation / 360) * 2) * Math.PI;
chartargetx = chartargetx + (walkspeed * Math.sin(angle));
chartargety = chartargety + ((-walkspeed) * Math.cos(angle));
positionchange = true;
} else if (k(kD)) {
angle = ((_local2._rotation / 360) * 2) * Math.PI;
chartargetx = chartargetx - (walkspeed * Math.sin(angle));
chartargety = chartargety - ((-walkspeed) * Math.cos(angle));
positionchange = true;
}
if (positionchange == true) {
canmovex = true;
canmovey = true;
chartop = chartargety - (charheight / 2);
charbottom = chartargety + (charheight / 2);
charleft = chartargetx - (charwidth / 2);
charright = chartargetx + (charwidth / 2);
outboundary = false;
if ((chartop < startheight) || (charbottom > maxheight)) {
trace("outta the top");
canmovey = false;
outboundary = true;
if (char._y < (startheight + 100)) {
char._y = startheight + (charheight / 2);
} else {
char._y = maxheight - (charheight / 2);
}
}
if ((charleft < maxwidth) || (charright > maxright)) {
trace("out");
canmovex = false;
outboundary = true;
if (char._x < (maxwidth + 100)) {
char._x = maxwidth + (charwidth / 2);
} else {
char._x = maxright - (charwidth / 2);
trace(maxwidth);
}
}
settoedge = false;
i = 0;
while (i < itemsinroom.length) {
itemaddress = itemsinroom[i];
itemheight = _local1[itemaddress]._height;
itemwidth = _local1[itemaddress]._width;
itemx = _local1[itemaddress]._x;
itemy = _local1[itemaddress]._y;
itemtop = itemy;
itembottom = itemy + itemheight;
itemleft = itemx;
itemright = itemx + itemwidth;
if ((((charbottom > itemtop) && (chartop < itembottom)) && (charright > itemleft)) && (charleft < itemright)) {
canmovey = false;
canmovex = false;
whotouchedme++;
charycentre = chartargety;
charxcentre = chartargetx;
if (((outboundary == false) && (settoedge == false)) && (whotouchedmelast < 2)) {
chartop = char._y - (charheight / 2);
charbottom = char._y + (charheight / 2);
charleft = char._x - (charwidth / 2);
charright = char._x + (charwidth / 2);
if ((charbottom > itemtop) && (chartop < itembottom)) {
canmovey = true;
settoedge = true;
if (char._x < itemx) {
char._x = itemleft - (charwidth / 2);
} else {
char._x = itemright + (charwidth / 2);
}
} else if ((charright > itemleft) && (charleft < itemright)) {
canmovex = true;
settoedge = true;
if (char._y < itemy) {
char._y = itemtop - (charheight / 2);
} else {
char._y = itembottom + (charheight / 2);
}
}
}
}
i++;
}
whotouchedmelast = whotouchedme;
whotouchedme = 0;
if (whotouchedmelast > 1) {
canmovex = false;
canmovey = false;
}
if (canmovex == true) {
_local2._x = chartargetx;
}
if (canmovey == true) {
_local2._y = chartargety;
}
}
}
function rubbishMeter() {
var _local1 = _root;
totalamount = messonleft.length + messonright.length;
leftpercent = (messonleft.length / totalamount) * 100;
pixpercent = (rml / 100) * leftpercent;
_local1.leftp = int(leftpercent) + "%";
_local1.rightp = (100 - int(leftpercent)) + "%";
_local1.rubbishmeter.meterbar._x = pixpercent;
}
startwidth = 0;
startheight = 0;
maxheight = this._height;
maxright = this._width;
maxwidth = boundary._x;
charheight = char.charbody._height;
charwidth = charheight;
char.swapDepths(10001);
rotationspeed = 10;
walkspeed = 6;
charholding = "";
itemsinroom = [];
messonleft = [];
messonright = [];
rubbishinplay = false;
rubbishballs = [];
var k = Key.isDown;
var kU = 38;
var kD = 40;
var kL = 37;
var kR = 39;
var kS = 32;
var kE = 16;
rml = _root.rubbishmeter._width;
_root.rubbishmeter.meterbar._x = 0;
depth = 10;
messspawned = false;
numbertogenerate = 15;
spacetimer = 0;
spacereset = 5;
rthrowdistance = 120;
rpeak = 50;
rspeed = 5;
seconds = 60;
framecount = 0;
framereset = 30;
_root.onEnterFrame = function () {
controlChar(char);
if (messspawned == false) {
n = 0;
while (n < numbertogenerate) {
createMess("left");
createMess("right");
n++;
}
messspawned = true;
}
mrcomputer();
if (rubbishinplay == true) {
moveRubbish();
}
if (spacetimer < 0) {
if (k(kE)) {
performaction();
spacetimer = spacereset;
}
}
spacetimer--;
rubbishMeter();
runtimer();
if (random(1500) == 1) {
if (leftwindow._currentframe == 1) {
leftwindow.play();
trace("window open!");
}
}
if (random(500) == 1) {
if (rightdoor._currentframe == 1) {
rightdoor.play();
trace("window open!");
}
}
if (_root.leftwindowopen == true) {
openWindow("left");
}
if (_root.rightdooropen == true) {
openWindow("right");
}
controlchartwo(chartwo);
if (c2spacetimer < 0) {
if (k(kS)) {
c2performaction();
c2spacetimer = c2spacereset;
}
}
c2spacetimer--;
};
windowtimer = 0;
windowreset = 30;
whotouchedme = 0;
whotouchedmelast = 0;
Symbol 503 MovieClip Frame 1
stop();
Symbol 513 MovieClip Frame 1
stop();
Symbol 516 MovieClip Frame 1
stop();
Symbol 522 MovieClip Frame 1
stop();
Symbol 523 Button
on (release) {
if (_root.oneplayer == "josh") {
_root.gotoAndStop("joshgame");
} else {
_root.gotoAndStop("drakegame");
}
}
Symbol 527 MovieClip Frame 1
stop();
Symbol 535 MovieClip Frame 1
stop();
Symbol 538 MovieClip Frame 1
stop();
Symbol 544 MovieClip Frame 1
stop();
Symbol 545 Button
on (release) {
if (_root.oneplayer == "josh") {
_root.gotoAndStop("joshgame");
} else {
_root.gotoAndStop("drakegame");
}
}
Symbol 550 MovieClip Frame 1
stop();
Symbol 566 MovieClip Frame 1
stop();
Symbol 567 Button
on (release) {
if (_root.firstgamewinner == "drake") {
_root.gotoAndStop("twoplayergame");
} else {
_root.gotoAndStop("twoplayerjosh");
}
}
Symbol 570 MovieClip Frame 23
stop();
Symbol 570 MovieClip Frame 46
stop();
Symbol 570 MovieClip Frame 47
trace("first game winner is =" + _root.firstgamewinner);
Symbol 570 MovieClip Frame 69
stop();
Symbol 570 MovieClip Frame 70
trace("first game winner is =" + _root.firstgamewinner);
Symbol 570 MovieClip Frame 92
stop();
Symbol 592 MovieClip Frame 1
stop();
Symbol 592 MovieClip Frame 15
this.gotoAndStop(1);
Symbol 592 MovieClip Frame 29
this.gotoAndStop(1);
Symbol 592 MovieClip Frame 43
this.gotoAndStop(1);
Symbol 592 MovieClip Frame 57
this.gotoAndStop(1);
Symbol 592 MovieClip Frame 71
this.gotoAndStop(1);
Symbol 592 MovieClip Frame 85
this.gotoAndStop(1);
Symbol 592 MovieClip Frame 99
this.gotoAndStop(1);
Symbol 593 MovieClip Frame 1
function checkkeysjosh(nametocheck) {
var _local1 = nametocheck;
var _local2 = _root;
updown = false;
rightdown = false;
downdown = false;
leftdown = false;
if (k(kU)) {
updown = true;
}
if (k(kR)) {
rightdown = true;
}
if (k(kD)) {
downdown = true;
}
if (k(kL)) {
leftdown = true;
}
typeoficon = scrolling[_local1].mytype;
if (scrolling[_local1].passedjosh == false) {
if (typeoficon == "up") {
if ((((updown == true) && (rightdown == false)) && (downdown == false)) && (leftdown == false)) {
scrolling[_local1].passedjosh = true;
joshscore = joshscore + scoreincrement;
joshcombo++;
joshmissedrow = 0;
}
} else if (typeoficon == "right") {
if ((((updown == false) && (rightdown == true)) && (downdown == false)) && (leftdown == false)) {
scrolling[_local1].passedjosh = true;
joshscore = joshscore + scoreincrement;
joshcombo++;
joshmissedrow = 0;
}
} else if (typeoficon == "down") {
if ((((updown == false) && (rightdown == false)) && (downdown == true)) && (leftdown == false)) {
scrolling[_local1].passedjosh = true;
joshscore = joshscore + scoreincrement;
joshcombo++;
joshmissedrow = 0;
}
} else if (typeoficon == "left") {
if ((((updown == false) && (rightdown == false)) && (downdown == false)) && (leftdown == true)) {
scrolling[_local1].passedjosh = true;
joshscore = joshscore + scoreincrement;
joshcombo++;
joshmissedrow = 0;
}
} else if (typeoficon == "updown") {
if ((((updown == true) && (rightdown == false)) && (downdown == true)) && (leftdown == false)) {
scrolling[_local1].passedjosh = true;
joshscore = joshscore + (scoreincrement * 3);
joshcombo++;
joshmissedrow = 0;
}
} else if (typeoficon == "leftright") {
if ((((updown == false) && (rightdown == true)) && (downdown == false)) && (leftdown == true)) {
scrolling[_local1].passedjosh = true;
joshscore = joshscore + (scoreincrement * 3);
joshcombo++;
joshmissedrow = 0;
}
} else if (typeoficon == "upright") {
if ((((updown == true) && (rightdown == true)) && (downdown == false)) && (leftdown == false)) {
scrolling[_local1].passedjosh = true;
joshscore = joshscore + (scoreincrement * 3);
joshcombo++;
joshmissedrow = 0;
}
} else if (typeoficon == "leftdown") {
if ((((updown == true) && (rightdown == false)) && (downdown == false)) && (leftdown == true)) {
scrolling[_local1].passedjosh = true;
joshscore = joshscore + (scoreincrement * 3);
joshcombo++;
joshmissedrow = 0;
}
} else if (typeoficon == "downright") {
if ((((updown == false) && (rightdown == true)) && (downdown == true)) && (leftdown == false)) {
scrolling[_local1].passedjosh = true;
joshscore = joshscore + (scoreincrement * 5);
joshcombo++;
joshmissedrow = 0;
}
} else if (typeoficon == "leftdownright") {
if ((((updown == false) && (rightdown == true)) && (downdown == true)) && (leftdown == true)) {
scrolling[_local1].passedjosh = true;
joshscore = joshscore + (scoreincrement * 5);
joshcombo++;
joshmissedrow = 0;
}
}
if (scrolling[_local1].passedjosh == true) {
scrolling[scrollname].whohitsme = "nobbynomates";
righthighlight = false;
righthitdisplay.gotoAndStop(1);
joshscore = joshscore + (int(joshcombo / 10) * scoreincrement);
_local2.thingbinhit = true;
if (_local2.oneplayer == "drake") {
if (thisone == false) {
_local2.loadbmps.drakebuzz.play();
thisone = true;
} else {
_local2.loadbmps.joshtalk.play();
thisone = false;
}
} else if (thisone == false) {
_local2.loadbmps.joshbuzz.play();
thisone = true;
} else {
_local2.loadbmps.drakemove.play();
thisone = false;
}
}
lightupmyworlddrake();
}
}
function scrollhitme() {
var _local1 = _root;
var _local2 = _parent;
i = 0;
while (i < hitmearray.length) {
scrollname = ["hitme" + hitmearray[i]];
scrolling[scrollname]._x = scrolling[scrollname]._x + speed;
poopeepassed = false;
if (scrolling[scrollname]._x < righthitareax) {
distanceaway = int(righthitareax - scrolling[scrollname]._x);
} else {
distanceaway = int(scrolling[scrollname]._x - righthitareax);
poopeepassed = true;
}
if ((distanceaway < 70) && (poopeepassed == false)) {
scrolling[scrollname]._xscale = scrolling[scrollname]._xscale + (speed * 1.5);
scrolling[scrollname]._yscale = scrolling[scrollname]._yscale + (speed * 1.5);
scrolling[scrollname]._y = scrolling[scrollname]._y - (speed / 5);
} else if (distanceaway < 20) {
scrolling[scrollname]._xscale = scrolling[scrollname]._xscale - (speed * 1.5);
scrolling[scrollname]._yscale = scrolling[scrollname]._yscale - (speed * 1.5);
scrolling[scrollname]._y = scrolling[scrollname]._y + 1;
}
if (scrolling[scrollname]._x > ofstage) {
scrolling[scrollname].removeMovieClip();
hitmearray.splice(i, 1);
i--;
} else {
leway = 15;
if (((scrolling[scrollname]._x > (righthitareax - leway)) && (scrolling[scrollname]._x < (righthitareax + leway))) && (scrolling[scrollname].passedjosh == false)) {
if (scrolling[scrollname].passedjosh == false) {
righthighlight = true;
checkkeysjosh(scrollname);
if (_local1.thingbinhit == true) {
if (distanceaway < 2) {
acc.gotoAndPlay("perfect");
joshperfects++;
joshscore = joshscore + ((int(joshcombo) * scoreincrement) * joshperfects);
} else if (distanceaway < 4) {
acc.gotoAndPlay("excellent");
joshperfects = 0;
joshscore = joshscore + (int(joshcombo / 2) * scoreincrement);
} else if (distanceaway < 6) {
acc.gotoAndPlay("good");
joshperfects = 0;
} else if (distanceaway < 9) {
acc.gotoAndPlay("average");
joshperfects = 0;
} else if (distanceaway < 11) {
acc.gotoAndPlay("poor");
joshperfects = 0;
} else {
acc.gotoAndPlay("dismal");
joshperfects = 0;
lightupmyworlddrake();
}
}
_local1.thingbinhit = false;
}
} else if (scrolling[scrollname]._x > (righthitareax + leway)) {
righthighlight = false;
if (scrolling[scrollname].passedjosh == false) {
joshcombo = 0;
joshmissedrow++;
if (joshmissedrow > missedtoloselife) {
sBheavy.start();
lightupmyworlddrake();
if (joshlives == 3) {
_local1.dlife3.gotoAndStop(2);
}
if (joshlives == 2) {
_local1.dlife2.gotoAndStop(2);
}
if (joshlives == 1) {
if (_local1.oneplayer == "drake") {
}
_local1.secondgamescore = _local1.jscore;
_local1.secondgameover = true;
_local2.danceexit.play();
delete _local1.onEnterFrame;
}
joshlives--;
joshmissedrow = 0;
scoreincrement = 0;
acc.gotoAndPlay("missed");
}
jmissed = true;
}
scrolling[scrollname].passedjosh = true;
}
if (righthighlight == true) {
righthitdisplay.gotoAndStop(2);
} else {
righthitdisplay.gotoAndStop(1);
}
}
i++;
}
}
function lightupmyworlddrake() {
var _local1 = this;
l = 1;
while (l < 11) {
lightname = "dl" + l;
if (joshcombo > (l - 1)) {
_local1[lightname].gotoAndStop(2);
} else {
_local1[lightname].gotoAndStop(1);
if (l == 1) {
p = 1;
while (p < 11) {
lightname = "dl" + p;
_local1[lightname].gotoAndStop(1);
p++;
}
}
return;
}
l++;
}
}
function createnew() {
myname = ["hitme" + depth];
if (_root.oneplayer == "drake") {
scrolling.attachMovie("hitmedrake", myname, depth);
} else {
scrolling.attachMovie("hitmejosh", myname, depth);
}
scrolling[myname]._x = spawnx;
scrolling[myname]._y = spawny;
scrolling[myname]._xscale = 80;
scrolling[myname]._yscale = 80;
scrolling[myname].whohitsme = "josh";
thistype = random(numberdifferent) + 1;
scrolling[myname].gotoAndStop(thistype);
findtype = eval ("hf" + thistype);
scrolling[myname].mytype = findtype;
scrolling[myname].typenum = thistype;
scrolling[myname].myspeed = speed;
scrolling[myname].passedjosh = false;
hitmearray.push(depth);
depth++;
}
function loadNextMovie() {
var _local1 = _parent;
storeq = questionscorrect;
if (questionscorrect > 7) {
questionscorrect = questionscorrect - 8;
if (questionscorrect > 7) {
questionscorrect = questionscorrect - 8;
if (questionscorrect > 7) {
questionscorrect = questionscorrect - 8;
}
}
}
if (questionscorrect == 0) {
_local1.showmovie.holder.loadMovie("guitar01.swf");
trace("load movie");
}
if (questionscorrect == 1) {
_local1.showmovie.holder.loadMovie("guitar02.swf");
trace("load movie");
}
if (questionscorrect == 2) {
_local1.showmovie.holder.loadMovie("guitar03.swf");
trace("load movie");
}
if (questionscorrect == 3) {
_local1.showmovie.holder.loadMovie("guitar04.swf");
trace("load movie");
}
if (questionscorrect == 4) {
_local1.showmovie.holder.loadMovie("guitar05.swf");
trace("load movie");
}
if (questionscorrect == 5) {
_local1.showmovie.holder.loadMovie("guitar06.swf");
trace("load movie");
}
if (questionscorrect == 6) {
_local1.showmovie.holder.loadMovie("guitar07.swf");
trace("load movie");
}
if (questionscorrect == 7) {
_local1.showmovie.holder.loadMovie("guitar08.swf");
trace("load movie");
}
questionscorrect = storeq;
}
function increasedifficulty() {
if (joshcombo > 9) {
questionscorrect++;
joshcombo = 0;
lightupmyworlddrake();
_root.showmovie.play();
_root.pauseforvid = true;
}
if (questionscorrect == 1) {
appearreset = 20;
numberdifferent = 6;
scoreincrement++;
speed = 4;
} else if (questionscorrect == 2) {
appearreset = 15;
numberdifferent = 9;
scoreincrement++;
speed = 5;
} else if (questionscorrect == 3) {
appearreset = 10;
numberdifferent = 10;
scoreincrement++;
speed = 6;
} else if (questionscorrect == 4) {
appearreset = 7;
scoreincrement++;
bonus = 150;
speed = 7;
} else if (questionscorrect == 5) {
appearreset = 7;
scoreincrement++;
bonus = 150;
speed = 7;
} else if (questionscorrect == 6) {
appearreset = 3;
scoreincrement++;
bonus = 200;
speed = 8;
} else if (questionscorrect == 7) {
appearreset = 0;
scoreincrement++;
bonus = 150;
speed = 8;
} else if ((depth == questionscorrect) == 8) {
appearreset = -1;
scoreincrement++;
bonus = 250;
speed = 9;
}
}
righthitareax = scrolling.righthit._x + (scrolling.righthit._width / 2);
ofstage = righthitareax + 100;
_root.secondgameover = false;
speed = 3;
appeartimer = 20;
appearreset = 25;
drakelives = 3;
joshlives = 3;
drakemissedrow = 0;
joshmissedrow = 0;
missedtoloselife = 0;
questionscorrect = 0;
var k = Key.isDown;
var kU = 38;
var kD = 40;
var kL = 37;
var kR = 39;
thisone = false;
drakescore = 0;
joshscore = 0;
drakecombo = 0;
joshcombo = 0;
scoreincrement = 1;
bonus = 10;
joshperfects = 0;
spawnx = scrolling.spawnhere._x;
spawny = scrolling.spawnhere._y - 5;
hf1 = "up";
hf2 = "right";
hf3 = "down";
hf4 = "left";
hf5 = "updown";
hf6 = "leftright";
hf7 = "upright";
hf8 = "leftdown";
hf9 = "downright";
hf10 = "leftdownright";
updown = false;
rightdown = false;
downdown = false;
leftdown = false;
_root.thingbinhit = false;
_root.pauseforvid = false;
depth = 0;
hitmearray = [];
numberdifferent = 4;
righthighlight = false;
jmissed = false;
_root.onEnterFrame = function () {
var _local1 = _root;
if (_local1.pauseforvid == false) {
appeartimer--;
if (appeartimer < 0) {
createnew();
appeartimer = (random(20) + appearreset) + 5;
}
scrollhitme();
_local1.jscore = joshscore;
_local1.joshcombo = joshcombo;
playSound();
}
increasedifficulty();
};
loadNextMovie();
function playSound() {
if (random(300) == 1) {
ps = random(4) + 1;
if (ps == 1) {
sIwill.start();
} else if (ps == 2) {
sPeace.start();
} else if (ps == 3) {
sThankyou.start();
} else if (ps == 4) {
sYoure.start();
}
}
}
sIwill = new Sound();
sIwill.attachSound("iwill");
sPeace = new Sound();
sPeace.attachSound("peace");
sThankyou = new Sound();
sThankyou.attachSound("thankyou");
sYoure = new Sound();
sYoure.attachSound("youre");
sError = new Sound();
sError.attachSound("errorbuzz");
sBheavy = new Sound();
sBheavy.attachSound("buzzheavy");
Symbol 609 MovieClip Frame 1
stop();
Symbol 609 MovieClip Frame 2
stop();
Symbol 614 Button
on (release) {
if (((((((((((((((((((((((_root.name == "tit") || (_root.name == "fuc")) || (_root.name == "fuk")) || (_root.name == "ass")) || (_root.name == "nob")) || (_root.name == "git")) || (_root.name == "dic")) || (_root.name == "dik")) || (_root.name == "cok")) || (_root.name == "poo")) || (_root.name == "po0")) || (_root.name == "p0o")) || (_root.name == "p00")) || (_root.name == "as5")) || (_root.name == "a5s")) || (_root.name == "a55")) || (_root.name == "bum")) || (_root.name == "t1t")) || (_root.name == "n0b")) || (_root.name == "g1t")) || (_root.name == "d1c")) || (_root.name == "d1k")) || (_root.name == "c0k")) {
_root.name = "";
} else if ((_root.name != "") && (_root.name != null)) {
_parent.email_entry.gotoAndStop("blue");
_parent.email_entry._alpha = 100;
_parent.keyboard.gotoAndStop("off");
nextFrame();
}
}
Symbol 616 MovieClip Frame 1
stop();
Symbol 616 MovieClip Frame 2
stop();
Symbol 623 Button
on (rollOver) {
gotoAndStop ("one");
}
on (rollOut) {
gotoAndStop (1);
}
on (press) {
_root.sound_holder.gotoAndStop("key_press");
if (_root.name.length < 3) {
_root.name = _root.name + "1";
}
}
Symbol 624 Button
on (rollOver) {
gotoAndStop ("two");
}
on (rollOut) {
gotoAndStop (1);
}
on (press) {
_root.sound_holder.gotoAndStop("key_press");
if (_root.name.length < 3) {
_root.name = _root.name + "2";
}
}
Symbol 625 Button
on (rollOver) {
gotoAndStop ("three");
}
on (rollOut) {
gotoAndStop (1);
}
on (press) {
_root.sound_holder.gotoAndStop("key_press");
if (_root.name.length < 3) {
_root.name = _root.name + "3";
}
}
Symbol 626 Button
on (rollOver) {
gotoAndStop ("four");
}
on (rollOut) {
gotoAndStop (1);
}
on (press) {
_root.sound_holder.gotoAndStop("key_press");
if (_root.name.length < 3) {
_root.name = _root.name + "4";
}
}
Symbol 627 Button
on (rollOver) {
gotoAndStop ("five");
}
on (rollOut) {
gotoAndStop (1);
}
on (press) {
_root.sound_holder.gotoAndStop("key_press");
if (_root.name.length < 3) {
_root.name = _root.name + "5";
}
}
Symbol 628 Button
on (rollOver) {
gotoAndStop ("six");
}
on (rollOut) {
gotoAndStop (1);
}
on (press) {
_root.sound_holder.gotoAndStop("key_press");
if (_root.name.length < 3) {
_root.name = _root.name + "6";
}
}
Symbol 629 Button
on (rollOver) {
gotoAndStop ("seven");
}
on (rollOut) {
gotoAndStop (1);
}
on (press) {
_root.sound_holder.gotoAndStop("key_press");
if (_root.name.length < 3) {
_root.name = _root.name + "7";
}
}
Symbol 630 Button
on (rollOver) {
gotoAndStop ("eight");
}
on (rollOut) {
gotoAndStop (1);
}
on (press) {
_root.sound_holder.gotoAndStop("key_press");
if (_root.name.length < 3) {
_root.name = _root.name + "8";
}
}
Symbol 631 Button
on (rollOver) {
gotoAndStop ("nine");
}
on (rollOut) {
gotoAndStop (1);
}
on (press) {
_root.sound_holder.gotoAndStop("key_press");
if (_root.name.length < 3) {
_root.name = _root.name + "9";
}
}
Symbol 632 Button
on (rollOver) {
gotoAndStop ("zero");
}
on (rollOut) {
gotoAndStop (1);
}
on (press) {
_root.sound_holder.gotoAndStop("key_press");
if (_root.name.length < 3) {
_root.name = _root.name + "0";
}
}
Symbol 633 Button
on (rollOver) {
gotoAndStop ("q");
}
on (rollOut) {
gotoAndStop (1);
}
on (press) {
_root.sound_holder.gotoAndStop("key_press");
if (_root.name.length < 3) {
_root.name = _root.name + "q";
}
}
Symbol 634 Button
on (rollOver) {
gotoAndStop ("w");
}
on (rollOut) {
gotoAndStop (1);
}
on (press) {
_root.sound_holder.gotoAndStop("key_press");
if (_root.name.length < 3) {
_root.name = _root.name + "w";
}
}
Symbol 635 Button
on (rollOver) {
gotoAndStop ("e");
}
on (rollOut) {
gotoAndStop (1);
}
on (press) {
_root.sound_holder.gotoAndStop("key_press");
if (_root.name.length < 3) {
_root.name = _root.name + "e";
}
}
Symbol 636 Button
on (rollOver) {
gotoAndStop ("r");
}
on (rollOut) {
gotoAndStop (1);
}
on (press) {
_root.sound_holder.gotoAndStop("key_press");
if (_root.name.length < 3) {
_root.name = _root.name + "r";
}
}
Symbol 637 Button
on (rollOver) {
gotoAndStop ("t");
}
on (rollOut) {
gotoAndStop (1);
}
on (press) {
_root.sound_holder.gotoAndStop("key_press");
if (_root.name.length < 3) {
_root.name = _root.name + "t";
}
}
Symbol 638 Button
on (rollOver) {
gotoAndStop ("y");
}
on (rollOut) {
gotoAndStop (1);
}
on (press) {
_root.sound_holder.gotoAndStop("key_press");
if (_root.name.length < 3) {
_root.name = _root.name + "y";
}
}
Symbol 639 Button
on (rollOver) {
gotoAndStop ("u");
}
on (rollOut) {
gotoAndStop (1);
}
on (press) {
_root.sound_holder.gotoAndStop("key_press");
if (_root.name.length < 3) {
_root.name = _root.name + "u";
}
}
Symbol 640 Button
on (rollOver) {
gotoAndStop ("i");
}
on (rollOut) {
gotoAndStop (1);
}
on (press) {
_root.sound_holder.gotoAndStop("key_press");
if (_root.name.length < 3) {
_root.name = _root.name + "i";
}
}
Symbol 641 Button
on (rollOver) {
gotoAndStop ("o");
}
on (rollOut) {
gotoAndStop (1);
}
on (press) {
_root.sound_holder.gotoAndStop("key_press");
if (_root.name.length < 3) {
_root.name = _root.name + "o";
}
}
Symbol 642 Button
on (rollOver) {
gotoAndStop ("p");
}
on (rollOut) {
gotoAndStop (1);
}
on (press) {
_root.sound_holder.gotoAndStop("key_press");
if (_root.name.length < 3) {
_root.name = _root.name + "p";
}
}
Symbol 643 Button
on (rollOver) {
gotoAndStop ("a");
}
on (rollOut) {
gotoAndStop (1);
}
on (press) {
_root.sound_holder.gotoAndStop("key_press");
if (_root.name.length < 3) {
_root.name = _root.name + "a";
}
}
Symbol 644 Button
on (rollOver) {
gotoAndStop ("s");
}
on (rollOut) {
gotoAndStop (1);
}
on (press) {
_root.sound_holder.gotoAndStop("key_press");
if (_root.name.length < 3) {
_root.name = _root.name + "s";
}
}
Symbol 645 Button
on (rollOver) {
gotoAndStop ("d");
}
on (rollOut) {
gotoAndStop (1);
}
on (press) {
_root.sound_holder.gotoAndStop("key_press");
if (_root.name.length < 3) {
_root.name = _root.name + "d";
}
}
Symbol 646 Button
on (rollOver) {
gotoAndStop ("f");
}
on (rollOut) {
gotoAndStop (1);
}
on (press) {
_root.sound_holder.gotoAndStop("key_press");
if (_root.name.length < 3) {
_root.name = _root.name + "f";
}
}
Symbol 647 Button
on (rollOver) {
gotoAndStop ("g");
}
on (rollOut) {
gotoAndStop (1);
}
on (press) {
_root.sound_holder.gotoAndStop("key_press");
if (_root.name.length < 3) {
_root.name = _root.name + "g";
}
}
Symbol 648 Button
on (rollOver) {
gotoAndStop ("h");
}
on (rollOut) {
gotoAndStop (1);
}
on (press) {
_root.sound_holder.gotoAndStop("key_press");
if (_root.name.length < 3) {
_root.name = _root.name + "h";
}
}
Symbol 649 Button
on (rollOver) {
gotoAndStop ("j");
}
on (rollOut) {
gotoAndStop (1);
}
on (press) {
_root.sound_holder.gotoAndStop("key_press");
if (_root.name.length < 3) {
_root.name = _root.name + "j";
}
}
Symbol 650 Button
on (rollOver) {
gotoAndStop ("k");
}
on (rollOut) {
gotoAndStop (1);
}
on (press) {
_root.sound_holder.gotoAndStop("key_press");
if (_root.name.length < 3) {
_root.name = _root.name + "k";
}
}
Symbol 651 Button
on (rollOver) {
gotoAndStop ("l");
}
on (rollOut) {
gotoAndStop (1);
}
on (press) {
_root.sound_holder.gotoAndStop("key_press");
if (_root.name.length < 3) {
_root.name = _root.name + "l";
}
}
Symbol 652 Button
on (rollOver) {
gotoAndStop ("z");
}
on (rollOut) {
gotoAndStop (1);
}
on (press) {
_root.sound_holder.gotoAndStop("key_press");
if (_root.name.length < 3) {
_root.name = _root.name + "z";
}
}
Symbol 653 Button
on (rollOver) {
gotoAndStop ("x");
}
on (rollOut) {
gotoAndStop (1);
}
on (press) {
_root.sound_holder.gotoAndStop("key_press");
if (_root.name.length < 3) {
_root.name = _root.name + "x";
}
}
Symbol 654 Button
on (rollOver) {
gotoAndStop ("c");
}
on (rollOut) {
gotoAndStop (1);
}
on (press) {
_root.sound_holder.gotoAndStop("key_press");
if (_root.name.length < 3) {
_root.name = _root.name + "c";
}
}
Symbol 655 Button
on (rollOver) {
gotoAndStop ("v");
}
on (rollOut) {
gotoAndStop (1);
}
on (press) {
_root.sound_holder.gotoAndStop("key_press");
if (_root.name.length < 3) {
_root.name = _root.name + "v";
}
}
Symbol 656 Button
on (rollOver) {
gotoAndStop ("b");
}
on (rollOut) {
gotoAndStop (1);
}
on (press) {
_root.sound_holder.gotoAndStop("key_press");
if (_root.name.length < 3) {
_root.name = _root.name + "b";
}
}
Symbol 657 Button
on (rollOver) {
gotoAndStop ("n");
}
on (rollOut) {
gotoAndStop (1);
}
on (press) {
_root.sound_holder.gotoAndStop("key_press");
if (_root.name.length < 3) {
_root.name = _root.name + "n";
}
}
Symbol 658 Button
on (rollOver) {
gotoAndStop ("m");
}
on (rollOut) {
gotoAndStop (1);
}
on (press) {
_root.sound_holder.gotoAndStop("key_press");
if (_root.name.length < 3) {
_root.name = _root.name + "m";
}
}
Symbol 659 Button
on (rollOver) {
gotoAndStop ("space");
}
on (rollOut) {
gotoAndStop (1);
}
on (press) {
_root.sound_holder.gotoAndStop("key_press");
if (_root.name.length < 3) {
_root.name = _root.name + " ";
}
}
Symbol 660 Button
on (rollOver) {
gotoAndStop ("del");
}
on (rollOut) {
gotoAndStop (1);
}
on (press) {
_root.sound_holder.gotoAndStop("key_press");
if (_root.name.length == 1) {
_root.name = "";
} else if (_root.name.length == 2) {
_root.name = _root.name.slice(0, 1);
} else if (_root.name.length == 3) {
_root.name = _root.name.slice(0, 2);
}
}
Symbol 700 MovieClip Frame 1
stop();
Instance of Symbol 661 MovieClip "v" in Symbol 700 MovieClip Frame 1
onClipEvent (load) {
delete Key.isDown;
}
onClipEvent (keyDown) {
if (Key.isDown(48) || (Key.isDown(96))) {
_parent.gotoAndStop("zero");
_root.sound_holder.gotoAndStop("key_press");
delete Key.isDown;
if (_root.name.length < 3) {
_root.name = _root.name + "0";
}
} else if (Key.isDown(49) || (Key.isDown(97))) {
_parent.gotoAndStop("one");
_root.sound_holder.gotoAndStop("key_press");
delete Key.isDown;
if (_root.name.length < 3) {
_root.name = _root.name + "1";
}
} else if (Key.isDown(50) || (Key.isDown(98))) {
_parent.gotoAndStop("two");
_root.sound_holder.gotoAndStop("key_press");
delete Key.isDown;
if (_root.name.length < 3) {
_root.name = _root.name + "2";
}
} else if (Key.isDown(51) || (Key.isDown(99))) {
_parent.gotoAndStop("three");
_root.sound_holder.gotoAndStop("key_press");
delete Key.isDown;
if (_root.name.length < 3) {
_root.name = _root.name + "3";
}
} else if (Key.isDown(52) || (Key.isDown(100))) {
_parent.gotoAndStop("four");
_root.sound_holder.gotoAndStop("key_press");
delete Key.isDown;
if (_root.name.length < 3) {
_root.name = _root.name + "4";
}
} else if (Key.isDown(53) || (Key.isDown(101))) {
_parent.gotoAndStop("five");
_root.sound_holder.gotoAndStop("key_press");
delete Key.isDown;
if (_root.name.length < 3) {
_root.name = _root.name + "5";
}
} else if (Key.isDown(54) || (Key.isDown(102))) {
_parent.gotoAndStop("six");
_root.sound_holder.gotoAndStop("key_press");
delete Key.isDown;
if (_root.name.length < 3) {
_root.name = _root.name + "6";
}
} else if (Key.isDown(55) || (Key.isDown(103))) {
_parent.gotoAndStop("seven");
_root.sound_holder.gotoAndStop("key_press");
delete Key.isDown;
if (_root.name.length < 3) {
_root.name = _root.name + "7";
}
} else if (Key.isDown(56) || (Key.isDown(104))) {
_parent.gotoAndStop("eight");
_root.sound_holder.gotoAndStop("key_press");
delete Key.isDown;
if (_root.name.length < 3) {
_root.name = _root.name + "8";
}
} else if (Key.isDown(57) || Key.isDown(105)) {
_parent.gotoAndStop("nine");
_root.sound_holder.gotoAndStop("key_press");
delete Key.isDown;
if (_root.name.length < 3) {
_root.name = _root.name + "9";
}
} else if (Key.isDown(65)) {
_parent.gotoAndStop("a");
_root.sound_holder.gotoAndStop("key_press");
delete Key.isDown;
if (_root.name.length < 3) {
_root.name = _root.name + "a";
}
} else if (Key.isDown(66)) {
_parent.gotoAndStop("b");
_root.sound_holder.gotoAndStop("key_press");
delete Key.isDown;
if (_root.name.length < 3) {
_root.name = _root.name + "b";
}
} else if (Key.isDown(67)) {
_parent.gotoAndStop("c");
_root.sound_holder.gotoAndStop("key_press");
delete Key.isDown;
if (_root.name.length < 3) {
_root.name = _root.name + "c";
}
} else if (Key.isDown(68)) {
_parent.gotoAndStop("d");
_root.sound_holder.gotoAndStop("key_press");
delete Key.isDown;
if (_root.name.length < 3) {
_root.name = _root.name + "d";
}
} else if (Key.isDown(69)) {
_parent.gotoAndStop("e");
_root.sound_holder.gotoAndStop("key_press");
delete Key.isDown;
if (_root.name.length < 3) {
_root.name = _root.name + "e";
}
} else if (Key.isDown(70)) {
_parent.gotoAndStop("f");
_root.sound_holder.gotoAndStop("key_press");
delete Key.isDown;
if (_root.name.length < 3) {
_root.name = _root.name + "f";
}
} else if (Key.isDown(71)) {
_parent.gotoAndStop("g");
_root.sound_holder.gotoAndStop("key_press");
delete Key.isDown;
if (_root.name.length < 3) {
_root.name = _root.name + "g";
}
} else if (Key.isDown(72)) {
_parent.gotoAndStop("h");
_root.sound_holder.gotoAndStop("key_press");
delete Key.isDown;
if (_root.name.length < 3) {
_root.name = _root.name + "h";
}
} else if (Key.isDown(73)) {
_parent.gotoAndStop("i");
_root.sound_holder.gotoAndStop("key_press");
delete Key.isDown;
if (_root.name.length < 3) {
_root.name = _root.name + "i";
}
} else if (Key.isDown(74)) {
_parent.gotoAndStop("j");
_root.sound_holder.gotoAndStop("key_press");
delete Key.isDown;
if (_root.name.length < 3) {
_root.name = _root.name + "j";
}
} else if (Key.isDown(75)) {
_parent.gotoAndStop("k");
_root.sound_holder.gotoAndStop("key_press");
delete Key.isDown;
if (_root.name.length < 3) {
_root.name = _root.name + "k";
}
} else if (Key.isDown(76)) {
_parent.gotoAndStop("l");
_root.sound_holder.gotoAndStop("key_press");
delete Key.isDown;
if (_root.name.length < 3) {
_root.name = _root.name + "l";
}
} else if (Key.isDown(77)) {
_parent.gotoAndStop("m");
_root.sound_holder.gotoAndStop("key_press");
delete Key.isDown;
if (_root.name.length < 3) {
_root.name = _root.name + "m";
}
} else if (Key.isDown(78)) {
_parent.gotoAndStop("n");
_root.sound_holder.gotoAndStop("key_press");
delete Key.isDown;
if (_root.name.length < 3) {
_root.name = _root.name + "n";
}
} else if (Key.isDown(79)) {
_parent.gotoAndStop("o");
_root.sound_holder.gotoAndStop("key_press");
delete Key.isDown;
if (_root.name.length < 3) {
_root.name = _root.name + "o";
}
} else if (Key.isDown(80)) {
_parent.gotoAndStop("p");
_root.sound_holder.gotoAndStop("key_press");
delete Key.isDown;
if (_root.name.length < 3) {
_root.name = _root.name + "p";
}
} else if (Key.isDown(81)) {
_parent.gotoAndStop("q");
_root.sound_holder.gotoAndStop("key_press");
delete Key.isDown;
if (_root.name.length < 3) {
_root.name = _root.name + "q";
}
} else if (Key.isDown(82)) {
_parent.gotoAndStop("r");
_root.sound_holder.gotoAndStop("key_press");
delete Key.isDown;
if (_root.name.length < 3) {
_root.name = _root.name + "r";
}
} else if (Key.isDown(83)) {
_parent.gotoAndStop("s");
_root.sound_holder.gotoAndStop("key_press");
delete Key.isDown;
if (_root.name.length < 3) {
_root.name = _root.name + "s";
}
} else if (Key.isDown(84)) {
_parent.gotoAndStop("t");
_root.sound_holder.gotoAndStop("key_press");
delete Key.isDown;
if (_root.name.length < 3) {
_root.name = _root.name + "t";
}
} else if (Key.isDown(85)) {
_parent.gotoAndStop("u");
_root.sound_holder.gotoAndStop("key_press");
delete Key.isDown;
if (_root.name.length < 3) {
_root.name = _root.name + "u";
}
} else if (Key.isDown(86)) {
_parent.gotoAndStop("v");
_root.sound_holder.gotoAndStop("key_press");
delete Key.isDown;
if (_root.name.length < 3) {
_root.name = _root.name + "v";
}
} else if (Key.isDown(87)) {
_parent.gotoAndStop("w");
_root.sound_holder.gotoAndStop("key_press");
delete Key.isDown;
if (_root.name.length < 3) {
_root.name = _root.name + "w";
}
} else if (Key.isDown(88)) {
_parent.gotoAndStop("x");
_root.sound_holder.gotoAndStop("key_press");
delete Key.isDown;
if (_root.name.length < 3) {
_root.name = _root.name + "x";
}
} else if (Key.isDown(89)) {
_parent.gotoAndStop("y");
_root.sound_holder.gotoAndStop("key_press");
delete Key.isDown;
if (_root.name.length < 3) {
_root.name = _root.name + "y";
}
} else if (Key.isDown(90)) {
_parent.gotoAndStop("z");
_root.sound_holder.gotoAndStop("key_press");
delete Key.isDown;
if (_root.name.length < 3) {
_root.name = _root.name + "z";
}
} else if (Key.isDown(32)) {
_parent.gotoAndStop("space");
_root.sound_holder.gotoAndStop("key_press");
delete Key.isDown;
if (_root.name.length < 3) {
_root.name = _root.name + " ";
}
} else if (Key.isDown(46)) {
_parent.gotoAndStop("del");
_root.sound_holder.gotoAndStop("key_press");
delete Key.isDown;
if (_root.name.length == 1) {
_root.name = "";
} else if (_root.name.length == 2) {
_root.name = _root.name.slice(0, 1);
} else if (_root.name.length == 3) {
_root.name = _root.name.slice(0, 2);
}
}
}
onClipEvent (keyUp) {
_parent.gotoAndStop(1);
}
Symbol 700 MovieClip Frame 2
stop();
Symbol 700 MovieClip Frame 3
stop();
Symbol 700 MovieClip Frame 4
stop();
Symbol 700 MovieClip Frame 5
stop();
Symbol 700 MovieClip Frame 6
stop();
Symbol 700 MovieClip Frame 7
stop();
Symbol 700 MovieClip Frame 8
stop();
Symbol 700 MovieClip Frame 9
stop();
Symbol 700 MovieClip Frame 10
stop();
Symbol 700 MovieClip Frame 11
stop();
Symbol 700 MovieClip Frame 12
stop();
Symbol 700 MovieClip Frame 13
stop();
Symbol 700 MovieClip Frame 14
stop();
Symbol 700 MovieClip Frame 15
stop();
Symbol 700 MovieClip Frame 16
stop();
Symbol 700 MovieClip Frame 17
stop();
Symbol 700 MovieClip Frame 18
stop();
Symbol 700 MovieClip Frame 19
stop();
Symbol 700 MovieClip Frame 20
stop();
Symbol 700 MovieClip Frame 21
stop();
Symbol 700 MovieClip Frame 22
stop();
Symbol 700 MovieClip Frame 23
stop();
Symbol 700 MovieClip Frame 24
stop();
Symbol 700 MovieClip Frame 25
stop();
Symbol 700 MovieClip Frame 26
stop();
Symbol 700 MovieClip Frame 27
stop();
Symbol 700 MovieClip Frame 28
stop();
Symbol 700 MovieClip Frame 29
stop();
Symbol 700 MovieClip Frame 30
stop();
Symbol 700 MovieClip Frame 31
stop();
Symbol 700 MovieClip Frame 32
stop();
Symbol 700 MovieClip Frame 33
stop();
Symbol 700 MovieClip Frame 34
stop();
Symbol 700 MovieClip Frame 35
stop();
Symbol 700 MovieClip Frame 36
stop();
Symbol 700 MovieClip Frame 37
stop();
Symbol 700 MovieClip Frame 38
stop();
Symbol 700 MovieClip Frame 39
stop();
Symbol 700 MovieClip Frame 40
stop();
Symbol 705 Button
on (release) {
this.name = _root.name;
this.email = _root.email;
this.result = _root.result;
this.character = "not_in_this_game";
if ((((_root.name != "") && (_root.email != "")) && (_root.name != null)) && (_root.email != null)) {
loadVariablesNum ((((("drakeandjosh.asp?name=" + this.name) + "&email=") + this.email) + "&result=") + this.result, 0);
_parent.gotoAndStop("scoreboard");
}
}
Symbol 706 MovieClip Frame 1
play();
Instance of Symbol 609 MovieClip "email_entry" in Symbol 706 MovieClip Frame 6
onClipEvent (enterFrame) {
if ((_root.email == "") || (_root.email == null)) {
_root.game_over_box.game_over_tween.hiscores_button._visible = 0;
} else {
_root.game_over_box.game_over_tween.hiscores_button._visible = 1;
}
}
Symbol 706 MovieClip Frame 20
stop();
Symbol 749 Button
on (release) {
_root.gotoAndStop("startmenu");
trace("startword bound");
}
Symbol 753 MovieClip Frame 1
stop();
Symbol 754 MovieClip Frame 1
stop();
Symbol 754 MovieClip Frame 2
trace("first game mess % = " + _root.firstgamepercent);
trace("second game score = " + _root.secondgamescore);
_root.finalscore = _root.secondgamescore / (_root.firstgamepercent / 10);
_root.result = int(_root.finalscore);
trace("there for final score is " + _root.finalscore);
Symbol 754 MovieClip Frame 10
stop();
Symbol 754 MovieClip Frame 11
stop();
Symbol 765 MovieClip Frame 1
stop();
Symbol 765 MovieClip Frame 15
this.gotoAndStop(1);
Symbol 765 MovieClip Frame 29
this.gotoAndStop(1);
Symbol 765 MovieClip Frame 43
this.gotoAndStop(1);
Symbol 765 MovieClip Frame 57
this.gotoAndStop(1);
Symbol 765 MovieClip Frame 71
this.gotoAndStop(1);
Symbol 765 MovieClip Frame 85
this.gotoAndStop(1);
Symbol 765 MovieClip Frame 99
this.gotoAndStop(1);
Symbol 766 MovieClip Frame 1
function checkkeysjosh(nametocheck) {
var _local1 = nametocheck;
var _local2 = _root;
updown = false;
rightdown = false;
downdown = false;
leftdown = false;
if (k(kU)) {
updown = true;
}
if (k(kR)) {
rightdown = true;
}
if (k(kD)) {
downdown = true;
}
if (k(kL)) {
leftdown = true;
}
typeoficon = scrolling[_local1].mytype;
if (scrolling[_local1].passedjosh == false) {
if (typeoficon == "up") {
if ((((updown == true) && (rightdown == false)) && (downdown == false)) && (leftdown == false)) {
scrolling[_local1].passedjosh = true;
joshscore = joshscore + scoreincrement;
joshcombo++;
joshmissedrow = 0;
}
} else if (typeoficon == "right") {
if ((((updown == false) && (rightdown == true)) && (downdown == false)) && (leftdown == false)) {
scrolling[_local1].passedjosh = true;
joshscore = joshscore + scoreincrement;
joshcombo++;
joshmissedrow = 0;
}
} else if (typeoficon == "down") {
if ((((updown == false) && (rightdown == false)) && (downdown == true)) && (leftdown == false)) {
scrolling[_local1].passedjosh = true;
joshscore = joshscore + scoreincrement;
joshcombo++;
joshmissedrow = 0;
}
} else if (typeoficon == "left") {
if ((((updown == false) && (rightdown == false)) && (downdown == false)) && (leftdown == true)) {
scrolling[_local1].passedjosh = true;
joshscore = joshscore + scoreincrement;
joshcombo++;
joshmissedrow = 0;
}
} else if (typeoficon == "updown") {
if ((((updown == true) && (rightdown == false)) && (downdown == true)) && (leftdown == false)) {
scrolling[_local1].passedjosh = true;
joshscore = joshscore + (scoreincrement * 3);
joshcombo++;
joshmissedrow = 0;
}
} else if (typeoficon == "leftright") {
if ((((updown == false) && (rightdown == true)) && (downdown == false)) && (leftdown == true)) {
scrolling[_local1].passedjosh = true;
joshscore = joshscore + (scoreincrement * 3);
joshcombo++;
joshmissedrow = 0;
}
} else if (typeoficon == "upright") {
if ((((updown == true) && (rightdown == true)) && (downdown == false)) && (leftdown == false)) {
scrolling[_local1].passedjosh = true;
joshscore = joshscore + (scoreincrement * 3);
joshcombo++;
joshmissedrow = 0;
}
} else if (typeoficon == "leftdown") {
if ((((updown == true) && (rightdown == false)) && (downdown == false)) && (leftdown == true)) {
scrolling[_local1].passedjosh = true;
joshscore = joshscore + (scoreincrement * 3);
joshcombo++;
joshmissedrow = 0;
}
} else if (typeoficon == "downright") {
if ((((updown == false) && (rightdown == true)) && (downdown == true)) && (leftdown == false)) {
scrolling[_local1].passedjosh = true;
joshscore = joshscore + (scoreincrement * 5);
joshcombo++;
joshmissedrow = 0;
}
} else if (typeoficon == "leftdownright") {
if ((((updown == false) && (rightdown == true)) && (downdown == true)) && (leftdown == true)) {
scrolling[_local1].passedjosh = true;
joshscore = joshscore + (scoreincrement * 5);
joshcombo++;
joshmissedrow = 0;
}
}
if (scrolling[_local1].passedjosh == true) {
scrolling[scrollname].whohitsme = "nobbynomates";
righthighlight = false;
righthitdisplay.gotoAndStop(1);
joshscore = joshscore + (int(joshcombo / 10) * scoreincrement);
_local2.thingbinhit = true;
if (_local2.oneplayer == "drake") {
if (thisone == false) {
_local2.loadbmps.drakebuzz.play();
thisone = true;
} else {
_local2.loadbmps.joshtalk.play();
thisone = false;
}
} else if (thisone == false) {
_local2.loadbmps.joshbuzz.play();
thisone = true;
} else {
_local2.loadbmps.drakemove.play();
thisone = false;
}
}
lightupmyworlddrake();
}
}
function scrollhitme() {
var _local1 = _root;
var _local2 = _parent;
i = 0;
while (i < hitmearray.length) {
scrollname = ["hitme" + hitmearray[i]];
scrolling[scrollname]._x = scrolling[scrollname]._x + speed;
poopeepassed = false;
if (scrolling[scrollname]._x < righthitareax) {
distanceaway = int(righthitareax - scrolling[scrollname]._x);
} else {
distanceaway = int(scrolling[scrollname]._x - righthitareax);
poopeepassed = true;
}
if ((distanceaway < 70) && (poopeepassed == false)) {
scrolling[scrollname]._xscale = scrolling[scrollname]._xscale + (speed * 1.5);
scrolling[scrollname]._yscale = scrolling[scrollname]._yscale + (speed * 1.5);
scrolling[scrollname]._y = scrolling[scrollname]._y - (speed / 5);
} else if (distanceaway < 20) {
scrolling[scrollname]._xscale = scrolling[scrollname]._xscale - (speed * 1.5);
scrolling[scrollname]._yscale = scrolling[scrollname]._yscale - (speed * 1.5);
scrolling[scrollname]._y = scrolling[scrollname]._y + 1;
}
if (scrolling[scrollname]._x > ofstage) {
scrolling[scrollname].removeMovieClip();
hitmearray.splice(i, 1);
i--;
} else {
leway = 15;
if (((scrolling[scrollname]._x > (righthitareax - leway)) && (scrolling[scrollname]._x < (righthitareax + leway))) && (scrolling[scrollname].passedjosh == false)) {
if (scrolling[scrollname].passedjosh == false) {
righthighlight = true;
checkkeysjosh(scrollname);
if (_local1.thingbinhit == true) {
if (distanceaway < 2) {
acc.gotoAndPlay("perfect");
joshperfects++;
joshscore = joshscore + ((int(joshcombo) * scoreincrement) * joshperfects);
} else if (distanceaway < 4) {
acc.gotoAndPlay("excellent");
joshperfects = 0;
joshscore = joshscore + (int(joshcombo / 2) * scoreincrement);
} else if (distanceaway < 6) {
acc.gotoAndPlay("good");
joshperfects = 0;
} else if (distanceaway < 9) {
acc.gotoAndPlay("average");
joshperfects = 0;
} else if (distanceaway < 11) {
acc.gotoAndPlay("poor");
joshperfects = 0;
} else {
acc.gotoAndPlay("dismal");
joshperfects = 0;
lightupmyworlddrake();
}
}
_local1.thingbinhit = false;
}
} else if (scrolling[scrollname]._x > (righthitareax + leway)) {
righthighlight = false;
if (scrolling[scrollname].passedjosh == false) {
joshcombo = 0;
joshmissedrow++;
if (joshmissedrow > missedtoloselife) {
sError.start();
lightupmyworlddrake();
if (joshlives == 3) {
_local1.dlife3.gotoAndStop(2);
}
if (joshlives == 2) {
_local1.dlife2.gotoAndStop(2);
}
if (joshlives == 1) {
if (_local1.oneplayer == "drake") {
}
_local1.secondgamescore = _local1.jscore;
_local1.secondgameover = true;
_local2.danceexit.play();
delete _local1.onEnterFrame;
}
joshlives--;
joshmissedrow = 0;
scoreincrement = 0;
acc.gotoAndPlay("missed");
}
jmissed = true;
}
scrolling[scrollname].passedjosh = true;
}
if (righthighlight == true) {
righthitdisplay.gotoAndStop(2);
} else {
righthitdisplay.gotoAndStop(1);
}
}
i++;
}
}
function lightupmyworlddrake() {
var _local1 = this;
l = 1;
while (l < 11) {
lightname = "dl" + l;
if (joshcombo > (l - 1)) {
_local1[lightname].gotoAndStop(2);
} else {
_local1[lightname].gotoAndStop(1);
if (l == 1) {
p = 1;
while (p < 11) {
lightname = "dl" + p;
_local1[lightname].gotoAndStop(1);
p++;
}
}
return;
}
l++;
}
}
function createnew() {
myname = ["hitme" + depth];
if (_root.oneplayer == "drake") {
scrolling.attachMovie("hitmedrake", myname, depth);
} else {
scrolling.attachMovie("hitmejosh", myname, depth);
}
scrolling[myname]._x = spawnx;
scrolling[myname]._y = spawny;
scrolling[myname]._xscale = 80;
scrolling[myname]._yscale = 80;
scrolling[myname].whohitsme = "josh";
thistype = random(numberdifferent) + 1;
scrolling[myname].gotoAndStop(thistype);
findtype = eval ("hf" + thistype);
scrolling[myname].mytype = findtype;
scrolling[myname].typenum = thistype;
scrolling[myname].myspeed = speed;
scrolling[myname].passedjosh = false;
hitmearray.push(depth);
depth++;
}
function loadNextMovie() {
var _local1 = _parent;
storeq = questionscorrect;
if (questionscorrect > 11) {
questionscorrect = questionscorrect - 12;
if (questionscorrect > 11) {
questionscorrect = questionscorrect - 12;
if (questionscorrect > 11) {
questionscorrect = questionscorrect - 12;
}
}
}
if (questionscorrect == 0) {
_local1.showmovie.holder.loadMovie("question01.swf");
trace("load movie");
}
if (questionscorrect == 1) {
_local1.showmovie.holder.loadMovie("josh01.swf");
trace("load movie");
}
if (questionscorrect == 2) {
_local1.showmovie.holder.loadMovie("drake01.swf");
trace("load movie");
}
if (questionscorrect == 3) {
_local1.showmovie.holder.loadMovie("question02.swf");
trace("load movie");
}
if (questionscorrect == 4) {
_local1.showmovie.holder.loadMovie("josh02.swf");
trace("load movie");
}
if (questionscorrect == 5) {
_local1.showmovie.holder.loadMovie("drake02.swf");
trace("load movie");
}
if (questionscorrect == 6) {
_local1.showmovie.holder.loadMovie("question03.swf");
trace("load movie");
}
if (questionscorrect == 7) {
_local1.showmovie.holder.loadMovie("josh03.swf");
trace("load movie");
}
if (questionscorrect == 8) {
_local1.showmovie.holder.loadMovie("drake03.swf");
trace("load movie");
}
if (questionscorrect == 9) {
_local1.showmovie.holder.loadMovie("question04.swf");
trace("load movie");
}
if (questionscorrect == 10) {
_local1.showmovie.holder.loadMovie("josh04.swf");
trace("load movie");
}
if (questionscorrect == 11) {
_local1.showmovie.holder.loadMovie("drake04.swf");
trace("load movie");
}
questionscorrect = storeq;
}
function increasedifficulty() {
if (joshcombo > 9) {
questionscorrect++;
joshcombo = 0;
lightupmyworlddrake();
_root.showmovie.play();
_root.pauseforvid = true;
}
if (questionscorrect == 1) {
appearreset = 20;
numberdifferent = 6;
scoreincrement++;
speed = 4;
} else if (questionscorrect == 2) {
appearreset = 15;
numberdifferent = 9;
scoreincrement++;
speed = 5;
} else if (questionscorrect == 3) {
appearreset = 10;
numberdifferent = 10;
scoreincrement++;
speed = 6;
} else if (questionscorrect == 4) {
appearreset = 7;
scoreincrement++;
bonus = 150;
speed = 7;
} else if (questionscorrect == 5) {
appearreset = 7;
scoreincrement++;
bonus = 150;
speed = 7;
} else if (questionscorrect == 6) {
appearreset = 3;
scoreincrement++;
bonus = 200;
speed = 8;
} else if (questionscorrect == 7) {
appearreset = 0;
scoreincrement++;
bonus = 150;
speed = 8;
} else if ((depth == questionscorrect) == 8) {
appearreset = -1;
scoreincrement++;
bonus = 250;
speed = 9;
}
}
righthitareax = scrolling.righthit._x + (scrolling.righthit._width / 2);
ofstage = righthitareax + 100;
_root.secondgameover = false;
speed = 3;
appeartimer = 20;
appearreset = 25;
drakelives = 3;
joshlives = 3;
drakemissedrow = 0;
joshmissedrow = 0;
missedtoloselife = 0;
questionscorrect = 0;
var k = Key.isDown;
var kU = 38;
var kD = 40;
var kL = 37;
var kR = 39;
thisone = false;
drakescore = 0;
joshscore = 0;
drakecombo = 0;
joshcombo = 0;
scoreincrement = 1;
bonus = 10;
joshperfects = 0;
spawnx = scrolling.spawnhere._x;
spawny = scrolling.spawnhere._y - 5;
hf1 = "up";
hf2 = "right";
hf3 = "down";
hf4 = "left";
hf5 = "updown";
hf6 = "leftright";
hf7 = "upright";
hf8 = "leftdown";
hf9 = "downright";
hf10 = "leftdownright";
updown = false;
rightdown = false;
downdown = false;
leftdown = false;
_root.thingbinhit = false;
_root.pauseforvid = false;
depth = 0;
hitmearray = [];
numberdifferent = 4;
righthighlight = false;
jmissed = false;
_root.onEnterFrame = function () {
var _local1 = _root;
if (_local1.pauseforvid == false) {
appeartimer--;
if (appeartimer < 0) {
createnew();
appeartimer = (random(20) + appearreset) + 5;
}
scrollhitme();
_local1.jscore = joshscore;
_local1.joshcombo = joshcombo;
playSound();
}
increasedifficulty();
};
loadNextMovie();
function playSound() {
if (random(300) == 1) {
ps = random(7) + 1;
if (ps == 1) {
sAlright.start();
} else if (ps == 2) {
sGood.start();
} else if (ps == 3) {
sKeep.start();
} else if (ps == 4) {
sWay.start();
} else if (ps == 5) {
sYou.start();
} else if (ps == 6) {
sClapping.start();
} else if (ps == 7) {
sApplause.start();
}
}
}
sAlright = new Sound();
sAlright.attachSound("alright");
sGood = new Sound();
sGood.attachSound("good");
sKeep = new Sound();
sKeep.attachSound("keep");
sWay = new Sound();
sWay.attachSound("way");
sYou = new Sound();
sYou.attachSound("you");
sApplause = new Sound();
sApplause.attachSound("applause");
sClapping = new Sound();
sClapping.attachSound("clapping");
sError = new Sound();
sError.attachSound("errorbuzz");
Symbol 772 MovieClip Frame 1
function lightupmyworlddrake() {
var _local1 = this;
l = 1;
while (l < 11) {
lightname = "dl" + l;
if (drakecombo > (l - 1)) {
_local1[lightname].gotoAndStop(2);
} else {
_local1[lightname].gotoAndStop(1);
if (l == 1) {
p = 1;
while (p < 11) {
lightname = "dl" + p;
_local1[lightname].gotoAndStop(1);
p++;
}
}
return;
}
l++;
}
}
function lightupmyworldjosh() {
var _local1 = this;
l = 1;
while (l < 11) {
lightname = "jl" + l;
if (joshcombo > (l - 1)) {
_local1[lightname].gotoAndStop(2);
} else {
_local1[lightname].gotoAndStop(1);
if (l == 1) {
p = 1;
while (p < 11) {
lightname = "jl" + p;
_local1[lightname].gotoAndStop(1);
p++;
}
}
return;
}
l++;
}
}
function loadNextMovie() {
var _local1 = _parent;
storeq = questionscorrect;
if (questionscorrect > 11) {
questionscorrect = questionscorrect - 12;
if (questionscorrect > 11) {
questionscorrect = questionscorrect - 12;
if (questionscorrect > 11) {
questionscorrect = questionscorrect - 12;
}
}
}
if (questionscorrect == 0) {
_local1.showmovie.holder.loadMovie("question01.swf");
trace("load movie");
}
if (questionscorrect == 1) {
_local1.showmovie.holder.loadMovie("josh01.swf");
trace("load movie");
}
if (questionscorrect == 2) {
_local1.showmovie.holder.loadMovie("drake01.swf");
trace("load movie");
}
if (questionscorrect == 3) {
_local1.showmovie.holder.loadMovie("question02.swf");
trace("load movie");
}
if (questionscorrect == 4) {
_local1.showmovie.holder.loadMovie("josh02.swf");
trace("load movie");
}
if (questionscorrect == 5) {
_local1.showmovie.holder.loadMovie("drake02.swf");
trace("load movie");
}
if (questionscorrect == 6) {
_local1.showmovie.holder.loadMovie("question03.swf");
trace("load movie");
}
if (questionscorrect == 7) {
_local1.showmovie.holder.loadMovie("josh03.swf");
trace("load movie");
}
if (questionscorrect == 8) {
_local1.showmovie.holder.loadMovie("drake03.swf");
trace("load movie");
}
if (questionscorrect == 9) {
_local1.showmovie.holder.loadMovie("question04.swf");
trace("load movie");
}
if (questionscorrect == 10) {
_local1.showmovie.holder.loadMovie("josh04.swf");
trace("load movie");
}
if (questionscorrect == 11) {
_local1.showmovie.holder.loadMovie("drake04.swf");
trace("load movie");
}
questionscorrect = storeq;
}
function checkkeysdrake(nametocheck) {
var _local1 = nametocheck;
var _local2 = _root;
wdown = false;
ddown = false;
sdown = false;
adown = false;
if (Key.isDown(87)) {
wdown = true;
}
if (Key.isDown(68)) {
ddown = true;
}
if (Key.isDown(83)) {
sdown = true;
}
if (Key.isDown(65)) {
adown = true;
}
typeoficon = scrolling[_local1].mytype;
if (scrolling[_local1].passed == false) {
if (typeoficon == "w") {
if ((((wdown == true) && (ddown == false)) && (sdown == false)) && (adown == false)) {
scrolling[_local1].passed = true;
scrolling[_local1].gotit.play();
drakescore = drakescore + scoreincrement;
if (scrolling[_local1]._currentframe == 16) {
drakescore = drakescore + bonus;
}
drakecombo++;
drakemissedrow = 0;
_local2.getit.start();
}
} else if (typeoficon == "d") {
if ((((wdown == false) && (ddown == true)) && (sdown == false)) && (adown == false)) {
scrolling[_local1].passed = true;
scrolling[_local1].gotit.play();
drakescore = drakescore + scoreincrement;
if (scrolling[_local1]._currentframe == 16) {
drakescore = drakescore + bonus;
}
drakecombo++;
drakemissedrow = 0;
_local2.getit.start();
}
} else if (typeoficon == "s") {
if ((((wdown == false) && (ddown == false)) && (sdown == true)) && (adown == false)) {
scrolling[_local1].passed = true;
scrolling[_local1].gotit.play();
drakescore = drakescore + scoreincrement;
if (scrolling[_local1]._currentframe == 16) {
drakescore = drakescore + bonus;
}
drakecombo++;
drakemissedrow = 0;
_local2.getit.start();
}
} else if (typeoficon == "a") {
if ((((wdown == false) && (ddown == false)) && (sdown == false)) && (adown == true)) {
scrolling[_local1].passed = true;
scrolling[_local1].gotit.play();
drakescore = drakescore + scoreincrement;
if (scrolling[_local1]._currentframe == 16) {
drakescore = drakescore + bonus;
}
drakecombo++;
drakemissedrow = 0;
_local2.getit.start();
}
} else if (typeoficon == "ws") {
if ((((wdown == true) && (ddown == false)) && (sdown == true)) && (adown == false)) {
scrolling[_local1].passed = true;
scrolling[_local1].gotit.play();
drakescore = drakescore + (scoreincrement * 3);
if (scrolling[_local1]._currentframe == 16) {
drakescore = drakescore + bonus;
}
drakecombo++;
drakemissedrow = 0;
_local2.getit.start();
}
} else if (typeoficon == "ad") {
if ((((wdown == false) && (ddown == true)) && (sdown == false)) && (adown == true)) {
scrolling[_local1].passed = true;
scrolling[_local1].gotit.play();
drakescore = drakescore + (scoreincrement * 3);
if (scrolling[_local1]._currentframe == 16) {
drakescore = drakescore + bonus;
}
drakecombo++;
drakemissedrow = 0;
_local2.getit.start();
}
} else if (typeoficon == "wd") {
if ((((wdown == true) && (ddown == true)) && (sdown == false)) && (adown == false)) {
scrolling[_local1].passed = true;
scrolling[_local1].gotit.play();
drakescore = drakescore + (scoreincrement * 3);
if (scrolling[_local1]._currentframe == 16) {
drakescore = drakescore + bonus;
}
drakecombo++;
drakemissedrow = 0;
_local2.getit.start();
}
} else if (typeoficon == "as") {
if ((((wdown == false) && (ddown == false)) && (sdown == true)) && (adown == true)) {
scrolling[_local1].passed = true;
scrolling[_local1].gotit.play();
drakescore = drakescore + (scoreincrement * 3);
if (scrolling[_local1]._currentframe == 16) {
drakescore = drakescore + bonus;
}
drakecombo++;
drakemissedrow = 0;
_local2.getit.start();
}
} else if (typeoficon == "wad") {
if ((((wdown == true) && (ddown == true)) && (sdown == false)) && (adown == true)) {
scrolling[_local1].passed = true;
scrolling[_local1].gotit.play();
drakescore = drakescore + (scoreincrement * 5);
if (scrolling[_local1]._currentframe == 16) {
drakescore = drakescore + bonus;
}
drakecombo++;
drakemissedrow = 0;
_local2.getit.start();
}
} else if (typeoficon == "wsd") {
if ((((wdown == true) && (ddown == true)) && (sdown == true)) && (adown == false)) {
scrolling[_local1].passed = true;
scrolling[_local1].gotit.play();
drakescore = drakescore + (scoreincrement * 5);
if (scrolling[_local1]._currentframe == 16) {
drakescore = drakescore + bonus;
}
drakecombo++;
drakemissedrow = 0;
_local2.getit.start();
}
} else if (typeoficon == "asd") {
if ((((wdown == false) && (ddown == true)) && (sdown == true)) && (adown == true)) {
scrolling[_local1].passed = true;
scrolling[_local1].gotit.play();
drakescore = drakescore + (scoreincrement * 5);
if (scrolling[_local1]._currentframe == 16) {
drakescore = drakescore + bonus;
}
drakecombo++;
drakemissedrow = 0;
_local2.getit.start();
}
}
if (scrolling[_local1].passed == true) {
_local2.dthingbinhit = true;
_local2.loadbmps.joshbuzz.play();
trace("play drake buzz");
}
lightupmyworlddrake();
}
}
function checkkeysjosh(nametocheck) {
var _local1 = nametocheck;
var _local2 = _root;
updown = false;
rightdown = false;
downdown = false;
leftdown = false;
if (Key.isDown(73)) {
updown = true;
}
if (Key.isDown(76)) {
rightdown = true;
}
if (Key.isDown(75)) {
downdown = true;
}
if (Key.isDown(74)) {
leftdown = true;
}
typeoficon = scrolling[_local1].mytype;
if (scrolling[_local1].passedjosh == false) {
if (typeoficon == "up") {
if ((((updown == true) && (rightdown == false)) && (downdown == false)) && (leftdown == false)) {
scrolling[_local1].passedjosh = true;
scrolling[_local1].gotit.play();
joshscore = joshscore + scoreincrement;
if (scrolling[_local1]._currentframe == 36) {
joshscore = joshscore + bonus;
}
joshcombo++;
joshmissedrow = 0;
_local2.getit.start();
}
} else if (typeoficon == "right") {
if ((((updown == false) && (rightdown == true)) && (downdown == false)) && (leftdown == false)) {
scrolling[_local1].passedjosh = true;
scrolling[_local1].gotit.play();
joshscore = joshscore + scoreincrement;
if (scrolling[_local1]._currentframe == 36) {
joshscore = joshscore + bonus;
}
joshcombo++;
joshmissedrow = 0;
_local2.getit.start();
}
} else if (typeoficon == "down") {
if ((((updown == false) && (rightdown == false)) && (downdown == true)) && (leftdown == false)) {
scrolling[_local1].passedjosh = true;
scrolling[_local1].gotit.play();
joshscore = joshscore + scoreincrement;
if (scrolling[_local1]._currentframe == 36) {
joshscore = joshscore + bonus;
}
joshcombo++;
joshmissedrow = 0;
_local2.getit.start();
}
} else if (typeoficon == "left") {
if ((((updown == false) && (rightdown == false)) && (downdown == false)) && (leftdown == true)) {
scrolling[_local1].passedjosh = true;
scrolling[_local1].gotit.play();
joshscore = joshscore + scoreincrement;
if (scrolling[_local1]._currentframe == 36) {
joshscore = joshscore + bonus;
}
joshcombo++;
joshmissedrow = 0;
_local2.getit.start();
}
} else if (typeoficon == "updown") {
if ((((updown == true) && (rightdown == false)) && (downdown == true)) && (leftdown == false)) {
scrolling[_local1].passedjosh = true;
scrolling[_local1].gotit.play();
joshscore = joshscore + (scoreincrement * 3);
if (scrolling[_local1]._currentframe == 36) {
joshscore = joshscore + bonus;
}
joshcombo++;
joshmissedrow = 0;
_local2.getit.start();
}
} else if (typeoficon == "leftright") {
if ((((updown == false) && (rightdown == true)) && (downdown == false)) && (leftdown == true)) {
scrolling[_local1].passedjosh = true;
scrolling[_local1].gotit.play();
joshscore = joshscore + (scoreincrement * 3);
if (scrolling[_local1]._currentframe == 36) {
joshscore = joshscore + bonus;
}
joshcombo++;
joshmissedrow = 0;
_local2.getit.start();
}
} else if (typeoficon == "upright") {
if ((((updown == true) && (rightdown == true)) && (downdown == false)) && (leftdown == false)) {
scrolling[_local1].passedjosh = true;
scrolling[_local1].gotit.play();
joshscore = joshscore + (scoreincrement * 3);
if (scrolling[_local1]._currentframe == 36) {
joshscore = joshscore + bonus;
}
joshcombo++;
joshmissedrow = 0;
_local2.getit.start();
}
} else if (typeoficon == "leftdown") {
if ((((updown == false) && (rightdown == false)) && (downdown == true)) && (leftdown == true)) {
scrolling[_local1].passedjosh = true;
scrolling[_local1].gotit.play();
joshscore = joshscore + (scoreincrement * 3);
if (scrolling[_local1]._currentframe == 36) {
joshscore = joshscore + bonus;
}
joshcombo++;
joshmissedrow = 0;
_local2.getit.start();
}
} else if (typeoficon == "leftupright") {
if ((((updown == true) && (rightdown == true)) && (downdown == false)) && (leftdown == true)) {
scrolling[_local1].passedjosh = true;
scrolling[_local1].gotit.play();
joshscore = joshscore + (scoreincrement * 5);
if (scrolling[_local1]._currentframe == 36) {
joshscore = joshscore + bonus;
}
joshcombo++;
joshmissedrow = 0;
_local2.getit.start();
}
} else if (typeoficon == "upleftdown") {
if ((((updown == true) && (rightdown == false)) && (downdown == true)) && (leftdown == true)) {
scrolling[_local1].passedjosh = true;
scrolling[_local1].gotit.play();
joshscore = joshscore + (scoreincrement * 5);
if (scrolling[_local1]._currentframe == 36) {
joshscore = joshscore + bonus;
}
joshcombo++;
joshmissedrow = 0;
_local2.getit.start();
}
} else if (typeoficon == "leftdownright") {
if ((((updown == false) && (rightdown == true)) && (downdown == true)) && (leftdown == true)) {
scrolling[_local1].passedjosh = true;
scrolling[_local1].gotit.play();
joshscore = joshscore + (scoreincrement * 5);
if (scrolling[_local1]._currentframe == 36) {
joshscore = joshscore + bonus;
}
joshcombo++;
joshmissedrow = 0;
_local2.getit.start();
}
}
if (scrolling[_local1].passedjosh == true) {
righthighlight = false;
_local2.jthingbinhit = true;
_local2.loadbmps.drakebuzz.play();
}
lightupmyworldjosh();
}
}
function scrollhitme() {
lefthighlight = false;
righthighlight = false;
numberhitmes = hitmearray.length;
i = 0;
while (i < numberhitmes) {
scrollname = ["hitme" + hitmearray[i]];
if (scrolling[scrollname]._x > ofstage) {
scrolling[scrollname].removeMovieClip();
hitmearray.splice(i, 1);
i--;
}
scrollname = ["hitme" + hitmearray[i]];
scrolling[scrollname]._x = scrolling[scrollname]._x + speed;
leway = 18;
if ((scrolling[scrollname]._x > (lefthitareax - leway)) && (scrolling[scrollname]._x < (lefthitareax + leway))) {
lefthighlight = true;
if (scrolling[scrollname].passed == false) {
checkkeysdrake(scrollname);
if (_root.dthingbinhit == true) {
if (scrolling[scrollname]._x < lefthitareax) {
distanceaway = int(lefthitareax - scrolling[scrollname]._x);
} else {
distanceaway = int(scrolling[scrollname]._x - lefthitareax);
}
if (distanceaway < 2) {
drakeacc.gotoAndPlay("perfect");
drakeperfects++;
drakescore = drakescore + ((int(joshcombo) * scoreincrement) * drakeperfects);
} else if (distanceaway < 4) {
drakeacc.gotoAndPlay("excellent");
drakeperfects = 0;
drakescore = drakescore + (int(joshcombo / 2) * scoreincrement);
} else if (distanceaway < 6) {
drakeacc.gotoAndPlay("good");
drakeperfects = 0;
} else if (distanceaway < 9) {
drakeacc.gotoAndPlay("average");
drakeperfects = 0;
} else if (distanceaway < 11) {
drakeacc.gotoAndPlay("poor");
drakeperfects = 0;
} else {
drakeacc.gotoAndPlay("dismal");
drakeperfects = 0;
lightupmyworlddrake();
}
}
_root.dthingbinhit = false;
} else {
lefthighlight = false;
}
} else if ((scrolling[scrollname]._x > (lefthitareax + leway)) && (scrolling[scrollname].whohitsme == "drake")) {
if (scrolling[scrollname]._currentframe == 16) {
thingy = random(4) + 1;
scrolling[scrollname].gotoAndStop(thingy);
scrolling[scrollname].typenum = thingy;
scrolling[scrollname].mytype = eval ("hf" + thingy);
}
scrolling[scrollname].gotoAndStop(scrolling[scrollname]._currentframe + 20);
findtype = eval ("hf" + (scrolling[scrollname].typenum + 20));
scrolling[scrollname].mytype = findtype;
scrolling[scrollname].whohitsme = "josh";
if (scrolling[scrollname].passed == false) {
drakecombo = 0;
drakemissedrow++;
if (drakemissedrow > missedtoloselife) {
sError.start();
if (drakelives == 3) {
_root.dlife3.gotoAndStop(2);
}
if (drakelives == 2) {
_root.dlife2.gotoAndStop(2);
}
if (drakelives == 1) {
_root.secondgameover = true;
_parent.gameovertwo.play();
delete _root.onEnterFrame;
}
drakelives--;
drakemissedrow = 0;
_root.oooh.start();
drakeacc.gotoAndPlay("missed");
lightupmyworlddrake();
}
scrolling[scrollname].gotoAndStop("jbonus");
scrolling[scrollname].mytype = "up";
}
scrolling[scrollname].passed = true;
}
if ((scrolling[scrollname]._x > (righthitareax - leway)) && (scrolling[scrollname]._x < (righthitareax + leway))) {
if (scrolling[scrollname].passedjosh == false) {
righthighlight = true;
checkkeysjosh(scrollname);
if (_root.jthingbinhit == true) {
if (scrolling[scrollname]._x < righthitareax) {
distanceaway = int(righthitareax - scrolling[scrollname]._x);
} else {
distanceaway = int(scrolling[scrollname]._x - righthitareax);
}
if (distanceaway < 2) {
joshacc.gotoAndPlay("perfect");
joshperfects++;
joshscore = joshscore + ((int(joshcombo) * scoreincrement) * joshperfects);
} else if (distanceaway < 4) {
joshacc.gotoAndPlay("excellent");
joshperfects = 0;
joshscore = joshscore + (int(joshcombo / 2) * scoreincrement);
} else if (distanceaway < 6) {
joshacc.gotoAndPlay("good");
joshperfects = 0;
} else if (distanceaway < 9) {
joshacc.gotoAndPlay("average");
joshperfects = 0;
} else if (distanceaway < 11) {
joshacc.gotoAndPlay("poor");
joshperfects = 0;
} else {
joshacc.gotoAndPlay("dismal");
joshperfects = 0;
lightupmyworldjosh();
}
}
_root.jthingbinhit = false;
} else {
righthighlight = false;
}
} else if ((scrolling[scrollname]._x > (righthitareax + leway)) && (scrolling[scrollname].whohitsme == "josh")) {
scrolling[scrollname].whohitsme = "nobbynomates";
if (scrolling[scrollname].passedjosh == false) {
joshcombo = 0;
joshmissedrow++;
if (joshmissedrow > missedtoloselife) {
sBheavy.start();
if (joshlives == 3) {
_root.jlife3.gotoAndStop(2);
}
if (joshlives == 2) {
_root.jlife2.gotoAndStop(2);
}
if (joshlives == 1) {
_root.secondgameover = true;
_parent.gameovertwo.play();
delete _root.onEnterFrame;
}
joshlives--;
joshmissedrow = 0;
joshacc.gotoAndPlay("missed");
lightupmyworldjosh();
}
jmissed = true;
}
scrolling[scrollname].passedjosh = true;
}
if (lefthighlight == true) {
lefthitdisplay.gotoAndStop(2);
} else {
lefthitdisplay.gotoAndStop(1);
}
if (righthighlight == true) {
righthitdisplay.gotoAndStop(2);
} else {
righthitdisplay.gotoAndStop(1);
}
scaleleway = 50;
if ((scrolling[scrollname]._x > (lefthitareax - scaleleway)) && (scrolling[scrollname]._x < (lefthitareax + scaleleway))) {
if (scrolling[scrollname]._x > lefthitareax) {
if (scrolling[scrollname]._xscale > 100) {
scrolling[scrollname]._xscale = scrolling[scrollname]._xscale - (speed * 3);
scrolling[scrollname]._yscale = scrolling[scrollname]._yscale - (speed * 3);
scrolling[scrollname]._y = scrolling[scrollname]._y + (speed / 4);
}
} else {
scrolling[scrollname]._xscale = scrolling[scrollname]._xscale + (speed * 1.8);
scrolling[scrollname]._yscale = scrolling[scrollname]._yscale + (speed * 1.8);
scrolling[scrollname]._y = scrolling[scrollname]._y - (speed / 5);
}
} else if ((scrolling[scrollname]._x > (righthitareax - scaleleway)) && (scrolling[scrollname]._x < (righthitareax + scaleleway))) {
if (scrolling[scrollname]._x > righthitareax) {
if (scrolling[scrollname]._xscale > 100) {
scrolling[scrollname]._xscale = scrolling[scrollname]._xscale - (speed * 3);
scrolling[scrollname]._yscale = scrolling[scrollname]._yscale - (speed * 3);
scrolling[scrollname]._y = scrolling[scrollname]._y + (speed / 4);
}
} else {
scrolling[scrollname]._xscale = scrolling[scrollname]._xscale + (speed * 1.8);
scrolling[scrollname]._yscale = scrolling[scrollname]._yscale + (speed * 1.8);
scrolling[scrollname]._y = scrolling[scrollname]._y - (speed / 5);
}
}
i++;
}
}
function createnew() {
myname = ["hitme" + depth];
scrolling.attachMovie("hitme", myname, depth);
scrolling[myname]._x = spawnx;
scrolling[myname]._y = spawny;
if (jmissed == true) {
scrolling[myname].gotoAndStop("dbonus");
scrolling[myname].mytype = "w";
jmissed = false;
} else {
thistype = random(numberdifferent) + 1;
scrolling[myname].gotoAndStop(thistype);
findtype = eval ("hf" + thistype);
scrolling[myname].mytype = findtype;
scrolling[myname].typenum = thistype;
}
scrolling[myname].whohitsme = "drake";
scrolling[myname].passed = false;
scrolling[myname].passedjosh = false;
hitmearray.push(depth);
depth++;
}
function loadNextMovie() {
var _local1 = _parent;
storeq = questionscorrect;
if (questionscorrect > 11) {
questionscorrect = questionscorrect - 12;
if (questionscorrect > 11) {
questionscorrect = questionscorrect - 12;
if (questionscorrect > 11) {
questionscorrect = questionscorrect - 12;
}
}
}
if (questionscorrect == 0) {
_local1.showmovie.holder.loadMovie("question01.swf");
trace("load movie");
}
if (questionscorrect == 1) {
_local1.showmovie.holder.loadMovie("josh01.swf");
trace("load movie");
}
if (questionscorrect == 2) {
_local1.showmovie.holder.loadMovie("drake01.swf");
trace("load movie");
}
if (questionscorrect == 3) {
_local1.showmovie.holder.loadMovie("question02.swf");
trace("load movie");
}
if (questionscorrect == 4) {
_local1.showmovie.holder.loadMovie("josh02.swf");
trace("load movie");
}
if (questionscorrect == 5) {
_local1.showmovie.holder.loadMovie("drake02.swf");
trace("load movie");
}
if (questionscorrect == 6) {
_local1.showmovie.holder.loadMovie("question03.swf");
trace("load movie");
}
if (questionscorrect == 7) {
_local1.showmovie.holder.loadMovie("josh03.swf");
trace("load movie");
}
if (questionscorrect == 8) {
_local1.showmovie.holder.loadMovie("drake03.swf");
trace("load movie");
}
if (questionscorrect == 9) {
_local1.showmovie.holder.loadMovie("question04.swf");
trace("load movie");
}
if (questionscorrect == 10) {
_local1.showmovie.holder.loadMovie("josh04.swf");
trace("load movie");
}
if (questionscorrect == 11) {
_local1.showmovie.holder.loadMovie("drake04.swf");
trace("load movie");
}
questionscorrect = storeq;
}
function increasedifficulty() {
if ((joshcombo > 4) && (drakecombo > 4)) {
questionscorrect++;
drakecombo = 0;
joshcombo = 0;
trace("show mooooooooooovie");
_root.showmovie.play();
_root.pauseforvid = true;
lightupmyworlddrake();
lightupmyworldjosh();
}
if (questionscorrect == 1) {
appearreset = 20;
scoreincrement++;
speed = 4;
}
if (questionscorrect == 2) {
appearreset = 15;
scoreincrement++;
speed = 5;
}
if (questionscorrect == 3) {
appearreset = 10;
scoreincrement++;
speed = 6;
}
if (questionscorrect == 4) {
appearreset = 7;
scoreincrement++;
bonus = 150;
}
}
lefthitareax = scrolling.lefthit._x + (scrolling.lefthit._width / 2);
righthitareax = scrolling.righthit._x + (scrolling.righthit._width / 2);
ofstage = righthitareax + 100;
speed = 3;
appeartimer = 20;
appearreset = 25;
drakelives = 3;
joshlives = 3;
drakemissedrow = 0;
joshmissedrow = 0;
missedtoloselife = 0;
_root.secondgameover = false;
var k = Key.isDown;
var kU = 38;
var kD = 40;
var kL = 37;
var kR = 39;
questionscorrect = 0;
drakescore = 0;
joshscore = 0;
drakecombo = 0;
joshcombo = 0;
scoreincrement = 1;
bonus = 10;
spawnx = scrolling.spawnhere._x;
spawny = scrolling.spawnhere._y;
hf21 = "up";
hf22 = "right";
hf23 = "down";
hf24 = "left";
hf25 = "updown";
hf26 = "leftright";
hf27 = "upright";
hf28 = "leftdown";
hf29 = "leftupright";
hf30 = "uprightdown";
hf31 = "leftdownright";
hf1 = "w";
hf2 = "d";
hf3 = "s";
hf4 = "a";
hf5 = "ws";
hf6 = "ad";
hf7 = "wd";
hf8 = "as";
hf9 = "wad";
hf10 = "wsd";
hf11 = "asd";
wdown = false;
ddown = false;
sdown = false;
adown = false;
updown = false;
rightdown = false;
downdown = false;
leftdown = false;
depth = 0;
hitmearray = [];
numberdifferent = 4;
lefthighlight = false;
righthighlight = false;
jmissed = false;
_root.dthingbinhit = false;
_root.jthingbinhit = false;
drakeperfects = 0;
joshperfects = 0;
_root.pauseforvid = false;
_root.onEnterFrame = function () {
var _local1 = _root;
if (_local1.pauseforvid == false) {
appeartimer--;
if (appeartimer < 0) {
createnew();
appeartimer = random(20) + appearreset;
}
scrollhitme();
_local1.dscore = drakescore;
_local1.jscore = joshscore;
_local1.drakecombo = drakecombo;
_local1.joshcombo = joshcombo;
playSound();
}
increasedifficulty();
};
loadNextMovie();
loadNextMovie();
function playSound() {
if (random(300) == 1) {
ps = random(10) + 1;
if (ps == 1) {
sAlright.start();
} else if (ps == 2) {
sGood.start();
} else if (ps == 3) {
sKeep.start();
} else if (ps == 4) {
sWay.start();
} else if (ps == 5) {
sYou.start();
} else if (ps == 6) {
sPeace.start();
} else if (ps == 7) {
sThankyou.start();
} else if (ps == 8) {
sYoure.start();
} else if (ps == 9) {
sApplause.start();
} else if (ps == 10) {
sClapping.start();
}
}
}
sPeace = new Sound();
sPeace.attachSound("peace");
sThankyou = new Sound();
sThankyou.attachSound("thankyou");
sYoure = new Sound();
sYoure.attachSound("youre");
sAlright = new Sound();
sAlright.attachSound("alright");
sGood = new Sound();
sGood.attachSound("good");
sKeep = new Sound();
sKeep.attachSound("keep");
sWay = new Sound();
sWay.attachSound("way");
sYou = new Sound();
sYou.attachSound("you");
sApplause = new Sound();
sApplause.attachSound("applause");
sClapping = new Sound();
sClapping.attachSound("clapping");
sError = new Sound();
sError.attachSound("errorbuzz");
sBheavy = new Sound();
sBheavy.attachSound("buzzheavy");
Symbol 796 MovieClip Frame 1
stop();
Symbol 796 MovieClip Frame 2
trace(" stroe " + _root.storeleft);
trace(" lp " + _root.lp);
_root.joshgame1 = _root.storeleft;
_root.drakegame1 = 100 - _root.storeleft;
_root.joshgame2 = _root.dscore;
_root.drakegame2 = _root.jscore;
trace("josh1 = " + _root.joshgame1);
trace("josh1 = " + _root.joshgame2);
if (_root.joshgame2 > 10) {
joshfinalscore = _root.joshgame2 / (_root.joshgame1 / 30);
_root.jresult = int(joshfinalscore);
} else {
_root.jresult = int(_root.joshgame2);
}
if (_root.drakegame2 > 10) {
drakefinalscore = _root.drakegame2 / (_root.drakegame1 / 30);
_root.dresult = int(drakefinalscore);
} else {
_root.dresult = int(_root.drakegame2);
}
if (_root.dresult > _root.jresult) {
this.gotoAndPlay("drakewin");
} else {
this.gotoAndPlay("joshwin");
}
Symbol 796 MovieClip Frame 26
stop();
Symbol 796 MovieClip Frame 50
stop();
Symbol 800 MovieClip Frame 1
function lightupmyworlddrake() {
var _local1 = this;
l = 1;
while (l < 11) {
lightname = "dl" + l;
if (drakecombo > (l - 1)) {
_local1[lightname].gotoAndStop(2);
} else {
_local1[lightname].gotoAndStop(1);
if (l == 1) {
p = 1;
while (p < 11) {
lightname = "dl" + p;
_local1[lightname].gotoAndStop(1);
p++;
}
}
return;
}
l++;
}
}
function lightupmyworldjosh() {
var _local1 = this;
l = 1;
while (l < 11) {
lightname = "jl" + l;
if (joshcombo > (l - 1)) {
_local1[lightname].gotoAndStop(2);
} else {
_local1[lightname].gotoAndStop(1);
if (l == 1) {
p = 1;
while (p < 11) {
lightname = "jl" + p;
_local1[lightname].gotoAndStop(1);
p++;
}
}
return;
}
l++;
}
}
function loadNextMovie() {
var _local1 = _parent;
storeq = questionscorrect;
if (questionscorrect > 11) {
questionscorrect = questionscorrect - 12;
if (questionscorrect > 11) {
questionscorrect = questionscorrect - 12;
if (questionscorrect > 11) {
questionscorrect = questionscorrect - 12;
}
}
}
if (questionscorrect == 0) {
_local1.showmovie.holder.loadMovie("question01.swf");
trace("load movie");
}
if (questionscorrect == 1) {
_local1.showmovie.holder.loadMovie("josh01.swf");
trace("load movie");
}
if (questionscorrect == 2) {
_local1.showmovie.holder.loadMovie("drake01.swf");
trace("load movie");
}
if (questionscorrect == 3) {
_local1.showmovie.holder.loadMovie("question02.swf");
trace("load movie");
}
if (questionscorrect == 4) {
_local1.showmovie.holder.loadMovie("josh02.swf");
trace("load movie");
}
if (questionscorrect == 5) {
_local1.showmovie.holder.loadMovie("drake02.swf");
trace("load movie");
}
if (questionscorrect == 6) {
_local1.showmovie.holder.loadMovie("question03.swf");
trace("load movie");
}
if (questionscorrect == 7) {
_local1.showmovie.holder.loadMovie("josh03.swf");
trace("load movie");
}
if (questionscorrect == 8) {
_local1.showmovie.holder.loadMovie("drake03.swf");
trace("load movie");
}
if (questionscorrect == 9) {
_local1.showmovie.holder.loadMovie("question04.swf");
trace("load movie");
}
if (questionscorrect == 10) {
_local1.showmovie.holder.loadMovie("josh04.swf");
trace("load movie");
}
if (questionscorrect == 11) {
_local1.showmovie.holder.loadMovie("drake04.swf");
trace("load movie");
}
questionscorrect = storeq;
}
function checkkeysdrake(nametocheck) {
var _local1 = nametocheck;
var _local2 = _root;
wdown = false;
ddown = false;
sdown = false;
adown = false;
if (Key.isDown(87)) {
wdown = true;
}
if (Key.isDown(68)) {
ddown = true;
}
if (Key.isDown(83)) {
sdown = true;
}
if (Key.isDown(65)) {
adown = true;
}
typeoficon = scrolling[_local1].mytype;
if (scrolling[_local1].passed == false) {
if (typeoficon == "w") {
if ((((wdown == true) && (ddown == false)) && (sdown == false)) && (adown == false)) {
scrolling[_local1].passed = true;
scrolling[_local1].gotit.play();
drakescore = drakescore + scoreincrement;
if (scrolling[_local1]._currentframe == 16) {
drakescore = drakescore + bonus;
}
drakecombo++;
drakemissedrow = 0;
_local2.getit.start();
}
} else if (typeoficon == "d") {
if ((((wdown == false) && (ddown == true)) && (sdown == false)) && (adown == false)) {
scrolling[_local1].passed = true;
scrolling[_local1].gotit.play();
drakescore = drakescore + scoreincrement;
if (scrolling[_local1]._currentframe == 16) {
drakescore = drakescore + bonus;
}
drakecombo++;
drakemissedrow = 0;
_local2.getit.start();
}
} else if (typeoficon == "s") {
if ((((wdown == false) && (ddown == false)) && (sdown == true)) && (adown == false)) {
scrolling[_local1].passed = true;
scrolling[_local1].gotit.play();
drakescore = drakescore + scoreincrement;
if (scrolling[_local1]._currentframe == 16) {
drakescore = drakescore + bonus;
}
drakecombo++;
drakemissedrow = 0;
_local2.getit.start();
}
} else if (typeoficon == "a") {
if ((((wdown == false) && (ddown == false)) && (sdown == false)) && (adown == true)) {
scrolling[_local1].passed = true;
scrolling[_local1].gotit.play();
drakescore = drakescore + scoreincrement;
if (scrolling[_local1]._currentframe == 16) {
drakescore = drakescore + bonus;
}
drakecombo++;
drakemissedrow = 0;
_local2.getit.start();
}
} else if (typeoficon == "ws") {
if ((((wdown == true) && (ddown == false)) && (sdown == true)) && (adown == false)) {
scrolling[_local1].passed = true;
scrolling[_local1].gotit.play();
drakescore = drakescore + (scoreincrement * 3);
if (scrolling[_local1]._currentframe == 16) {
drakescore = drakescore + bonus;
}
drakecombo++;
drakemissedrow = 0;
_local2.getit.start();
}
} else if (typeoficon == "ad") {
if ((((wdown == false) && (ddown == true)) && (sdown == false)) && (adown == true)) {
scrolling[_local1].passed = true;
scrolling[_local1].gotit.play();
drakescore = drakescore + (scoreincrement * 3);
if (scrolling[_local1]._currentframe == 16) {
drakescore = drakescore + bonus;
}
drakecombo++;
drakemissedrow = 0;
_local2.getit.start();
}
} else if (typeoficon == "wd") {
if ((((wdown == true) && (ddown == true)) && (sdown == false)) && (adown == false)) {
scrolling[_local1].passed = true;
scrolling[_local1].gotit.play();
drakescore = drakescore + (scoreincrement * 3);
if (scrolling[_local1]._currentframe == 16) {
drakescore = drakescore + bonus;
}
drakecombo++;
drakemissedrow = 0;
_local2.getit.start();
}
} else if (typeoficon == "as") {
if ((((wdown == false) && (ddown == false)) && (sdown == true)) && (adown == true)) {
scrolling[_local1].passed = true;
scrolling[_local1].gotit.play();
drakescore = drakescore + (scoreincrement * 3);
if (scrolling[_local1]._currentframe == 16) {
drakescore = drakescore + bonus;
}
drakecombo++;
drakemissedrow = 0;
_local2.getit.start();
}
} else if (typeoficon == "wad") {
if ((((wdown == true) && (ddown == true)) && (sdown == false)) && (adown == true)) {
scrolling[_local1].passed = true;
scrolling[_local1].gotit.play();
drakescore = drakescore + (scoreincrement * 5);
if (scrolling[_local1]._currentframe == 16) {
drakescore = drakescore + bonus;
}
drakecombo++;
drakemissedrow = 0;
_local2.getit.start();
}
} else if (typeoficon == "wsd") {
if ((((wdown == true) && (ddown == true)) && (sdown == true)) && (adown == false)) {
scrolling[_local1].passed = true;
scrolling[_local1].gotit.play();
drakescore = drakescore + (scoreincrement * 5);
if (scrolling[_local1]._currentframe == 16) {
drakescore = drakescore + bonus;
}
drakecombo++;
drakemissedrow = 0;
_local2.getit.start();
}
} else if (typeoficon == "asd") {
if ((((wdown == false) && (ddown == true)) && (sdown == true)) && (adown == true)) {
scrolling[_local1].passed = true;
scrolling[_local1].gotit.play();
drakescore = drakescore + (scoreincrement * 5);
if (scrolling[_local1]._currentframe == 16) {
drakescore = drakescore + bonus;
}
drakecombo++;
drakemissedrow = 0;
_local2.getit.start();
}
}
if (scrolling[_local1].passed == true) {
_local2.dthingbinhit = true;
_local2.loadbmpstwo.drakebuzz.play();
trace("play drake buzz");
}
lightupmyworlddrake();
}
}
function checkkeysjosh(nametocheck) {
var _local1 = nametocheck;
var _local2 = _root;
updown = false;
rightdown = false;
downdown = false;
leftdown = false;
if (Key.isDown(73)) {
updown = true;
}
if (Key.isDown(76)) {
rightdown = true;
}
if (Key.isDown(75)) {
downdown = true;
}
if (Key.isDown(74)) {
leftdown = true;
}
typeoficon = scrolling[_local1].mytype;
if (scrolling[_local1].passedjosh == false) {
if (typeoficon == "up") {
if ((((updown == true) && (rightdown == false)) && (downdown == false)) && (leftdown == false)) {
scrolling[_local1].passedjosh = true;
scrolling[_local1].gotit.play();
joshscore = joshscore + scoreincrement;
if (scrolling[_local1]._currentframe == 36) {
joshscore = joshscore + bonus;
}
joshcombo++;
joshmissedrow = 0;
_local2.getit.start();
}
} else if (typeoficon == "right") {
if ((((updown == false) && (rightdown == true)) && (downdown == false)) && (leftdown == false)) {
scrolling[_local1].passedjosh = true;
scrolling[_local1].gotit.play();
joshscore = joshscore + scoreincrement;
if (scrolling[_local1]._currentframe == 36) {
joshscore = joshscore + bonus;
}
joshcombo++;
joshmissedrow = 0;
_local2.getit.start();
}
} else if (typeoficon == "down") {
if ((((updown == false) && (rightdown == false)) && (downdown == true)) && (leftdown == false)) {
scrolling[_local1].passedjosh = true;
scrolling[_local1].gotit.play();
joshscore = joshscore + scoreincrement;
if (scrolling[_local1]._currentframe == 36) {
joshscore = joshscore + bonus;
}
joshcombo++;
joshmissedrow = 0;
_local2.getit.start();
}
} else if (typeoficon == "left") {
if ((((updown == false) && (rightdown == false)) && (downdown == false)) && (leftdown == true)) {
scrolling[_local1].passedjosh = true;
scrolling[_local1].gotit.play();
joshscore = joshscore + scoreincrement;
if (scrolling[_local1]._currentframe == 36) {
joshscore = joshscore + bonus;
}
joshcombo++;
joshmissedrow = 0;
_local2.getit.start();
}
} else if (typeoficon == "updown") {
if ((((updown == true) && (rightdown == false)) && (downdown == true)) && (leftdown == false)) {
scrolling[_local1].passedjosh = true;
scrolling[_local1].gotit.play();
joshscore = joshscore + (scoreincrement * 3);
if (scrolling[_local1]._currentframe == 36) {
joshscore = joshscore + bonus;
}
joshcombo++;
joshmissedrow = 0;
_local2.getit.start();
}
} else if (typeoficon == "leftright") {
if ((((updown == false) && (rightdown == true)) && (downdown == false)) && (leftdown == true)) {
scrolling[_local1].passedjosh = true;
scrolling[_local1].gotit.play();
joshscore = joshscore + (scoreincrement * 3);
if (scrolling[_local1]._currentframe == 36) {
joshscore = joshscore + bonus;
}
joshcombo++;
joshmissedrow = 0;
_local2.getit.start();
}
} else if (typeoficon == "upright") {
if ((((updown == true) && (rightdown == true)) && (downdown == false)) && (leftdown == false)) {
scrolling[_local1].passedjosh = true;
scrolling[_local1].gotit.play();
joshscore = joshscore + (scoreincrement * 3);
if (scrolling[_local1]._currentframe == 36) {
joshscore = joshscore + bonus;
}
joshcombo++;
joshmissedrow = 0;
_local2.getit.start();
}
} else if (typeoficon == "leftdown") {
if ((((updown == false) && (rightdown == false)) && (downdown == true)) && (leftdown == true)) {
scrolling[_local1].passedjosh = true;
scrolling[_local1].gotit.play();
joshscore = joshscore + (scoreincrement * 3);
if (scrolling[_local1]._currentframe == 36) {
joshscore = joshscore + bonus;
}
joshcombo++;
joshmissedrow = 0;
_local2.getit.start();
}
} else if (typeoficon == "leftupright") {
if ((((updown == true) && (rightdown == true)) && (downdown == false)) && (leftdown == true)) {
scrolling[_local1].passedjosh = true;
scrolling[_local1].gotit.play();
joshscore = joshscore + (scoreincrement * 5);
if (scrolling[_local1]._currentframe == 36) {
joshscore = joshscore + bonus;
}
joshcombo++;
joshmissedrow = 0;
_local2.getit.start();
}
} else if (typeoficon == "upleftdown") {
if ((((updown == true) && (rightdown == false)) && (downdown == true)) && (leftdown == true)) {
scrolling[_local1].passedjosh = true;
scrolling[_local1].gotit.play();
joshscore = joshscore + (scoreincrement * 5);
if (scrolling[_local1]._currentframe == 36) {
joshscore = joshscore + bonus;
}
joshcombo++;
joshmissedrow = 0;
_local2.getit.start();
}
} else if (typeoficon == "leftdownright") {
if ((((updown == false) && (rightdown == true)) && (downdown == true)) && (leftdown == true)) {
scrolling[_local1].passedjosh = true;
scrolling[_local1].gotit.play();
joshscore = joshscore + (scoreincrement * 5);
if (scrolling[_local1]._currentframe == 36) {
joshscore = joshscore + bonus;
}
joshcombo++;
joshmissedrow = 0;
_local2.getit.start();
}
}
if (scrolling[_local1].passedjosh == true) {
righthighlight = false;
_local2.jthingbinhit = true;
_local2.loadbmpstwo.joshbuzz.play();
}
lightupmyworldjosh();
}
}
function scrollhitme() {
lefthighlight = false;
righthighlight = false;
numberhitmes = hitmearray.length;
i = 0;
while (i < numberhitmes) {
scrollname = ["hitme" + hitmearray[i]];
if (scrolling[scrollname]._x > ofstage) {
scrolling[scrollname].removeMovieClip();
hitmearray.splice(i, 1);
i--;
}
scrollname = ["hitme" + hitmearray[i]];
scrolling[scrollname]._x = scrolling[scrollname]._x + speed;
leway = 18;
if ((scrolling[scrollname]._x > (lefthitareax - leway)) && (scrolling[scrollname]._x < (lefthitareax + leway))) {
lefthighlight = true;
if (scrolling[scrollname].passed == false) {
checkkeysdrake(scrollname);
if (_root.dthingbinhit == true) {
if (scrolling[scrollname]._x < lefthitareax) {
distanceaway = int(lefthitareax - scrolling[scrollname]._x);
} else {
distanceaway = int(scrolling[scrollname]._x - lefthitareax);
}
if (distanceaway < 2) {
drakeacc.gotoAndPlay("perfect");
drakeperfects++;
drakescore = drakescore + ((int(joshcombo) * scoreincrement) * drakeperfects);
} else if (distanceaway < 4) {
drakeacc.gotoAndPlay("excellent");
drakeperfects = 0;
drakescore = drakescore + (int(joshcombo / 2) * scoreincrement);
} else if (distanceaway < 6) {
drakeacc.gotoAndPlay("good");
drakeperfects = 0;
} else if (distanceaway < 9) {
drakeacc.gotoAndPlay("average");
drakeperfects = 0;
} else if (distanceaway < 11) {
drakeacc.gotoAndPlay("poor");
drakeperfects = 0;
} else {
drakeacc.gotoAndPlay("dismal");
drakeperfects = 0;
lightupmyworlddrake();
}
}
_root.dthingbinhit = false;
} else {
lefthighlight = false;
}
} else if ((scrolling[scrollname]._x > (lefthitareax + leway)) && (scrolling[scrollname].whohitsme == "drake")) {
if (scrolling[scrollname]._currentframe == 16) {
thingy = random(4) + 1;
scrolling[scrollname].gotoAndStop(thingy);
scrolling[scrollname].typenum = thingy;
scrolling[scrollname].mytype = eval ("hf" + thingy);
}
scrolling[scrollname].gotoAndStop(scrolling[scrollname]._currentframe + 20);
findtype = eval ("hf" + (scrolling[scrollname].typenum + 20));
scrolling[scrollname].mytype = findtype;
scrolling[scrollname].whohitsme = "josh";
if (scrolling[scrollname].passed == false) {
drakecombo = 0;
drakemissedrow++;
if (drakemissedrow > missedtoloselife) {
sError.start();
if (drakelives == 3) {
_root.dlife3.gotoAndStop(2);
}
if (drakelives == 2) {
_root.dlife2.gotoAndStop(2);
}
if (drakelives == 1) {
_root.secondgameover = true;
_parent.gameovertwo.play();
delete _root.onEnterFrame;
}
drakelives--;
drakemissedrow = 0;
_root.oooh.start();
drakeacc.gotoAndPlay("missed");
lightupmyworlddrake();
}
scrolling[scrollname].gotoAndStop("jbonus");
scrolling[scrollname].mytype = "up";
}
scrolling[scrollname].passed = true;
}
if ((scrolling[scrollname]._x > (righthitareax - leway)) && (scrolling[scrollname]._x < (righthitareax + leway))) {
if (scrolling[scrollname].passedjosh == false) {
righthighlight = true;
checkkeysjosh(scrollname);
if (_root.jthingbinhit == true) {
if (scrolling[scrollname]._x < righthitareax) {
distanceaway = int(righthitareax - scrolling[scrollname]._x);
} else {
distanceaway = int(scrolling[scrollname]._x - righthitareax);
}
if (distanceaway < 2) {
joshacc.gotoAndPlay("perfect");
joshperfects++;
joshscore = joshscore + ((int(joshcombo) * scoreincrement) * joshperfects);
} else if (distanceaway < 4) {
joshacc.gotoAndPlay("excellent");
joshperfects = 0;
joshscore = joshscore + (int(joshcombo / 2) * scoreincrement);
} else if (distanceaway < 6) {
joshacc.gotoAndPlay("good");
joshperfects = 0;
} else if (distanceaway < 9) {
joshacc.gotoAndPlay("average");
joshperfects = 0;
} else if (distanceaway < 11) {
joshacc.gotoAndPlay("poor");
joshperfects = 0;
} else {
joshacc.gotoAndPlay("dismal");
joshperfects = 0;
lightupmyworldjosh();
}
}
_root.jthingbinhit = false;
} else {
righthighlight = false;
}
} else if ((scrolling[scrollname]._x > (righthitareax + leway)) && (scrolling[scrollname].whohitsme == "josh")) {
scrolling[scrollname].whohitsme = "nobbynomates";
if (scrolling[scrollname].passedjosh == false) {
joshcombo = 0;
joshmissedrow++;
if (joshmissedrow > missedtoloselife) {
sBheavy.start();
if (joshlives == 3) {
_root.jlife3.gotoAndStop(2);
}
if (joshlives == 2) {
_root.jlife2.gotoAndStop(2);
}
if (joshlives == 1) {
_root.secondgameover = true;
_parent.gameovertwo.play();
delete _root.onEnterFrame;
}
joshlives--;
joshmissedrow = 0;
joshacc.gotoAndPlay("missed");
lightupmyworldjosh();
}
jmissed = true;
}
scrolling[scrollname].passedjosh = true;
}
if (lefthighlight == true) {
lefthitdisplay.gotoAndStop(2);
} else {
lefthitdisplay.gotoAndStop(1);
}
if (righthighlight == true) {
righthitdisplay.gotoAndStop(2);
} else {
righthitdisplay.gotoAndStop(1);
}
scaleleway = 50;
if ((scrolling[scrollname]._x > (lefthitareax - scaleleway)) && (scrolling[scrollname]._x < (lefthitareax + scaleleway))) {
if (scrolling[scrollname]._x > lefthitareax) {
if (scrolling[scrollname]._xscale > 100) {
scrolling[scrollname]._xscale = scrolling[scrollname]._xscale - (speed * 3);
scrolling[scrollname]._yscale = scrolling[scrollname]._yscale - (speed * 3);
scrolling[scrollname]._y = scrolling[scrollname]._y + (speed / 4);
}
} else {
scrolling[scrollname]._xscale = scrolling[scrollname]._xscale + (speed * 1.8);
scrolling[scrollname]._yscale = scrolling[scrollname]._yscale + (speed * 1.8);
scrolling[scrollname]._y = scrolling[scrollname]._y - (speed / 5);
}
} else if ((scrolling[scrollname]._x > (righthitareax - scaleleway)) && (scrolling[scrollname]._x < (righthitareax + scaleleway))) {
if (scrolling[scrollname]._x > righthitareax) {
if (scrolling[scrollname]._xscale > 100) {
scrolling[scrollname]._xscale = scrolling[scrollname]._xscale - (speed * 3);
scrolling[scrollname]._yscale = scrolling[scrollname]._yscale - (speed * 3);
scrolling[scrollname]._y = scrolling[scrollname]._y + (speed / 4);
}
} else {
scrolling[scrollname]._xscale = scrolling[scrollname]._xscale + (speed * 1.8);
scrolling[scrollname]._yscale = scrolling[scrollname]._yscale + (speed * 1.8);
scrolling[scrollname]._y = scrolling[scrollname]._y - (speed / 5);
}
}
i++;
}
}
function createnew() {
myname = ["hitme" + depth];
scrolling.attachMovie("hitme", myname, depth);
scrolling[myname]._x = spawnx;
scrolling[myname]._y = spawny;
if (jmissed == true) {
scrolling[myname].gotoAndStop("dbonus");
scrolling[myname].mytype = "w";
jmissed = false;
} else {
thistype = random(numberdifferent) + 1;
scrolling[myname].gotoAndStop(thistype);
findtype = eval ("hf" + thistype);
scrolling[myname].mytype = findtype;
scrolling[myname].typenum = thistype;
}
scrolling[myname].whohitsme = "drake";
scrolling[myname].passed = false;
scrolling[myname].passedjosh = false;
hitmearray.push(depth);
depth++;
}
function loadNextMovie() {
var _local1 = _parent;
storeq = questionscorrect;
if (questionscorrect > 7) {
questionscorrect = questionscorrect - 8;
if (questionscorrect > 7) {
questionscorrect = questionscorrect - 8;
if (questionscorrect > 7) {
questionscorrect = questionscorrect - 8;
}
}
}
if (questionscorrect == 0) {
_local1.showmovie.holder.loadMovie("guitar01.swf");
trace("load movie");
}
if (questionscorrect == 1) {
_local1.showmovie.holder.loadMovie("guitar02.swf");
trace("load movie");
}
if (questionscorrect == 2) {
_local1.showmovie.holder.loadMovie("guitar03.swf");
trace("load movie");
}
if (questionscorrect == 3) {
_local1.showmovie.holder.loadMovie("guitar04.swf");
trace("load movie");
}
if (questionscorrect == 4) {
_local1.showmovie.holder.loadMovie("guitar05.swf");
trace("load movie");
}
if (questionscorrect == 5) {
_local1.showmovie.holder.loadMovie("guitar06.swf");
trace("load movie");
}
if (questionscorrect == 6) {
_local1.showmovie.holder.loadMovie("guitar07.swf");
trace("load movie");
}
if (questionscorrect == 7) {
_local1.showmovie.holder.loadMovie("guitar08.swf");
trace("load movie");
}
questionscorrect = storeq;
}
function increasedifficulty() {
if ((joshcombo > 4) && (drakecombo > 4)) {
questionscorrect++;
drakecombo = 0;
joshcombo = 0;
trace("show mooooooooooovie");
_root.showmovie.play();
_root.pauseforvid = true;
lightupmyworlddrake();
lightupmyworldjosh();
}
if (questionscorrect == 1) {
appearreset = 20;
scoreincrement++;
speed = 4;
}
if (questionscorrect == 2) {
appearreset = 15;
scoreincrement++;
speed = 5;
}
if (questionscorrect == 3) {
appearreset = 10;
scoreincrement++;
speed = 6;
}
if (questionscorrect == 4) {
appearreset = 7;
scoreincrement++;
bonus = 150;
}
}
lefthitareax = scrolling.lefthit._x + (scrolling.lefthit._width / 2);
righthitareax = scrolling.righthit._x + (scrolling.righthit._width / 2);
ofstage = righthitareax + 100;
speed = 3;
appeartimer = 20;
appearreset = 25;
drakelives = 3;
joshlives = 3;
drakemissedrow = 0;
joshmissedrow = 0;
missedtoloselife = 0;
_root.secondgameover = false;
var k = Key.isDown;
var kU = 38;
var kD = 40;
var kL = 37;
var kR = 39;
questionscorrect = 0;
drakescore = 0;
joshscore = 0;
drakecombo = 0;
joshcombo = 0;
scoreincrement = 1;
bonus = 10;
spawnx = scrolling.spawnhere._x;
spawny = scrolling.spawnhere._y;
hf21 = "up";
hf22 = "right";
hf23 = "down";
hf24 = "left";
hf25 = "updown";
hf26 = "leftright";
hf27 = "upright";
hf28 = "leftdown";
hf29 = "leftupright";
hf30 = "uprightdown";
hf31 = "leftdownright";
hf1 = "w";
hf2 = "d";
hf3 = "s";
hf4 = "a";
hf5 = "ws";
hf6 = "ad";
hf7 = "wd";
hf8 = "as";
hf9 = "wad";
hf10 = "wsd";
hf11 = "asd";
wdown = false;
ddown = false;
sdown = false;
adown = false;
updown = false;
rightdown = false;
downdown = false;
leftdown = false;
depth = 0;
hitmearray = [];
numberdifferent = 4;
lefthighlight = false;
righthighlight = false;
jmissed = false;
_root.dthingbinhit = false;
_root.jthingbinhit = false;
drakeperfects = 0;
joshperfects = 0;
_root.pauseforvid = false;
_root.onEnterFrame = function () {
var _local1 = _root;
if (_local1.pauseforvid == false) {
appeartimer--;
if (appeartimer < 0) {
createnew();
appeartimer = random(20) + appearreset;
}
scrollhitme();
_local1.dscore = drakescore;
_local1.jscore = joshscore;
_local1.drakecombo = drakecombo;
_local1.joshcombo = joshcombo;
playSound();
}
increasedifficulty();
};
loadNextMovie();
loadNextMovie();
function playSound() {
if (random(300) == 1) {
ps = random(4) + 1;
if (ps == 1) {
sIwill.start();
} else if (ps == 2) {
sPeace.start();
} else if (ps == 3) {
sThankyou.start();
} else if (ps == 4) {
sYoure.start();
}
}
}
sIwill = new Sound();
sIwill.attachSound("iwill");
sPeace = new Sound();
sPeace.attachSound("peace");
sThankyou = new Sound();
sThankyou.attachSound("thankyou");
sYoure = new Sound();
sYoure.attachSound("youre");
sError = new Sound();
sError.attachSound("errorbuzz");
sBheavy = new Sound();
sBheavy.attachSound("buzzheavy");