Frame 5
thisPercentLoaded = this.getBytesLoaded() / this.getBytesTotal();
loadingProgress.gotoAndStop(Math.round(thisPercentLoaded * 100));
loadingProgress.percentOutput = Math.round(thisPercentLoaded * 100) add "%";
if (thisPercentLoaded >= 1) {
gotoAndPlay (17);
} else {
gotoAndPlay (4);
}
Frame 28
_root._quality = "best";
stop();
Instance of Symbol 192 MovieClip "resetHider" in Frame 28
onClipEvent (load) {
function gameIsHidden() {
_parent.gameEngine.gameHidden();
}
function gameIsRevealed() {
_parent.gameEngine.gameRevealed();
}
}
Instance of Symbol 262 MovieClip "screens" in Frame 28
onClipEvent (load) {
this.gotoAndStop("startScreen");
}
Symbol 8 MovieClip Frame 34
gotoAndPlay (1);
Symbol 10 MovieClip Frame 1
stop();
Instance of Symbol 14 MovieClip in Symbol 58 MovieClip Frame 1
onClipEvent (load) {
gotoAndPlay (5);
}
Instance of Symbol 36 MovieClip "4" in Symbol 58 MovieClip Frame 1
onClipEvent (load) {
trace(_name);
gotoAndPlay(_name);
}
Instance of Symbol 36 MovieClip "1" in Symbol 58 MovieClip Frame 1
onClipEvent (load) {
trace(_name);
gotoAndPlay(_name);
}
Instance of Symbol 69 MovieClip "hitBox" in Symbol 110 MovieClip Frame 1
onClipEvent (load) {
this._visible = 0;
}
Symbol 114 MovieClip Frame 1
stop();
Symbol 131 MovieClip Frame 13
stop();
Symbol 132 MovieClip Frame 1
stop();
Symbol 132 MovieClip Frame 10
stop();
Symbol 132 MovieClip Frame 20
play();
Symbol 132 MovieClip Frame 31
stop();
Symbol 147 MovieClip Frame 1
stop();
Symbol 147 MovieClip Frame 21
stop();
Symbol 149 MovieClip Frame 1
stop();
Symbol 180 MovieClip Frame 1
stop();
Symbol 180 MovieClip Frame 5
stop();
Symbol 180 MovieClip Frame 33
gotoAndStop (5);
Symbol 185 MovieClip Frame 1
stop();
Symbol 185 MovieClip Frame 5
stop();
Symbol 185 MovieClip Frame 55
gotoAndPlay (31);
Symbol 186 MovieClip Frame 1
stop();
Instance of Symbol 69 MovieClip "ground" in Symbol 186 MovieClip Frame 1
onClipEvent (load) {
this._visible = 0;
}
Instance of Symbol 111 MovieClip "projectileMask" in Symbol 186 MovieClip Frame 1
onClipEvent (load) {
this._visible = 0;
}
Symbol 190 MovieClip Frame 1
stop();
Symbol 190 MovieClip Frame 141
_parent.gameEngine.gonzoVideoDone();
Symbol 192 MovieClip Frame 1
stop();
Symbol 192 MovieClip Frame 15
gameIsHidden();
Symbol 192 MovieClip Frame 30
gameIsRevealed();
Symbol 193 Button
on (release) {
gameEngineRef.canonAngle = (canonAngle = constrainToBounds(canonAngle + 1, 0, 90));
}
Symbol 194 Button
on (release) {
gameEngineRef.canonAngle = (canonAngle = constrainToBounds(canonAngle - 1, 0, 90));
}
Symbol 195 Button
on (release) {
gameEngineRef.canonPower = (canonPower = constrainToBounds(canonPower + 1, 0, 99));
}
Symbol 196 Button
on (release) {
gameEngineRef.canonPower = (canonPower = constrainToBounds(canonPower - 1, 0, 99));
}
Symbol 197 Button
on (release) {
gameEngineRef.fireCanon();
}
Symbol 204 Button
on (release) {
gameEngineRef.showPoolPosition();
}
Symbol 211 Button
on (release) {
gameEngineRef.fireCanon();
}
Symbol 217 Button
on (press) {
voltageUpPress();
}
on (release, releaseOutside) {
voltageUpRelease();
}
Symbol 223 Button
on (press) {
voltageDownPress();
}
on (release, releaseOutside) {
voltageDownRelease();
}
Symbol 229 Button
on (press) {
angleDialPress();
}
on (release, dragOut) {
angleDialRelease();
}
Symbol 236 MovieClip Frame 1
function setStars(newStars) {
trace("setStars " add stars);
this.gotoAndStop(5 + (newStars * 2));
}
function setScore(newScore) {
trace("setScore " add newScore);
scoreTarget = newScore;
}
function resetScoreboard() {
setStars(4);
scoreCurrent = (scoreTarget = (scoreOutput = 0));
}
scoreAddMin = 25;
scoreAddMax = 100;
scoreCurrent = (scoreTarget = (scoreOutput = 0));
this.onEnterFrame = function () {
if (scoreCurrent < scoreTarget) {
scoreCurrent = constrainToBounds(scoreCurrent + Math.randomWithinRange(scoreAddMin, scoreAddMax), 0, scoreTarget);
scoreOutput = Math.round(scoreCurrent);
}
};
resetScoreboard();
Symbol 237 Button
on (release) {
gameEngineRef.setRandomPoolPosition();
}
Symbol 238 Button
on (release) {
gameEngineRef.showPoolPosition();
}
Symbol 239 Button
on (release) {
resetInterface();
}
Symbol 240 MovieClip Frame 1
gameEngineRef = _parent.gameEngine;
canonAngle = 45;
canonPower = 10;
canonPowerMin = 35;
canonPowerMax = 100;
voltageButtonDelayFirst = 8;
voltageButtonDelayAfter = 2;
voltageButtonDelayCurrent = 0;
trackingAngleDial = 0;
angleDialAngleMin = 20;
angleDialAngleMax = 340;
angleDialAngleMasterStart = 225;
canonAngleMin = 10;
canonAngleMax = 65;
Symbol 240 MovieClip Frame 2
function voltageUpPress() {
voltageButtonDelayCurrent = voltageButtonDelayFirst;
canonPowerIncrement();
voltageUpIsDown = 1;
}
function voltageUpRelease() {
voltageUpIsDown = 0;
}
function voltageDownPress() {
voltageButtonDelayCurrent = voltageButtonDelayFirst;
canonPowerDecrement();
voltageDownIsDown = 1;
}
function voltageDownRelease() {
voltageDownIsDown = 0;
}
function canonPowerIncrement() {
canonPower = constrainToBounds(canonPower + 1, canonPowerMin, canonPowerMax);
}
function canonPowerDecrement() {
canonPower = constrainToBounds(canonPower - 1, canonPowerMin, canonPowerMax);
}
function angleDialPress() {
var mouseDX = (this._xmouse - angleDialDot._x);
var mouseDY = (this._ymouse - angleDialDot._y);
angleDialMouseAngleStartRad = Math.atan2(mouseDX, mouseDY);
angleDialMouseAngleStart = ((angleDialMouseAngleStartRad / Math.PI) * 180) + 0;
angleDialAngleStart = angleDialDot._rotation;
trace((("mouseDX=" add mouseDX) add " mouseDY=") add mouseDY);
trackingAngleDial = 1;
}
function angleDialRelease() {
trackingAngleDial = 0;
}
function resetInterface() {
angleDialAngleLast = (angleDialAngleCurrent = angleDialAngleMasterStart);
angleDialAnglePercent = (angleDialAngleCurrent - angleDialAngleMin) / (angleDialAngleMax - angleDialAngleMin);
canonAngle = Math.round(canonAngleMin + (angleDialAnglePercent * (canonAngleMax - canonAngleMin)));
angleDialDot._rotation = angleDialAngleCurrent;
gameEngineRef.canonAngle = canonAngle;
canonPower = canonPowerMin;
}
Symbol 240 MovieClip Frame 3
resetInterface();
Symbol 240 MovieClip Frame 5
if (voltageUpIsDown) {
voltageButtonDelayCurrent--;
if (voltageButtonDelayCurrent <= 0) {
voltageButtonDelayCurrent = voltageButtonDelayAfter;
canonPowerIncrement();
}
}
if (voltageDownIsDown) {
voltageButtonDelayCurrent--;
if (voltageButtonDelayCurrent <= 0) {
voltageButtonDelayCurrent = voltageButtonDelayAfter;
canonPowerDecrement();
}
}
if (trackingAngleDial == 1) {
mouseDX = this._xmouse - angleDialDot._x;
mouseDY = this._ymouse - angleDialDot._y;
angleDialMouseAngleCurrentRad = Math.atan2(mouseDX, mouseDY);
angleDialMouseAngleCurrent = ((angleDialMouseAngleCurrentRad / Math.PI) * 180) + 0;
angleDialMouseAngleDiff = angleDialMouseAngleCurrent - angleDialMouseAngleStart;
angleDialAngleCurrent = angleDialAngleStart - angleDialMouseAngleDiff;
if (angleDialAngleCurrent < 0) {
angleDialAngleCurrent = angleDialAngleCurrent + 360;
}
angleDialAngleCurrent = constrainToBounds(angleDialAngleCurrent, angleDialAngleMin, angleDialAngleMax);
if (Math.abs(angleDialAngleCurrent - angleDialAngleLast) > 100) {
angleDialAngleCurrent = angleDialAngleLast;
}
angleDialAngleLast = angleDialAngleCurrent;
angleDialAnglePercent = (angleDialAngleCurrent - angleDialAngleMin) / (angleDialAngleMax - angleDialAngleMin);
canonAngle = Math.round(canonAngleMin + (angleDialAnglePercent * (canonAngleMax - canonAngleMin)));
angleDialDot._rotation = angleDialAngleCurrent;
}
gameEngineRef.canonAngle = canonAngle;
gameEngineRef.canonPower = canonPower;
gotoAndPlay (4);
Symbol 251 Button
on (release) {
_parent.gotoAndPlay("outroStart");
}
Symbol 259 Button
on (release) {
_parent.gotoAndPlay("outroGameOver");
}
Symbol 261 MovieClip Frame 1
congratsTextStart = "YOU SCORED ";
congratsTextEnd = " POINTS AND GONZO\rSCORED A RIDE IN AN AMBULANCE";
congratsText = (congratsTextStart add _parent.scoreFinal) add congratsTextEnd;
stop();
Symbol 262 MovieClip Frame 1
gameEngineRef = _parent.gameEngine;
Symbol 262 MovieClip Frame 5
stop();
Symbol 262 MovieClip Frame 20
stop();
Symbol 262 MovieClip Frame 36
gameEngineRef.startGame();
gotoAndStop (1);
Symbol 262 MovieClip Frame 55
stop();
Symbol 262 MovieClip Frame 71
gameEngineRef.playAgain();
gotoAndStop (1);
Symbol 271 MovieClip Frame 1
stop();
Symbol 271 MovieClip Frame 5
play();
Symbol 271 MovieClip Frame 6
gotoAndStop (1);
Symbol 271 MovieClip Frame 15
trace("hit ground sound");
play();
Symbol 271 MovieClip Frame 18
gotoAndStop (1);
Symbol 271 MovieClip Frame 30
trace("splash sound");
play();
Symbol 271 MovieClip Frame 31
gotoAndStop (1);
Symbol 271 MovieClip Frame 45
trace("success 1");
play();
Symbol 271 MovieClip Frame 46
gotoAndStop (1);
Symbol 271 MovieClip Frame 55
trace("success 1");
play();
Symbol 271 MovieClip Frame 56
gotoAndStop (1);
Symbol 271 MovieClip Frame 65
trace("success 1");
play();
Symbol 271 MovieClip Frame 66
gotoAndStop (1);
Symbol 274 Button
on (release) {
getURL ("javascript:window.close();", "_self");
}
Symbol 277 MovieClip Frame 23
stop();
Symbol 278 MovieClip Frame 1
interfaceRef = _parent.interface;
bgdRef = _parent.bgd;
canonRef = _parent.bgd.canon;
canonExplosionRef = _parent.bgd.canon.canon.smoke;
projectileRef = _parent.bgd.gonzo;
projectileStartingPointRef = _parent.bgd.canon.canon.projectileStartPoint;
poolRef = _parent.bgd.pool;
groundRef = _parent.bgd.ground;
splashRef = _parent.bgd.splash;
gonzoInPoolRef = _parent.bgd.gonzoInPool;
projectileMaskRef = _parent.bgd.projectileMask;
resetHiderRef = _parent.resetHider;
scoreboardRef = _parent.interface.scoreboard;
screensRef = _parent.screens;
projectileShadowRef = _parent.bgd.gonzoShadow;
soundsRef = _parent.sounds;
gonzoVideoRef = _parent.gonzoVideo;
currentState = "busy";
gravity = 1.8;
groundFriction = 0.78;
canonAngle = 0;
canonPower = 0;
projectileStartX = 0;
projectileStartY = 0;
projectileVXGroundMin = 1;
projectileEnteringWater = 0;
projectileHitTarget = 0;
scrollBorder = 50;
poolXMin = 500;
poolXMax = 4000;
poolXDiffMin = 500;
projectilePointBottomLeft = new Object();
projectilePointBottomRight = new Object();
scrollBgdRadCurrent = 0;
scrollBgdRadStep = 0;
scrollBgdDX = 0;
showPoolRadStep = 0.05;
callbackCountdownCurrent = 0;
showPoolPause = 32;
showProjectileOnGroundPause = 35;
showHappyGonzoPause = 50;
scoreLocal = 0;
scoreHitMin = 50;
poolDistanceToScoreMod = 0.873;
starsMax = 4;
starsCurrent = starsMax;
doProjectileShadow = 1;
projectileShadowProjectileYMin = -1000;
projectileShadowScaleMin = 100;
projectileShadowScaleMax = 400;
projectileShadowAlphaMin = 100;
projectileShadowAlphaMax = 0;
gonzoScreamingSound = new Sound(_parent.gonzoScreaming);
gonzoScreamingSound.setVolume(0);
gonzoScreamingVolumeMin = 100;
gonzoScreamingVolumeMax = 5;
projectileShadowYPercentMod = 0.8;
gonzoScreamingLoopsTotal = 4;
gonzoScreamingLoopLast = 0;
gonzoSuccessClipLast = 0;
gonzoSuccessClipsTotal = 3;
if (_global.constrainToBounds == undefined) {
_global.constrainToBounds = function (numToCheck, boundaryMin, boundaryMax) {
if (numToCheck < boundaryMin) {
return(boundaryMin);
}
if (numToCheck > boundaryMax) {
return(boundaryMax);
}
return(numToCheck);
};
}
if (Math.randomWithinRange == undefined) {
Math.randomWithinRange = function (randomMin, randomMax) {
return(randomMin + (Math.random() * (randomMax - randomMin)));
};
}
Symbol 278 MovieClip Frame 2
function resetFireVars() {
projectileEnteringWater = 0;
projectileHitTarget = 0;
doProjectileShadow = 1;
}
function fireCanon() {
trace("fire canon");
if (currentState == "idle") {
soundsRef.gotoAndPlay("fireCanon");
canonExplosionRef.gotoAndPlay("doExplosion");
projectileStartingPoint = {x:projectileStartingPointRef._x, y:projectileStartingPointRef._y};
projectileStartingPointRef._parent.localToGlobal(projectileStartingPoint);
projectileRef._parent.globalToLocal(projectileStartingPoint);
projectileRef._x = projectileStartingPoint.x;
projectileRef._y = projectileStartingPoint.y;
projectileRef._rotation = -1 * canonAngle;
projectileRef.gotoAndStop("gonzoFlying");
var canonAngleRad = (-1 * ((canonAngle / 180) * Math.PI));
projectileVX = canonPower * Math.cos(canonAngleRad);
projectileVY = canonPower * Math.sin(canonAngleRad);
projectileStartAngle = canonAngle;
projectileStartVY = projectileVY;
trace((("projectileStartAngle=" add projectileStartAngle) add " projectileStartVY=") add projectileStartVY);
currentState = "projectileInAir";
bgdRef._x = bgdStartX;
bgdRef._y = bgdStartY;
projectileMaskRef._x = (projectileMaskRef._y = -3000);
projectileRef.setMask(null);
doNewGonzoScreamingSound();
resetFireVars();
}
}
function projectileHitPool(bottomLeftX, bottomLeftY, bottomRightX, bottomRightY) {
if (projectileEnteringWater == 1) {
} else {
doProjectileShadow = 0;
projectileShadowRef._x = (projectileShadowRef._y = -1000);
gonzoScreamingSound.stop();
gonzoScreamingSound.setVolume(0);
topLeftPoint = {x:projectileRef.collisionDefine.topLeft._x, y:projectileRef.collisionDefine.topLeft._y};
topRightPoint = {x:projectileRef.collisionDefine.topRight._x, y:projectileRef.collisionDefine.topRight._y};
projectileRef.collisionDefine.localToGlobal(topLeftPoint);
projectileRef.collisionDefine.localToGlobal(topRightPoint);
poolHitBoxULPoint = {x:poolRef.hitBox._x, y:poolRef.hitBox._y};
poolRef.hitBox._parent.localToGlobal(poolHitBoxULPoint);
leftSlope = (topLeftPoint.y - bottomLeftY) / (topLeftPoint.x - bottomLeftX);
rightSlope = (topRightPoint.y - bottomRightY) / (topRightPoint.x - bottomRightX);
leftPoolDY = topLeftPoint.y - poolHitBoxULPoint.y;
rightPoolDY = topRightPoint.y - poolHitBoxULPoint.y;
leftPoolX = topLeftPoint.x - (leftPoolDY / leftSlope);
rightPoolX = topRightPoint.x - (rightPoolDY / rightSlope);
poolLeftSideX = poolHitBoxULPoint.x;
poolRightSideX = poolHitBoxULPoint.x + poolRef.hitBox._width;
if ((leftPoolX >= poolLeftSideX) && (leftPoolX <= poolRightSideX)) {
resultString = "1";
} else {
resultString = "0";
}
trace((((rightPoolX add " vs ") add poolLeftSideX) add ",") add poolRightSideX);
if ((rightPoolX >= poolLeftSideX) && (rightPoolX <= poolRightSideX)) {
resultString = resultString + "1";
} else {
resultString = resultString + "0";
}
switch (resultString) {
case "11" :
trace("hit pool sucess");
soundsRef.gotoAndPlay("splash");
projectileEnteringWater = 1;
projectileHitTarget = 1;
splashPoint = {x:leftPoolX + ((rightPoolX - leftPoolX) / 2), y:bottomRightY};
splashRef._parent.globalToLocal(splashPoint);
splashRef._x = splashPoint.x;
splashRef._y = poolRef._y;
splashRef.gotoAndPlay("doAnim");
projectileMaskRef._x = poolRef._x;
projectileMaskRef._y = poolRef._y;
projectileRef.setMask(projectileMaskRef);
return;
case "10" :
trace("hit back wall");
return;
case "01" :
case "00" :
trace("hit front wall");
}
}
}
function projectileHitGround() {
trace("hitGround");
if (projectileEnteringWater == 0) {
soundsRef.gotoAndPlay("hitGround");
}
projectileInAir = 0;
currentState = "projectileSlidingOnGround";
projectileRef._y = groundRef._y;
projectileRef._rotation = 0;
projectileRef.gotoAndStop("gonzoSliding");
doProjectileShadow = 0;
projectileShadowRef._x = (projectileShadowRef._y = -1000);
gonzoScreamingSound.stop();
gonzoScreamingSound.setVolume(0);
}
function setRandomPoolPosition() {
do {
poolXNew = Math.randomWithinRange(poolXMin, poolXMax);
} while (Math.abs(poolXNew - poolXCurrent) < poolXDiffMin);
poolRef._x = (poolXCurrent = poolXNew);
trace("pool at " add poolXCurrent);
}
function scrollBgd(newBgdX, radSteps, scrollDoneCallbackFunc) {
trace("scrollBgd");
scrollBgdRadCurrent = 0;
scrollBgdRadStep = radSteps;
scrollBgdStart = bgdRef._x;
scrollBgdFinish = newBgdX;
scrollBgdDoneCallback = scrollDoneCallbackFunc;
currentState = "scrollingBgd";
}
function setPauseForCallback(pauseTicks, pauseDoneCallbackFunc) {
callbackCountdownCurrent = pauseTicks;
callbackCountdownFunction = pauseDoneCallbackFunc;
currentState = "callbackCountdown";
}
function showPoolPosition() {
if (currentState == "idle") {
scrollBgd(bgdRef._x - poolXCurrent, showPoolRadStep, showPoolDone);
}
}
function showPoolDone() {
setPauseForCallback(showPoolPause, poolPauseDone);
}
function poolPauseDone() {
scrollBgd(bgdStartX, showPoolRadStep, showCanonAfterPoolDone);
}
function showCanonAfterPoolDone() {
trace("showCanonAfterPoolDone");
projectileRef._x = (projectileRef._y = -1000);
currentState = "idle";
}
function fallingDownDone() {
if (projectileHitTarget == 1) {
trace("show happy gonzo");
gonzoInPoolRef._x = poolRef._x;
gonzoInPoolRef._y = poolRef._y;
gonzoInPoolRef.gotoAndPlay("doAnim");
if (starsCurrent < starsMax) {
starsCurrent = starsCurrent + 0.5;
scoreboardRef.setStars(starsCurrent);
}
scoreLocal = scoreLocal + (scoreHitMin + (poolRef._x * poolDistanceToScoreMod));
scoreboardRef.setScore(scoreLocal);
setPauseForCallback(showHappyGonzoPause, showHappyGonzoPauseDone);
var gonzoSuccessClipNew;
do {
gonzoSuccessClipNew = Math.ceil(Math.random() * gonzoSuccessClipsTotal);
} while (gonzoSuccessClipNew == gonzoSuccessClipLast);
gonzoSuccessClipLast = gonzoSuccessClipNew;
soundsRef.gotoAndPlay("gonzoSuccess" add gonzoSuccessClipNew);
} else {
starsCurrent--;
if (starsCurrent >= 0) {
scoreboardRef.setStars(starsCurrent);
setPauseForCallback(showProjectileOnGroundPause, fallingDownPauseDone);
} else {
gameOver();
}
}
}
function showHappyGonzoPauseDone() {
trace("showHappyGonzoPauseDone");
fadeToNextLevel();
}
function fadeToNextLevel() {
resetHiderRef.gotoAndPlay("startHide");
currentState = "busy";
}
function fallingDownPauseDone() {
scrollBgd(bgdStartX, showPoolRadStep, bgdResetToCanon);
}
function bgdResetToCanon() {
projectileRef._x = (projectileRef._y = -1000);
currentState = "idle";
}
function setNewLevel() {
bgdRef._x = (bgdTargetX = bgdStartX);
projectileRef._x = (projectileRef._y = -1000);
gonzoInPoolRef._x = (gonzoInPoolRef._y = -1000);
gonzoInPoolRef.gotoAndStop("idle");
splashRef._x = (splashRef._y = -1000);
setRandomPoolPosition();
}
function gameHidden() {
trace("gameHidden");
setNewLevel();
}
function gameRevealed() {
currentState = "idle";
showPoolPosition();
}
function doNewGonzoScreamingSound() {
var gonzoScreamingLoopNew;
do {
gonzoScreamingLoopNew = Math.ceil(Math.random() * gonzoScreamingLoopsTotal);
} while (gonzoScreamingLoopNew == gonzoScreamingLoopLast);
trace("doNewGonzoScreamingSound " add gonzoScreamingLoopNew);
gonzoScreamingLoopLast = gonzoScreamingLoopNew;
gonzoScreamingSound.attachSound("screamLoop" add gonzoScreamingLoopNew);
gonzoScreamingSound.onSoundComplete = doNewGonzoScreamingSound;
gonzoScreamingSound.start(0, 0);
}
Symbol 278 MovieClip Frame 3
function startGame() {
gonzoVideoRef.gotoAndPlay("doVideo");
}
function gonzoVideoDone() {
resetGame();
currentState = "idle";
setRandomPoolPosition();
showPoolPosition();
}
function gameOver() {
currentState = "busy";
screensRef.scoreFinal = Math.round(scoreLocal);
screensRef.gotoAndPlay("introGameOver");
}
function playAgain() {
resetGame();
fadeToNextLevel();
}
function resetGame() {
scoreLocal = 0;
starsCurrent = starsMax;
scoreboardRef.resetScoreboard();
}
Symbol 278 MovieClip Frame 4
stageWidth = Stage.width;
stageHeight = Stage.height;
bgdStartX = bgdRef._x;
bgdStartY = bgdRef._y;
bgdTargetX = bgdRef._x;
canonBarrelPoint = new object();
canonBarrelPoint.x = canonRef.barrel._x;
canonBarrelPoint.y = canonRef.barrel._y;
canonRef.localToGlobal(canonBarrelPoint);
projectileHeight = projectileRef._width;
projectileShadowY = projectileShadowRef._y;
Symbol 278 MovieClip Frame 6
canonRef.gotoAndStop(Math.round(canonAngle));
if (currentState == "projectileInAir") {
projectileRef._x = projectileRef._x + projectileVX;
projectileRef._y = projectileRef._y + projectileVY;
projectileVY = projectileVY + gravity;
projectileRef._rotation = projectileStartAngle * (-1 * (projectileVY / projectileStartVY));
projectilePointBottomLeft.x = projectileRef.collisionDefine.bottomLeft._x;
projectilePointBottomLeft.y = projectileRef.collisionDefine.bottomLeft._y;
projectilePointBottomRight.x = projectileRef.collisionDefine.bottomRight._x;
projectilePointBottomRight.y = projectileRef.collisionDefine.bottomRight._y;
projectileRef.collisionDefine.localToGlobal(projectilePointBottomLeft);
projectileRef.collisionDefine.localToGlobal(projectilePointBottomRight);
if (poolRef.hitBox.hitTest(projectilePointBottomLeft.x, projectilePointBottomLeft.y, true) || (poolRef.hitBox.hitTest(projectilePointBottomRight.x, projectilePointBottomRight.y, true))) {
projectileHitPool(projectilePointBottomLeft.x, projectilePointBottomLeft.y, projectilePointBottomRight.x, projectilePointBottomRight.y);
} else if (groundRef.hitTest(projectilePointBottomLeft.x, projectilePointBottomLeft.y, true)) {
projectileHitGround();
}
if (doProjectileShadow == 1) {
projectileShadowYPercent = (projectileRef._y - projectileShadowY) / (projectileShadowProjectileYMin - projectileShadowY);
projectileShadowRef._x = projectileRef._x;
projectileShadowRef._y = projectileShadowY;
projectileShadowRef._xscale = (projectileShadowRef._yscale = projectileShadowScaleMin + (projectileShadowYPercent * (projectileShadowScaleMax - projectileShadowScaleMin)));
projectileShadowRef._alpha = projectileShadowAlphaMin + (projectileShadowYPercent * (projectileShadowAlphaMax - projectileShadowAlphaMin));
gonzoScreamingVolumeNew = constrainToBounds(gonzoScreamingVolumeMin + ((projectileShadowYPercent * projectileShadowYPercentMod) * (gonzoScreamingVolumeMax - gonzoScreamingVolumeMin)), gonzoScreamingVolumeMax, gonzoScreamingVolumeMin);
gonzoScreamingSound.setVolume(gonzoScreamingVolumeNew);
}
} else if (currentState == "projectileSlidingOnGround") {
projectileRef._x = projectileRef._x + projectileVX;
projectileVX = projectileVX * groundFriction;
if (projectileVX <= projectileVXGroundMin) {
fallingDownCountdown = Math.round(projectileRef._rotation / 10) + 1;
fallingDownDAngle = projectileRef._rotation / fallingDownCountdown;
fallingDownDY = (projectileHeight * Math.sin((projectileRef._rotation / 180) * Math.PI)) / fallingDownCountdown;
currentState = "fallingDown";
projectileRef.gotoAndPlay("gonzoFalling");
}
} else if (currentState == "fallingDown") {
fallingDownCountdown--;
if (fallingDownCountdown <= 0) {
fallingDownDone();
}
} else if (currentState == "scrollingBgd") {
scrollBgdRadCurrent = scrollBgdRadCurrent + scrollBgdRadStep;
scrollBgdDXPercent = (Math.cos(scrollBgdRadCurrent + Math.PI) / 2) + 0.5;
bgdTargetX = scrollBgdStart + (scrollBgdDXPercent * (scrollBgdFinish - scrollBgdStart));
if (scrollBgdRadCurrent > Math.PI) {
trace("scrolling bgd done, calling " add scrollBgdDoneCallback);
this.scrollBgdDoneCallback();
}
} else if (currentState == "callbackCountdown") {
callbackCountdownCurrent--;
if (callbackCountdownCurrent <= 0) {
this.callbackCountdownFunction();
}
} else if ((currentState == "idle") || (currentState == "busy")) {
}
if (currentState == "projectileInAir") {
projectilePoint = {x:projectileRef._x, y:projectileRef._y};
projectileRef._parent.localToGlobal(projectilePoint);
projectileOffCenterX = projectilePoint.x - (stageWidth / 2);
bgdTargetX = bgdRef._x - projectileOffCenterX;
}
bgdRef._x = bgdRef._x + (0.35 * (bgdTargetX - bgdRef._x));
gotoAndPlay (5);
Symbol 280 MovieClip Frame 1
stop();
Symbol 280 MovieClip Frame 7
stop();