Symbol 884 MovieClip Frame 1
onEnterFrame = function () {
var _local1 = int((getTimer() * 15) / 1000);
gotoAndStop((_local1 % 7) + 1);
};
Symbol 889 MovieClip Frame 1
onEnterFrame = function () {
var _local1 = int((getTimer() * 15) / 1000);
gotoAndStop((_local1 % 7) + 1);
};
Symbol 890 MovieClip Frame 1
stop();
Symbol 911 MovieClip Frame 1
stop();
Symbol 911 MovieClip Frame 11
stop();
Symbol 1014 MovieClip [Popup] Frame 1
#initclip 23
Object.registerClass("Popup", com.midasplayer.carnivalshootout.Popup);
#endinitclip
Symbol 1016 MovieClip [Blast] Frame 1
#initclip 18
Object.registerClass("Blast", com.midasplayer.carnivalshootout.Blast);
#endinitclip
Symbol 1031 MovieClip [ScorePopup] Frame 1
#initclip 19
Object.registerClass("ScorePopup", com.midasplayer.carnivalshootout.ScorePopup);
#endinitclip
Symbol 1033 MovieClip [BloodSplat] Frame 1
#initclip 20
Object.registerClass("BloodSplat", com.midasplayer.carnivalshootout.BloodSplat);
#endinitclip
Symbol 1037 MovieClip [Layer] Frame 1
#initclip 21
Object.registerClass("Layer", com.midasplayer.carnivalshootout.Layer);
#endinitclip
Symbol 1105 MovieClip [GameArea] Frame 1
#initclip 22
Object.registerClass("GameArea", com.midasplayer.carnivalshootout.CarnivalShootoutGameArea);
#endinitclip
Symbol 1150 MovieClip Frame 1
stop();
Symbol 1159 MovieClip Frame 1
gotoAndStop (4);
this.onMouseDown = function () {
if ((((_xmouse >= 2) && (_ymouse >= 2)) && (_xmouse <= 6)) && (_ymouse <= 6)) {
gotoAndStop (5);
}
};
Symbol 1171 Button
on (press) {
_root.gamePanel.toggleSoundPressed();
}
on (rollOver) {
Mouse.show();
}
on (rollOut) {
Mouse.hide();
}
Symbol 1176 Button
on (press) {
_root.gamePanel.endGamePressed();
}
on (rollOver) {
Mouse.show();
}
on (rollOut) {
Mouse.hide();
}
Symbol 1199 MovieClip [__Packages.com.midasplayer.carnivalshootout.Blast] Frame 0
class com.midasplayer.carnivalshootout.Blast extends MovieClip
{
var age, clipContainer, _xscale, _yscale, _alpha;
function Blast () {
super();
}
function init(newClipContainer) {
age = new com.midasplayer.timing.IFloat();
scale = 2;
clipContainer = newClipContainer;
}
function tick(tick) {
var _local2 = age.get(1);
_local2++;
age.set(_local2);
}
function isAlive() {
return(age.get(1) < 5);
}
function render(tick, alpha) {
var _local2 = age.get(alpha);
_xscale = 150 - (_local2 * 20);
_yscale = 150 - (_local2 * 20);
_alpha = ((5 - ((_local2 * _local2) / 5)) * 100) / 5;
}
var scale = 1;
}
Symbol 1200 MovieClip [__Packages.com.midasplayer.timing.IFloat] Frame 0
class com.midasplayer.timing.IFloat
{
function IFloat () {
}
function set(newValue) {
lastValue = value;
value = newValue;
}
function get(alpha) {
return(lastValue + ((value - lastValue) * alpha));
}
var value = 0;
var lastValue = 0;
}
Symbol 1201 MovieClip [__Packages.com.midasplayer.carnivalshootout.ScorePopup] Frame 0
class com.midasplayer.carnivalshootout.ScorePopup extends MovieClip
{
var age, clipContainer, _xscale, _yscale, _alpha, star0, star1, star2, gotoAndStop;
function ScorePopup () {
super();
}
function init(newClipContainer) {
age = new com.midasplayer.timing.IFloat();
scale = 2;
clipContainer = newClipContainer;
_xscale = 10;
_yscale = 10;
_alpha = 0;
}
function setScore(score, multiplier) {
if (score > 0) {
if (multiplier == 0) {
star0._visible = false;
star1._visible = false;
star2._visible = false;
} else if (multiplier == 1) {
star1._visible = false;
star2._visible = false;
} else if (multiplier == 2) {
star0._visible = false;
}
gotoAndStop(1);
} else {
score = -score;
gotoAndStop(2);
}
var _local3 = score << 0;
var _local2 = 0;
while (_local2 < 4) {
if (_local3 == 0) {
this["scoreNum" + _local2].gotoAndStop(11);
} else {
this["scoreNum" + _local2].gotoAndStop((_local3 % 10) + 1);
}
_local3 = (_local3 / 10) << 0;
_local2++;
}
}
function tick(tick) {
var _local2 = age.get(1);
_local2++;
age.set(_local2);
}
function isAlive() {
return(age.get(1) < 20);
}
function render(tick, alpha) {
var _local3 = age.get(alpha);
_xscale = (_local3 * 15) + 10;
_yscale = (_local3 * 15) + 10;
var _local2 = _local3 / 20;
_alpha = (1 - ((_local2 * _local2) * _local2)) * 100;
}
var scale = 1;
}
Symbol 1202 MovieClip [__Packages.com.midasplayer.carnivalshootout.BloodSplat] Frame 0
class com.midasplayer.carnivalshootout.BloodSplat extends MovieClip
{
var age, x, y, xa2, ya2, xa, ya, _x, _y, lifeSpan, clipContainer, _alpha, _xscale, _yscale, _rotation;
function BloodSplat () {
super();
}
function init(newClipContainer) {
age = new com.midasplayer.timing.IFloat();
x = new com.midasplayer.timing.IFloat();
y = new com.midasplayer.timing.IFloat();
xa2 = new com.midasplayer.timing.IFloat();
ya2 = new com.midasplayer.timing.IFloat();
var _local4 = (Math.random() * Math.PI) * 2;
var _local3 = Math.random() * 20;
xa = Math.cos(_local4) * _local3;
ya = Math.sin(_local4) * _local3;
_x = _x + (xa * 2);
_y = _y + (ya * 2);
x.set(_x);
x.set(_x);
y.set(_y);
y.set(_y);
xa2.set(xa);
ya2.set(ya);
lifeSpan = ((Math.random() * 30) + 10) << 0;
scale = 2;
clipContainer = newClipContainer;
_alpha = 100;
var _local2 = (Math.random() * 3) + 1;
_xscale = (20 + (Math.random() * 5)) * _local2;
_yscale = (20 + (Math.random() * 10)) * _local2;
}
function tick(tick) {
x.set(x.get(1) + xa);
y.set(y.get(1) + ya);
ya = ya + 1;
xa2.set(xa);
ya2.set(ya);
var _local2 = age.get(1);
_local2++;
age.set(_local2);
}
function isAlive() {
return(age.get(1) < lifeSpan);
}
function render(tick, alpha) {
var _local3 = age.get(alpha);
var _local4 = (Math.atan2(-xa2.get(alpha), ya2.get(alpha)) * 180) / Math.PI;
_rotation = _local4;
_x = x.get(alpha);
_y = y.get(alpha);
_local3 = 200 - ((_local3 * 200) / lifeSpan);
if (_local3 < 100) {
_alpha = _local3;
}
}
var scale = 1;
}
Symbol 1203 MovieClip [__Packages.com.midasplayer.carnivalshootout.Layer] Frame 0
class com.midasplayer.carnivalshootout.Layer extends MovieClip
{
function Layer () {
super();
}
}
Symbol 1204 MovieClip [__Packages.com.midasplayer.carnivalshootout.ClipContainer] Frame 0
class com.midasplayer.carnivalshootout.ClipContainer extends MovieClip
{
var entities, survivingEntities;
function ClipContainer () {
super();
}
function tick(tick) {
if ((entities == null) || (entities == undefined)) {
entities = new Array();
}
survivingEntities = new Array();
var _local2 = 0;
while (_local2 < entities.length) {
entities[_local2].tick(tick);
if (entities[_local2].isAlive() != false) {
survivingEntities.push(entities[_local2]);
} else {
entities[_local2].removeMovieClip();
}
_local2++;
}
entities = survivingEntities;
}
function render(tick, alpha) {
this.alpha = alpha;
if ((entities == null) || (entities == undefined)) {
entities = new Array();
}
var _local2 = 0;
while (_local2 < entities.length) {
entities[_local2].render(tick, alpha);
_local2++;
}
}
function addEntity(entity) {
if ((entities == null) || (entities == undefined)) {
entities = new Array();
}
survivingEntities = new Array();
var _local2 = 0;
while (_local2 < entities.length) {
if (entities[_local2] != entity) {
survivingEntities.push(entities[_local2]);
}
_local2++;
}
entities = survivingEntities;
entities.push(entity);
entity.init(this);
}
function removeEntity(entity) {
if ((entities == null) || (entities == undefined)) {
entities = new Array();
}
survivingEntities = new Array();
var _local2 = 0;
while (_local2 < entities.length) {
if (entities[_local2] != entity) {
survivingEntities.push(entities[_local2]);
} else {
entities[_local2].removeMovieClip();
}
_local2++;
}
entities = survivingEntities;
}
var alpha = 0;
}
Symbol 1205 MovieClip [__Packages.com.midasplayer.timing.Timeable] Frame 0
interface com.midasplayer.timing.Timeable
{
}
Symbol 1206 MovieClip [__Packages.com.midasplayer.carnivalshootout.CarnivalShootoutGameArea] Frame 0
class com.midasplayer.carnivalshootout.CarnivalShootoutGameArea extends com.midasplayer.carnivalshootout.ClipContainer implements com.midasplayer.timing.Timeable
{
var lastQuality, endGameIsPressed, round, currentCreature, roundTick, nextRoundInTicks, musicIn, communicator, ammoMeter, startInTicks, encoder, recoil, timer, startTime, lastShootTime, ammoMeterStartPosY, remainingTicks, speedBonus, layer0, layer1, bg, overlayBg, layer2, layer3, scorePanelXStart, scorePanelYStart, scorePanelRot, scorePanelPos, scorePanelPosA, scorePanelTarget, performance, _quality, creatureId, _xmouse, alpha, _ymouse, addEntity, _x, _y, bonusCreatureId, popups3, popups2, popups1, popups0, attachMovie;
function CarnivalShootoutGameArea () {
super();
}
function init() {
lastQuality = "MEDIUM";
endGameIsPressed = false;
_root.debugWarning._visible = DEBUG_MODE;
_root.debugWarningText._visible = DEBUG_MODE;
round = -1;
if (DEBUG_MODE) {
round = DEBUG_ROUND - 1;
}
_root.roundMeter.gotoAndStop(round + 2);
currentCreature = 0;
roundTick = 0;
nextRoundInTicks = -1;
musicIn = -1;
communicator = new com.midasplayer.carnivalshootout.Communicator();
communicator.parseGameData(_root.gameData);
ammoMeter = _root.ammoMeter;
startInTicks = TICKS_PER_SECOND * 10;
_root.scorePanel.gotoAndStop(1);
encoder = new com.midasplayer.carnivalshootout.Encoder();
recoil = new com.midasplayer.timing.IFloat();
recoil.set(0);
timer = new com.midasplayer.timing.Timer(this, TICKS_PER_SECOND);
setTimeMeter(0);
autoStartTime = TICKS_PER_SECOND * 5;
ammo = CLIP_SIZE;
startTime = getTimer();
lastShootTime = -1;
ammoMeterStartPosY = ammoMeter._y;
remainingTicks = TICKS_PER_SECOND * SECONDS_PER_ROUND;
Key.addListener(this);
speedBonus = 0;
layer0.xstart = layer0._x;
layer1.xstart = layer1._x;
layer0.ystart = layer0._y;
layer1.ystart = layer1._y;
var _local4 = communicator.levelData[round + 1];
bg.gotoAndStop(1 + _local4.level);
overlayBg._visible = false;
bg.pos = new com.midasplayer.timing.IFloat();
bg.target = (_local4.level + 1) * 490;
layer0.gotoAndStop(1 + _local4.level);
layer1.gotoAndStop(1 + _local4.level);
layer2.gotoAndStop(1 + _local4.level);
layer3.gotoAndStop(1 + _local4.level);
setScoreMeter(0);
communicator.gameStarted();
com.midasplayer.carnivalshootout.SoundHolder.get("StartupSound").stopAndPlay();
Mouse.hide();
_root.aim._alpha = 100;
_root.aim._visible = true;
_root.aim._x = -100;
_root.aim._y = -100;
_root.scorePanel.instructionHeaderText.text = _global.textMappings.instruction_header;
_root.scorePanel.instructionText.text = _global.textMappings.instructions;
_root.aim.reloadReminder0.text = _global.textMappings.reload;
_root.aim.reloadReminder1.text = _global.textMappings.reload;
scorePanelXStart = _root.scorePanel._x;
scorePanelYStart = _root.scorePanel._y;
scorePanelRot = new com.midasplayer.timing.IFloat();
scorePanelPos = new com.midasplayer.timing.IFloat();
scorePanelPosA = 0;
scorePanelTarget = 0;
performance = new com.midasplayer.timing.Performance(20);
performance.addQualityFeedbackListener(mx.utils.Delegate.create(this, onLowQualityWarning));
}
function onLowQualityWarning() {
if (_quality != "HIGH") {
lastQuality = "LOW";
if (_quality == "MEDIUM") {
_quality = "LOW";
}
}
}
function tick(tick) {
scorePanelPosA = scorePanelPosA + ((scorePanelTarget - scorePanelPos.get(1)) * 0.05);
scorePanelPos.set(scorePanelPos.get(1) + scorePanelPosA);
scorePanelRot.set((scorePanelRot.get(1) + (scorePanelPosA * 0.3)) * 0.3);
scorePanelPosA = scorePanelPosA * 0.75;
_root.scorePanel._visible = scorePanelPos.get(1) < 500;
if (musicIn > 0) {
musicIn--;
if (musicIn == 0) {
com.midasplayer.carnivalshootout.SoundHolder.get("GameMusic").playLooping();
}
}
if (nextRoundInTicks > 0) {
nextRoundInTicks--;
if (gameIsOver) {
_root.scorePanel.quitsInLabel.text = _global.textMappings.time_to_end;
} else {
_root.scorePanel.quitsInLabel.text = _global.textMappings.time_to_start;
}
_root.scorePanel.timeCountDown.text = "" + (((nextRoundInTicks / TICKS_PER_SECOND) << 0) + 1);
if (nextRoundInTicks == 0) {
if (gameIsOver) {
communicator.gameQuit();
} else {
startRound();
}
}
}
if (speedBonus > 0) {
speedBonus--;
}
if (!gameStarted) {
startInTicks--;
if (startInTicks > 0) {
_root.scorePanel.quitsInLabel.text = _global.textMappings.time_to_start;
_root.scorePanel.timeCountDown.text = "" + (((startInTicks / TICKS_PER_SECOND) << 0) + 1);
} else {
startRound();
}
}
if ((!roundOver) && (gameStarted)) {
remainingTicks--;
var _local6 = ((remainingTicks / TICKS_PER_SECOND) << 0) + 1;
if (_local6 <= 0) {
_local6 = 0;
doRoundOver();
}
setTimeMeter(_local6);
var _local5 = communicator.levelData[round];
if (_local5.creatureCount > currentCreature) {
if (_local5.times[currentCreature] <= roundTick) {
var _local10 = _local5.types[currentCreature] + (_local5.level * 20);
var _local9 = _local5.flags[currentCreature];
var _local8 = _local5.goldFlags[currentCreature];
var _local7 = _local5.offsets[currentCreature];
addCreature(creatureId++, _local10, _local9, _local8, _local7);
currentCreature++;
}
}
roundTick = Math.round(roundTick + 1);
encoder.tick(_xmouse, _ymouse - Math.floor(recoil.get(alpha)));
}
recoil.set(recoil.get(1) * 0.9);
super.tick(tick);
}
function doRoundOver() {
killAllPopups();
_root.scorePanel.gotoAndStop(2);
scorePanelTarget = 0;
var _local6 = hits + misses;
var _local5 = ((_local6 > 0) ? (hits / _local6) : 0);
var _local4 = Math.floor((1000 * _local5) * _local5);
score = score + _local4;
setScoreMeter(score);
communicator.roundOver(_local4);
var _local7 = ((round == 0) ? 4000 : 15000);
if ((round == 2) || (_global.shortGameMode)) {
_root.scorePanel.targetText.text = "";
} else {
_root.scorePanel.targetText.text = _global.textMappings.target_score;
}
_root.scorePanel.accText.text = _global.textMappings.accuracy;
_root.scorePanel.scoreText.text = _global.textMappings.score;
_root.scorePanel.accBonText.text = _global.textMappings.accuracy_bonus;
_root.scorePanel.totScoreText.text = _global.textMappings.total_score;
if ((round == 2) || (_global.shortGameMode)) {
_root.scorePanel.targetNum.text = "";
} else {
_root.scorePanel.targetNum.text = "" + _local7;
}
_root.scorePanel.accNum.text = ("" + ((_local5 * 100) << 0)) + "%";
_root.scorePanel.scoreNum.text = "" + (score - _local4);
_root.scorePanel.accBonNum.text = "" + _local4;
_root.scorePanel.totScoreNum.text = "" + score;
if ((round == 2) || (_global.shortGameMode)) {
_root.scorePanel.infoLabel.text = "";
gameIsOver = true;
} else if (score < _local7) {
gameIsOver = true;
}
_root.scorePanel.headerLabel.text = _global.textMappings.level_completed.split("{0}").join(round + 1);
if (endGameIsPressed) {
communicator.gameEnd(score);
_root.scorePanel.qualifyLabel.text = "";
_root.scorePanel.targetText.text = "";
_root.scorePanel.targetNum.text = "";
_root.scorePanel.headerLabel.text = _global.textMappings.end_game;
} else if (gameIsOver) {
communicator.gameEnd(score);
_root.scorePanel.qualifyLabel.text = "";
if (round < 2) {
_root.scorePanel.qualifyLabel.text = _global.textMappings.not_qualify;
}
} else {
_root.scorePanel.qualifyLabel.text = _global.textMappings.qualify;
}
com.midasplayer.carnivalshootout.SoundHolder.get("LevelStartSound").stop();
com.midasplayer.carnivalshootout.SoundHolder.get("StartupSound").stop();
com.midasplayer.carnivalshootout.SoundHolder.get("GameMusic").stop();
com.midasplayer.carnivalshootout.SoundHolder.get("GameOverMusic").stopAndPlay();
roundOver = true;
nextRoundInTicks = TICKS_PER_SECOND * 7;
}
function addCreature(id, type, hasFlag, hasGoldFlag, timeOffset) {
var _local3 = null;
var _local2 = 0;
switch (type) {
case com.midasplayer.carnivalshootout.AnimalRules.TYPE_ARCTIC_WATER_BIRD :
_local2 = 2;
break;
case com.midasplayer.carnivalshootout.AnimalRules.TYPE_ARCTIC_FLY_BIRD :
_local2 = 2;
break;
case com.midasplayer.carnivalshootout.AnimalRules.TYPE_ARCTIC_FISH :
_local2 = 3;
break;
case com.midasplayer.carnivalshootout.AnimalRules.TYPE_ARCTIC_SNOWHEN :
_local2 = 1;
break;
case com.midasplayer.carnivalshootout.AnimalRules.TYPE_ARCTIC_ORCA :
_local2 = 2;
break;
case com.midasplayer.carnivalshootout.AnimalRules.TYPE_ARCTIC_PENGUIN :
_local2 = 0;
break;
case com.midasplayer.carnivalshootout.AnimalRules.TYPE_ARCTIC_SEAL :
_local2 = 1;
break;
case com.midasplayer.carnivalshootout.AnimalRules.TYPE_FOREST_RED_FISH :
_local2 = 3;
break;
case com.midasplayer.carnivalshootout.AnimalRules.TYPE_FOREST_FOX :
_local2 = 1;
break;
case com.midasplayer.carnivalshootout.AnimalRules.TYPE_FOREST_RACOON :
_local2 = 1;
break;
case com.midasplayer.carnivalshootout.AnimalRules.TYPE_FOREST_CROW :
_local2 = 1;
break;
case com.midasplayer.carnivalshootout.AnimalRules.TYPE_FOREST_GREEN_BIRD :
_local2 = 2;
break;
case com.midasplayer.carnivalshootout.AnimalRules.TYPE_FOREST_OWL :
_local2 = 2;
break;
case com.midasplayer.carnivalshootout.AnimalRules.TYPE_FOREST_SKUNK :
_local2 = 2;
break;
case com.midasplayer.carnivalshootout.AnimalRules.TYPE_FOREST_OWL_REVERSED :
_local2 = 2;
break;
case com.midasplayer.carnivalshootout.AnimalRules.TYPE_FOREST_BEAR :
_local2 = 0;
break;
case com.midasplayer.carnivalshootout.AnimalRules.TYPE_JUNGLE_GREEN_FISH :
_local2 = 3;
break;
case com.midasplayer.carnivalshootout.AnimalRules.TYPE_JUNGLE_RED_BIRD :
_local2 = 1;
break;
case com.midasplayer.carnivalshootout.AnimalRules.TYPE_JUNGLE_BEAVER :
_local2 = 0;
break;
case com.midasplayer.carnivalshootout.AnimalRules.TYPE_JUNGLE_PARROT :
_local2 = 2;
break;
case com.midasplayer.carnivalshootout.AnimalRules.TYPE_JUNGLE_MONKEY :
_local2 = 2;
break;
case com.midasplayer.carnivalshootout.AnimalRules.TYPE_JUNGLE_SEA_BIRD :
_local2 = 2;
break;
case com.midasplayer.carnivalshootout.AnimalRules.TYPE_JUNGLE_ALLIGATOR :
_local2 = 3;
break;
case com.midasplayer.carnivalshootout.AnimalRules.TYPE_JUNGLE_PARROT_REVERSED :
_local2 = 2;
break;
case com.midasplayer.carnivalshootout.AnimalRules.TYPE_WATER_BOOT :
_local2 = 3;
break;
case com.midasplayer.carnivalshootout.AnimalRules.TYPE_WATER_CRAB :
_local2 = 1;
break;
case com.midasplayer.carnivalshootout.AnimalRules.TYPE_WATER_FISH_0 :
_local2 = 2;
break;
case com.midasplayer.carnivalshootout.AnimalRules.TYPE_WATER_FISH_1 :
_local2 = 1;
break;
case com.midasplayer.carnivalshootout.AnimalRules.TYPE_WATER_SEAHORSE_RIGHT :
_local2 = 3;
break;
case com.midasplayer.carnivalshootout.AnimalRules.TYPE_WATER_SHELL :
_local2 = 0;
break;
case com.midasplayer.carnivalshootout.AnimalRules.TYPE_WATER_JELLYFISH :
_local2 = 0;
break;
case com.midasplayer.carnivalshootout.AnimalRules.TYPE_WATER_STARFISH :
_local2 = 3;
break;
case com.midasplayer.carnivalshootout.AnimalRules.TYPE_WATER_SEAHORSE_LEFT :
_local2 = 3;
break;
case com.midasplayer.carnivalshootout.AnimalRules.TYPE_CITY_BEERCAN_0 :
_local2 = 2;
break;
case com.midasplayer.carnivalshootout.AnimalRules.TYPE_CITY_BEERCAN_1 :
_local2 = 2;
break;
case com.midasplayer.carnivalshootout.AnimalRules.TYPE_CITY_CAT :
_local2 = 1;
break;
case com.midasplayer.carnivalshootout.AnimalRules.TYPE_CITY_COCKROACH :
_local2 = 1;
break;
case com.midasplayer.carnivalshootout.AnimalRules.TYPE_CITY_DEAD_FISH :
_local2 = 3;
break;
case com.midasplayer.carnivalshootout.AnimalRules.TYPE_CITY_DOG :
_local2 = 2;
break;
case com.midasplayer.carnivalshootout.AnimalRules.TYPE_CITY_ZILLA :
_local2 = 0;
break;
case com.midasplayer.carnivalshootout.AnimalRules.TYPE_CITY_DOVE :
_local2 = 1;
break;
case com.midasplayer.carnivalshootout.AnimalRules.TYPE_CITY_PLASTIC_BAG :
_local2 = 3;
break;
case com.midasplayer.carnivalshootout.AnimalRules.TYPE_CITY_RAT :
_local2 = 0;
break;
case com.midasplayer.carnivalshootout.AnimalRules.TYPE_LALA_ABC :
_local2 = 2;
break;
case com.midasplayer.carnivalshootout.AnimalRules.TYPE_LALA_EGGMAN :
_local2 = 1;
break;
case com.midasplayer.carnivalshootout.AnimalRules.TYPE_LALA_GINGERBREAD_MAN :
_local2 = 1;
break;
case com.midasplayer.carnivalshootout.AnimalRules.TYPE_LALA_MOON :
_local2 = 0;
break;
case com.midasplayer.carnivalshootout.AnimalRules.TYPE_LALA_TEAPOT :
_local2 = 3;
break;
case com.midasplayer.carnivalshootout.AnimalRules.TYPE_LALA_TURTLE :
_local2 = 0;
break;
case com.midasplayer.carnivalshootout.AnimalRules.TYPE_LALA_ELEPHANT :
_local2 = 3;
break;
case com.midasplayer.carnivalshootout.AnimalRules.TYPE_LALA_RABBIT :
_local2 = 1;
break;
case com.midasplayer.carnivalshootout.AnimalRules.TYPE_LALA_SUN :
_local2 = 0;
}
_local3 = this["popups" + _local2].attachMovie("Popup", "popup" + popupId, 1000 + popupId);
_local3.setType(id, type);
_local3.setFlag(hasFlag, hasGoldFlag);
_local3.offset = timeOffset;
_local3.bonusHit = false;
addEntity(_local3);
popupId++;
}
function render(tick, alpha) {
_root.scorePanel._x = scorePanelXStart + scorePanelPos.get(alpha);
_root.scorePanel._y = scorePanelYStart - 10;
_root.scorePanel._rotation = scorePanelRot.get(alpha);
_root.scorePanel.pinne0._rotation = -_root.scorePanel._rotation;
_root.scorePanel.pinne1._rotation = -_root.scorePanel._rotation;
super.render(tick, alpha);
if ((nextRoundInTicks > 0) && (nextRoundInTicks < (5 * TICKS_PER_SECOND))) {
if (_quality == "LOW") {
lastQuality = "LOW";
_quality = "HIGH";
} else if (_quality == "MEDIUM") {
lastQuality = "MEDIUM";
_quality = "HIGH";
}
}
if ((nextRoundInTicks > (5 * TICKS_PER_SECOND)) && (!gameIsOver)) {
bg._x = -bg.pos.get(alpha);
var _local5 = (nextRoundInTicks - (5 * TICKS_PER_SECOND)) - alpha;
var _local7 = communicator.levelData[round + 1];
overlayBg.gotoAndStop(_local7.level + 1);
if (_local5 > TICKS_PER_SECOND) {
overlayBg._visible = true;
var _local13 = ((_local5 / TICKS_PER_SECOND) - 1) * 500;
if (_local13 > 500) {
_local13 = 500;
}
if (_local13 < 0) {
_local13 = 0;
}
overlayBg._y = -_local13;
} else {
overlayBg._visible = false;
bg.gotoAndStop(_local7.level + 1);
layer0.gotoAndStop(_local7.level + 1);
layer1.gotoAndStop(_local7.level + 1);
layer2.gotoAndStop(_local7.level + 1);
layer3.gotoAndStop(_local7.level + 1);
var _local14 = 0;
var _local9 = 0;
var _local12 = (_local5 / TICKS_PER_SECOND) * 600;
if (_local12 > 600) {
_local12 = 600;
}
if (_local12 < 0) {
_local12 = 0;
}
var _local8 = ((_local5 / TICKS_PER_SECOND) * 600) - 150;
if (_local8 > 600) {
_local8 = 600;
}
if (_local8 < 0) {
_local8 = 0;
}
if (_local7.level == 4) {
_local8 = 0;
_local9 = ((-(_local5 / TICKS_PER_SECOND)) * 600) + 150;
if (_local9 < -600) {
_local9 = -600;
}
if (_local9 > 0) {
_local9 = 0;
}
}
var _local11 = ((_local5 / TICKS_PER_SECOND) * 600) - 250;
if (_local11 > 600) {
_local11 = 600;
}
if (_local11 < 0) {
_local11 = 0;
}
var _local10 = ((_local5 / TICKS_PER_SECOND) * 600) - 100;
if (_local10 > 600) {
_local10 = 600;
}
if (_local10 < 0) {
_local10 = 0;
}
layer0._x = layer0.xstart - _local14;
layer1._x = layer1.xstart - _local9;
layer0._y = layer0.ystart - _local12;
layer1._y = layer1.ystart - _local8;
layer2._x = -120 + (Math.sin(((tick + alpha) * 0.04) + Math.PI) * 40);
layer2._y = (341 + (Math.sin(((tick + alpha) * 0.09) + 2.0943951023932) * 6)) + (_local11 / 4);
layer3._x = -80 + (Math.sin((tick + alpha) * 0.04) * 40);
layer3._y = (376 + (Math.sin(((tick + alpha) * 0.09) + 4.18879020478639) * 6)) + (_local10 / 4);
}
} else {
overlayBg._visible = false;
layer2._x = -120 + (Math.sin(((tick + alpha) * 0.04) + Math.PI) * 40);
layer2._y = 341 + (Math.sin(((tick + alpha) * 0.09) + 2.0943951023932) * 6);
layer3._x = -80 + (Math.sin((tick + alpha) * 0.04) * 40);
layer3._y = 376 + (Math.sin(((tick + alpha) * 0.09) + 4.18879020478639) * 6);
layer0._y = layer0.ystart;
layer1._y = layer1.ystart;
}
_root.aim._x = _xmouse + _x;
_root.aim._y = (_ymouse - Math.floor(recoil.get(alpha))) + _y;
if ((ammo > 0) && (!reloading)) {
_root.aim.gotoAndStop(1);
} else {
_root.aim.gotoAndStop((tick % 25) + 2);
}
var _local5 = getTimer() - reloadTime;
if (_local5 < 500) {
ammoMeter.colt.gotoAndStop((((CLIP_SIZE - ((_local5 * CLIP_SIZE) / 500)) << 0) * 2) + 4);
ammoMeter._rotation = 0;
} else {
reloading = false;
_local5 = getTimer() - lastShootTime;
if (_local5 < 100) {
_local5 = (_local5 * (_local5 + 100)) / 200;
if (_local5 < 50) {
ammoMeter._rotation = ((_local5 * 360) / CLIP_SIZE) / 100;
ammoMeter.colt.gotoAndStop((CLIP_SIZE - ammo) * 2);
} else {
ammoMeter._rotation = (((_local5 * 360) / CLIP_SIZE) / 100) - 30;
ammoMeter.colt.gotoAndStop(((CLIP_SIZE - ammo) * 2) + 1);
}
} else {
ammoMeter._rotation = 0;
ammoMeter.colt.gotoAndStop(((CLIP_SIZE - ammo) * 2) + 2);
}
}
performance.frameUpdated();
}
function onDragOut() {
if (!initialized) {
return(undefined);
}
onRollOut();
}
function onDragOver() {
if (!initialized) {
return(undefined);
}
onRollOver();
}
function onEnterFrame() {
if (firstOutOfAmmo && (ammo == 0)) {
_root.aim.reloadReminder0._alpha = 100;
_root.aim.reloadReminder0._visible = true;
_root.aim.reloadReminder1._alpha = 100;
_root.aim.reloadReminder1._visible = true;
} else {
_root.aim.reloadReminder0._alpha = 0;
_root.aim.reloadReminder0._visible = false;
_root.aim.reloadReminder1._alpha = 0;
_root.aim.reloadReminder1._visible = false;
}
if (DEBUG_MODE && (_root.gameData == undefined)) {
_root.gameData = ((((((((("<gamedata randomseed=\"566730670\" timelimit=\"270\"> <level num=\"0\" level=\"3\" data=\"003i,04DA09sQ04UI03sX00na1F8R053P01kL0B6E04pA05nG00f411D7124E0zKI04QK0EXT01g915Fv091O013c19UA01Kc1zES0VbK08.31Oc\"/> <level num=\"1\" level=\"4\" data=\"004u113Tr00II09FC02yo0xcS02Ww08.112iD08PV0FN113im01tz0F3Y0zLL007I01NN00WF05Tv0ySn01ns08bx057p0Ojx08BY0aTR04Fw0xs.090S04Bx0UOw05ZM09Vu03B\"/> <level num=\"2\" level=\"5\" data=\"0022x05IE00vz02Xe01nk00CT02Dh00FS04vc00Zy01Ri08RB03Ga09zk059z0FVD00Vk08MT0yfR00Wt03wS024O05Zq018i005r04ov0zZg02CK0Fsz0ADx05bB08wb04dd0MOt0xwl0AMd08es0OyK03Yo0VGJ05fO02Ji09BN0ALS08f\"/> <text id=\"level\">LEVEL</text> <text id=\"reload\">CLICK TO RELOAD</text> <text id=\"time_to_end\">TIME TO END:</text> <text id=\"time_to_start\">TIME TO START:</text> <text id=\"instructions\">WELCOME TO THE CARNIVAL! AIM AND SHOOT THE MOVING ANIMAL TARGETS. HITTING AN ANIMAL'S TARGET ZONE INCREASES THE SCORE. AVOID ANIMALS WITH A WHITE FLAG AND GET AN ANIMAL WITH A GOLD FLAG TO TRIGGER A SECRET ANIMAL WITH A GOLDEN BALL TARGET.</text> <text id=\"target_score\">TARGET</text> <text id=\"instruction_header\">INSTRUCTIONS</text> <text id=\"toggle_sound\">SOUND ON/OFF</text>" + " <text id=\"level_completed\">LEVEL {0} COMPLETED</text>") + " <text id=\"total_score\">TOTAL SCORE</text>") + " <text id=\"not_qualify\">YOU DID NOT QUALIFY FOR THE NEXT LEVEL</text>") + " <text id=\"accuracy\">ACCURACY</text>") + " <text id=\"score\">SCORE</text>") + " <text id=\"qualify\">YOU QUALIFIED FOR THE NEXT LEVEL</text>") + " <text id=\"time_left\">TIME LEFT</text>") + " <text id=\"end_game\">END GAME</text>") + " <text id=\"accuracy_bonus\">ACCURACY BONUS</text>") + "</gamedata>";
}
if (_root.gameData == undefined) {
return(undefined);
}
if (!initialized) {
init();
Mouse.hide();
initialized = true;
_root.hider._visible = false;
}
timer.advanceTime();
}
function onRollOver() {
if (!initialized) {
return(undefined);
}
Mouse.hide();
encoder.rollOver();
_root.aim._alpha = 100;
_root.aim._visible = true;
_root.aim._x = _xmouse + _x;
_root.aim._y = (_ymouse - Math.floor(recoil.get(alpha))) + _y;
}
function onRollOut() {
if (!initialized) {
return(undefined);
}
encoder.rollOut();
_root.aim._alpha = 0;
_root.aim._visible = false;
}
function startRound() {
performance.begin();
if (_quality == "LOW") {
lastQuality = "LOW";
}
_quality = lastQuality;
round++;
communicator.roundStarted(round);
creatureId = 0;
bonusCreatureId = 0;
_root.roundMeter.gotoAndStop(round + 1);
_root.roundDigit.target = round + 1;
hits = 0;
misses = 0;
reloadTime = -1;
ammo = 6;
gameStarted = true;
scorePanelTarget = SCORE_PANEL_OFFSCREEN_POS;
roundOver = false;
currentCreature = 0;
roundTick = 0;
remainingTicks = TICKS_PER_SECOND * SECONDS_PER_ROUND;
nextRoundInTicks = -1;
musicIn = -1;
lastShootTime = -1;
com.midasplayer.carnivalshootout.SoundHolder.get("StartupSound").stop();
com.midasplayer.carnivalshootout.SoundHolder.get("GameOverMusic").stop();
com.midasplayer.carnivalshootout.SoundHolder.get("LevelStartSound").play();
musicIn = TICKS_PER_SECOND * 2;
}
function onMouseDown() {
if ((!initialized) && (!gameIsOver)) {
return(undefined);
}
if ((!gameStarted) || ((nextRoundInTicks > 0) && (nextRoundInTicks < (TICKS_PER_SECOND * 5)))) {
if (gameIsOver) {
communicator.gameQuit();
} else {
startRound();
}
nextRoundInTicks = 0;
} else if (!roundOver) {
if ((((_xmouse > 0) && (_ymouse > 0)) && (_xmouse < 490)) && (_ymouse < 460)) {
encoder.shootAt(_xmouse, _ymouse - Math.floor(recoil.get(alpha)), alpha);
shootAt(_xmouse, _ymouse - Math.floor(recoil.get(alpha)));
} else if (ammo == 0) {
reload();
} else {
var _local3 = (_root.ammoMeter._x - _x) - _xmouse;
var _local4 = (_root.ammoMeter._y - _y) - _ymouse;
var _local5 = (_local3 * _local3) + (_local4 * _local4);
if (((_local5 < 2500) && (ammo > 0)) && (!reloading)) {
ammo--;
com.midasplayer.carnivalshootout.SoundHolder.get("ClickSound").playOffs(0.2);
}
}
}
}
function killAllPopups() {
killAllTargets(popups3);
killAllTargets(popups2);
killAllTargets(popups1);
killAllTargets(popups0);
}
function killAllTargets(layer) {
for (var _local3 in layer) {
var _local1 = layer[_local3];
if (_local1 instanceof MovieClip) {
if (_local1.isShootable() == true) {
_local1.shoot();
}
}
}
}
function shootAt(x, y) {
if (reloading) {
return(undefined);
}
var _local10 = (alpha * 64) << 0;
lastShootTime = getTimer();
if (ammo > 0) {
recoil.set(25);
recoil.set(25);
ammo--;
var _local12 = attachMovie("Blast", "blast" + blastId, 6000 + blastId);
if ((++blastId) == 10) {
blastId = 0;
}
_local12._x = x;
_local12._y = y;
_local12._rotation = Math.random() * 360;
addEntity(_local12);
var _local3;
if (_local3 == undefined) {
_local3 = checkTarget(x, y, layer3);
}
if (_local3 == undefined) {
_local3 = findTarget(x, y, popups3);
}
if (_local3 == undefined) {
_local3 = checkTarget(x, y, layer2);
}
if (_local3 == undefined) {
_local3 = findTarget(x, y, popups2);
}
if (_local3 == undefined) {
_local3 = checkTarget(x, y, layer1);
}
if (_local3 == undefined) {
_local3 = findTarget(x, y, popups1);
}
if (_local3 == undefined) {
_local3 = checkTarget(x, y, layer0);
}
if (_local3 == undefined) {
_local3 = findTarget(x, y, popups0);
}
if ((_local3 != undefined) && (_local3.isShootable() == true)) {
var _local11 = false;
if (!_local3.bonusHit) {
var _local15 = _local3.bonus._xscale;
var _local14 = _local3.bonus._yscale;
_local3.bonus._xscale = 0;
_local3.bonus._yscale = 0;
var _local18 = _local3.stick._xscale;
var _local19 = _local3.stick._yscale;
_local3.stick._xscale = 0;
_local3.stick._yscale = 0;
if (!_local3.hitTest(x + _x, y + _y, true)) {
_local11 = true;
_local3.bonusHit = true;
_local3.bonus.gotoAndPlay(2);
}
_local3.bonus._xscale = _local15;
_local3.bonus._yscale = _local14;
_local3.stick._xscale = _local18;
_local3.stick._yscale = _local19;
}
var _local8 = attachMovie("ScorePopup", "score" + blastId, 5000 + blastId);
var _local9 = communicator.levelData[round].getScore(_local3.id, x, y, roundTick + (_local10 / 64));
_root.debugText.text = communicator.levelData[round].verifyScore(_local3.id, x, y, roundTick + (_local10 / 64), _local9);
if (_local11) {
_local9 = (500 + ((speedBonus * 10) / (TICKS_PER_SECOND * 5))) << 0;
speedBonus = TICKS_PER_SECOND * 5;
} else {
if (_local3.hasFlag && (!_local3.goldFlag)) {
speedBonus = 0;
} else {
_local9 = _local9 + (((speedBonus * 10) / (TICKS_PER_SECOND * 5)) << 0);
speedBonus = TICKS_PER_SECOND * 5;
}
if (_local3.goldFlag && (_local3.getLastMultiplier() > 0)) {
var _local17 = communicator.levelData[round];
var _local22 = 6 + (_local17.level * 20);
var _local21 = false;
var _local20 = false;
var _local13 = _local3.offset;
com.midasplayer.carnivalshootout.SoundHolder.get("BonusAnimalSound").stopAndPlay();
var _local16 = -(++bonusCreatureId);
addCreature(_local16, _local22, _local21, _local20, _local13);
}
}
_local8._x = x;
_local8._y = y;
if (_local8._x < 50) {
_local8._x = 50;
}
if (_local8._y < 50) {
_local8._y = 50;
}
if (_local8._x > 440) {
_local8._x = 440;
}
if (_local8._y > 440) {
_local8._y = 440;
}
_local8.setScore(_local9, _local3.getLastMultiplier());
_local8._rotation = (Math.random() * 40) - 20;
addEntity(_local8);
if (bloodEnabled) {
var _local4 = 0;
while (_local4 < 15) {
var _local5 = _local3._parent.attachMovie("BloodSplat", ("blood" + (blastId * 15)) + _local4, (8000 + (blastId * 15)) + _local4);
_local5._x = x;
_local5._y = y;
addEntity(_local5);
_local4++;
}
}
hits++;
if (_local9 < 0) {
com.midasplayer.carnivalshootout.SoundHolder.get("DontShootSound").stopAndPlay();
} else if (_local11) {
com.midasplayer.carnivalshootout.SoundHolder.get("SpecialHitSound").stopAndPlay();
} else {
com.midasplayer.carnivalshootout.SoundHolder.get("HitSound").stopAndPlay();
}
if ((score + _local9) < 0) {
_local9 = -score;
}
if (_local11) {
communicator.shootAt(x, y, roundTick << 0, _local10, _local3.id + 10000, _local9);
} else {
communicator.shootAt(x, y, roundTick << 0, _local10, _local3.id, _local9);
}
score = score + _local9;
setScoreMeter(score);
if (!_local11) {
_local3.shoot();
}
} else {
communicator.shootAt(x, y, roundTick << 0, _local10, -99999, 0);
speedBonus = 0;
misses++;
com.midasplayer.carnivalshootout.SoundHolder.get("MissSound" + Math.floor(Math.random() * 1)).stopAndPlay();
}
com.midasplayer.carnivalshootout.SoundHolder.get("ShootSound").play();
} else {
ammo = -1;
reload();
com.midasplayer.carnivalshootout.SoundHolder.get("ClickSound").stopAndPlay();
}
}
function setTimeMeter(seconds) {
_root.timeMeter.text = "" + (seconds << 0);
}
function setScoreMeter(score) {
_root.scoreMeter.text = "" + (score << 0);
}
function checkTarget(x, y, obj) {
var _local5 = obj.hide._xscale;
var _local4 = obj.hide._yscale;
obj.hide._xscale = 0;
obj.hide._yscale = 0;
var _local3;
if (obj.hitTest(x + _x, y + _y, true)) {
_local3 = obj;
}
obj.hide._xscale = _local5;
obj.hide._yscale = _local4;
return(_local3);
}
function findTarget(x, y, layer) {
var _local5;
var _local6 = -100000000;
for (var _local10 in layer) {
var _local2 = layer[_local10];
if ((_local2 instanceof MovieClip) && (_local2.getDepth() > _local6)) {
var _local4 = _local2.flag._xscale;
var _local3 = _local2.flag._yscale;
_local2.flag._xscale = 0;
_local2.flag._yscale = 0;
if (_local2.hitTest(x + _x, y + _y, true)) {
_local5 = _local2;
_local6 = _local2.getDepth();
if (_local2 instanceof com.midasplayer.carnivalshootout.Layer) {
_local5 = findTarget(x, y, _local2);
}
}
_local2.flag._xscale = _local4;
_local2.flag._yscale = _local3;
}
}
if (_local5.isShootable() != true) {
_local5 = undefined;
}
return(_local5);
}
function onKeyDown() {
if (!initialized) {
return(undefined);
}
var _local3 = chr(Key.getAscii());
if (_local3 == "q") {
enteredText = "";
} else {
enteredText = enteredText + _local3;
if (enteredText == "blood") {
bloodEnabled = !bloodEnabled;
}
if (enteredText == "notch") {
_root.egoPanel._visible = !_root.egoPanel._visible;
enteredText = "";
}
}
if (_local3 == "s") {
toggleSoundPressed();
}
}
function reload() {
firstOutOfAmmo = false;
_root.aim.reloadReminder0._alpha = 0;
_root.aim.reloadReminder0._visible = false;
_root.aim.reloadReminder1._alpha = 0;
_root.aim.reloadReminder1._visible = false;
reloading = true;
reloadTime = getTimer();
com.midasplayer.carnivalshootout.SoundHolder.get("ReloadSound").stopAndPlay();
ammo = CLIP_SIZE;
}
function endGamePressed() {
if (!gameIsOver) {
endGameIsPressed = true;
roundOver = true;
gameIsOver = true;
communicator.endGamePressed(0);
communicator.gameEnd(score);
nextRoundInTicks = TICKS_PER_SECOND * 1;
remainingTicks = 0;
doRoundOver();
musicIn = 0;
}
}
function toggleSoundPressed() {
com.midasplayer.carnivalshootout.SoundHolder.toggleSound();
}
var DEBUG_MODE = false;
var DEBUG_ROUND = 0;
var TICKS_PER_SECOND = 24;
var SECONDS_PER_ROUND = 60;
var CLIP_SIZE = 6;
var SCORE_PANEL_OFFSCREEN_POS = 550;
var initialized = false;
var blastId = 0;
var popupId = 0;
var ammo = 0;
var score = 0;
var hits = 0;
var misses = 0;
var reloadTime = -1;
var reloading = false;
var roundOver = false;
var gameStarted = false;
var autoStartTime = 0;
var gameIsOver = false;
var firstOutOfAmmo = true;
var bloodEnabled = false;
var enteredText = "";
}
Symbol 1207 MovieClip [__Packages.com.midasplayer.timing.Timer] Frame 0
class com.midasplayer.timing.Timer
{
var timeable;
function Timer (timeable, gameTicksPerSecond) {
millisPerGameTick = 1000 / gameTicksPerSecond;
this.timeable = timeable;
maxTickTime = 500;
}
function getMillisPerTick() {
return(millisPerGameTick);
}
function setMaxTickTime(millis) {
maxTickTime = millis;
}
function advanceTime2() {
var _local3 = getTimer();
if (startTime < 0) {
startTime = _local3;
unprocessedTime = millisPerGameTick;
}
time = _local3 - startTime;
var _local4 = time - lastTime;
lastTime = time;
unprocessedTime = unprocessedTime + _local4;
if (unprocessedTime >= millisPerGameTick) {
var _local2 = maxTickTime + _local3;
do {
timeable.tick(tick);
tick++;
unprocessedTime = unprocessedTime - millisPerGameTick;
} while ((unprocessedTime >= millisPerGameTick) && (getTimer() < _local2));
}
var _local5 = (unprocessedTime % millisPerGameTick) / millisPerGameTick;
timeable.render(tick, _local5);
}
function advanceTime() {
time = getTimer();
var _local3 = time - lastTime;
lastTime = time;
unprocessedTime = unprocessedTime + _local3;
var _local2 = 0;
while (unprocessedTime > millisPerGameTick) {
unprocessedTime = unprocessedTime - millisPerGameTick;
timeable.tick(tick);
tick++;
_local2++;
if (_local2 >= 10) {
unprocessedTime = 0;
}
}
var _local4 = unprocessedTime / millisPerGameTick;
timeable.render(tick, _local4);
}
var time = 0;
var startTime = -1;
var lastTime = 0;
var unprocessedTime = 0;
var tick = 0;
var millisPerGameTick = 0;
var maxTickTime = -1;
}
Symbol 1208 MovieClip [__Packages.com.midasplayer.carnivalshootout.Encoder] Frame 0
class com.midasplayer.carnivalshootout.Encoder
{
var shortMode, encodeData, lastX, lastY, same;
function Encoder () {
shortMode = false;
encodeData = "";
lastX = -1;
lastY = -1;
same = 0;
}
function rollOver() {
encodeData = encodeData + ENTER_CHAR;
}
function rollOut() {
encodeData = encodeData + EXIT_CHAR;
}
function shootAt(x, y, alpha) {
encodeData = encodeData + SHOOT_CHAR;
encodeShortNumber(Math.floor(alpha * 64));
encodePos(x, y);
}
function tick(x, y) {
encodePos(x, y);
}
function encodePos(x, y) {
x = x >> 2;
y = y >> 2;
if ((x != lastX) || (y != lastY)) {
if (same > 0) {
encodeData = encodeData + SAME_CHAR;
encodeShortNumber(same);
}
if ((((x < (lastX + 32)) && (x >= (lastX - 32))) && (y < (lastY + 32))) && (y >= (lastY - 32))) {
var _local5 = (x - lastX) + 32;
var _local4 = (y - lastY) + 32;
if (!shortMode) {
encodeData = encodeData + SHORT_CHAR;
shortMode = true;
}
encodeShortNumber(_local5);
encodeShortNumber(_local4);
} else {
if (shortMode) {
encodeData = encodeData + SHORT_CHAR;
shortMode = false;
}
encodeLongNumber(x);
encodeLongNumber(y);
}
lastX = x;
lastY = y;
same = 0;
} else {
if (same == 63) {
encodeData = encodeData + SAME_CHAR;
encodeShortNumber(same);
same = 0;
}
same++;
}
}
function encodeShortNumber(v) {
v = Math.floor(v);
var _local3 = v & 63;
encodeData = encodeData + BASE_64_CHARS.charAt(_local3);
}
function encodeLongNumber(v) {
v = Math.floor(v);
var _local4 = v & 63;
var _local3 = (v >> 6) & 63;
encodeData = encodeData + (BASE_64_CHARS.charAt(_local4) + BASE_64_CHARS.charAt(_local3));
}
var BASE_64_CHARS = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_-";
var ENTER_CHAR = ")";
var EXIT_CHAR = "(";
var SHOOT_CHAR = "+";
var SHORT_CHAR = "/";
var SAME_CHAR = "=";
}
Symbol 1209 MovieClip [__Packages.com.midasplayer.carnivalshootout.Communicator] Frame 0
class com.midasplayer.carnivalshootout.Communicator
{
var levelData;
function Communicator () {
levelData = new Array();
}
function gameStarted() {
fscommand ("gameStart");
}
function roundStarted(roundNum) {
fscommand ("playData", ((((CMD_ROUND_START + ",") + roundNum) + " ") + GAME_VERSION) + "=0");
}
function shootAt(x, y, localTime, localTimeFraction, hitCreature, score) {
fscommand ("playData", (((((((((((CMD_SHOOT_AT + ",") + x) + " ") + y) + " ") + localTime) + " ") + localTimeFraction) + " ") + hitCreature) + "=") + score);
}
function reload(localTime) {
fscommand ("playData", ((CMD_RELOAD + ",") + localTime) + "=0");
}
function roundOver(accuracyBonus) {
fscommand ("playData", (CMD_ROUND_OVER + "=") + accuracyBonus);
}
function endGamePressed(localTime) {
fscommand ("playData", ((CMD_END_GAME + ",") + localTime) + "=0");
}
function gameEnd(score) {
fscommand ("gameEnd", score);
}
function gameQuit() {
fscommand ("gameQuit");
}
function parseGameData(gameData) {
var _local8 = new XML(_root.gameData);
_global.shortGameMode = new String(_local8.childNodes[0].attributes.mode) == "short";
_global.textMappings = new Object();
var _local5 = _local8.childNodes[0].childNodes;
var _local4 = 0;
while (_local4 < _local5.length) {
_root.debugText.text = _root.debugText.text + ("\r" + _local5[_local4].nodeName);
if (_local5[_local4].nodeName == "text") {
_global.textMappings[_local5[_local4].attributes.id] = new String(_local5[_local4].firstChild.nodeValue);
}
if (_local5[_local4].nodeName == "level") {
var _local6 = new Number(_local5[_local4].attributes.num);
var _local7 = new Number(_local5[_local4].attributes.level);
levelData[_local6.valueOf()] = new com.midasplayer.carnivalshootout.LevelData(_local7.valueOf(), new String(_local5[_local4].attributes.data));
}
_local4++;
}
_root.scoreText.text = _global.textMappings.score;
_root.timeLeftText.text = _global.textMappings.time_left;
_root.levelText.text = _global.textMappings.level;
_root.endGameText.text = _global.textMappings.end_game;
_root.toggleSoundText.text = _global.textMappings.toggle_sound;
}
static var GAME_VERSION = 1;
static var CMD_ROUND_START = 568;
static var CMD_SHOOT_AT = 164;
static var CMD_RELOAD = 764;
static var CMD_ROUND_OVER = 305;
static var CMD_END_GAME = 231;
}
Symbol 1210 MovieClip [__Packages.com.midasplayer.carnivalshootout.LevelData] Frame 0
class com.midasplayer.carnivalshootout.LevelData
{
var bonusCreatureId, level, creatureCount, times, offsets, types, flags, goldFlags;
function LevelData (level, data) {
bonusCreatureId = 0;
this.level = level;
creatureCount = (data.length / 4) << 0;
times = new Array(creatureCount);
offsets = new Array(creatureCount);
types = new Array(creatureCount);
flags = new Array(creatureCount);
goldFlags = new Array(creatureCount);
var _local8 = 0;
var _local2 = 0;
while (_local2 < creatureCount) {
var _local7 = BASE_64_CHARS.indexOf(data.charAt((_local2 * 4) + 0));
var _local6 = BASE_64_CHARS.indexOf(data.charAt((_local2 * 4) + 1));
var _local3 = BASE_64_CHARS.indexOf(data.charAt((_local2 * 4) + 2));
var _local5 = BASE_64_CHARS.indexOf(data.charAt((_local2 * 4) + 3));
_local8 = _local8 + (_local7 + (_local6 * 64));
times[_local2] = _local8;
offsets[_local2] = _local5 / 64;
types[_local2] = _local3 & 15;
flags[_local2] = (_local3 & 32) > 0;
goldFlags[_local2] = (_local3 & 16) > 0;
_local2++;
}
}
function addBonusCreature(i, type, timeOffset, roundTime) {
times[50 - i] = roundTime;
offsets[50 - i] = timeOffset;
types[50 - i] = type;
flags[50 - i] = false;
goldFlags[50 - i] = false;
}
function getScore(i, x, y, time) {
if (i < 0) {
i = 50 - i;
}
return(com.midasplayer.carnivalshootout.AnimalRules.getScore(types[i] + (level * 20), time - times[i], x, y, offsets[i], flags[i] && (!goldFlags[i]), 1));
}
function verifyScore(i, x, y, time, score) {
if (i < 0) {
i = 50 - i;
}
var _local4 = com.midasplayer.carnivalshootout.AnimalRules.getScore(types[i] + (level * 20), time - times[i], x, y, offsets[i], flags[i] && (!goldFlags[i]), 1.05);
if (goldFlags[i] && (com.midasplayer.carnivalshootout.AnimalRules.lastMultiplier > 0)) {
var _local3 = -(++bonusCreatureId);
addBonusCreature(_local3, 6, offsets[i], time << 0);
}
return(_local4 >= score);
}
static var BASE_64_CHARS = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ,.";
}
Symbol 1211 MovieClip [__Packages.com.midasplayer.carnivalshootout.AnimalRules] Frame 0
class com.midasplayer.carnivalshootout.AnimalRules
{
function AnimalRules () {
}
static function setPos(type, time, pos, offset) {
var _local3 = (offset * Math.PI) * 2;
switch (type) {
case TYPE_ARCTIC_WATER_BIRD :
pos.x = 640 - (time * 3.8);
pos.y = 387;
pos.rot = (Math.sin((time * 0.16) + _local3) * (Math.sin((time * 0.16) + _local3) + 2)) * 10;
break;
case TYPE_ARCTIC_FLY_BIRD :
pos.x = 640 - (time * 6);
pos.y = 0;
pos.rot = Math.sin((time * 0.13) + _local3) * 40;
break;
case TYPE_ARCTIC_FISH :
pos.x = -150 + (time * 3);
pos.y = 440 + (Math.cos((time * 0.16) + _local3) * 8);
pos.rot = Math.sin((time * 0.08) + _local3) * 10;
break;
case TYPE_ARCTIC_SNOWHEN :
pos.x = 640 - (time * 6);
pos.y = 327;
pos.rot = Math.sin((time * 0.38) + _local3) * 10;
break;
case TYPE_ARCTIC_ORCA :
pos.x = (((offset * 9) << 0) * 50) + 45;
pos.rot = (time * 3) - 90;
pos.y = 387 + ((1 - Math.cos((pos.rot * Math.PI) / 180)) * 75);
break;
case TYPE_ARCTIC_PENGUIN :
pos.x = 640 - (time * 6);
pos.y = 230;
pos.rot = Math.sin((time * 0.18) + _local3) * 15;
break;
case TYPE_ARCTIC_SEAL :
pos.x = 640 - (time * 3.8);
pos.y = 327;
pos.rot = Math.sin((time * 0.18) + _local3) * 25;
break;
case TYPE_FOREST_RED_FISH :
pos.x = -150 + (time * 3);
pos.y = 440 + (Math.cos((time * 0.16) + _local3) * 8);
pos.rot = Math.sin((time * 0.08) + _local3) * 10;
break;
case TYPE_FOREST_FOX :
pos.x = -150 + (time * 6);
pos.y = 327;
pos.rot = Math.sin((time * 0.18) + _local3) * 15;
break;
case TYPE_FOREST_RACOON :
pos.x = 640 - (time * 6);
pos.y = 327;
pos.rot = Math.sin((time * 0.18) + _local3) * 15;
break;
case TYPE_FOREST_CROW :
pos.x = -150 + (time * 6);
pos.y = 230;
pos.rot = Math.sin((time * 0.38) + _local3) * 10;
break;
case TYPE_FOREST_GREEN_BIRD :
pos.x = 640 - (time * 6);
pos.y = 0;
pos.rot = Math.sin((time * 0.13) + _local3) * 40;
break;
case TYPE_FOREST_OWL :
pos.x = (640 - (time * 10)) + ((time * time) / 5.5);
pos.y = (((offset * 9) << 0) * 20) + 85;
pos.rot = -90;
break;
case TYPE_FOREST_OWL_REVERSED :
pos.x = (-150 + (time * 10)) - ((time * time) / 5.5);
pos.y = (((offset * 9) << 0) * 20) + 85;
pos.rot = 90;
break;
case TYPE_FOREST_SKUNK :
pos.x = (640 - (time * 7)) + (Math.sin((time * 0.28) + _local3) * 20);
pos.y = 327;
pos.rot = Math.sin((time * 0.28) + _local3) * 10;
break;
case TYPE_FOREST_BEAR :
var _local8 = (42.2222222222222 + (offset * 30)) + 10;
pos.x = 640 - (time * 9);
if (pos.x < 260) {
pos.x = 260;
}
if (time > _local8) {
pos.x = 260 - ((time - _local8) * 8);
}
pos.y = 230;
pos.rot = 0;
break;
case TYPE_JUNGLE_GREEN_FISH :
pos.x = -150 + (time * 3);
pos.y = 440 + (Math.cos((time * 0.16) + _local3) * 8);
pos.rot = Math.sin((time * 0.08) + _local3) * 10;
break;
case TYPE_JUNGLE_RED_BIRD :
pos.x = -150 + (time * 6);
pos.y = 327;
pos.rot = Math.sin((time * 0.18) + _local3) * 15;
break;
case TYPE_JUNGLE_BEAVER :
pos.x = 640 - (time * 6);
pos.y = 230;
pos.rot = Math.sin((time * 0.18) + _local3) * 15;
break;
case TYPE_JUNGLE_PARROT :
pos.x = (640 - (time * 10)) + ((time * time) / 5.5);
pos.y = (((offset * 9) << 0) * 20) + 85;
pos.rot = -90;
break;
case TYPE_JUNGLE_MONKEY :
pos.x = -150 + (time * 6);
pos.y = 0;
pos.rot = Math.sin((time * 0.13) + _local3) * 40;
break;
case TYPE_JUNGLE_SEA_BIRD :
pos.x = 640 - (time * 3.8);
pos.y = 387;
pos.rot = (Math.sin((time * 0.16) + _local3) * (Math.sin((time * 0.16) + _local3) + 2)) * 10;
break;
case TYPE_JUNGLE_PARROT_REVERSED :
pos.x = (-150 + (time * 10)) - ((time * time) / 5.5);
pos.y = (((offset * 9) << 0) * 20) + 85;
pos.rot = 90;
break;
case TYPE_JUNGLE_ALLIGATOR :
var _local5 = time * 0.8;
pos.x = (((offset * 9) << 0) * 40) + _local5;
pos.rot = (_local5 * 3) - 90;
pos.y = (687 - (_local5 * 14)) + ((_local5 * _local5) / 5.5);
break;
case TYPE_WATER_BOOT :
pos.x = 640 - (time * 6);
pos.y = 0;
pos.rot = Math.sin((time * 0.18) + _local3) * 15;
break;
case TYPE_WATER_CRAB :
var _local6 = 280 + (offset * 80);
var _local7 = 170 + (offset * 80);
_local8 = (((640 - _local6) / 9) + (offset * 15)) + 5;
var _local10 = ((_local8 + ((_local6 - _local7) / 8)) + (offset * 15)) + 5;
pos.x = 640 - (time * 9);
if (pos.x < _local6) {
pos.x = _local6;
}
if (time > _local8) {
pos.x = _local6 - ((time - _local8) * 8);
}
if (pos.x < _local7) {
pos.x = _local7;
}
if (time > _local10) {
pos.x = _local7 - ((time - _local10) * 8);
}
pos.x = -150 + (640 - pos.x);
pos.y = 327;
pos.rot = Math.sin((time * 0.18) + _local3) * 15;
break;
case TYPE_WATER_FISH_0 :
pos.x = -150 + (time * 6);
pos.y = 387;
pos.rot = Math.sin((time * 0.18) + _local3) * 15;
break;
case TYPE_WATER_FISH_1 :
pos.x = 640 - (time * 6);
pos.y = 230;
pos.rot = Math.sin((time * 0.18) + _local3) * 15;
break;
case TYPE_WATER_SEAHORSE_RIGHT :
pos.x = (640 - (time * 10)) + ((time * time) / 5.5);
pos.y = (((offset * 9) << 0) * 20) + 85;
pos.rot = -90;
break;
case TYPE_WATER_SHELL :
pos.x = 640 - (time * 6);
pos.y = 230;
pos.rot = Math.sin((time * 0.18) + _local3) * 15;
break;
case TYPE_WATER_JELLYFISH :
pos.x = -150 + (time * 6);
pos.y = 0;
pos.rot = Math.sin((time * 0.18) + _local3) * 15;
pos.rot = pos.rot + (Math.sin((time * 0.3) + _local3) * 7);
break;
case TYPE_WATER_STARFISH :
pos.x = 640 - (time * 6);
pos.y = 440;
pos.rot = Math.sin((time * 0.18) + _local3) * 15;
break;
case TYPE_WATER_SEAHORSE_LEFT :
pos.x = (-150 + (time * 10)) - ((time * time) / 5.5);
pos.y = (((offset * 9) << 0) * 20) + 85;
pos.rot = 90;
break;
case TYPE_CITY_BEERCAN_0 :
pos.x = 640 - (time * 6);
pos.y = 387;
pos.rot = Math.sin((time * 0.28) + _local3) * 15;
break;
case TYPE_CITY_BEERCAN_1 :
pos.x = -150 + (time * 6);
pos.y = 387;
pos.rot = Math.sin((time * 0.28) + _local3) * 15;
break;
case TYPE_CITY_CAT :
pos.x = 640 - (time * 6);
pos.y = 230;
pos.rot = Math.sin((time * 0.18) + _local3) * 15;
break;
case TYPE_CITY_COCKROACH :
pos.x = 50;
pos.y = (270 - (time * 6)) + (Math.sin(time * 0.4) * 15);
pos.rot = 0;
break;
case TYPE_CITY_DEAD_FISH :
pos.x = 640 - (time * 5.2);
pos.y = 440 + (Math.cos((time * 0.16) + _local3) * 8);
pos.rot = Math.sin((time * 0.08) + _local3) * 10;
break;
case TYPE_CITY_DOG :
pos.x = -150 + (time * 7);
pos.y = 327;
pos.rot = Math.sin((time * 0.18) + _local3) * 15;
break;
case TYPE_CITY_ZILLA :
pos.x = 640 - (time * 5);
pos.y = 230;
pos.rot = Math.sin((time * 0.18) + _local3) * 20;
break;
case TYPE_CITY_DOVE :
pos.x = -150 + (time * 5);
pos.y = 230;
pos.rot = Math.sin((time * 0.18) + _local3) * 15;
break;
case TYPE_CITY_PLASTIC_BAG :
pos.x = (640 - (time * 6)) + (Math.sin((time * 0.16) + _local3) * 16);
pos.y = -16 + (Math.cos((time * 0.16) + _local3) * 16);
pos.rot = Math.sin((time * 0.32) + _local3) * 8;
break;
case TYPE_CITY_RAT :
_local6 = 280 + (offset * 80);
_local7 = 170 + (offset * 80);
_local8 = (((640 - _local6) / 9) + (offset * 15)) + 5;
_local10 = ((_local8 + ((_local6 - _local7) / 8)) + (offset * 15)) + 5;
pos.x = 640 - (time * 9);
if (pos.x < _local6) {
pos.x = _local6;
}
if (time > _local8) {
pos.x = _local6 - ((time - _local8) * 8);
}
if (pos.x < _local7) {
pos.x = _local7;
}
if (time > _local10) {
pos.x = _local7 - ((time - _local10) * 8);
}
pos.y = 230;
pos.rot = 0;
break;
case TYPE_LALA_ABC :
pos.x = (-150 + (time * 5.2)) + (Math.cos((time * 0.16) + _local3) * 8);
pos.y = 440;
pos.rot = Math.sin((time * 0.08) + _local3) * 10;
break;
case TYPE_LALA_EGGMAN :
pos.x = 640 - (time * 5);
pos.y = 327;
pos.rot = Math.sin((time * 0.12) + _local3) * 20;
break;
case TYPE_LALA_GINGERBREAD_MAN :
pos.x = -150 + (time * 5);
pos.y = 230;
pos.rot = Math.sin((time * 0.18) + _local3) * 4;
break;
case TYPE_LALA_MOON :
var _local9 = time * 0.75;
pos.x = (630 - (_local9 * 10)) + ((_local9 * _local9) / 5.5);
pos.y = time * 1.8;
pos.rot = -90;
break;
case TYPE_LALA_TEAPOT :
pos.x = 640 - (time * 6);
pos.y = 440 + (Math.cos((time * 0.16) + _local3) * 8);
pos.rot = Math.sin((time * 0.18) + _local3) * 25;
break;
case TYPE_LALA_TURTLE :
pos.x = 640 - (time * 4);
pos.y = 230;
pos.rot = Math.sin((time * 0.18) + _local3) * 15;
break;
case TYPE_LALA_ELEPHANT :
pos.x = 640 - (((time * time) * 0.1) * 1);
pos.y = 0;
pos.rot = Math.sin((time * 0.18) + _local3) * 15;
break;
case TYPE_LALA_RABBIT :
pos.x = (-150 + (time * 6)) + (Math.sin((time * 0.18) + _local3) * 20);
pos.y = 327;
pos.rot = Math.sin((time * 0.18) + _local3) * 15;
break;
case TYPE_LALA_SUN :
pos.x = 640 - (time * 6);
pos.y = -24 + (Math.sin((time * 0.07) + _local3) * 16);
pos.rot = Math.sin((time * 0.02) + _local3) * 32;
break;
default :
pos.x = 640 - (time * 6);
pos.y = 227 + (Math.sin(time * 0.8) * 80);
pos.rot = Math.sin((time * 0.08) + _local3) * 10;
}
}
static function getScore(type, time, x, y, offset, hasFlag, scoreRadius) {
if (scoreRadius == undefined) {
scoreRadius = 1;
}
var _local9 = popupInfo[type][0];
var _local10 = popupInfo[type][1];
var _local14 = ((popupInfo[type][2] / 2) * scoreRadius) << 0;
var _local2 = popupInfo[type][3];
if (hasFlag) {
return(-(_local2 << 0));
}
var _local1 = new Object();
setPos(type, time, _local1, offset);
var _local7 = Math.sin((_local1.rot * Math.PI) / 180);
var _local5 = Math.cos((_local1.rot * Math.PI) / 180);
var _local13 = (_local1.x + (_local5 * _local9)) - (_local7 * _local10);
var _local12 = (_local1.y + (_local7 * _local9)) + (_local5 * _local10);
var _local6 = x - _local13;
var _local8 = y - _local12;
var _local3 = (Math.sqrt((_local6 * _local6) + (_local8 * _local8)) * 3) / _local14;
if (_local3 < 1) {
lastMultiplier = 3;
return((_local2 * 2) << 0);
}
if (_local3 < 2) {
lastMultiplier = 2;
return((_local2 * 1.5) << 0);
}
if (_local3 < 3) {
lastMultiplier = 1;
return((_local2 * 1.2) << 0);
}
lastMultiplier = 0;
return(_local2 << 0);
}
static var TYPE_ARCTIC_WATER_BIRD = 0;
static var TYPE_ARCTIC_FLY_BIRD = 1;
static var TYPE_ARCTIC_FISH = 2;
static var TYPE_ARCTIC_SNOWHEN = 3;
static var TYPE_ARCTIC_ORCA = 4;
static var TYPE_ARCTIC_PENGUIN = 5;
static var TYPE_ARCTIC_SEAL = 6;
static var TYPE_FOREST_RED_FISH = 20;
static var TYPE_FOREST_FOX = 21;
static var TYPE_FOREST_RACOON = 22;
static var TYPE_FOREST_CROW = 23;
static var TYPE_FOREST_GREEN_BIRD = 24;
static var TYPE_FOREST_OWL = 25;
static var TYPE_FOREST_SKUNK = 26;
static var TYPE_FOREST_OWL_REVERSED = 28;
static var TYPE_FOREST_BEAR = 29;
static var TYPE_JUNGLE_GREEN_FISH = 40;
static var TYPE_JUNGLE_RED_BIRD = 41;
static var TYPE_JUNGLE_BEAVER = 42;
static var TYPE_JUNGLE_PARROT = 43;
static var TYPE_JUNGLE_MONKEY = 44;
static var TYPE_JUNGLE_SEA_BIRD = 45;
static var TYPE_JUNGLE_ALLIGATOR = 46;
static var TYPE_JUNGLE_PARROT_REVERSED = 48;
static var TYPE_WATER_BOOT = 60;
static var TYPE_WATER_CRAB = 61;
static var TYPE_WATER_FISH_0 = 62;
static var TYPE_WATER_FISH_1 = 63;
static var TYPE_WATER_SEAHORSE_RIGHT = 64;
static var TYPE_WATER_SHELL = 65;
static var TYPE_WATER_JELLYFISH = 66;
static var TYPE_WATER_STARFISH = 68;
static var TYPE_WATER_SEAHORSE_LEFT = 69;
static var TYPE_CITY_BEERCAN_0 = 80;
static var TYPE_CITY_BEERCAN_1 = 81;
static var TYPE_CITY_CAT = 82;
static var TYPE_CITY_COCKROACH = 83;
static var TYPE_CITY_DEAD_FISH = 84;
static var TYPE_CITY_DOG = 85;
static var TYPE_CITY_ZILLA = 86;
static var TYPE_CITY_DOVE = 88;
static var TYPE_CITY_PLASTIC_BAG = 89;
static var TYPE_CITY_RAT = 90;
static var TYPE_LALA_ABC = 100;
static var TYPE_LALA_EGGMAN = 101;
static var TYPE_LALA_GINGERBREAD_MAN = 102;
static var TYPE_LALA_MOON = 103;
static var TYPE_LALA_TEAPOT = 104;
static var TYPE_LALA_TURTLE = 105;
static var TYPE_LALA_ELEPHANT = 106;
static var TYPE_LALA_RABBIT = 108;
static var TYPE_LALA_SUN = 109;
static var SCORE_LOW = 125;
static var SCORE_MEDIUM = 200;
static var SCORE_HIGH = 350;
static var popupInfo = [[8, -65, 32, SCORE_LOW], [-4, 62, 20, SCORE_HIGH], [-6, -88, 20, SCORE_LOW], [2, -32, 22, SCORE_HIGH], [0, -86, 32, SCORE_MEDIUM], [-2, -46, 32, SCORE_MEDIUM], [-8, -54, 32, SCORE_LOW], [-8, -133, 24, SCORE_HIGH], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [-1, -92, 24, SCORE_LOW], [-9, -55, 24, SCORE_MEDIUM], [6, -25, 20, SCORE_MEDIUM], [6, -34, 16, SCORE_HIGH], [-1, 65, 20, SCORE_HIGH], [-28, -64, 28, SCORE_MEDIUM], [0, -23, 20, SCORE_LOW], [0, -133, 24, SCORE_HIGH], [28, -64, 28, SCORE_MEDIUM], [20, -64, 28, SCORE_LOW], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [-5, -94, 20, SCORE_LOW], [-4, -40, 28, SCORE_MEDIUM], [0, -46, 32, SCORE_MEDIUM], [17, -83, 24, SCORE_MEDIUM], [-2, 97, 18, SCORE_HIGH], [-3, -32, 28, SCORE_MEDIUM], [12, -60, 28, SCORE_LOW], [0, -133, 24, SCORE_HIGH], [-17, -83, 24, SCORE_MEDIUM], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [-30, 40, 24, SCORE_HIGH], [1, -42, 24, SCORE_MEDIUM], [-6, -73, 40, SCORE_MEDIUM], [-3, -45, 32, SCORE_LOW], [2, -87, 28, SCORE_MEDIUM], [6, -53, 32, SCORE_LOW], [0, 77, 62, SCORE_LOW], [0, 46, 24, SCORE_HIGH], [0, -78, 26, SCORE_MEDIUM], [-3, -91, 28, SCORE_MEDIUM], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, -58, 30, SCORE_MEDIUM], [0, -58, 30, SCORE_MEDIUM], [-5, -40, 24, SCORE_MEDIUM], [-1, 5, 24, SCORE_HIGH], [0, -85, 32, SCORE_MEDIUM], [-7, -46, 30, SCORE_LOW], [-5, -85, 30, SCORE_LOW], [-12, -167, 24, SCORE_HIGH], [3, -37, 30, SCORE_LOW], [8, 72, 30, SCORE_HIGH], [-1, -38, 24, SCORE_MEDIUM], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [-13, -114, 24, SCORE_MEDIUM], [0, -38, 40, SCORE_LOW], [0, -35, 24, SCORE_MEDIUM], [0, -88, 24, SCORE_HIGH], [5, -70, 36, SCORE_MEDIUM], [2, -32, 32, SCORE_LOW], [17, 107, 40, SCORE_MEDIUM], [-55, 108, 24, SCORE_HIGH], [0, -35, 20, SCORE_MEDIUM], [0, 114, 20, SCORE_HIGH], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]];
static var lastMultiplier = 0;
}
Symbol 1212 MovieClip [__Packages.com.midasplayer.carnivalshootout.SoundHolder] Frame 0
class com.midasplayer.carnivalshootout.SoundHolder
{
static var globalSound;
var soundMc, sound;
function SoundHolder (ownerMc, soundName) {
var _local2 = ownerMc.getNextHighestDepth();
soundMc = ownerMc.createEmptyMovieClip("soundMcc" + _local2, _local2);
sound = new Sound(soundMc);
sound.attachSound(soundName);
}
static function get(resourceName) {
var _local2 = soundMap[resourceName];
if ((_local2 == undefined) || (_local2 == null)) {
_local2 = new com.midasplayer.carnivalshootout.SoundHolder(_root, resourceName);
soundMap[resourceName] = _local2;
}
return(_local2);
}
static function toggleSound() {
if (globalSound == undefined) {
globalSound = new Sound(_root);
}
soundOn = !soundOn;
globalSound.setVolume((soundOn ? 100 : 0));
}
function setVolume(volume) {
sound.setVolume(volume);
}
function playLooping() {
sound.start(0, 9999999);
}
function stopAndPlayOffs(offs) {
sound.stop();
sound.start(offs, 0);
}
function stopAndPlay() {
sound.stop();
sound.start(0);
}
function playOffs(offs) {
sound.start(offs, 0);
}
function play() {
sound.start(0);
}
function stop() {
sound.stop();
}
static var soundMap = new Object();
static var soundOn = true;
}
Symbol 1213 MovieClip [__Packages.com.midasplayer.timing.Performance] Frame 0
class com.midasplayer.timing.Performance
{
var idealFps, measurePeriod, minPeriodFps, listeners, startAt, period, nextFpsUpdate, totalFps, fpsCount, lastFpsCount, periodFps, updates;
function Performance (idealFps) {
this.idealFps = idealFps;
measurePeriod = 5;
minPeriodFps = (idealFps / 2) * measurePeriod;
listeners = [];
begin();
}
function begin() {
startAt = -1;
period = -1;
nextFpsUpdate = getTimer();
totalFps = 0;
fpsCount = 0;
lastFpsCount = -1;
periodFps = 0;
updates = 0;
}
function frameUpdated() {
fpsCount++;
var _local3 = getTimer();
if (startAt < 0) {
startAt = _local3;
}
if (_local3 > nextFpsUpdate) {
if (updates > 0) {
lastFpsCount = fpsCount;
totalFps = totalFps + fpsCount;
}
periodFps = periodFps + fpsCount;
if ((++period) == measurePeriod) {
if (periodFps < minPeriodFps) {
for (var _local2 in listeners) {
listeners[_local2](periodFps / measurePeriod);
}
}
period = 0;
periodFps = 0;
}
nextFpsUpdate = _local3 + 1000;
fpsCount = 0;
updates++;
}
}
function addQualityFeedbackListener(fn) {
listeners.push(fn);
}
function setFpsThreshold(minPeriodFps, measurePeriod) {
this.minPeriodFps = minPeriodFps * measurePeriod;
this.measurePeriod = measurePeriod;
}
function get fps() {
return(lastFpsCount);
}
function get averageFps() {
return(totalFps / ((getTimer() - startAt) / 1000));
}
}
Symbol 1214 MovieClip [__Packages.mx.utils.Delegate] Frame 0
class mx.utils.Delegate extends Object
{
var func;
function Delegate (f) {
super();
func = f;
}
static function create(obj, func) {
var _local2 = function () {
var _local2 = arguments.callee.target;
var _local3 = arguments.callee.func;
return(_local3.apply(_local2, arguments));
};
_local2.target = obj;
_local2.func = func;
return(_local2);
}
function createDelegate(obj) {
return(create(obj, func));
}
}
Symbol 1215 MovieClip [__Packages.com.midasplayer.carnivalshootout.Popup] Frame 0
class com.midasplayer.carnivalshootout.Popup extends MovieClip
{
var id, type, gotoAndStop, bonusHit, hasFlag, goldFlag, flag, time, pos, deadAnim, shot, clipContainer, deadTime, age, spinSpeed, _xmouse, _xscale, _yscale, offset, _x, _y, _rotation;
function Popup () {
super();
}
function setType(_id, _type) {
id = _id;
type = _type;
gotoAndStop((type * 2) + 1);
bonusHit = false;
}
function setFlag(hasFlag, goldFlag) {
this.hasFlag = hasFlag;
this.goldFlag = goldFlag;
if (goldFlag) {
flag.gotoAndStop(2);
}
if (!hasFlag) {
flag._xscale = 0;
flag._yscale = 0;
}
}
function init(newClipContainer) {
time = 0;
pos = new Object();
deadAnim = new com.midasplayer.timing.IFloat();
shot = false;
clipContainer = newClipContainer;
deadTime = 0;
age = 0;
}
function tick(tick) {
if (shot) {
deadTime++;
}
deadAnim.set(deadTime);
age++;
if (!shot) {
if (pos.x < -150) {
shot = true;
}
if (pos.x > 800) {
shot = true;
}
if (pos.rot > 90) {
shot = true;
}
if (shot) {
deadTime = 1000;
}
}
}
function isAlive() {
return((!shot) || (deadTime < 15));
}
function isShootable() {
return(!shot);
}
function shoot() {
shot = true;
spinSpeed = (Math.abs(_xmouse) / 100) + 0.05;
}
function render(tick, alpha) {
_xscale = Math.cos(314 / ((deadAnim.get(alpha) * spinSpeed) + 10)) * 100;
if (_xscale < 0) {
gotoAndStop((type * 2) + 2);
} else {
gotoAndStop((type * 2) + 1);
}
_yscale = Math.cos((deadAnim.get(alpha) * Math.PI) / 30) * 100;
time = age + alpha;
com.midasplayer.carnivalshootout.AnimalRules.setPos(type, time, pos, offset);
_x = pos.x;
_y = pos.y;
_rotation = pos.rot;
}
function getScore(x, y, alpha) {
return(com.midasplayer.carnivalshootout.AnimalRules.getScore(type, time, x, y, offset, hasFlag && (!goldFlag)));
}
function getLastMultiplier() {
return(com.midasplayer.carnivalshootout.AnimalRules.lastMultiplier);
}
}