Frame 1
stop();
Instance of Symbol 33 MovieClip "loadBar_mc" in Frame 1
onClipEvent (load) {
this.bar_mc._xscale = (_root.blood_mc._yscale = 0);
this.swapDepths(1);
}
onClipEvent (enterFrame) {
this.bar_mc._xscale = (_root.blood_mc._yscale = (_level0.getBytesLoaded() / _level0.getBytesTotal()) * 100);
if (_level0.getBytesLoaded() == _level0.getBytesTotal()) {
removeMovieClip(this);
_root.gotoAndStop("gameScene");
}
}
Frame 29
function getCos(degrees) {
degrees = Math.round(degrees);
if (degrees < 0) {
degrees = 360 + (degrees % 360);
} else if (degrees > 360) {
degrees = degrees % 360;
}
var _local2 = cosTable[degrees];
return(_local2);
}
function getSin(degrees) {
if (degrees < 0) {
degrees = 360 + (degrees % 360);
} else if (degrees > 360) {
degrees = degrees % 360;
}
var _local2 = sinTable[degrees];
return(_local2);
}
function radiansToDegrees(radians) {
return((radians / Math.PI) * 180);
}
function degreesToRadians(degrees) {
return((degrees * Math.PI) / 180);
}
var sinTable = new Array();
var degrees = 0;
while (degrees < 359) {
var radians = degreesToRadians(degrees);
mysin = Math.sin(radians);
sinTable.push(mysin);
degrees++;
}
var cosTable = new Array();
var degrees = 0;
while (degrees < 359) {
var radians = degreesToRadians(degrees);
mycos = Math.cos(radians);
cosTable.push(mycos);
degrees++;
}
stop();
_root.createEmptyMovieClip("cameraman_mc", 200);
cameraman_mc.frameCount = 0;
cameraman_mc.camNum = 1;
var cameraOn = false;
_root.createEmptyMovieClip("elements3D_mc", 10);
_root.elements3D_mc.attachMovie("line", "line_mc", 1);
_root.elements3D_mc.line_mc._x = -1000;
_root.elements3D_mc.line_mc._y = -1000;
_root.createEmptyMovieClip("engine3D", 100);
_root.engine3D.lnum = 2;
_root.engine3D.screencenterX = (_root.screenCenterX = _root.center_mc._x);
_root.engine3D.screencenterY = _root.center_mc._y;
_root.center_mc._visible = false;
_root.engine3D.d = 600;
_root.engine3D.offx = 0;
_root.engine3D.offy = -160;
_root.engine3D.offz = -400;
_root.engine3D.playerrx = 10;
_root.engine3D.playerry = 10;
_root.engine3D.playerrz = 0;
_root.engine3D.myCos = new Array();
_root.engine3D.mySin = new Array();
i = 0;
while (i < 3600) {
_root.engine3D.myCos[i] = Math.cos(i * 0.00174532925199433);
_root.engine3D.mySin[i] = Math.sin(i * 0.00174532925199433);
i++;
}
_root.bg_mc.nested_mc.stop();
_root.cutscenes_mc.swapDepths(500);
_root.cutscenes_mc.stop();
_root.strike_mc.swapDepths(550);
_root.interface_mc.swapDepths(600);
_root.interface_mc.buyDVD_btn.onRelease = function () {
getURL ("http://www.amazon.com/gp/product/B000JLTRJK/ref=imdbap_t_13/102-8263387-6577723", "_blank");
};
_root.interface_mc.officialSite_btn.onRelease = function () {
getURL ("http://www.jackassmovie.com/", "_blank");
};
var levelNum = 1;
var roundNum = 1;
var score = 0;
var roundScore = 0;
var roundScores_ar = new Array();
_root.interface_mc.roundScore_mc._visible = false;
interface_mc.round1_mc._visible = (interface_mc.round2_mc._visible = (interface_mc.round3_mc._visible = false));
interface_mc.levelSum_mc._visible = false;
var levelScores_ar = new Array();
var instructions_ar = new Array();
instructions_ar[0] = "Johnny Knoxville Target Practice";
instructions_ar[1] = "Punt Wee-Man";
instructions_ar[2] = "Preston Bowl-a-Rammer!";
instructions_ar[3] = "Explode Steve-O";
var xpower = 0;
var ypower = 0;
var zpower = 0;
var obstacles_ar = new Array();
var leftLimit = -500;
var rightLimit = 500;
var backWallLimit = 1000;
var bottomLimit = 0;
var wallHeight = -500;
var frontLimit = -300;
var peakHeight = (wallHeight + ((leftLimit - rightLimit) / 2));
var gore_ar = new Array();
var sprites_ar = new Array();
var wireframes_ar = new Array();
var boxes_ar = new Array();
_root.createEmptyMovieClip("sounds_mc", _root.getNextHighestDepth());
_root.sounds_mc.createEmptyMovieClip("barrel_mc", _root.sounds_mc.getNextHighestDepth());
barrel_sound = new Sound(_root.sounds_mc.barrel_mc);
barrel_sound.attachSound("barrel_sound");
_root.sounds_mc.createEmptyMovieClip("barrelHit_mc", _root.sounds_mc.getNextHighestDepth());
barrelHit = new Sound(_root.sounds_mc.barrelHit_mc);
barrelHit.attachSound("barrelHit");
_root.sounds_mc.createEmptyMovieClip("bowlingPin_mc", _root.sounds_mc.getNextHighestDepth());
bowlingPin = new Sound(_root.sounds_mc.bowlingPin_mc);
bowlingPin.attachSound("bowlingPin");
_root.sounds_mc.createEmptyMovieClip("splat_mc", _root.sounds_mc.getNextHighestDepth());
splat_sound = new Sound(_root.sounds_mc.splat_mc);
splat_sound.attachSound("splat_sound");
_root.sounds_mc.createEmptyMovieClip("oof_mc", _root.sounds_mc.getNextHighestDepth());
oof = new Sound(_root.sounds_mc.oof_mc);
oof.attachSound("oof");
_root.sounds_mc.createEmptyMovieClip("banjo1_mc", _root.sounds_mc.getNextHighestDepth());
banjo1 = new Sound(_root.sounds_mc.banjo1_mc);
banjo1.attachSound("banjo1");
_root.sounds_mc.createEmptyMovieClip("banjo2_mc", _root.sounds_mc.getNextHighestDepth());
banjo2 = new Sound(_root.sounds_mc.banjo2_mc);
banjo2.attachSound("banjo2");
_root.sounds_mc.createEmptyMovieClip("banjo3_mc", _root.sounds_mc.getNextHighestDepth());
banjo3 = new Sound(_root.sounds_mc.banjo3_mc);
banjo3.attachSound("banjo3");
_root.sounds_mc.createEmptyMovieClip("banjo1_mc", _root.sounds_mc.getNextHighestDepth());
banjo1 = new Sound(_root.sounds_mc.banjo1_mc);
banjo1.attachSound("banjo1");
_root.sounds_mc.createEmptyMovieClip("bodyHit1_mc", _root.sounds_mc.getNextHighestDepth());
bodyHit1 = new Sound(_root.sounds_mc.bodyHit1_mc);
bodyHit1.attachSound("bodyHit1");
_root.sounds_mc.createEmptyMovieClip("bodyHit2_mc", _root.sounds_mc.getNextHighestDepth());
bodyHit2 = new Sound(_root.sounds_mc.bodyHit2_mc);
bodyHit2.attachSound("bodyHit2");
_root.sounds_mc.createEmptyMovieClip("bullCharge_mc", _root.sounds_mc.getNextHighestDepth());
bull_charge = new Sound(_root.sounds_mc.bullCharge_mc);
bull_charge.attachSound("bull_charge");
_root.sounds_mc.createEmptyMovieClip("bullImpact_mc", _root.sounds_mc.getNextHighestDepth());
bull_impact = new Sound(_root.sounds_mc.bullImpact_mc);
bull_impact.attachSound("bull_impact");
_root.sounds_mc.createEmptyMovieClip("bullSnort_mc", _root.sounds_mc.getNextHighestDepth());
bull_snort = new Sound(_root.sounds_mc.bullSnort_mc);
bull_snort.attachSound("bull_snort");
_root.sounds_mc.createEmptyMovieClip("crowd_mc", _root.sounds_mc.getNextHighestDepth());
crowd_cheer = new Sound(_root.sounds_mc.crowd_mc);
crowd_cheer.attachSound("crowd_cheer");
_root.sounds_mc.createEmptyMovieClip("explosion2_mc", _root.sounds_mc.getNextHighestDepth());
explosion2 = new Sound(_root.sounds_mc.explosion2_mc);
explosion2.attachSound("explosion2");
_root.sounds_mc.createEmptyMovieClip("groan1_mc", _root.sounds_mc.getNextHighestDepth());
groan1 = new Sound(_root.sounds_mc.groan1_mc);
groan1.attachSound("groan1");
_root.sounds_mc.createEmptyMovieClip("groan2_mc", _root.sounds_mc.getNextHighestDepth());
groan2 = new Sound(_root.sounds_mc.groan2_mc);
groan2.attachSound("groan2");
_root.sounds_mc.createEmptyMovieClip("humanLaunched_mc", _root.sounds_mc.getNextHighestDepth());
human_launched = new Sound(_root.sounds_mc.humanLaunched_mc);
human_launched.attachSound("human_launched");
_root.sounds_mc.createEmptyMovieClip("bellPrize_mc", _root.sounds_mc.getNextHighestDepth());
bell_prize = new Sound(_root.sounds_mc.bellPrize_mc);
bell_prize.attachSound("bell_prize");
_root.sounds_mc.createEmptyMovieClip("bellRound_mc", _root.sounds_mc.getNextHighestDepth());
bell_round = new Sound(_root.sounds_mc.bellRound_mc);
bell_round.attachSound("bell_round");
_root.sounds_mc.createEmptyMovieClip("moo_mc", _root.sounds_mc.getNextHighestDepth());
moo = new Sound(_root.sounds_mc.moo_mc);
moo.attachSound("moo");
_root.sounds_mc.createEmptyMovieClip("theme_mc", _root.sounds_mc.getNextHighestDepth());
riff_theme = new Sound(_root.sounds_mc.theme_mc);
riff_theme.attachSound("riff_theme");
_root.sounds_mc.createEmptyMovieClip("strike_mc", _root.sounds_mc.getNextHighestDepth());
strike = new Sound(_root.sounds_mc.strike_mc);
strike.attachSound("strike");
_root.sounds_mc.createEmptyMovieClip("wood_debris_mc", _root.sounds_mc.getNextHighestDepth());
wood_debris = new Sound(_root.sounds_mc.wood_debris_mc);
wood_debris.attachSound("wood_debris");
var masterSound = new Sound(_root);
var soundsOn = true;
_root.interface_mc.mute_btn.onPress = function () {
if (_root.soundsOn == true) {
stopAllSounds();
_root.masterSound.setVolume(0);
_root.soundsOn = false;
_root.interface_mc.mute_mc.gotoAndStop("off");
} else if (_root.soundsOn == false) {
_root.masterSound.setVolume(100);
_root.soundsOn = true;
_root.interface_mc.mute_mc.gotoAndStop("on");
}
};
_root.bull_mc.swapDepths(650);
_root.bull_mc._visible = false;
function transferMomentum(A, B) {
trace(" >< ");
var _local5 = (A.bounce + B.bounce) / 2;
var _local8 = A.x - B.x;
var _local7 = A.y - B.y;
var _local6 = A.z - B.z;
var _local4 = Math.sqrt(((_local8 * _local8) + (_local7 * _local7)) + (_local6 * _local6));
var _local27 = A.xspeed;
var _local25 = A.yspeed;
var _local22 = A.zspeed;
var _local26 = B.xspeed;
var _local23 = B.yspeed;
var _local21 = B.zspeed;
var _local13 = (((_local27 * _local8) + (_local25 * _local7)) + (_local22 * _local6)) / _local4;
var _local11 = (((_local26 * _local8) + (_local23 * _local7)) + (_local21 * _local6)) / _local4;
var _local16 = (_local13 * _local8) / _local4;
var _local14 = (_local13 * _local7) / _local4;
var _local10 = (_local13 * _local6) / _local4;
var _local15 = (_local11 * _local8) / _local4;
var _local12 = (_local11 * _local7) / _local4;
var _local9 = (_local11 * _local6) / _local4;
var _local29 = _local15 - _local16;
var _local18 = _local12 - _local14;
var _local31 = _local9 - _local10;
var _local19 = _local16 - _local15;
var _local17 = _local14 - _local12;
var _local20 = _local10 - _local9;
var _local34 = (((B.x + B.radius) - B.xspeed) >= _root.rightLimit) || (((B.x - B.radius) - B.xspeed) <= _root.leftLimit);
var _local28 = (((B.y + B.radius) + B.yspeed) + _local17) >= _root.bottomLimit;
var _local32 = ((B.z + B.radius) - B.zspeed) >= _root.backWallLimit;
var _local33 = (((A.x + A.radius) - A.xspeed) >= _root.rightLimit) || (((A.x - A.radius) - A.xspeed) <= _root.leftLimit);
var _local24 = (((A.y + A.radius) + A.yspeed) + _local18) >= _root.bottomLimit;
var _local30 = ((A.z + A.radius) - A.zspeed) >= _root.backWallLimit;
A.xspeed = A.xspeed + (_local15 - _local16);
A.yspeed = A.yspeed + (_local12 - _local14);
A.zspeed = A.zspeed + (_local9 - _local10);
B.xspeed = B.xspeed + _local19;
B.yspeed = B.yspeed + _local17;
B.zspeed = B.zspeed + _local20;
B.yspeed = B.yspeed * _local5;
B.xspeed = B.xspeed * _local5;
B.zspeed = B.zspeed * _local5;
A.yspeed = A.yspeed * _local5;
A.xspeed = A.xspeed * _local5;
A.zspeed = A.zspeed * _local5;
if (!(_local24 && (_local28))) {
if ((Math.abs(A.xspeed) < 2) && (Math.abs(B.xspeed) < 2)) {
if (A.x > B.x) {
A.xspeed = A.xspeed + 3;
B.xspeed = B.xspeed - 3;
} else {
A.xspeed = A.xspeed - 3;
B.xspeed = B.xspeed + 3;
}
}
}
A.x = B.x + ((A.x - B.x) * 1.02);
A.y = B.y + ((A.y - B.y) * 1.02);
A.z = B.z + ((A.z - B.z) * 1.02);
}
function lineSphereIntersect(mover, checkSprite, cx, cy, cz, radius, x1, y1, z1, x2, y2, z2) {
var _local10;
var _local8;
var _local15;
var _local13;
var _local20;
var _local17;
var _local5;
var _local23;
var _local21;
var _local22;
var _local24;
_local10 = x2 - x1;
_local8 = y2 - y1;
dz = z2 - z1;
_local15 = ((_local10 * _local10) + (_local8 * _local8)) + (dz * dz);
_local13 = 2 * (((_local10 * (x1 - cx)) + (_local8 * (y1 - cy))) + (dz * (z1 - cz)));
_local20 = ((((x1 - cx) * (x1 - cx)) + ((y1 - cy) * (y1 - cy))) + ((z1 - cz) * (z1 - cz))) - (radius * radius);
_local17 = (_local13 * _local13) - ((4 * _local15) * _local20);
if ((_local15 <= 1E-7) || (_local17 < 0)) {
var _local12 = false;
} else if (_local17 == 0) {
trace("one solution");
_local5 = (-_local13) / (2 * _local15);
_local23 = x1 + (_local5 * _local10);
_local21 = y1 + (_local5 * _local8);
iz1 = z1 + (_local5 * dz);
var _local12 = {x:_local23, y:_local21, z:iz1};
} else {
_local5 = ((-_local13) - Math.sqrt(_local17)) / (2 * _local15);
_local22 = x1 + (_local5 * _local10);
_local24 = y1 + (_local5 * _local8);
iz2 = z1 + (_local5 * dz);
var _local12 = {x:_local22, y:_local24, z:iz2};
}
mover.inside = false;
if (_local12 != false) {
var _local18 = Math.round((((cx - x1) * (cx - x1)) + ((cy - y1) * (cy - y1))) + ((cz - z1) * (cz - z1)));
if (_local18 < (radius * radius)) {
trace("diff: " + ((radius * radius) - _local18));
mover.inside = true;
trace(((" -- " + mover.myClip._name) + " Inside Circle!! of: ") + checkSprite.myClip._name);
var _local19 = Math.sqrt(_local18);
trace((_local19 + " vs radius: ") + radius);
var _local16 = (radius + 1) / _local19;
trace("new Distance: " + (_local19 * _local16));
x1 = cx - ((cx - x1) * _local16);
mover.x = x1;
y1 = cy - ((cy - y1) * _local16);
mover.y = y1;
z1 = cz - ((cz - z1) * _local16);
mover.z = z1;
var _local12 = false;
} else if (!_root.pointInBox(_local12, x1, y1, z1, x2, y2, z2)) {
var _local12 = false;
}
}
return(_local12);
}
function pointInBox(point, boxMinX, boxMinY, boxMinZ, boxMaxX, boxMaxY, boxMaxZ) {
if (boxMinX > boxMaxX) {
tempmin = boxMaxX;
boxMaxX = boxMinX;
boxMinX = tempmin;
}
if (boxMinY > boxMaxY) {
tempmin = boxMaxY;
boxMaxY = boxMinY;
boxMinY = tempmin;
}
if (boxMinZ > boxMaxZ) {
tempmin = boxMaxZ;
boxMaxZ = boxMinZ;
boxMinZ = tempmin;
}
if ((((((point.x <= boxMaxX) && (point.x >= boxMinX)) && (point.y >= boxMinY)) && (point.y <= boxMaxY)) && (point.z >= boxMinZ)) && (point.z <= boxMaxZ)) {
return(true);
}
return(false);
}
function boxInBox(AminX, AminY, AminZ, AmaxX, AmaxY, AmaxZ, BminX, BminY, BminZ, BmaxX, BmaxY, BmaxZ) {
if (AminX > AmaxX) {
tempmin = AmaxX;
AmaxX = AminX;
AminX = tempmin;
}
if (AminY > AmaxY) {
tempmin = AmaxY;
AmaxY = AminY;
AminY = tempmin;
}
if (AminZ > AmaxZ) {
tempmin = AmaxZ;
AmaxZ = AminZ;
AminZ = tempmin;
}
if (BminX > BmaxX) {
tempmin = BmaxX;
BmaxX = BminX;
BminX = tempmin;
}
if (BminY > BmaxY) {
tempmin = BmaxY;
BmaxY = BminY;
BminY = tempmin;
}
if (BminZ > BmaxZ) {
tempmin = BmaxZ;
BmaxZ = BminZ;
BminZ = tempmin;
}
if ((((((AminX <= BmaxX) && (AmaxX >= BminX)) && (AmaxY >= BminY)) && (AminY <= BmaxY)) && (AmaxZ >= BminZ)) && (AminZ <= BmaxZ)) {
return(true);
}
return(false);
}
function hitCheckSphereToBox(mover, B) {
var _local9 = mover.radius;
var _local6 = mover.x - mover.xspeed;
var _local18 = mover.x;
var _local5 = mover.y - mover.yspeed;
var _local17 = mover.y;
var _local4 = mover.z - mover.zspeed;
var _local15 = mover.z;
if (_local6 > _local18) {
AMaxX = _local6;
AMinX = _local18;
} else {
AMaxX = _local18;
AMinX = _local6;
}
if (_local5 > _local17) {
AMinY = _local17;
AMaxY = _local5;
} else {
AMinY = _local5;
AMaxY = _local17;
}
if (_local4 > _local15) {
AMinZ = _local15;
AMaxZ = _local4;
} else {
AMinZ = _local4;
AMaxZ = _local15;
}
var _local12 = B.right + _local9;
var _local16 = B.left - _local9;
var _local11 = B.bottom + _local9;
var _local14 = B.top - _local9;
var _local10 = B.back + _local9;
var _local13 = B.front - _local9;
if ((((((AMaxX > _local16) && (AMinX < _local12)) && (AMaxY > _local14)) && (AMinY < _local11)) && (AMaxZ > _local13)) && (AMinZ < _local10)) {
var _local19 = {x:Number, y:Number, z:Number, hitSide:String};
var _local3 = null;
var _local1 = null;
var _local2 = null;
var _local8 = "";
var _local23 = _local18 - _local6;
var _local22 = _local17 - _local5;
var _local21 = _local15 - _local4;
if ((_local5 < _local14) && (_local17 > _local14)) {
_local3 = _local14;
} else if ((_local5 > _local11) && (_local17 < _local11)) {
_local3 = _local11;
}
if (_local3 != null) {
ypercent = (_local3 - _local5) / _local22;
_local1 = _local6 + (_local23 * ypercent);
if ((_local1 >= _local16) && (_local1 <= _local12)) {
_local2 = _local4 + (_local21 * ypercent);
if ((_local2 >= _local13) && (_local2 <= _local10)) {
_local8 = "y";
}
}
}
if (_local8 == "") {
if ((_local6 < _local16) && (_local18 > _local16)) {
_local1 = _local16;
} else if ((_local6 > _local12) && (_local18 < _local12)) {
_local1 = _local12;
}
if (_local1 != null) {
xpercent = (_local1 - _local6) / _local23;
_local3 = _local5 + (_local22 * xpercent);
if ((_local3 >= _local14) && (_local3 <= _local11)) {
_local2 = _local4 + (_local21 * xpercent);
if ((_local2 >= _local13) && (_local2 <= _local10)) {
_local8 = "x";
}
}
}
}
if (_local8 == "") {
if ((_local4 < _local13) && (_local15 > _local13)) {
_local2 = _local13;
} else if ((_local4 > _local10) && (_local15 < _local10)) {
_local2 = _local10;
}
if (_local2 != null) {
zpercent = (_local2 - _local4) / _local21;
_local3 = _local5 + (_local22 * zpercent);
if ((_local3 >= _local14) && (_local3 <= _local11)) {
_local1 = _local6 + (_local23 * zpercent);
if ((_local1 >= _local16) && (_local1 <= _local12)) {
_local8 = "z";
}
}
}
}
if (_local8 != "") {
_local19.x = _local1;
_local19.y = _local3;
_local19.z = _local2;
_local19.hitSide = _local8;
return(_local19);
}
return(false);
}
return(false);
}
function linesIntersect(startX1, startY1, endX1, endY1, startX2, startY2, endX2, endY2) {
var _local1 = (endY1 - startY1) / (endX1 - startX1);
var _local2 = (endY2 - startY2) / (endX2 - startX2);
var _local3 = endY1 - (endX1 * _local1);
var _local4 = ((endY2 - (endX2 * _local2)) - _local3) / (_local1 - _local2);
return({x:_local4, y:(_local1 * _local4) + _local3});
}
function vectorSegHitCheck(mA, Ax1, Ay1, Ax2, Ay2, mB, Bx1, By1, Bx2, By2) {
if (((mA == mB) || (isNaN(mA))) || (isNaN(mB))) {
trace("Slopes same or NaN");
return(false);
}
bB = By1 - (mB * Bx1);
if ((mA == Infinity) || (mA == (-Infinity))) {
x3 = Ax1;
var _local21 = x3 - Bx1;
var _local23 = Bx2 - Bx1;
var _local22 = By2 - By1;
var _local20 = (_local21 * _local22) / _local23;
y3 = By1 + _local20;
} else {
bA = Ay1 - (mA * Ax1);
x3 = (bA - bB) / ((-mA) + mB);
y3 = (mA * x3) + bA;
}
var _local14;
var _local7;
var _local13;
var _local17;
var _local16;
var _local9;
var _local15;
var _local8;
if (Bx1 < Bx2) {
_local14 = Bx2;
_local7 = Bx1;
} else {
_local14 = Bx1;
_local7 = Bx2;
}
if (Ax1 < Ax2) {
_local13 = Ax2;
_local17 = Ax1;
} else {
_local13 = Ax1;
_local17 = Ax2;
}
if (By1 < By2) {
_local16 = By2;
_local9 = By1;
} else {
_local16 = By1;
_local9 = By2;
}
if (Ay1 < Ay2) {
_local15 = Ay2;
_local8 = Ay1;
} else {
_local15 = Ay1;
_local8 = Ay2;
}
if (!((((((((x3 >= _local17) && (x3 <= _local13)) && (x3 >= _local7)) && (x3 <= _local14)) && (y3 >= _local8)) && (y3 <= _local15)) && (y3 >= _local9)) && (y3 <= _local16))) {
return(false);
}
if ((mA == Infinity) || (mA == (-Infinity))) {
trace((("X3: " + x3) + ", Y3: ") + y3);
}
var _local5 = new Object();
_local5.x = x3;
_local5.y = y3;
return(_local5);
}
function hitCheck() {
var _local10 = (Math.abs(this.xspeed) + Math.abs(this.yspeed)) + Math.abs(this.zspeed);
if (this.z < _root.frontLimit) {
trace(this.myClip._name + " OUT OF BOUNDS");
this.myClip.nested_mc._visible = false;
delete this.myClip.onEnterFrame;
if (this != _root.missile) {
_root.removeSprite(this);
}
if (this.myShadow != null) {
this.myShadow.myClip.nested_mc._visible = 0;
delete this.myShadow.myClip.onEnterFrame;
}
} else {
var _local7 = 0;
while (_local7 < _root.boxes_ar.length) {
var _local4 = _root.boxes_ar[_local7];
var _local5 = _root.hitCheckSphereToBox(this, _local4);
if (_local5 != false) {
if (_local4.solid) {
var _local6;
this.x = _local5.x;
this.y = _local5.y;
this.z = _local5.z;
if (this.solid) {
trace((("hit BOX" + this.myClip._name) + " on side: ") + _local5.hitSide);
if (_local5.hitSide == "x") {
_local6 = 0;
this.xspeed = this.xspeed * ((-(this.bounce + _local4.bounce)) / 2);
} else if (_local5.hitSide == "y") {
this.yspeed = this.yspeed * ((-(this.bounce + _local4.bounce)) / 2);
_local6 = 1;
if (this == _root.missile) {
if (this.yspeed > 5) {
_root.oof.start(0, 1);
this.myClip.nested_mc._rotation = 90;
}
}
if (((Math.abs(this.yspeed) < 2) && (Math.abs(this.xspeed) < 1)) && (Math.abs(this.zspeed) < 1)) {
trace("__Stopped by Box Top: " + this.myClip._name);
this.xspeed = (this.yspeed = (this.zspeed = 0));
if (this == _root.missile) {
this.myClip.nested_mc.gotoAndStop("onGround");
this.myClip.nested_mc._rotation = 0;
}
if (this.myShadow != null) {
delete this.myShadow.myClip.onEnterFrame;
}
delete this.myClip.onEnterFrame;
}
} else if (_local5.hitSide == "z") {
_local6 = 2;
this.zspeed = this.zspeed * ((-(this.bounce + _local4.bounce)) / 2);
}
if (this == _root.missile) {
trace("splatSide: " + _local6);
_root.splat(this, _local6);
_root.oof.start(0, 1);
}
} else {
trace(this.myClip._name + " stopped by BOX");
if (this.bounce == 0) {
delete this.myClip.onEnterFrame;
}
}
} else {
trace((this.myClip._name + " hit nonsolid BOX on side: ") + _local5.hitSide);
}
if ((_local4.hit == false) && (this.solid)) {
_root.isHit(_local4);
}
break;
}
_local7++;
}
var _local9 = this.radius;
var _local17 = (this.x - _local9) - _root.leftLimit;
var _local13 = (this.x + _local9) - _root.rightLimit;
var _local12 = (this.z + _local9) - _root.backWallLimit;
var _local16 = (this.y + _local9) - _root.bottomLimit;
if (this.y >= _root.wallHeight) {
var _local5 = false;
_local7 = 0;
while (_local7 < _root.obstacles_ar.length) {
var _local3 = _root.obstacles_ar[_local7];
if ((_local3 != this) && (this.solid == true)) {
if (_local3.myType == 0) {
var _local8 = this.radius + _local3.radius;
_local5 = _root.lineSphereIntersect(this, _local3, _local3.x, _local3.y, _local3.z, _local8, this.x - this.xspeed, this.y - this.yspeed, this.z - this.zspeed, this.x, this.y, this.z);
if (_local5 != false) {
if (whichSprite == _root.missile) {
_root.oof.start(0, 1);
}
_root.transferMomentum(this, _local3);
}
}
if (_local5 != false) {
trace((this.myClip._name + " HIT ") + _local3.myClip._name);
this.x = _local5.x;
this.y = _local5.y;
this.z = _local5.z;
if ((_local3.fixed == false) && (_local3.myClip.onEnterFrame == null)) {
_local3.startMove();
}
if ((_local3.hit == false) && (_local3 != _root.missile)) {
_root.isHit(_local3);
}
break;
}
}
_local7++;
}
if (_local17 < 0) {
this.x = _root.leftLimit + _local9;
if (this.bounce > 0) {
this.xspeed = this.xspeed * ((-(0.6 + this.bounce)) / 2);
if (_local10 > 15) {
if (this == _root.missile) {
_root.splat(this, 0);
this.startBounce("left");
} else if (this.mySound != null) {
this.mySound.start(0, 1);
}
}
} else {
delete this.myClip.onEnterFrame;
}
} else if (_local13 > 0) {
this.x = _root.rightLimit - _local9;
if (this.bounce > 0) {
this.xspeed = this.xspeed * ((-(0.6 + this.bounce)) / 2);
if (_local10 > 15) {
if (this == _root.missile) {
_root.splat(this, 0);
this.startBounce("right");
} else if (this.mySound != null) {
this.mySound.start(0, 1);
}
}
} else {
delete this.myClip.onEnterFrame;
}
}
if ((_local12 > 0) && ((this.z - this.zspeed) < _root.backWallLimit)) {
this.z = _root.backWallLimit - _local9;
if (this.bounce > 0) {
this.zspeed = this.zspeed * ((-(0.3 + this.bounce)) / 2);
if (_local10 > 15) {
if (this == _root.missile) {
_root.splat(this, 2);
this.startBounce("back");
} else if (this.mySound != null) {
this.mySound.start(0, 1);
}
}
} else {
delete this.myClip.onEnterFrame;
}
}
if (_local16 > 0) {
this.y = _root.bottomLimit - _local9;
if (this.bounce > 0) {
this.yspeed = this.yspeed * ((-(0.3 + this.bounce)) / 2);
this.xspeed = this.xspeed * 0.9;
this.zspeed = this.zspeed * 0.9;
} else {
delete this.myClip.onEnterFrame;
}
if (this == _root.missile) {
if (this.yspeed < -5) {
_root.oof.start(0, 1);
_root.splat(this, 1);
this.startBounce("floor");
} else {
var _local14 = (720 + this.myClip.nested_mc._rotation) % 360;
this.myClip.nested_mc._rotation = 0;
this.myClip.nested_mc.gotoAndStop("onGround");
if (_local14 > 180) {
this.myClip.nested_mc._xscale = -100;
}
}
} else if ((this.yspeed < -5) && (this.mySound != null)) {
this.mySound.start(0, 1);
}
if (((Math.abs(this.yspeed) < 2) && (Math.abs(this.xspeed) < 1)) && (Math.abs(this.zspeed) < 1)) {
trace("__Stopped by Ground: " + this.myClip._name);
this.xspeed = (this.yspeed = (this.zspeed = 0));
if (this == _root.missile) {
this.myClip.nested_mc.gotoAndStop("onGround");
this.myClip.nested_mc._rotation = 0;
}
if (this.myShadow != null) {
delete this.myShadow.myClip.onEnterFrame;
}
delete this.myClip.onEnterFrame;
}
}
} else {
var _local11 = this.yspeed / this.xspeed;
if (this.x > 0) {
var _local5 = _root.vectorSegHitCheck(_local11, this.x - this.xspeed, this.y - this.yspeed, this.x, this.y, 1, 0, _root.peakHeight, _root.rightLimit, _root.wallHeight);
if (_local5 != false) {
trace("hit CEILING RIGHT" + this.myClip._name);
if (this.bounce > 0) {
trace((("cP: " + _local5.x) + ", ") + _local5.y);
var _local15 = this.xspeed;
this.xspeed = this.yspeed;
this.yspeed = _local15;
this.x = _local5.x + (this.xspeed / 10);
this.y = _local5.y + (this.yspeed / 10);
if (this == _root.missile) {
_root.splat(this, 1);
}
} else {
delete this.myClip.onEnterFrame;
}
}
} else {
var _local5 = _root.vectorSegHitCheck(_local11, this.x - this.xspeed, this.y - this.yspeed, this.x, this.y, -1, 0, _root.peakHeight, _root.leftLimit, _root.wallHeight);
if (_local5 != false) {
trace("hit CEILING LEFT" + this.myClip._name);
if (this.bounce > 0) {
trace((("cP: " + _local5.x) + ", ") + _local5.y);
trace((("xySpeeds: " + this.xspeed) + ", ") + this.yspeed);
var _local15 = -this.xspeed;
this.xspeed = -this.yspeed;
this.yspeed = _local15;
this.x = _local5.x + (this.xspeed / 10);
this.y = _local5.y + (this.yspeed / 10);
if (this == _root.missile) {
_root.splat(this, 1);
}
} else {
delete this.myClip.onEnterFrame;
}
}
}
if (_local12 > 0) {
trace("hit BACK UPPER" + this.myClip._name);
this.z = _root.backWallLimit - _local9;
if (this.bounce > 0) {
this.zspeed = this.zspeed * ((-(0.3 + this.bounce)) / 2);
if (this == _root.missile) {
_root.splat(this, 2);
this.startBounce("back");
} else if (this.mySound != null) {
this.mySound.start(0, 1);
}
} else {
delete this.myClip.onEnterFrame;
}
}
}
}
}
function isHit(whichSprite) {
whichSprite.hit = true;
if (whichSprite.targValue > 0) {
_root.roundScore = _root.roundScore + whichSprite.targValue;
if ((_root.levelNum == 3) && (_root.roundScore == 100)) {
_root.roundScore = _root.roundScore + 50;
_root.strike_mc.play();
}
_root.interface_mc.roundScore_mc.roundScore_txt.text = _root.roundScore;
var _local3 = _root.elements3D_mc.attachMovie("points", "points" + _root.elements3D_mc.getNextHighestDepth(), _root.elements3D_mc.getNextHighestDepth());
_local3._x = whichSprite.myClip._x;
_local3._y = whichSprite.myClip._y - 50;
_local3.nested_mc.points_txt.text = whichSprite.targValue;
}
if (whichSprite.mySound != null) {
whichSprite.mySound.start(0, 1);
}
whichSprite.myClip.nested_mc.play();
if (whichSprite.bounce == 1.5) {
_root.explode(whichSprite);
}
}
function Box(x, y, z, w, h, d, solid, targValue, bounce, myClip, mySound, permanent) {
trace("New Box");
this.mySound = mySound;
this.myClip = myClip;
this.hit = false;
this.bounce = bounce;
this.solid = solid;
this.targValue = targValue;
this.permanent = permanent;
this.left = x - (w / 2);
this.right = x + (w / 2);
this.top = y - (h / 2);
this.bottom = y + (h / 2);
this.front = z - (d / 2);
this.back = z + (d / 2);
this.scale = 1;
_root.boxes_ar.push(this);
return(this);
}
function removeBox(whichBox) {
trace("REMOVING BOX: ");
var _local2 = 0;
while (_local2 < _root.boxes_ar.length) {
var _local3 = _root.boxes_ar[_local2];
if (_local3 == whichBox) {
_root.boxes_ar.splice(_local2, 1);
break;
}
_local2++;
}
}
function Barrel(x, y, z) {
var _local2 = new _root.engine3D.sprite3d("barrel", x, y, z, 80, 40, 40, 40, 5, 0.8, true, false, 5, null, 1, 0, _root.barrelHit);
}
function Crate(x, y, z) {
var _local2 = new _root.engine3D.sprite3d("crate", x, y, z, 80, 40, 40, 30, 4, 1.5, true, true, 5, null, 1, 0, _root.explosion2);
}
function Crate_points(x, y, z, points) {
var _local2 = new _root.engine3D.sprite3d("crate_red", x, y, z, 80, 40, 40, 30, 4, 1.5, true, true, points, null, 1, 0, _root.explosion2);
}
function Beachball(x, y, z) {
var _local2 = new _root.engine3D.sprite3d("beachBall", x, y, z, 120, 120, 120, 60, 1, 1, true, false, 1, null, 1, 0);
}
function Pin(x, y, z) {
var _local2 = new _root.engine3D.sprite3d("pin", x, y, z, 100, 100, 100, 50, 4, 0.9, true, false, 10, null, 1, 0, _root.bowlingPin);
}
_root.engine3D.point3d = function (x, y, z) {
this.x = x;
this.y = y;
this.z = z;
};
_root.engine3D.line3d = function (p1, p2) {
this.p1 = p1;
this.p2 = p2;
};
_root.engine3D.quad3d = function (p1, p2, p3, p4) {
this.p1 = p1;
this.p2 = p2;
this.p3 = p3;
this.p4 = p4;
};
_root.engine3D.wireframe3d = function (x, y, z, rx, ry, rz, sx, sy, sz) {
trace("new wireframe3d");
this.numpoints = 0;
this.pointlist = new Array();
this.tpointlist = new Array();
this.numlines = 0;
this.linep1 = new Array();
this.linep2 = new Array();
this.linename = new Array();
this.x = x;
this.y = y;
this.z = z;
this.rx = rx;
this.ry = ry;
this.rz = rz;
this.sx = sx;
this.sy = sy;
this.sz = sz;
_root.wireframes_ar.push(this);
};
_root.engine3D.wireframe3d.prototype.addpoint = function (point) {
this.pointlist[this.numpoints] = point;
this.tpointlist[this.numpoints] = new _root.engine3D.point3d(point.x, point.y, point.z);
this.numpoints++;
};
_root.engine3D.wireframe3d.prototype.addline = function (p1num, p2num) {
this.linep1[this.numlines] = p1num;
this.linep2[this.numlines] = p2num;
duplicateMovieClip (_root.elements3D_mc.line_mc, "line" + _root.engine3D.lnum, _root.engine3D.lnum);
this.linename[this.numlines] = "line" + _root.engine3D.lnum;
var nextLine = eval ("_root.elements3D_mc.line" + _root.engine3D.lnum);
nextLine.drawline = function (sx1, sy1, sx2, sy2) {
var _local3 = sx2 - sx1;
var _local2 = sy2 - sy1;
this._xscale = _local3;
this._yscale = _local2;
this._x = sx1;
this._y = sy1;
};
_root.engine3D.lnum++;
this.numlines++;
};
_root.engine3D.sprite3d = function (clipSource, x, y, z, myHeight, myWidth, myDepth, myRadius, myMass, bounce, solid, fixed, targValue, myShadow, scale, myType, mySound) {
this.mySound = mySound;
this.mass = myMass;
this.hit = false;
this.radius = myRadius;
this.bounce = bounce;
this.solid = solid;
this.fixed = fixed;
this.targValue = targValue;
this.myShadow = myShadow;
this.myType = myType;
this.xDim = {dmax:myWidth / 2, dmin:(-myWidth) / 2};
this.yDim = {dmax:myHeight / 2, dmin:(-myHeight) / 2};
this.zDim = {dmax:myDepth / 2, dmin:(-myDepth) / 2};
this.xspeed = (this.yspeed = (this.zspeed = 0));
if (solid == true) {
_root.obstacles_ar.push(this);
}
this.x = x;
if ((y + this.radius) > _root.bottomLimit) {
this.y = _root.bottomLimit - this.radius;
} else {
this.y = y;
}
this.z = z;
this.scale = scale;
this.myClip = _root.elements3D_mc.attachMovie(clipSource, "image" + _root.engine3D.lnum, _root.engine3D.lnum);
this.myClip.nested_mc.stop();
this.myClip.mySprite = this;
this.myName = "image" + _root.engine3D.lnum;
_root.engine3D.lnum++;
this.hitCheck = _root.hitCheck;
this.moveMe = _root.moveMe;
this.startMove = _root.startMove;
this.drawMe = function () {
_root.engine3D.drawsprite3d(this);
};
this.drawMe();
this.endBounce = _root.endBounce;
this.startBounce = _root.startBounce;
_root.sprites_ar.push(this);
return(this);
};
_root.engine3D.drawsprite3d = function (obj) {
xoff = _root.engine3D.offx;
yoff = _root.engine3D.offy;
zoff = _root.engine3D.offz;
xrot = _root.engine3D.playerrx;
yrot = _root.engine3D.playerry;
zrot = _root.engine3D.playerrz;
xrot = Math.floor(xrot) % 3600;
yrot = Math.floor(yrot) % 3600;
zrot = Math.floor(zrot) % 3600;
if (xrot < 0) {
xrot = xrot + 3600;
}
if (yrot < 0) {
yrot = yrot + 3600;
}
if (zrot < 0) {
zrot = zrot + 3600;
}
pyawsin = this.mySin[yrot];
pyawcos = this.myCos[yrot];
prollsin = this.mySin[zrot];
prollcos = this.myCos[zrot];
ppitchsin = this.mySin[xrot];
ppitchcos = this.myCos[xrot];
newx = obj.x - xoff;
newy = obj.y - yoff;
newz = obj.z - zoff;
tx = (pyawcos * newx) - (pyawsin * newz);
tz = (pyawsin * newx) + (pyawcos * newz);
newx = (prollcos * tx) + (prollsin * newy);
ty = (prollcos * newy) - (prollsin * tx);
newz = (ppitchcos * tz) - (ppitchsin * ty);
newy = (ppitchsin * tz) + (ppitchcos * ty);
if (newz > 0) {
sx = (this.d * (newx / newz)) + this.screencenterX;
sy = (this.d * (newy / newz)) + this.screencenterY;
_root.elements3D_mc[obj.myName]._visible = true;
_root.elements3D_mc[obj.myName]._x = sx;
_root.elements3D_mc[obj.myName]._y = sy;
scale = ((_root.engine3D.d * 100) / newz) * obj.scale;
_root.elements3D_mc[obj.myName]._xscale = scale;
_root.elements3D_mc[obj.myName]._yscale = scale;
_root.elements3D_mc[obj.myName].swapDepths(100000 - Math.floor(newz * 25));
} else {
_root.elements3D_mc[obj.myName]._visible = false;
}
};
_root.engine3D.drawobject = function (obj) {
i = 0;
while (i < obj.numlines) {
p1ind = obj.linep1[i];
p2ind = obj.linep2[i];
newx1 = obj.tpointlist[p1ind].x;
newy1 = obj.tpointlist[p1ind].y;
newz1 = obj.tpointlist[p1ind].z;
newx2 = obj.tpointlist[p2ind].x;
newy2 = obj.tpointlist[p2ind].y;
newz2 = obj.tpointlist[p2ind].z;
if ((newz1 > 0) && (newz2 > 0)) {
sx1 = (this.d * (newx1 / newz1)) + this.screencenterX;
sy1 = (this.d * (newy1 / newz1)) + this.screencenterY;
sx2 = (this.d * (newx2 / newz2)) + this.screencenterX;
sy2 = (this.d * (newy2 / newz2)) + this.screencenterY;
avez = (newz1 + newz2) >> 1;
_root.elements3D_mc[obj.linename[i]]._visible = true;
_root.elements3D_mc[obj.linename[i]].swapDepths(100000 - Math.floor(avez));
_root.elements3D_mc[obj.linename[i]].drawline(sx1, sy1, sx2, sy2);
} else {
_root.elements3D_mc[obj.linename[i]]._visible = false;
}
i++;
}
};
_root.engine3D.manipulateobject = function (obj, xoff, yoff, zoff, xrot, yrot, zrot) {
obj.rx = Math.floor(obj.rx) % 3600;
obj.ry = Math.floor(obj.ry) % 3600;
obj.rz = Math.floor(obj.rz) % 3600;
if (obj.rx < 0) {
obj.rx = obj.rx + 3600;
}
if (obj.ry < 0) {
obj.ry = obj.ry + 3600;
}
if (obj.rz < 0) {
obj.rz = obj.rz + 3600;
}
xrot = Math.floor(xrot) % 3600;
yrot = Math.floor(yrot) % 3600;
zrot = Math.floor(zrot) % 3600;
if (xrot < 0) {
xrot = xrot + 3600;
}
if (yrot < 0) {
yrot = yrot + 3600;
}
if (zrot < 0) {
zrot = zrot + 3600;
}
yawsin = this.mySin[obj.ry];
yawcos = this.myCos[obj.ry];
rollsin = this.mySin[obj.rz];
rollcos = this.myCos[obj.rz];
pitchsin = this.mySin[obj.rx];
pitchcos = this.myCos[obj.rx];
pyawsin = this.mySin[yrot];
pyawcos = this.myCos[yrot];
prollsin = this.mySin[zrot];
prollcos = this.myCos[zrot];
ppitchsin = this.mySin[xrot];
ppitchcos = this.myCos[xrot];
i = 0;
while (i < obj.numpoints) {
x1 = obj.pointlist[i].x * obj.sx;
y1 = obj.pointlist[i].y * obj.sy;
z1 = obj.pointlist[i].z * obj.sz;
tx = (yawcos * x1) - (yawsin * z1);
tz = (yawsin * x1) + (yawcos * z1);
newx = (rollcos * tx) + (rollsin * y1);
ty = (rollcos * y1) - (rollsin * tx);
newz = (pitchcos * tz) - (pitchsin * ty);
newy = (pitchsin * tz) + (pitchcos * ty);
newx = newx + (obj.x - xoff);
newy = newy + (obj.y - yoff);
newz = newz + (obj.z - zoff);
tx = (pyawcos * newx) - (pyawsin * newz);
tz = (pyawsin * newx) + (pyawcos * newz);
newx = (prollcos * tx) + (prollsin * newy);
ty = (prollcos * newy) - (prollsin * tx);
newz = (ppitchcos * tz) - (ppitchsin * ty);
newy = (ppitchsin * tz) + (ppitchcos * ty);
obj.tpointlist[i].x = newx;
obj.tpointlist[i].y = newy;
obj.tpointlist[i].z = newz;
i++;
}
};
function drawAll(everyone) {
var _local2 = 0;
while (_local2 < _root.sprites_ar.length) {
var _local3 = _root.sprites_ar[_local2];
if ((_local3.myClip.onEnterFrame == null) || (everyone == true)) {
_local3.drawMe();
}
_local2++;
}
_local2 = 0;
while (_local2 < _root.wireframes_ar.length) {
var _local4 = _root.wireframes_ar[_local2];
_root.engine3D.manipulateobject(_local4, _root.engine3D.offx, _root.engine3D.offy, _root.engine3D.offz, _root.engine3D.playerrx, _root.engine3D.playerry, _root.engine3D.playerrz);
_root.engine3D.drawobject(_local4);
_local2++;
}
}
function switchCamera(camNum) {
_root.cameraman_mc.camNum = camNum;
_root.bg_mc._x = _root.screenCenterX;
var _local3;
var _local2 = 1;
while (_local2 < _root.sprites_ar.length) {
_local3 = _root.sprites_ar[_local2];
if (_local3.cameraAngles == true) {
_local3.myClip.gotoAndStop(camNum);
}
_local2++;
}
switch (camNum) {
case 1 :
_root.engine3D.offx = 0;
_root.engine3D.offy = -170;
_root.engine3D.offz = -400;
_root.engine3D.playerrx = 10;
_root.engine3D.playerry = 10;
_root.engine3D.playerrz = 0;
break;
case 2 :
_root.engine3D.offy = -2;
_root.engine3D.playerrx = 300;
_root.engine3D.playerry = -400;
_root.engine3D.offx = 450;
_root.engine3D.offz = -550;
break;
case 3 :
_root.engine3D.offy = -2;
_root.engine3D.playerrx = 300;
_root.engine3D.playerry = 400;
_root.engine3D.offx = -450;
_root.engine3D.offz = -550;
break;
case 4 :
_root.engine3D.offx = 0;
_root.engine3D.offy = -300;
_root.engine3D.offz = -600;
_root.engine3D.playerrx = -150;
_root.engine3D.playerry = 10;
_root.engine3D.playerrz = 0;
break;
default :
trace("default");
_root.engine3D.offx = 0;
_root.engine3D.offy = -160;
_root.engine3D.offz = -400;
_root.engine3D.playerrx = 10;
_root.engine3D.playerry = 10;
_root.engine3D.playerrz = 0;
}
_root.bg_mc.nested_mc.gotoAndStop(camNum);
_root.bg_mc._xscale = (_root.bg_mc._yscale = 100);
_root.drawAll(true);
}
cameraman_mc.onEnterFrame = function () {
if (_root.cameraOn) {
if (_root.missile.y < _root.wallHeight) {
if ((_root.missile.x < 0) && (this.camNum != 2)) {
_root.switchCamera(2);
} else if ((_root.missile.x >= 0) && (this.camNum != 3)) {
_root.switchCamera(3);
}
} else if ((_root.missile.y > _root.wallHeight) && (this.camNum != 1)) {
_root.switchCamera(1);
}
if (this.camNum == 1) {
if ((_root.missile.z > 300) && (_root.missile.z < (_root.backWallLimit + 100))) {
var _local4 = ((_root.missile.z - 800) - _root.engine3D.offz) / 5;
} else {
var _local4 = (-400 - _root.engine3D.offz) / 3;
}
if (Math.abs(_local4) > 20) {
_root.engine3D.offz = _root.engine3D.offz + _local4;
var _local6;
if (_root.engine3D.offz == -400) {
_local6 = 100;
} else {
_local6 = (2.33 * (_root.engine3D.d * 100)) / (1000 - _root.engine3D.offz);
}
}
var _local3 = _root.missile.x;
if (_local3 > 200) {
_local3 = 201;
} else if (_local3 < -200) {
_local3 = -201;
}
var _local5 = _local3 - _root.engine3D.offx;
if (Math.abs(_local5) > 25) {
} else if (Math.abs(_root.engine3D.offx) < 25) {
}
if ((Math.abs(_local5) > 25) || (Math.abs(_local4) > 10)) {
_root.bg_mc._xscale = (_root.bg_mc._yscale = _local6);
_root.engine3D.offx = _root.engine3D.offx + _local5;
_root.bg_mc._x = (_root.engine3D.d * ((-_root.engine3D.offx) / (1000 - _root.engine3D.offz))) + _root.screenCenterX;
_root.drawAll(true);
}
}
}
};
function placeDot(mover) {
var _local4 = 2000 - Math.round(mover.z);
var _local2 = _root.dots_mc.attachMovie("dot3d", "dot" + _local4, _local4);
_local2._x = mover.myClip._x;
_local2._y = mover.myClip._y;
_local2._xscale = (_local2._yscale = mover.myClip._xscale);
_root.dots_ar.push(_local2);
}
function splat(mover, xyz) {
if ((xyz == "z") || (xyz == "y")) {
_root.bodyHit1.start(0, 1);
} else {
_root.bodyHit2.start(0, 1);
}
var _local9;
var _local8;
var _local7;
var _local13 = mover.x;
var _local12 = mover.y;
var _local11 = mover.z;
var _local3 = 0;
while (_local3 <= 330) {
var _local2 = new _root.engine3D.sprite3d("gore", _local13, _local12, _local11, 0, 0, 0, 1, 0, 0, false, false, 0, null, 1, 0);
_local2.myClip.nested_mc.gotoAndPlay(Math.round(Math.random() * (_local2.myClip.nested_mc._totalframes - 1)) + 1);
_local2.myClip.nested_mc._xscale = (_local2.myClip.nested_mc._yscale = 50 + (Math.random() * 50));
var _local5 = (((_local3 % 90) / 30) + 5) + (Math.random() * 5);
var _local6 = _local5 / 20;
if (xyz == 0) {
_local9 = mover.xspeed * _local6;
_local8 = (_root.getSin(_local3) * _local5) + (mover.yspeed / 2);
_local7 = (_root.getCos(_local3) * _local5) + (mover.zspeed / 2);
} else if (xyz == 1) {
_local9 = (_root.getCos(_local3) * _local5) + (mover.xspeed / 2);
_local8 = mover.yspeed * _local6;
_local7 = (_root.getSin(_local3) * _local5) + (mover.zspeed / 2);
} else if (xyz == 2) {
_local9 = (_root.getCos(_local3) * _local5) + (mover.xspeed / 2);
_local8 = (_root.getSin(_local3) * _local5) + (mover.yspeed / 2);
_local7 = mover.zspeed * _local6;
}
_local2.xspeed = _local9;
_local2.yspeed = _local8;
_local2.zspeed = _local7;
_local2.startMove();
_root.gore_ar.push(_local2);
_local3 = _local3 + 30;
}
}
function startMove() {
this.myClip.onEnterFrame = function () {
if (_root.gameOn) {
trace(" *Natural move: " + this._name);
this.movePercent = 1;
this.moveMe();
this.drawMe();
this.drawVector();
this.yspeed++;
}
};
if (this.myShadow != null) {
this.myShadow.myClip.onEnterFrame = function () {
if (x > 5) {
x = 0;
}
x++;
};
this.myClip.onEnterFrame = function () {
this.mySprite.moveMe();
this.mySprite.drawMe();
this.mySprite.yspeed++;
this.mySprite.myShadow.x = this.mySprite.x;
this.mySprite.myShadow.z = this.mySprite.z + 3;
this.mySprite.myShadow.drawMe();
var _local2 = 1 - (this.mySprite.y / -1000);
if (_local2 < 0.2) {
_local2 = 0.2;
}
this.mySprite.myShadow.myClip._xscale = (this.mySprite.myShadow.myClip._yscale = this.mySprite.myShadow.myClip._yscale * _local2);
};
} else {
this.myClip.onEnterFrame = function () {
this.mySprite.moveMe();
this.mySprite.drawMe();
this.mySprite.yspeed++;
};
}
}
function moveMe() {
this.x = this.x + this.xspeed;
this.y = this.y + this.yspeed;
this.z = this.z + this.zspeed;
if ((this != _root.missile) || (this.y < 10)) {
this.myClip.nested_mc._rotation = this.myClip.nested_mc._rotation + (this.xspeed / 2);
}
this.hitCheck();
while (this.inside) {
trace("__Inside");
this.x = this.x + this.xspeed;
this.y = this.y + this.yspeed;
this.z = this.z + this.zspeed;
this.hitCheck();
}
}
function removeSprite(whichSprite) {
var _local2 = 0;
while (_local2 < _root.sprites_ar.length) {
var _local3 = _root.sprites_ar[_local2];
if (_local3 == whichSprite) {
_root.sprites_ar.splice(_local2, 1);
break;
}
_local2++;
}
_root.removeFromObstacles(whichSprite);
removeMovieClip(whichSprite.myClip);
}
function removeFromObstacles(whichSprite) {
var _local2 = 0;
while (_local2 < _root.obstacles_ar.length) {
var _local3 = _root.obstacles_ar[_local2];
if (_local3 == whichSprite) {
trace("REMOVING from Obstacles: " + whichSprite.myClip._name);
_root.obstacles_ar.splice(_local2, 1);
break;
}
_local2++;
}
}
function explode(whichSprite) {
var _local19 = whichSprite.radius;
var _local17;
var _local16;
var _local15;
var _local12;
var _local13;
var _local14;
var _local11;
var _local9;
var _local7;
var _local6;
var _local10;
trace("EXPLODING " + whichSprite.myClip._name);
var _local18 = new _root.engine3D.sprite3d("explosion", whichSprite.x, whichSprite.y, whichSprite.z, 0, 0, 0, 0, 0, 0, false, true, 0, null, 1, 0);
_root.sprites_ar.push(_local18);
var _local8 = 0;
while (_local8 < _root.obstacles_ar.length) {
var _local3 = _root.obstacles_ar[_local8];
if ((_local3 != whichSprite) && (_local3.bounce != 1.5)) {
xDiff = _local3.x - whichSprite.x;
_local7 = _local3.y - whichSprite.y;
_local6 = _local3.z - whichSprite.z;
_local10 = ((xDiff * xDiff) + (_local7 * _local7)) + (_local6 * _local6);
if (_local10 < 40000) {
_local11 = Math.sqrt(_local10);
_local9 = (200 - _local11) / 4;
_local17 = Math.sqrt((xDiff * xDiff) + (_local7 * _local7));
_local16 = Math.sqrt((xDiff * xDiff) + (_local6 * _local6));
_local15 = Math.sqrt((_local6 * _local6) + (_local7 * _local7));
_local13 = Math.atan2(_local7, _local16);
_local12 = Math.atan2(xDiff, _local15);
_local14 = Math.atan2(_local6, _local17);
whichSprite.zspeed = Math.sin(_local14) * _local9;
whichSprite.yspeed = Math.sin(_local13) * _local9;
whichSprite.xspeed = Math.sin(_local12) * _local9;
whichSprite.radius = _local11 - _local3.radius;
_root.transferMomentum(whichSprite, _local3);
if ((_local3.fixed == false) && (_local3.myClip.onEnterFrame == null)) {
_local3.startMove();
}
}
}
_local8++;
}
var _local5 = 0;
while (_local5 <= 345) {
var _local4 = new _root.engine3D.sprite3d("crate_debris", whichSprite.x, whichSprite.y, whichSprite.z, 1, 1, 1, 1, 1, 0.3, false, false, 0, null, 1, 0, _root.wood_debris);
_local4.myClip.nested_mc._rotation = Math.random() * 359;
_local4.myClip.nested_mc._xscale = (_local4.myClip.nested_mc._yscale = 75 + (Math.random() * 40));
spraymod = ((((_local5 % 90) / 45) * 5) + 10) + (Math.random() * 5);
trace("smod:");
trace(_local5 % 90);
trace(spraymod);
trace("");
bouncemod = (((_local5 % 90) / 45) * -10) + (spraymod * -1);
_local4.xspeed = _root.getCos(_local5) * spraymod;
_local4.yspeed = bouncemod;
_local4.zspeed = _root.getSin(_local5) * spraymod;
_local4.startMove();
_local5 = _local5 + 45;
}
whichSprite.xspeed = (whichSprite.yspeed = (whichSprite.zspeed = 0));
whichSprite.radius = _local19;
delete whichSprite.myClip.onEnterFrame;
_root.removeFromObstacles(whichSprite);
whichSprite.returnToObstacles = true;
}
function startBounce(whichSurface) {
var _local2 = (720 + this.myClip.nested_mc._rotation) % 360;
trace("Bounce ROTATION: " + _local2);
this.myClip.nested_mc.gotoAndStop("bounce");
if (whichSurface == "floor") {
trace(" bounce floor");
if (_local2 < 180) {
this.myClip.nested_mc._rotation = 90;
} else {
this.myClip.nested_mc._rotation = 270;
this.myClip.nested_mc._xscale = -100;
}
} else if (whichSurface == "left") {
trace("bounce left");
if ((_local2 > 90) && (_local2 < 270)) {
this.myClip.nested_mc._rotation = 180;
} else {
this.myClip.nested_mc._rotation = 0;
this.myClip.nested_mc._xscale = -100;
}
} else if (whichSurface == "right") {
if ((_local2 > 90) && (_local2 < 270)) {
this.myClip.nested_mc._rotation = 180;
this.myClip.nested_mc._xscale = -100;
trace("bounce Right, rotation: " + this.myClip.nested_mc._rotation);
} else {
this.myClip.nested_mc._rotation = 0;
}
} else if (whichSurface == "back") {
trace("Back Bounce");
this.myClip.nested_mc.gotoAndStop("backBounce");
}
}
function endBounce() {
this.myClip.nested_mc._xscale = 100;
this.myClip.nested_mc._yscale = 100;
if ((this.y > -5) && ((-Math.abs(this.yspeed)) < 2)) {
this.myClip.nested_mc.gotoAndStop("onGround");
this.myClip.nested_mc._rotation = 0;
} else {
this.myClip.nested_mc.gotoAndStop("hit");
}
}
function setupLevel(levelNum) {
trace("setting up Level: " + levelNum);
trace("ROund: " + _root.roundNum);
while (_root.sprites_ar.length > 0) {
_root.removeSprite(_root.sprites_ar[0]);
}
var _local2 = 0;
while (_root.boxes_ar.length > _local2) {
if (_root.boxes_ar[_local2].permanent == false) {
_root.removeBox(_root.boxes_ar[_local2]);
} else {
_local2++;
}
}
trace("Obstacles: " + _root.obstacles_ar.length);
_root.engine3D.lnum = _root.permanentLinesNum;
switch (levelNum) {
case 1 :
var _local4 = new _root.engine3D.sprite3d("shadow", 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, false, true, 0, null, 1, 0);
var _local9 = new _root.engine3D.sprite3d("knoxville", 0, 0, 1, 100, 50, 30, 40, 6, 0.6, true, false, 0, _local4, 1, 0);
_root.missile = _local9;
var _local8 = new _root.engine3D.sprite3d("target_5", 0, -400, 1002, 100, 100, 0, 50, 0, 0.3, false, true, 0, null, 1, 0);
var _local7 = new _root.engine3D.sprite3d("target_10", 250, -250, 1002, 100, 100, 0, 50, 0, 0.3, false, true, 0, null, 1, 0);
var _local5 = new _root.engine3D.sprite3d("target_10", -250, -250, 1002, 100, 100, 0, 50, 0, 0.3, false, true, 0, null, 1, 0);
var _local6 = new _root.engine3D.sprite3d("target_20", 0, -700, 1002, 100, 100, 0, 50, 0, 0.3, false, true, 0, null, 1, 0);
var _local11 = new Box(0, -400, 1000, 150, 150, 40, false, 100, 0.5, _local8.myClip, _root.bell_prize, false);
var _local15 = new Box(250, -250, 1000, 100, 100, 40, false, 25, 0.5, _local7.myClip, _root.bell_prize, false);
var _local16 = new Box(-250, -250, 1000, 100, 100, 40, false, 25, 0.5, _local5.myClip, _root.bell_prize, false);
var _local17 = new Box(0, -700, 1000, 100, 100, 40, false, 50, 0.5, _local6.myClip, _root.bell_prize, false);
new Barrel(0, 0, 800);
new Barrel(90, 0, 600);
new Barrel(0, 0, 500);
new Barrel(-160, 0, 700);
new Barrel(150, 0, 550);
new Barrel(100, 0, 300);
new Barrel(-100, 0, 900);
new Barrel(50, 0, 750);
new Crate(50, 0, 200);
new Crate(-120, 0, 250);
new Crate(-50, 0, 500);
new Crate(120, 0, 700);
new Crate(-100, 0, 800);
break;
case 2 :
_local4 = new _root.engine3D.sprite3d("shadow", 0, 0, 1, 0, 0, 0, 0, 0, 0, false, true, 0, null, 1, 0);
_local9 = new _root.engine3D.sprite3d("weeman", 0, 0, 1, 100, 50, 30, 30, 4, 0.7, true, false, 0, _local4, 1, 0);
_root.missile = _local9;
_local8 = new _root.engine3D.sprite3d("target_5", 0, -400, 1002, 100, 100, 0, 50, 0, 0.3, false, true, 0, null, 1, 0);
_local7 = new _root.engine3D.sprite3d("target_10", 250, -250, 1002, 100, 100, 0, 50, 0, 0.3, false, true, 0, null, 1, 0);
_local5 = new _root.engine3D.sprite3d("target_10", -250, -250, 1002, 100, 100, 0, 50, 0, 0.3, false, true, 0, null, 1, 0);
_local6 = new _root.engine3D.sprite3d("target_20", 0, -700, 1002, 100, 100, 0, 50, 0, 0.3, false, true, 0, null, 1, 0);
_local11 = new Box(0, -400, 1000, 150, 150, 40, false, 100, 0.5, _local8.myClip, _root.bell_prize, false);
_local15 = new Box(250, -250, 1000, 100, 100, 40, false, 25, 0.5, _local7.myClip, _root.bell_prize, false);
_local16 = new Box(-250, -250, 1000, 100, 100, 40, false, 25, 0.5, _local5.myClip, _root.bell_prize, false);
_local17 = new Box(0, -700, 1000, 100, 100, 40, false, 50, 0.5, _local6.myClip, _root.bell_prize, false);
new Barrel(10, 0, 500);
new Barrel(-40, 0, 600);
new Barrel(60, 0, 600);
new Barrel(-90, 0, 700);
new Barrel(10, 0, 700);
new Barrel(110, 0, 700);
new Barrel(-140, 0, 800);
new Barrel(-40, 0, 800);
new Barrel(60, 0, 800);
new Barrel(350, 0, 600);
new Crate(60, 0, 200);
new Crate(-110, 0, 250);
new Crate(-50, 0, 900);
new Crate(130, 0, 900);
new Crate(-190, 0, 900);
if (_root.roundNum == 1) {
var _local3 = new _root.engine3D.sprite3d("goalpost1", -200, -300, 800, 20, 20, 20, 0, 0, 0.5, false, true, 0, null, 1, 0);
_local3.cameraAngles = true;
trace("Goalpost 1: " + _local3.myClip._name);
var _local12 = new Box(-200, -150, 800, 20, 300, 20, true, 25, 0.5, _local3.myClip, null, false);
var _local19 = new Box(-200, -300, 800, 300, 20, 20, true, 25, 0.5, _local3.myClip, null, false);
var _local18 = new Box(-350, -450, 800, 20, 300, 20, true, 25, 0.5, _local3.myClip, null, false);
var _local10 = new Box(-50, -450, 800, 20, 300, 20, true, 25, 0.5, _local3.myClip, null, false);
var _local13 = new Box(-200, -700, 800, 300, 800, 20, false, 75, 0.5, _local3.myClip, _root.crowd_cheer, false);
} else if (_root.roundNum == 2) {
var _local3 = new _root.engine3D.sprite3d("goalpost2", 250, -300, 700, 20, 20, 20, 0, 0, 0.5, false, true, 0, null, 1, 0);
_local3.cameraAngles = true;
var _local12 = new Box(250, -150, 700, 20, 300, 20, true, 25, 0.5, _local3.myClip, null, false);
var _local19 = new Box(250, -300, 700, 200, 20, 20, true, 25, 0.5, _local3.myClip, null, false);
var _local18 = new Box(150, -400, 700, 20, 200, 20, true, 25, 0.5, _local3.myClip, null, false);
var _local10 = new Box(350, -400, 700, 20, 200, 20, true, 25, 0.5, _local3.myClip, null, false);
var _local13 = new Box(250, -700, 700, 200, 800, 20, false, 75, 0.5, _local3.myClip, _root.crowd_cheer, false);
} else if (_root.roundNum == 3) {
var _local3 = new _root.engine3D.sprite3d("goalpost3", -100, -450, 850, 20, 20, 20, 0, 0, 0.5, false, true, 0, null, 1, 0);
_local3.cameraAngles = true;
var _local12 = new Box(-100, -225, 850, 20, 450, 20, true, 25, 0.5, _local3.myClip, null, false);
var _local19 = new Box(-100, -450, 850, 200, 20, 20, true, 25, 0.5, _local3.myClip, null, false);
var _local18 = new Box(-200, -550, 850, 20, 200, 20, true, 25, 0.5, _local3.myClip, null, false);
var _local10 = new Box(0, -550, 850, 20, 200, 20, true, 25, 0.5, _local3.myClip, null, false);
var _local13 = new Box(-100, -725, 850, 200, 550, 20, false, 75, 0.5, _local3.myClip, _root.crowd_cheer, false);
}
break;
case 3 :
_local4 = new _root.engine3D.sprite3d("shadow", 0, 0, 1, 0, 0, 0, 0, 0, 0, false, true, 0, null, 1, 0);
_local9 = new _root.engine3D.sprite3d("preston", 0, 0, 1, 100, 50, 30, 55, 8, 0.5, true, false, 0, _local4, 1, 0);
_root.missile = _local9;
new Pin(10, -60, 400);
new Pin(-80, -60, 500);
new Pin(100, -60, 500);
new Pin(-170, -60, 600);
new Pin(10, -60, 580);
new Pin(190, -60, 600);
new Pin(-260, -60, 700);
new Pin(-80, -60, 670);
new Pin(100, -60, 670);
new Pin(280, -60, 700);
break;
case 4 :
_local4 = new _root.engine3D.sprite3d("shadow", 0, 0, 1, 0, 0, 0, 0, 0, false, true, 0, null, 1, 0);
_local9 = new _root.engine3D.sprite3d("steveO", 0, 0, 1, 100, 50, 30, 40, 6, 0.6, true, false, 0, _local4, 1, 0);
_root.missile = _local9;
new Crate(0, -30, 600);
new Barrel(0, -95, 600);
new Barrel(0, -170, 598);
new Barrel(0, -245, 596);
new Barrel(0, -40, 400);
new Barrel(0, -115, 398);
new Crate(-50, -30, 700);
new Barrel(-50, -95, 698);
new Barrel(-50, -170, 696);
new Crate(-50, -30, 500);
new Barrel(-50, -95, 498);
new Barrel(-50, -170, 496);
new Crate(-100, -30, 600);
new Barrel(-100, -95, 598);
new Barrel(-100, -170, 596);
new Barrel(-100, -40, 400);
new Barrel(-150, -40, 700);
new Barrel(-150, -40, 500);
new Barrel(-200, -40, 600);
new Crate(45, -30, 700);
new Barrel(45, -95, 698);
new Barrel(45, -170, 696);
new Crate(45, -30, 500);
new Barrel(45, -95, 498);
new Barrel(45, -170, 496);
new Crate(95, -30, 600);
new Barrel(95, -95, 598);
new Barrel(95, -170, 596);
new Barrel(95, -40, 400);
new Barrel(145, -40, 700);
new Barrel(145, -40, 500);
new Barrel(195, -40, 600);
new Crate_points(360, -170, 940, 50);
new Crate_points(-300, -30, 930, 25);
new Crate_points(450, -30, 500, 25);
new Crate_points(-400, -30, 100, 75);
break;
default :
trace(" ***** setupLevel() called, w/ illegal parameter *****");
}
}
function launch() {
var _local5;
if (_root.levelNum == 2) {
_local5 = 1.4;
} else if (_root.levelNum == 3) {
_local5 = 0.7;
} else {
_local5 = 1;
}
_root.cameraOn = true;
_root.missile.xspeed = _root.xpower * _local5;
_root.missile.yspeed = _root.ypower * _local5;
_root.missile.zspeed = _root.zpower;
if (_root.levelNum != 3) {
_root.missile.zspeed = _root.missile.zspeed * _local5;
}
trace("mX: " + _root.missile.xspeed);
trace("mY: " + _root.missile.yspeed);
trace("mZ: " + _root.missile.zspeed);
_root.missile.startMove();
_root.missile.myClip.nested_mc.play();
_root.bull_impact.start(0, 1);
if ((Math.abs(_root.missile.yspeed) + Math.abs(_root.missile.yspeed)) > 40) {
_root.human_launched.start(0, 1);
}
_root.createEmptyMovieClip("endRef_mc", 151);
_root.endRef_mc.onEnterFrame = function () {
var _local4 = true;
var _local3 = 0;
while (_local3 < _root.sprites_ar.length) {
if (_root.sprites_ar[_local3].myClip.onEnterFrame != null) {
_local4 = false;
break;
}
_local3++;
}
if (_local4) {
trace("*******************");
trace("Ref Says ROUND OVER");
trace("*******************");
_root.endRound();
removeMovieClip(this);
}
};
switchCamera(1);
}
function reset(level, round) {
_root.interface_mc._visible = true;
_root.interface_mc.level_txt.text = level;
_root.interface_mc.round_txt.text = round;
_root.cameraOn = false;
_root.missile.x = 0;
_root.missile.y = -_root.missile.radius;
trace("missile.y: " + _root.missile.y);
_root.missile.z = 1;
_root.missile.xspeed = (_root.missile.yspeed = (_root.missile.zspeed = 0));
_root.missile.myShadow.x = 0;
_root.missile.myShadow.z = 1;
_root.character_mc.nested_mc.gotoAndStop(1);
missile.drawMe();
_root.missile.myShadow.drawMe();
_root.switchCamera(4);
_root.drawAll(true);
}
function endRound() {
_root.cameraOn = false;
trace("ENDROUND, missile.z: " + _root.missile.z);
if (_root.missile.z > 0) {
if (Math.random() > 0.5) {
_root.groan1.start(0, 1);
} else {
_root.groan2.start(0, 1);
}
}
var banjoDone = false;
_root.createEmptyMovieClip("timer_mc", 150);
_root.timer_mc.startTime = getTimer();
_root.timer_mc.onEnterFrame = function () {
var _local3 = getTimer() - this.startTime;
if ((_local3 > 100) && (banjoDone == false)) {
banjoDone = true;
if (_root.roundNum == 1) {
_root.banjo1.start(0, 1);
} else if (_root.roundNum == 2) {
_root.banjo2.start(0, 1);
} else if (_root.roundNum == 3) {
_root.banjo3.start(0, 1);
}
}
if (_local3 > 1500) {
_root.roundScores_ar[_root.roundNum - 1] = _root.roundScore;
_root.roundScore = 0;
_root.roundNum++;
if (_root.roundNum > 3) {
_root.segueLevel(_root.levelNum);
} else {
_root.startRound();
}
removeMovieClip(this);
}
};
}
function startRound() {
_root.setupLevel(_root.levelNum);
_root.reset(_root.levelNum, _root.roundNum);
var _local3;
if (_root.roundNum == 1) {
_local3 = _root.interface_mc.round1_mc;
} else if (_root.roundNum == 2) {
_local3 = _root.interface_mc.round2_mc;
} else if (_root.roundNum == 3) {
_local3 = _root.interface_mc.round3_mc;
}
_local3._visible = true;
_local3.onEnterFrame = function () {
if (this._currentframe == this._totalframes) {
this._visible = false;
_root.interface_mc.roundScore_mc.roundNum_txt.text = _root.roundNum;
_root.interface_mc.roundScore_mc.roundScore_txt.text = (_root.roundScore = 0);
_root.startBull();
delete this.onEnterFrame;
} else if (this._currentframe == 2) {
_root.bell_round.start(0, 1);
}
};
_local3.gotoAndPlay(1);
}
function segueLevel(levelNum) {
_root.interface_mc.levelSum_mc._visible = true;
_root.interface_mc.levelSum_mc.levelNum_txt.text = _root.levelNum;
_root.interface_mc.levelSum_mc.r1_txt.text = _root.roundScores_ar[0];
_root.interface_mc.levelSum_mc.r2_txt.text = _root.roundScores_ar[1];
_root.interface_mc.levelSum_mc.r3_txt.text = _root.roundScores_ar[2];
_root.levelScores_ar[_root.levelNum - 1] = (_root.roundScores_ar[0] + _root.roundScores_ar[1]) + _root.roundScores_ar[2];
_root.interface_mc.levelSum_mc.total_txt.text = _root.levelScores_ar[_root.levelNum - 1];
_root.roundNum = 1;
_root.levelNum++;
_root.interface_mc.levelSum_mc.ok_btn.onRelease = function () {
trace("SEGUE: " + _root.levelNum);
_root.cutscenes_mc._visible = true;
if (_root.levelNum == 1) {
_root.startGame();
} else {
if (_root.levelNum == 5) {
stopAllSounds();
_root.interface_mc.roundScore_mc._visible = false;
_root.cutscenes_mc.gotoAndStop("gameOver");
_root.cutscenes_mc.l1_txt.text = _root.levelScores_ar[0];
_root.cutscenes_mc.l2_txt.text = _root.levelScores_ar[1];
_root.cutscenes_mc.l3_txt.text = _root.levelScores_ar[2];
_root.cutscenes_mc.l4_txt.text = _root.levelScores_ar[3];
_root.cutscenes_mc.total_txt.text = ((_root.levelScores_ar[0] + _root.levelScores_ar[1]) + _root.levelScores_ar[2]) + _root.levelScores_ar[3];
_root.levelNum = 1;
} else {
stopAllSounds();
_root.cutscenes_mc.gotoAndStop(String("intro" + _root.levelNum));
_root.cutscenes_mc.startLevel_btn.onRelease = function () {
_root.interface_mc.roundScore_mc.levelNum_txt.text = _root.levelNum;
_root.interface_mc.roundScore_mc.roundNum_txt.text = _root.roundNum;
_root.interface_mc.roundScore_mc.instructions_txt.text = _root.instructions_ar[_root.levelNum - 1];
_root.cutscenes_mc._visible = false;
_root.startRound();
};
}
trace("CurFrame: " + this._currentframe);
}
this._parent._visible = false;
};
}
function startGame() {
_root.roundScore = 0;
_root.levelScore = 0;
_root.roundScores_ar.length = 0;
_root.levelScores_ar.length = 0;
_root.interface_mc.roundScore_mc._visible = true;
_root.interface_mc.roundScore_mc.roundScore_txt.text = "0";
_root.interface_mc.roundScore_mc.levelNum_txt.text = "1";
_root.interface_mc.roundScore_mc.roundNum_txt.text = "1";
_root.levelNum = 1;
_root.roundNum = 1;
_root.cutscenes_mc._visible = true;
_root.cutscenes_mc.gotoAndStop("intro1");
_root.cutscenes_mc.startLevel_btn.onRelease = function () {
_root.startRound();
_root.cutscenes_mc._visible = false;
};
}
function startBull() {
trace("start Bull");
_root.interface_mc.instructions_txt.text = _root.instructions_ar[_root.levelNum - 1];
_root.bull_mc._visible = 1;
_root.bull_mc.instructions_mc._visible = 1;
_root.bull_mc.nested_mc._visible = 0;
_root.bull_mc.nested_mc.gotoAndStop(3);
_root.bull_mc.nested_mc.charge.stop();
_root.bull_mc.head_mc._visible = 1;
_root.bull_mc.head_mc._xscale = (_root.bull_mc.head_mc._yscale = 75);
_root.bull_mc.head_mc._x = 0;
_root.bull_mc.head_mc._y = 0;
_root.bull_mc.arrow_mc._rotation = 90;
_root.bull_mc.arrow_mc.tail_mc._xscale = 10;
_root.bull_mc.arrow_mc._visible = false;
_root.bull_mc.meter_mc.pointer_mc._y = 0;
_root.bull_mc.onMouseUp = function () {
if ((this._visible == 1) && (this.hitTest(_xmouse, _ymouse, false))) {
this.head_mc._x = (this.head_mc._y = 0);
this.head_mc._xscale = (this.head_mc._yscale = 75);
_root.bull_mc.onMouseDown = null;
_root.bull_mc.arrow_mc._visible = (this.meter_mc._visible = false);
this.nested_mc._visible = 1;
var _local4 = Math.sqrt((this._xmouse * this._xmouse) + (this._ymouse * this._ymouse));
if (_local4 > 150) {
_local4 = 150;
}
var _local3 = Math.atan2(this._ymouse, this._xmouse);
if (_root.radiansToDegrees(_local3) < 30) {
_local3 = _root.degreesToRadians(30);
} else if (_root.radiansToDegrees(_local3) > 150) {
_local3 = _root.degreesToRadians(150);
}
var _local6 = Math.sin(_local3);
var _local5 = Math.cos(_local3);
this.nested_mc._y = (_local6 * _local4) * 0.6;
this.nested_mc._x = _local5 * _local4;
var _local7 = 75 + (25 * (_local4 / 150));
this.nested_mc._xscale = (this.nested_mc._yscale = _local7);
var _local8 = Math.round(_local5 * 2) + 3;
this.nested_mc.gotoAndStop(_local8);
_root.bull_mc.nested_mc.charge.play();
this.xStep = (-this.nested_mc._x) / 10;
this.yStep = (-this.nested_mc._y) / 10;
this.scaleStep = (75 - this.nested_mc._xscale) / 10;
this.steps = 0;
_root.bull_charge.start(0, 1);
this.onEnterFrame = function () {
this.steps++;
this.nested_mc._x = this.nested_mc._x + this.xStep;
this.nested_mc._y = this.nested_mc._y + this.yStep;
this.nested_mc._xscale = (this.nested_mc._xscale = this.nested_mc._xscale + this.scaleStep);
if (this.steps >= 10) {
_root.launch();
delete this.onEnterFrame;
this._visible = 0;
}
};
}
};
_root.bull_mc.onMouseDown = function () {
if (((this._visible == 1) && (this.hitTest(_xmouse, _ymouse, false))) && (this._ymouse > -40)) {
_root.bull_snort.start(0, 1);
this.instructions_mc._visible = 0;
_root.bull_mc.myWidth = _root.bull_mc._width;
_root.bull_mc.maxDist = 300;
_root.bull_mc.arrow_mc._visible = true;
_root.bull_mc.meter_mc._visible = 1;
_root.bull_mc.meter_mc.pointer_mc._y = 0;
_root.bull_mc.yPower = 0;
_root.bull_mc.dir = 1;
_root.bull_mc.onEnterFrame = function () {
if (this._ymouse > 1) {
var _local3 = Math.sqrt((this._xmouse * this._xmouse) + (this._ymouse * this._ymouse));
if (_local3 > 150) {
_local3 = 150;
}
var _local4 = Math.atan2(this._ymouse, this._xmouse);
if (_root.radiansToDegrees(_local4) < 30) {
_local4 = _root.degreesToRadians(30);
} else if (_root.radiansToDegrees(_local4) > 150) {
_local4 = _root.degreesToRadians(150);
}
var _local6 = Math.sin(_local4);
var _local5 = Math.cos(_local4);
}
this.head_mc._y = (_local6 * (_local3 + 40)) * 0.6;
this.head_mc._x = _local5 * _local3;
var _local8 = 75 + (25 * (_local3 / 150));
this.head_mc._xscale = (this.head_mc._yscale = _local8);
this.arrow_mc._rotation = _root.radiansToDegrees(_local4);
this.arrow_mc.tail_mc._xscale = (60 * (_local3 / 150)) + ((40 * (_local3 / 150)) * Math.abs(_local5));
this.yPower = this.yPower + (3 * this.dir);
if (this.yPower >= 100) {
this.yPower == 100;
this.dir = -1;
} else if (this.yPower < 0) {
this.yPower == 0;
this.dir = 1;
}
this.meter_mc.pointer_mc._y = -120 * (this.yPower / 100);
var _local9 = Math.atan2(_local6 * 1.6, _local5);
var _local7 = Math.cos(_local9);
_root.xpower = (-_local7) * ((_local3 / 150) * 30);
_root.ypower = (this.yPower / 100) * -40;
_root.zpower = (1 - Math.abs(_local7)) * ((_local3 / 150) * 40);
};
}
};
}
var l = _root.leftLimit;
var r = _root.rightLimit;
var fr = _root.frontLimit;
var fl = _root.bottomLimit;
var b = _root.backWallLimit;
var wh = _root.wallHeight;
var p = _root.peakHeight;
var hayPile_bl = new Box(l + 55, -90, b - 85, 105, 180, 170, true, 5, 0.5, null, null, true);
var hayPile_br = new Box(r - 140, -60, b - 60, 280, 120, 120, true, 5, 0.5, null, null, true);
trace("boxes_ar.length: " + _root.boxes_ar.length);
var permanentLinesNum = _root.engine3D.lnum;
Instance of Symbol 1003 MovieClip "framerate" in Frame 29
/* no clip actions */
Symbol 3 MovieClip [dot3d] Frame 22
stop();
Symbol 20 MovieClip [splat] Frame 16
stop();
Symbol 48 MovieClip [goalpost3] Frame 1
stop();
Symbol 59 MovieClip [goalpost2] Frame 1
stop();
Symbol 72 MovieClip [goalpost1] Frame 1
stop();
Symbol 84 MovieClip Frame 1
stop();
Symbol 84 MovieClip Frame 14
stop();
Symbol 101 MovieClip Frame 1
stop();
Symbol 101 MovieClip Frame 3
stop();
Symbol 137 MovieClip [explosion] Frame 36
_root.removeSprite(this.mySprite);
Symbol 143 MovieClip [gore] Frame 15
stop();
_root.removeSprite(this.mySprite);
Symbol 153 MovieClip Frame 1
stop();
Symbol 314 MovieClip Frame 14
this._parent._parent.mySprite.endBounce();
Symbol 337 MovieClip Frame 12
this._parent._parent.mySprite.endBounce();
Symbol 338 MovieClip Frame 2
stop();
Symbol 487 MovieClip Frame 12
this._parent._parent.mySprite.endBounce();
Symbol 512 MovieClip Frame 13
this._parent._parent.mySprite.endBounce();
Symbol 513 MovieClip Frame 2
stop();
Symbol 660 MovieClip Frame 11
this._parent._parent.mySprite.endBounce();
Symbol 679 MovieClip Frame 10
this._parent._parent.mySprite.endBounce();
Symbol 680 MovieClip Frame 2
stop();
Symbol 819 MovieClip Frame 8
this._parent._parent.mySprite.endBounce();
Symbol 838 MovieClip Frame 10
this._parent._parent.mySprite.endBounce();
Symbol 839 MovieClip Frame 2
stop();
Symbol 842 MovieClip [haybail_wide] Frame 1
stop();
Symbol 844 MovieClip [haybail_narrow] Frame 1
stop();
Symbol 850 MovieClip Frame 1
stop();
Symbol 850 MovieClip Frame 3
if (this._parent.mySprite.xspeed < 0) {
this.gotoAndPlay("fallLeft");
}
Symbol 850 MovieClip Frame 14
stop();
Symbol 850 MovieClip Frame 25
stop();
Symbol 859 MovieClip [points] Frame 25
removeMovieClip(this);
Symbol 867 MovieClip Frame 1
stop();
Symbol 867 MovieClip Frame 3
stop();
Symbol 899 MovieClip Frame 1
stop();
Symbol 999 MovieClip Frame 1
stop();
this.instructions_btn.onRelease = function () {
this._parent.gotoAndStop("instructions");
};
this.start_btn.onRelease = function () {
_root.startGame();
};
this.sendToFriend_btn.onRelease = function () {
this._parent.gotoAndStop("sendToFriend");
};
Symbol 999 MovieClip Frame 6
stop();
this.home_btn.onRelease = function () {
this._parent.gotoAndStop("home");
};
this.start_btn.onRelease = function () {
_root.startGame();
};
Symbol 999 MovieClip Frame 14
sendToFriend_btn.onRelease = function () {
this._parent.gotoAndStop("sendToFriend");
};
replay_btn.onRelease = function () {
_root.startGame();
};
Symbol 999 MovieClip Frame 22
stop();
error_mc._visible = (YNstar_mc._visible = (YEstar_mc._visible = (FNstar_mc._visible = (FEstar_mc._visible = false))));
this.send_btn.onRelease = function () {
this._parent.error_mc._visible = (this._parent.YNstar_mc._visible = (this._parent.YEstar_mc._visible = (this._parent.FNstar_mc._visible = (this._parent.FEstar_mc._visible = false))));
var _local6 = this._parent.yourName_txt.text;
var _local4 = this._parent.yourEmail_txt.text;
var _local3 = this._parent.friendEmail_txt.text;
var _local5 = this._parent.friendName_txt.text;
var _local7 = this._parent.message_txt.text;
var _local2 = false;
if ((_local4.indexOf(".", 0) == -1) || (_local4.indexOf("@", 0) == -1)) {
this._parent.YEstar_mc._visible = true;
_local2 = true;
}
if ((_local3.indexOf(".", 0) == -1) || (_local3.indexOf("@", 0) == -1)) {
this._parent.FEstar_mc._visible = true;
_local2 = true;
}
if (_local6 == "") {
this._parent.YNstar_mc._visible = true;
_local2 = true;
}
if (_local5 == "") {
this._parent.FNstar_mc._visible = true;
_local2 = true;
}
if (_local2 == false) {
send_lv = new LoadVars();
theResult = new LoadVars();
send_lv.friendAddress = _local3;
send_lv.yourAddress = _local4;
send_lv.friendName = _local5;
send_lv.yourName = _local6;
send_lv.Message = _local7;
send_lv.sendAndLoad("Mail.php", theResult, "POST");
this._parent.yourName_txt.text = "";
this._parent.yourEmail_txt.text = "";
this._parent.friendEmail_txt.text = "";
this._parent.friendName_txt.text = "";
this._parent.message_txt.text = "Thankyou";
} else {
this._parent.error_mc._visible = true;
}
};
home_btn.onRelease = function () {
this._parent.gotoAndStop("home");
};
Symbol 999 MovieClip Frame 79
this.strike_mc.play();
Symbol 1145 MovieClip Frame 3
stop();
Symbol 1146 MovieClip Frame 1
stop();
Symbol 1157 MovieClip Frame 1
this.onOff_btn.onPress = function () {
if (this._parent.onOff_txt.text == "on") {
this._parent.onOff_txt.text = "off";
} else {
this._parent.onOff_txt.text = "on";
}
};
this.launch_btn.onRelease = function () {
_root.launch();
delete _root.bull_mc.onEnterFrame;
_root.bull_mc._visible = 0;
};
this.test_btn.onRelease = function () {
var _local2 = 0;
while (_local2 < _root.sprites_ar.length) {
if (_root.sprites_ar[_local2].myClip.onEnterFrame != null) {
trace(" __still Running: " + _root.sprites_ar[_local2].myClip._name);
trace((((("x: " + _root.sprites_ar[_local2].x) + ", y: ") + _root.sprites_ar[_local2].y) + ", z: ") + _root.sprites_ar[_local2].z);
}
_local2++;
}
};
this.reset_btn.onRelease = function () {
_root.levelNum = Number(this._parent.level_txt.text);
_root.setupLevel(Number(this._parent.level_txt.text));
};
this.cam_btn.camNum = 1;
this.cam_btn.onRelease = function () {
this.camNum++;
if (this.camNum > 4) {
this.camNum = 1;
}
_root.switchCamera(this.camNum);
_root.camaraOn = false;
};
Symbol 1212 MovieClip Frame 1
stop();
Symbol 1219 MovieClip Frame 1
stop();
Symbol 1219 MovieClip Frame 11
gotoAndStop (1);