Frame 1
function init() {
PROJECT_CLIP.init();
}
var PROJECT_CLIP = project;
if (this == _root) {
init();
}
Symbol 38 MovieClip Frame 16
stop();
Symbol 43 MovieClip Frame 1
stop();
Symbol 47 MovieClip Frame 16
stop();
Symbol 50 MovieClip Frame 1
stop();
Symbol 53 MovieClip Frame 1
stop();
Symbol 74 MovieClip Frame 1
stop();
Instance of Symbol 43 MovieClip in Symbol 74 MovieClip Frame 1
on (press) {
_parent._parent.clickPlay();
}
Instance of Symbol 50 MovieClip in Symbol 74 MovieClip Frame 1
on (press) {
_parent._parent.clickViewScore();
}
Instance of Symbol 53 MovieClip in Symbol 74 MovieClip Frame 1
on (press) {
_parent._parent.clickHelp();
}
Symbol 100 MovieClip Frame 1
stop();
Symbol 117 MovieClip Frame 1
stop();
Symbol 119 MovieClip Frame 1
stop();
Symbol 121 MovieClip Frame 1
stop();
Symbol 124 MovieClip Frame 1
stop();
Symbol 190 MovieClip Frame 1
stop();
Instance of Symbol 43 MovieClip in Symbol 205 MovieClip Frame 1
on (release) {
_parent._parent.gotoAndPlay("outro");
}
Symbol 211 MovieClip Frame 2
stop();
Symbol 211 MovieClip Frame 5
btn.useHandCursor = false;
Symbol 211 MovieClip Frame 14
stop();
Symbol 211 MovieClip Frame 26
_parent.onHelpClose();
Symbol 221 MovieClip Frame 2
stop();
Symbol 221 MovieClip Frame 12
if (middlePath != undefined) {
middlePath[middleFunc]();
}
Symbol 221 MovieClip Frame 19
if (endPath != undefined) {
endPath[endFunc]();
}
Symbol 248 MovieClip Frame 2
stop();
Symbol 248 MovieClip Frame 5
txt.art.txt_level.text = levelNum;
play();
Symbol 248 MovieClip Frame 32
_parent.completeLevelTransition();
Symbol 253 MovieClip Frame 1
stop();
Symbol 261 MovieClip Frame 1
stop();
Symbol 264 MovieClip Frame 1
stop();
Symbol 267 MovieClip Frame 1
stop();
Symbol 270 MovieClip Frame 1
stop();
Symbol 271 MovieClip Frame 1
stop();
Symbol 272 MovieClip Frame 1
stop();
Instance of Symbol 270 MovieClip in Symbol 272 MovieClip Frame 1
on (release) {
_parent._parent._parent._parent.toggleMute();
}
Symbol 272 MovieClip Frame 2
Instance of Symbol 271 MovieClip in Symbol 272 MovieClip Frame 2
on (release) {
_parent._parent._parent._parent.toggleMute();
}
Instance of Symbol 261 MovieClip in Symbol 273 MovieClip Frame 1
on (release) {
_parent._parent.action = "help";
_parent._parent.gotoAndPlay("outro");
}
Instance of Symbol 264 MovieClip in Symbol 273 MovieClip Frame 1
on (release) {
_parent._parent.action = "quitcheck";
_parent._parent.gotoAndPlay("outro");
}
Instance of Symbol 267 MovieClip in Symbol 273 MovieClip Frame 1
on (release) {
_parent._parent.action = "resume";
_parent._parent.gotoAndPlay("outro");
}
Symbol 274 MovieClip Frame 2
stop();
Symbol 274 MovieClip Frame 5
btn.useHandCursor = false;
Symbol 274 MovieClip Frame 15
stop();
if (_parent.getIsMute()) {
this.popup_mc.mute_btn.gotoAndStop("off");
}
Symbol 274 MovieClip Frame 28
_parent.onMenuClose(action);
Symbol 279 MovieClip Frame 1
stop();
Symbol 282 MovieClip Frame 1
stop();
Instance of Symbol 279 MovieClip in Symbol 284 MovieClip Frame 1
on (release) {
_parent._parent.action = "quit";
_parent._parent.gotoAndPlay("outro");
}
Instance of Symbol 282 MovieClip in Symbol 284 MovieClip Frame 1
on (release) {
_parent._parent.action = "menureturn";
_parent._parent.gotoAndPlay("outro");
}
Symbol 285 MovieClip Frame 2
stop();
Symbol 285 MovieClip Frame 5
btn.useHandCursor = false;
Symbol 285 MovieClip Frame 15
stop();
if (_parent.getIsMute()) {
this.popup_mc.mute_btn.gotoAndStop("off");
}
Symbol 285 MovieClip Frame 28
_parent.onMenuClose(action);
Symbol 318 MovieClip Frame 1
stop();
Symbol 339 MovieClip Frame 1
stop();
Instance of Symbol 339 MovieClip "menu_btn" in Symbol 340 MovieClip Frame 1
on (press) {
_parent._parent.clickMenu();
}
Symbol 380 MovieClip Frame 1
stop();
Symbol 383 MovieClip Frame 1
stop();
Symbol 387 MovieClip Frame 17
stop();
Symbol 389 MovieClip Frame 1
stop();
Symbol 390 MovieClip Frame 1
stop();
Instance of Symbol 383 MovieClip in Symbol 390 MovieClip Frame 1
on (release) {
_parent._parent.clickPlayAgain();
}
Instance of Symbol 50 MovieClip in Symbol 390 MovieClip Frame 1
on (release) {
_parent._parent.clickViewScore();
}
Instance of Symbol 389 MovieClip "btn_submit" in Symbol 390 MovieClip Frame 1
on (release) {
_parent._parent.clickSubmitScore();
}
Symbol 391 MovieClip Frame 10
stop();
Symbol 404 Button
on (release) {
_parent.goTitle();
}
Symbol 429 MovieClip Frame 1
stop();
Symbol 429 MovieClip Frame 5
stop();
Symbol 429 MovieClip Frame 10
stop();
Symbol 436 MovieClip Frame 1
stop();
Symbol 436 MovieClip Frame 5
stop();
Symbol 436 MovieClip Frame 10
stop();
Symbol 441 MovieClip [_nick_highscore_board] Frame 1
#initclip 30
Object.registerClass("_nick_highscore_board", nick.highscores.HighscoreTable);
#endinitclip
btn.useHandCursor = false;
Symbol 441 MovieClip [_nick_highscore_board] Frame 10
stop();
Symbol 441 MovieClip [_nick_highscore_board] Frame 14
stop();
Symbol 441 MovieClip [_nick_highscore_board] Frame 19
stop();
Instance of Symbol 429 MovieClip "btn_next" in Symbol 441 MovieClip [_nick_highscore_board] Frame 19
on (release) {
_parent.nextPage();
}
on (rollOver) {
gotoAndStop ("over");
}
on (rollOut, dragOut) {
gotoAndStop ("off");
}
on (press) {
gotoAndStop ("down");
}
Instance of Symbol 436 MovieClip "btn_back" in Symbol 441 MovieClip [_nick_highscore_board] Frame 19
on (release) {
_parent.prevPage();
}
on (rollOver) {
gotoAndStop ("over");
}
on (rollOut, dragOut) {
gotoAndStop ("off");
}
on (press) {
gotoAndStop ("down");
}
Instance of Symbol 43 MovieClip "play_btn" in Symbol 441 MovieClip [_nick_highscore_board] Frame 19
on (release) {
_parent.gotoAndPlay("exit");
}
Symbol 441 MovieClip [_nick_highscore_board] Frame 25
play();
Symbol 441 MovieClip [_nick_highscore_board] Frame 32
_parent.clickPlayAgain();
stop();
Symbol 463 MovieClip Frame 7
stop();
Symbol 473 MovieClip Frame 10
stop();
Symbol 473 MovieClip Frame 14
_parent.gotoAndStop("idle");
Symbol 483 MovieClip Frame 6
_parent.gotoAndStop("idle");
Symbol 497 MovieClip Frame 14
stop();
Symbol 506 MovieClip Frame 6
_parent.gotoAndStop("idle");
Symbol 515 MovieClip Frame 14
stop();
Symbol 525 MovieClip Frame 14
stop();
Symbol 529 MovieClip Frame 1
stop();
Symbol 538 MovieClip Frame 14
stop();
Symbol 542 MovieClip Frame 14
stop();
Symbol 547 MovieClip Frame 11
stop();
Symbol 551 MovieClip Frame 14
stop();
Symbol 553 MovieClip Frame 7
stop();
Symbol 557 MovieClip Frame 20
stop();
Symbol 559 MovieClip Frame 9
stop();
Symbol 560 MovieClip Frame 9
stop();
Symbol 585 MovieClip [factory] Frame 1
stop();
Symbol 585 MovieClip [factory] Frame 9
play();
Symbol 598 MovieClip [Project] Frame 1
#initclip 29
Object.registerClass("Project", nick.santaShowdown.Engine);
#endinitclip
stop();
Symbol 599 MovieClip [__Packages.nick.santaShowdown.Engine] Frame 0
class nick.santaShowdown.Engine extends MovieClip
{
var interval, sound, viewport_mc, __viewport, activeWorld, __score, __lives, state, hud_mc, __isMuted, __updateUI, isPaused, pause_mc, isMouseDown, iris_mc, screen_mc, gotoAndStop, highscore_mc, mouse, transition_mc, key, menu_mc, mute_mc, help_mc, quit_mc;
function Engine () {
super();
}
function init() {
super.init();
interval = new smashing.IntervalEngine(this, "update");
interval.startFast();
nick.highscores.HighscoreEngine.init();
sound = new smashing.sound.SoundEngine();
sound.generateSounds(viewport_mc, 10);
sound.createGroup("music");
sound.createSound("music", "showdown_loop.wav", "music");
sound.createSound("factoryHit", "PULLBACK 1 L.wav");
sound.createSound("factoryDie", "game_over_mod.wav");
sound.createSound("beam", "BIG WAND L.wav");
sound.createSound("start", "Game_Start.mp3");
sound.createSound("mascot", "Game_Mascot_Appears.mp3");
sound.createSound("end_1", "End_1.mp3");
sound.createSound("end_2", "End_2.mp3");
sound.createSound("end_3", "End_3.mp3");
nick.santaShowdown.GameState.init();
smashing.keithm.Viewport.init(viewport_mc, 1, nick.santaShowdown.GameState.getInstance());
__viewport = smashing.keithm.Viewport.getInstance();
__viewport.createGroup({name:"enemy", index:0, slots:100});
__viewport.createGroup({name:"factory", index:1, slots:1});
__viewport.createGroup({name:"pickup", index:2, slots:5});
__viewport.createGroup({name:"projectile", index:3, slots:200});
__viewport.createGroup({name:"player", index:4, slots:1});
__viewport.reset();
activeWorld = new nick.santaShowdown.World();
activeWorld.init(this);
__initMouse();
__initKey();
reset();
playMusic();
goTitle();
}
function get score() {
return(__score);
}
function get lives() {
return(__lives);
}
function state_game() {
state = "g";
hud_mc.menu_btn._visible = true;
}
function state_menu() {
state = "m";
}
function state_quit() {
state = "q";
}
function hideMenu() {
hud_mc.menu_btn._visible = true;
}
function reset() {
__lives = __STARTLIVES;
__score = 0;
__isMuted = false;
__updateUI = true;
}
function startGame() {
reset();
goGameplay();
startLevel();
}
function startLevel() {
__viewport.newView();
activeWorld.generate();
pause();
activeWorld.start();
}
function endLevel() {
pause();
goNextLevel();
}
function stopGame() {
__viewport.newView();
pause();
}
function winGame() {
}
function silence() {
stopSound("beam");
stopMusic();
}
function gameOver() {
pause();
activeWorld.onQuit();
playIris(this, "gameOverDelayed");
}
function gameOverDelayed() {
__viewport.newView();
goGameOver();
}
function togglePause() {
if (isPaused) {
unpause();
pause_mc.gotoAndStop("off");
} else {
pause();
pause_mc.gotoAndStop("on");
}
}
function pause() {
isPaused = true;
}
function unpause() {
isPaused = false;
}
function healSparkle() {
hud_mc.health_mc.sparkle_mc.gotoAndPlay("on");
}
function scoreSparkle() {
hud_mc.score_mc.sparkle_mc.gotoAndPlay("on");
}
function update(el) {
if (el > 0.2) {
el = 0.2;
}
if (!isPaused) {
if (isMouseDown) {
activeWorld.playerFire();
}
activeWorld.update(el);
if (__updateUI) {
updateUI();
__updateUI = false;
}
}
updateAfterEvent();
}
function addScore(t_score) {
__score = __score + t_score;
__updateUI = true;
}
function requestUpdateUI() {
__updateUI = true;
}
function playIris(middlePath, middleFunc, endPath, endFunc) {
iris_mc.middlePath = middlePath;
iris_mc.middleFunc = middleFunc;
iris_mc.endPath = endPath;
iris_mc.endFunc = endFunc;
iris_mc.gotoAndPlay("start");
}
function delayedHelp() {
startGame();
goHelp();
}
function clickPlay() {
screen_mc.gotoAndStop(2);
playIris(this, "startGame", this, "unpause");
}
function clickPlayAgain() {
screen_mc.gotoAndStop(2);
playIris(this, "startGame", this, "unpause");
}
function clickMenu() {
goMenu();
}
function clickHelp() {
screen_mc.gotoAndStop(2);
playIris(this, "goGameplay", this, "delayedHelp");
}
function onHelpClose() {
unpause();
state_game();
}
function onMenuClose(action) {
if (action == "resume") {
unpause();
state_game();
} else if (action == "quitcheck") {
goQuitCheck();
} else if (action == "quit") {
gameOver();
} else if (action == "help") {
goHelp();
} else if (action == "menureturn") {
goMenu();
}
}
function clickViewScore() {
(gotoAndStop("highscores"));// not popped
nick.highscores.HighscoreEngine.viewScores(highscore_mc);
}
function clickSubmitScore() {
(gotoAndStop("highscores"));// not popped
nick.highscores.HighscoreEngine.sendAndViewScore(highscore_mc, finalScore);
}
function get accuracy() {
var _local2 = Math.ceil((activeWorld.shotsHit / activeWorld.shotsFired) * 100);
if (_local2 > 100) {
_local2 = 100;
}
if (isNaN(_local2) || (_local2 == undefined)) {
_local2 = 0;
}
return(_local2);
}
function get finalScore() {
return(score + finalBonus);
}
function get finalBonus() {
if (accuracy == NaN) {
return(0);
}
return(accuracy * activeWorld.shotsHit);
}
function __initMouse() {
mouse = {};
mouse.owner = this;
mouse.onMouseUp = function () {
this.owner.mouse_up();
};
mouse.onMouseDown = function () {
this.owner.mouse_down();
};
Mouse.addListener(mouse);
}
function mouse_up() {
isMouseDown = false;
}
function mouse_down() {
if (isPaused) {
return(undefined);
}
isMouseDown = true;
}
function runLevelTransition(t_levelNum) {
activeWorld.suspendSpawning();
transition_mc.levelNum = t_levelNum;
transition_mc.gotoAndPlay("play");
}
function completeLevelTransition() {
activeWorld.reinstateSpawning();
if (activeWorld.__get__levelNum() == 1) {
playSound("start");
}
}
function __initKey() {
key = {};
key.owner = this;
key.onKeyDown = function () {
this.owner.key_down();
};
Key.addListener(key);
}
function key_down() {
if (Key.getCode() == 80) {
togglePause();
} else if (Key.getCode() == 77) {
toggleMute();
} else if (Key.getCode() == 81) {
}
}
function playSound(t_name, t_loops) {
if (t_loops == undefined) {
sound.playSound(t_name);
} else {
sound.playSound(t_name, t_loops);
}
}
function stopSound(t_name) {
sound.stopSound(t_name);
}
function playMusic() {
if (!__isMuted) {
sound.playSound("music", 0);
}
}
function stopMusic() {
sound.stopSound("music");
}
function toggleMute() {
if (__isMuted) {
__isMuted = false;
playMusic();
menu_mc.popup_mc.mute_btn.gotoAndStop("on");
} else {
__isMuted = true;
stopMusic();
mute_mc.popup_mc.mute_btn.gotoAndStop("off");
}
}
function getIsMute() {
return(__isMuted);
}
function parseMainXML() {
}
function goTitle() {
pause();
(gotoAndStop("title"));// not popped
state_menu();
}
function goStartLevel(t_levelName) {
pause();
(gotoAndStop("startLevel"));// not popped
state_menu();
}
function goHelp() {
pause();
help_mc.gotoAndPlay("intro");
state_menu();
hud_mc.menu_btn._visible = false;
}
function goQuitCheck() {
state_quit();
quit_mc.gotoAndPlay("intro");
}
function goMenu() {
if (state == "m") {
return(undefined);
}
pause();
menu_mc.gotoAndPlay("intro");
state_menu();
hud_mc.menu_btn._visible = false;
}
function goGameplay() {
(gotoAndStop("game"));// not popped
state_game();
updateUI();
}
function goGameOver() {
pause();
state_menu();
(gotoAndStop("lose"));// not popped
screen_mc.art_mc.scores_mc.txt_score.text = (screen_mc.art_mc.scoresShad_mc.txt_score.text = score);
screen_mc.art_mc.scores_mc.txt_hits.text = (screen_mc.art_mc.scoresShad_mc.txt_hits.text = activeWorld.shotsHit);
screen_mc.art_mc.scores_mc.txt_acc.text = (screen_mc.art_mc.scoresShad_mc.txt_acc.text = String(accuracy) + "%");
screen_mc.art_mc.scores_mc.txt_bonus.text = (screen_mc.art_mc.scoresShad_mc.txt_bonus.text = finalBonus);
screen_mc.art_mc.scores_mc.txt_total.text = (screen_mc.art_mc.scoresShad_mc.txt_total.text = finalScore);
screen_mc.end_txt.gotoAndStop(getEndTextFrame());
if (nick.highscores.HighscoreEngine.__get__isLoggedIn() != true) {
screen_mc.btn_submit._visible = false;
}
}
function getEndTextFrame() {
if (activeWorld.__get__levelNum() < 5) {
playSound("end_1");
return(1);
}
if (activeWorld.__get__levelNum() < 10) {
playSound("end_2");
return(5);
}
playSound("end_3");
return(10);
}
function goGameWin() {
pause();
state_menu();
(gotoAndStop("win"));// not popped
}
function goNextLevel() {
pause();
state_menu();
(gotoAndStop("nextLevel"));// not popped
}
function updateUI() {
if (activeWorld.__get__healthPercent() == 0) {
hud_mc.health_mc.gotoAndStop(1);
} else {
hud_mc.health_mc.gotoAndStop(activeWorld.__get__healthPercent() * 100);
}
hud_mc.score_mc.txt_score.text = score;
}
var __STARTLIVES = 3;
var __HIGHSCORE_SEND_URL = "http://www.smashingideas.com/cgi-bin/doctorCompactor/submit_score.cgi";
var __HIGHSCORE_RECEIVE_URL = "http://www.smashingideas.com/cgi-bin/doctorCompactor/get_scores.cgi";
}
Symbol 600 MovieClip [__Packages.smashing.IntervalEngine] Frame 0
class smashing.IntervalEngine
{
var _uo, _uf, _update_interval, _last_update, _i, _ft, _el;
function IntervalEngine (update_object, update_function) {
_uo = update_object;
_uf = update_function;
}
function startFlat(FPS) {
_FPS = FPS;
_update_interval = 1 / FPS;
_last_update = getTimer() * 0.001;
_i = setInterval(this, "_flat_step", 0);
}
function startFlex() {
_last_update = getTimer() * 0.001;
_i = setInterval(this, "_flex_step", 0);
}
function startFast() {
_last_update = getTimer();
_i = setInterval(this, "_fast_step", 10);
}
function reset(Void) {
if (_i != undefined) {
clearInterval(_i);
}
_ft = 0;
_last_update = getTimer() * 0.001;
_lel = _MAX_FRAMETIME / 2;
}
function _flex_step(Void) {
_el = Math.min(_MAX_FRAMETIME, (-_last_update) + ((_last_update = getTimer() * 0.001)));
_lel = _lel - Math.max(-_MAX_TIMEDIFF, Math.min(_MAX_TIMEDIFF, _lel - _el));
_uo[_uf](_lel);
}
function _flat_step(Void) {
_ft = _ft + ((-_last_update) + ((_last_update = getTimer() * 0.001)));
if (_ft < _update_interval) {
return(undefined);
}
_uo[_uf](_ft);
_ft = 0;
}
function _fast_step(Void) {
_el = (-_last_update) + ((_last_update = getTimer()));
_uo[_uf](_el * 0.001);
}
function clear() {
clearInterval(_i);
}
var _MAX_TIMEDIFF = 0.005;
var _MIN_FPS = 5;
var _MAX_FRAMETIME = 1 / smashing.IntervalEngine.prototype._MIN_FPS;
var _lel = 0.2;
var _FPS = 0;
}
Symbol 601 MovieClip [__Packages.smashing.keithm.Viewport] Frame 0
class smashing.keithm.Viewport
{
static var __a_groups, __o_groups, __dimensions, __viewportPath, __viewportDepth, __useScrollport, __instance, __scrollportDepth, mc, scrollmc;
function Viewport (t_path, t_depth, dimensions) {
__a_groups = [];
__o_groups = {};
__dimensions = dimensions;
__viewportPath = t_path;
__viewportDepth = t_depth;
__useScrollport = false;
}
static function init(t_path, t_depth, dimensions) {
__instance = new smashing.keithm.Viewport(t_path, t_depth, dimensions);
}
static function getInstance() {
return(__instance);
}
function setScrollport(t_depth) {
__useScrollport = true;
__scrollportDepth = t_depth;
}
function reset() {
var _local6 = __a_groups.length;
var _local2;
var _local5 = [];
var _local3 = 0;
while (_local5.length < _local6) {
_local2 = __a_groups.length;
while (_local2--) {
if (__a_groups[_local2].index < __a_groups[_local3].index) {
_local3 = _local2;
}
}
_local5.push(__a_groups[_local3]);
__a_groups.splice(_local3, 1);
}
__a_groups = _local5;
var _local4 = __defaultMCDepth;
_local2 = 0;
while (_local2 < __a_groups.length) {
_local4 = __a_groups[_local2].init(_local4);
_local4++;
_local2++;
}
newView();
}
function newView() {
var _local1 = __a_groups.length;
while (_local1--) {
__a_groups[_local1].reset();
}
if (mc != undefined) {
mc.removeMovieClip();
}
mc = __viewportPath.createEmptyMovieClip("viewport" + __viewportDepth, __viewportDepth);
if (__useScrollport) {
if (scrollmc != undefined) {
scrollmc.removeMovieClip();
}
scrollmc = __viewportPath.createEmptyMovieClip("scrollport" + __scrollportDepth, __scrollportDepth);
scrollmc.scrollRect = new flash.geom.Rectangle(0, 0, __dimensions.SCREEN_WIDTH + 1, __dimensions.SCREEN_HEIGHT);
}
}
function clearGroup(t_group) {
var _local2 = __o_groups[t_group].mcs;
while (_local2.length > 0) {
__eraseAsset(_local2[0].mc, t_group);
}
}
function draw(t_data) {
var _local4;
if (t_data.element != undefined) {
var _local3 = t_data.element;
if (!_local3.isSpawned) {
return(undefined);
}
_local4 = __drawElement(_local3);
if (_local4 != undefined) {
_local3.onDraw(_local4, getInstance());
// unexpected jump
}
return(undefined);
}
if (t_data.assetID == "_empty") {
return(__drawEmpty(t_data.groupName, t_data.depth + t_data.depthInfluence));
}
return(__drawAsset(t_data.assetID, t_data.groupName, t_data.depth + t_data.depthInfluence));
}
function erase(t_data) {
if (t_data.element != undefined) {
__eraseAsset(t_data.element.mc, t_data.element.getDrawType());
t_data.element.onErase(getInstance());
} else {
__eraseAsset(t_data.mc, t_data.groupName);
}
}
function createGroup(t_data) {
__a_groups.push((__o_groups[t_data.name] = new smashing.keithm.ViewportGroup(t_data)));
}
function requestGroupDepthSort(t_group) {
__o_groups[t_group].requestDepthSort();
}
function requestDepthChange(t_element) {
__o_groups[t_element.getDrawType()].requestDepthChange(t_element);
}
function __drawElement(t_element) {
var _local5;
var _local2 = __o_groups[t_element.getDrawType()];
var _local7 = _local2.getDepth(t_element[_local2.sortAxis] + t_element.depthInfluence);
var _local3 = mc;
if (_local2.scrollport) {
_local3 = scrollmc;
}
if (t_element.assetID == "_empty") {
var _local4 = _local3.createEmptyMovieClip(t_element.getDrawType() + _local7, _local7);
} else {
var _local4 = _local3.attachMovie(t_element.assetID, t_element.assetID + _local7, _local7);
}
_local2.mcs.push({mc:_local4, depth:_local7});
_local5.initScale();
return(_local4);
}
function __drawAsset(t_asset, t_groupName, t_depth) {
var _local1 = __o_groups[t_groupName];
var _local6 = _local1.getDepth(t_depth);
var _local3 = mc;
if (_local1.scrollport) {
_local3 = scrollmc;
}
var _local2 = _local3.attachMovie(t_asset, t_asset + _local6, _local6);
_local1.mcs.push({mc:_local2, depth:_local6});
return(_local2);
}
function __drawEmpty(t_groupName, t_depth) {
var _local3 = __o_groups[t_groupName];
var _local6 = _local3.getDepth(t_depth);
var _local2 = mc;
if (_local3.scrollport) {
_local2 = scrollmc;
}
var _local1 = _local2.createEmptyMovieClip(t_groupName + _local6, _local6);
__o_groups[t_groupName].mcs.push({mc:_local1, depth:_local6});
return(_local1);
}
function __eraseAsset(t_mc, t_groupName) {
var _local2 = __o_groups[t_groupName];
var _local1 = _local2.mcs.length;
while (_local1--) {
if (_local2.mcs[_local1].mc == t_mc) {
_local2.mcs[_local1].mc.removeMovieClip();
_local2.mcs.splice(_local1, 1);
return(undefined);
}
}
}
function toString() {
return("Viewport exists");
}
static var __defaultMCDepth = 100;
}
Symbol 602 MovieClip [__Packages.smashing.keithm.ViewportGroup] Frame 0
class smashing.keithm.ViewportGroup
{
var name, mcs, index, numSlots, sortAxis, ascending, reverse, scrollport, min, max, current, isSearching, loop;
function ViewportGroup (t_data) {
name = t_data.name;
mcs = [];
index = t_data.index;
numSlots = t_data.slots;
if (t_data.sortAxis == undefined) {
t_data.sortAxis = "";
}
sortAxis = t_data.sortAxis;
if ((sortAxis != "") && (numSlots < 10000)) {
numSlots = 10000;
}
if (t_data.ascending == undefined) {
t_data.ascending = false;
}
ascending = t_data.ascending;
if (t_data.reverse == undefined) {
t_data.reverse = false;
}
reverse = t_data.reverse;
if (t_data.scrollport == undefined) {
t_data.scrollport = false;
}
scrollport = t_data.scrollport;
}
function init(t_depth) {
min = t_depth;
max = t_depth + numSlots;
reset();
return(max);
}
function reset() {
mcs = [];
if (reverse) {
current = max;
} else {
current = min;
}
}
function requestDepthChange(t_element) {
t_element.mc.swapDepths(__getChangedDepth(t_element));
}
function requestDepthSort() {
}
function getDepth(t_depth) {
if (sortAxis != "") {
return(__getNewDepth(t_depth));
}
increment();
return(current);
}
function increment() {
isSearching = true;
while (isSearching) {
if (reverse) {
current--;
if (current < min) {
current = max;
}
} else {
current++;
if (current > max) {
current = min;
}
}
isSearching = false;
loop = mcs.length;
while (loop--) {
if (mcs[loop].depth == current) {
isSearching = true;
loop = 0;
}
}
}
}
function __getNewDepth(depth) {
if (depth < 0) {
return(undefined);
}
if (ascending) {
depth = min + Math.ceil(depth);
} else {
depth = max - Math.ceil(depth);
}
loop = mcs.length;
while (loop--) {
if (mcs[loop].depth == depth) {
if (ascending) {
depth++;
} else {
depth--;
}
loop = mcs.length;
}
}
return(depth);
}
function __getChangedDepth(t_element) {
var _local2 = Math.ceil(t_element[sortAxis]);
if (_local2 < 0) {
return(undefined);
}
if (ascending) {
_local2 = min + _local2;
} else {
_local2 = max - _local2;
}
var _local3 = -1;
loop = mcs.length;
while (loop--) {
if (mcs[loop].mc == t_element.mc) {
_local3 = loop;
} else if (mcs[loop].depth == _local2) {
if (ascending) {
_local2++;
} else {
_local2--;
}
loop = mcs.length;
}
}
mcs[_local3].depth = _local2;
return(_local2);
}
}
Symbol 603 MovieClip [__Packages.smashing.sound.SoundEngine] Frame 0
class smashing.sound.SoundEngine
{
var __mc, o_sounds, o_groups, __a_soundQueue, __flag_muted, __flag_overwrite, __groupCount, __callbackPath, __callbackFunc;
function SoundEngine () {
}
function generateSounds(t_path, t_depth, t_overwrite) {
__mc = t_path.createEmptyMovieClip(__DEFAULTMCNAME, t_depth);
o_sounds = {};
o_groups = {};
__a_soundQueue = [];
__flag_muted = false;
if (t_overwrite == undefined) {
t_overwrite = false;
}
__flag_overwrite = t_overwrite;
__groupCount = 0;
createGroup(__DEFAULTGROUPNAME);
}
function setCallback(path, func) {
__callbackPath = path;
__callbackFunc = func;
}
function createGroup(t_name) {
__groupCount++;
var _local2 = __mc.createEmptyMovieClip(t_name, __groupCount);
_local2.soundObject = new Sound(_local2);
o_groups[t_name] = _local2;
}
function createSound(t_name, t_assetID, t_groupName, doCallback) {
var _local4;
if (((t_groupName == undefined) || (t_groupName == "")) || (t_groupName == null)) {
_local4 = o_groups[__DEFAULTGROUPNAME];
} else {
_local4 = o_groups[t_groupName];
}
if (_local4 != undefined) {
var _local2 = {};
_local2.soundEffect = new Sound(_local4);
_local2.soundEffect.attachSound(t_assetID);
if (doCallback == undefined) {
doCallback = false;
}
_local2.doCallback = doCallback;
o_sounds[t_name] = _local2;
}
}
function playSound(t_soundName, t_loops, t_queued) {
if (__flag_muted) {
return(undefined);
}
var _local2 = o_sounds[t_soundName];
if (_local2 != undefined) {
if (t_loops == undefined) {
t_loops = 1;
} else if (t_loops == 0) {
t_loops = 100000 /* 0x0186A0 */;
}
if (__flag_overwrite) {
_local2.soundEffect.stop();
}
if (t_queued == true) {
__a_soundQueue[0].doCallback = _local2.doCallback;
_local2.soundEffect.onSoundComplete = mx.utils.Delegate.create(this, onQueuedSoundComplete);
} else if (_local2.doCallback) {
_local2.soundEffect.owner = this;
_local2.soundEffect.myName = t_soundName;
_local2.soundEffect.onSoundComplete = function () {
this.owner.onCallbackSoundComplete(this.myName);
};
}
_local2.soundEffect.start(0, t_loops);
}
}
function stopSound(t_soundName) {
o_sounds[t_soundName].soundEffect.stop();
}
function stopAll() {
clearQueue();
stopAllSounds();
}
function changeVolume(t_vol, t_groupName) {
if (t_groupName == undefined) {
t_groupName = __DEFAULTGROUPNAME;
}
o_groups[t_groupName].soundObject.setVolume(t_vol);
}
function toggleSound() {
if (__flag_muted) {
soundOn();
} else {
soundOff();
}
return(!__flag_muted);
}
function soundOff() {
__flag_muted = true;
}
function soundOn() {
__flag_muted = false;
}
function callbackSound(t_soundName, t_loops, path, func) {
playSound(t_soundName, t_loops, false);
var _local2 = o_sounds[t_soundName];
_local2.soundEffect.cbpath = path;
_local2.soundEffect.cbfunc = func;
_local2.soundEffect.onSoundComplete = function () {
this.onSoundComplete = null;
this.cbpath[func]();
};
}
function onCallbackSoundComplete(name) {
__callbackPath[__callbackFunc](name);
}
function queueSound(t_soundName) {
__a_soundQueue.push({soundName:t_soundName, isPlaying:false, doCallback:false});
__playQueue();
}
function __playQueue() {
if (__a_soundQueue.length == 0) {
return(undefined);
}
if (!__a_soundQueue[0].isPlaying) {
playSound(__a_soundQueue[0].soundName, 1, true);
__a_soundQueue[0].isPlaying = true;
}
}
function onQueuedSoundComplete() {
if (__a_soundQueue[0].doCallback) {
onCallbackSoundComplete(__a_soundQueue[0].soundName);
}
__a_soundQueue.splice(0, 1);
__playQueue();
}
function clearQueue() {
__a_soundQueue = [__a_soundQueue[0]];
}
function get queueLength() {
return(__a_soundQueue.length);
}
function get isQueuePlaying() {
if (__a_soundQueue.length == 0) {
return(false);
}
return(true);
}
function get isMuted() {
return(__flag_muted);
}
var __DEFAULTMCNAME = "soundEngine_MC";
var __DEFAULTGROUPNAME = "sound";
}
Symbol 604 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 605 MovieClip [__Packages.nick.santaShowdown.World] Frame 0
class nick.santaShowdown.World
{
var engine, __enemyCount, __isGameOver, __fireTimer, __showLevelDropdown, __isFirstCupid, __levelNum, et, __isSpawning, __hasPickup, __factory, __player, __camera, __updateProjectiles, loop, a_entitys, bloop, a_projectiles, proj, obj, shotsHit, __hasCupid, __hasNewYear, __hasEaster, __player_HP, shotsFired, __et_currentMax, __LEVELUP_ET_MAX_CHANGE, __ET_MAX_MINCAP, __et_currentMin, __LEVELUP_ET_MIN_CHANGE, __ET_MIN_MINCAP, a_enemyTimeline, __hasShoutedThisLevel, __levelupCounter, __START_ET_MAX, __START_ET_MIN;
function World () {
}
function init(t_engine) {
engine = t_engine;
}
function get kills() {
return(__enemyCount);
}
function stateGameOver() {
__isGameOver = true;
__fireTimer = 99;
engine.hideMenu();
suspendSpawning();
}
function start() {
__showLevelDropdown = true;
__isFirstCupid = true;
}
function update(el) {
if (__showLevelDropdown && (el > 0)) {
engine.runLevelTransition(__levelNum);
__showLevelDropdown = false;
}
et = et - el;
if ((et <= 0) && (__isSpawning)) {
spawnEnemy();
if ((!__hasPickup) && (Math.random() < 0.25)) {
spawnPickup();
}
}
if (__isGameOver) {
if (__factory.mc._currentFrame < 5) {
engine.gameOver();
}
} else {
__fireTimer = __fireTimer - el;
}
if (!__isGameOver) {
__player.updateMoveAndRender(__camera, el);
}
__updateProjectiles = true;
loop = a_entitys.length;
if (loop == 0) {
bloop = a_projectiles.length;
while (bloop--) {
proj = a_projectiles[bloop];
proj.updateMoveAndRender(__camera, el);
if (proj.doRemove) {
a_projectiles.splice(bloop, 1);
}
}
} else {
while (loop--) {
obj = a_entitys[loop];
if (!__isGameOver) {
obj.updateMoveAndRender(__camera, el);
}
bloop = a_projectiles.length;
while (bloop--) {
proj = a_projectiles[bloop];
if (__updateProjectiles) {
proj.updateMoveAndRender(__camera, el);
}
if ((obj.isAlive && (proj.isAlive)) && (proj.runHD_entity_radius(obj, el))) {
shotsHit++;
proj.hitReact();
obj.hitReact(proj);
if (obj.TYPE == "pickup") {
applyPickup(obj.PICKUP_EFFECT);
}
}
if (__updateProjectiles) {
if (proj.doRemove) {
a_projectiles.splice(bloop, 1);
}
}
}
__updateProjectiles = false;
if (obj.isAlive) {
if (__player.hasBeam) {
if (obj.runHD_line_sphere({x:__player.x, y:__player.y}, {x:__player.x + __player.beamTarget.x, y:__player.y + __player.beamTarget.y}, el)) {
obj.hitReact({TYPE:"projectile"});
}
}
if (((obj.TYPE == "enemy") && (obj.isAlive)) && (__factory.runHD_entity_box(obj, el))) {
obj.hitReact(__factory);
factoryDamage();
}
}
if (obj.doRemove) {
if (obj.TYPE == "pickup") {
__hasPickup = false;
} else if (obj.CHARACTER == "cupid") {
__hasCupid = false;
} else if (obj.CHARACTER == "newyear") {
__hasNewYear = false;
} else if (obj.CHARACTER == "easter") {
__hasEaster = false;
}
a_entitys.splice(loop, 1);
}
}
}
}
function applyPickup(effect) {
if (effect == "score") {
addScore(200);
engine.scoreSparkle();
} else if (effect == "health") {
__player_HP++;
if (__player_HP > __PLAYER_MAXHP) {
__player_HP = __PLAYER_MAXHP;
}
engine.healSparkle();
engine.requestUpdateUI();
} else if (effect == "powerup") {
powerUp();
}
}
function onQuit() {
__player.powerDown();
}
function powerUp() {
__player.powerUp();
}
function playerFire() {
if (((__fireTimer <= 0) && (!__player.getIsAnimating())) && (!__isGameOver)) {
shotsFired++;
__player.fire();
__fireTimer = __FIRE_RATE;
}
}
function playerRelease() {
}
function pauseAnimations() {
var _local2 = a_entitys.length;
while (_local2--) {
a_entitys[_local2].pauseAnimations();
}
}
function unpauseAnimations() {
var _local2 = a_entitys.length;
while (_local2--) {
a_entitys[_local2].unpauseAnimations();
}
}
function factoryDamage() {
if (__isGameOver) {
return(undefined);
}
__player_HP--;
if (__player_HP == 0) {
__factory.damage();
engine.playSound("factoryDie");
stateGameOver();
pauseAnimations();
} else {
__factory.damage();
engine.playSound("factoryHit");
}
engine.requestUpdateUI();
}
function addScore(val) {
engine.addScore(val);
}
function levelUp() {
__levelNum++;
__et_currentMax = __et_currentMax - __LEVELUP_ET_MAX_CHANGE;
if (__et_currentMax < __ET_MAX_MINCAP) {
__et_currentMax = __ET_MAX_MINCAP;
}
__et_currentMin = __et_currentMin - __LEVELUP_ET_MIN_CHANGE;
if (__et_currentMin < __ET_MIN_MINCAP) {
__et_currentMin = __ET_MIN_MINCAP;
}
newEnemyTimeline();
}
function createProjectile(t_angle) {
if (t_angle == undefined) {
t_angle = 0;
}
if (t_angle < 0) {
t_angle = t_angle + 360;
}
var _local5 = __player.magnitudeToVector(1, t_angle + 180);
var _local4 = {x:__player.x, y:__player.y};
var _local3 = new nick.santaShowdown.ents.Projectile({owner:this, x:_local4.x, y:_local4.y, fireVector:_local5.normalize(), camera:__camera});
_local3.spawn();
a_projectiles.push(_local3);
}
function spawnEnemy() {
if (a_enemyTimeline.length == 0) {
levelUp();
engine.runLevelTransition(__levelNum);
return(undefined);
}
et = __et_currentMin + (Math.random() * (__et_currentMax - __et_currentMin));
var _local2;
var _local4 = true;
var _local3 = 3;
while (_local4 && (_local3 > 0)) {
_local2 = a_enemyTimeline.pop();
if ((((_local2.type == "cupid") && (__hasCupid)) || ((_local2.type == "newyear") && (__hasNewYear))) || ((_local2.type == "easter") && (__hasEaster))) {
a_enemyTimeline.unshift(_local2);
} else {
_local4 = false;
}
_local3--;
}
if (_local3 == 0) {
return(undefined);
}
var _local5;
switch (_local2.type) {
case "elf" :
_local5 = new nick.santaShowdown.ents.Elf({angle:_local2.angle, owner:this, camera:__camera});
break;
case "blueelf" :
_local5 = new nick.santaShowdown.ents.BlueElf({angle:_local2.angle, owner:this, camera:__camera});
break;
case "cupid" :
_local5 = new nick.santaShowdown.ents.Cupid({angle:_local2.angle, owner:this, camera:__camera});
if (__isFirstCupid || ((Math.random() < 0.25) && (!__hasShoutedThisLevel))) {
engine.playSound("mascot");
}
__isFirstCupid = false;
__hasCupid = true;
break;
case "easter" :
_local5 = new nick.santaShowdown.ents.Easter({angle:_local2.angle, owner:this, camera:__camera});
__hasEaster = true;
break;
case "newyear" :
_local5 = new nick.santaShowdown.ents.NewYear({angle:_local2.angle, owner:this, camera:__camera});
__hasNewYear = true;
break;
}
a_entitys.push(_local5);
}
function spawnPickup() {
var _local3 = 50 + (Math.random() * 500);
var _local2 = ((Math.random() > 0.5) ? 290 : 57);
if ((__levelNum >= 3) && (Math.random() < 0.17)) {
a_entitys.push(new nick.santaShowdown.ents.PickupLaser({x:_local3, y:_local2, owner:this, camera:__camera}));
} else if ((__player_HP < __PLAYER_MAXHP) && (Math.random() < (0.33 - (__levelNum / 100)))) {
a_entitys.push(new nick.santaShowdown.ents.PickupNog({x:_local3, y:_local2, owner:this, camera:__camera}));
} else {
a_entitys.push(new nick.santaShowdown.ents.PickupCandy({x:_local3, y:_local2, owner:this, camera:__camera}));
}
__hasPickup = true;
}
function suspendSpawning() {
__isSpawning = false;
}
function reinstateSpawning() {
__isSpawning = true;
}
function generate() {
__isSpawning = true;
__isGameOver = false;
__enemyCount = 0;
__levelupCounter = 0;
__levelNum = 1;
__hasPickup = false;
__hasShoutedThisLevel = false;
shotsFired = 0;
shotsHit = 0;
__player_HP = __PLAYER_MAXHP;
__camera = new nick.santaShowdown.GameCamera({dimensions:nick.santaShowdown.GameState.getInstance()});
__player = new nick.santaShowdown.ents.Player({x:nick.santaShowdown.GameState.getInstance().playerStart.x, y:nick.santaShowdown.GameState.getInstance().playerStart.y, owner:this, camera:__camera});
__factory = new nick.santaShowdown.ents.Factory({owner:this, camera:__camera});
__factory.render(__camera, 0);
a_entitys = [];
a_projectiles = [];
newEnemyTimeline();
__START_ET_MAX = 2.2;
__LEVELUP_ET_MAX_CHANGE = 0.2;
__ET_MAX_MINCAP = 1.2;
__START_ET_MIN = 0.4;
__LEVELUP_ET_MIN_CHANGE = 0.025;
__ET_MIN_MINCAP = 0.2;
__et_currentMax = __START_ET_MAX;
__et_currentMin = __START_ET_MIN;
__fireTimer = 0;
et = __et_currentMax;
__hasCupid = false;
__hasNewYear = false;
__hasEaster = false;
}
function newEnemyTimeline() {
a_enemyTimeline = [];
var _local3;
var _local4;
var _local2;
if (__levelNum >= 3) {
_local3 = 1 + (__levelNum - 3);
}
if (__levelNum >= 6) {
_local2 = 1 + Math.floor((__levelNum - 6) / 2);
if (_local2 > 3) {
_local2 = 3;
}
}
if (__levelNum >= 10) {
_local4 = 1 + (__levelNum - 9);
}
var _local5 = (__levelNum - 1) * 0.2;
if (_local5 > 1) {
_local5 = 1;
}
var _local8 = __ENEMYS_DEAD_FOR_LEVELUP + __levelNum;
if (__levelNum > 9) {
_local8 = _local8 * 1.5;
}
var _local6;
while (_local8--) {
_local6 = Math.random() * 360;
if ((((_local3 > 0) || (_local2 > 0)) || (_local4 > 0)) && (Math.random() > 0.5)) {
if ((_local2 > 0) && (Math.random() < 0.33)) {
a_enemyTimeline.push({type:"newyear", angle:_local6});
_local2--;
} else if ((_local4 > 0) && (Math.random() < 0.5)) {
a_enemyTimeline.push({type:"easter", angle:_local6});
_local4--;
} else if ((_local3 > 0) && (Math.random() < 0.5)) {
a_enemyTimeline.push({type:"cupid", angle:_local6});
_local3--;
} else if (Math.random() < _local5) {
a_enemyTimeline.push({type:"blueelf", angle:_local6});
} else {
a_enemyTimeline.push({type:"elf", angle:_local6});
}
} else if (Math.random() < _local5) {
a_enemyTimeline.push({type:"blueelf", angle:_local6});
} else {
a_enemyTimeline.push({type:"elf", angle:_local6});
}
}
}
function get levelNum() {
return(__levelNum);
}
function get healthPercent() {
return(__player_HP / __PLAYER_MAXHP);
}
var __FIRE_RATE = 0.44;
var __PLAYER_MAXHP = 5;
var __ENEMYS_DEAD_FOR_LEVELUP = 10;
}
Symbol 606 MovieClip [__Packages.smashing.keithm.Renderable] Frame 0
class smashing.keithm.Renderable
{
var mc, baseWidth, baseHeight, hdWidth, hdHeight, radius, doUpdate, owner, assetID, startX, startY, startZ, depthInfluence, flipH, threedScale, isSpawned, x, nextX, y, nextY, z, nextZ, __onscreen, isDrawn, isAlive, isHidden, scale, startScale, hdReg;
function Renderable (t_data) {
mc = null;
baseWidth = __DEF_WIDTH;
baseHeight = __DEF_HEIGHT;
if (__USE_DIMENSIONS_AS_HD) {
hdWidth = baseWidth / 2;
hdHeight = baseHeight / 2;
radius = hdWidth;
} else {
hdWidth = __DEF_HD_WIDTH / 2;
hdHeight = __DEF_HD_HEIGHT / 2;
radius = hdWidth;
}
setHDRegistration();
doUpdate = __DO_UPDATE;
init(t_data);
}
function init(t_data) {
if (t_data.owner == undefined) {
}
owner = t_data.owner;
if (t_data.asset == undefined) {
t_data.asset = __DEF_ASSET;
}
assetID = t_data.asset;
if (t_data.x == undefined) {
t_data.x = 0;
}
startX = t_data.x;
if (t_data.y == undefined) {
t_data.y = 0;
}
startY = t_data.y;
if (t_data.z == undefined) {
t_data.z = __DEF_Z;
}
startZ = t_data.z;
if (t_data.depthInfluence == undefined) {
t_data.depthInfluence = 0;
}
depthInfluence = t_data.depthInfluence;
if (t_data.camera != undefined) {
initScale(t_data.camera);
} else if (owner.camera != undefined) {
initScale(owner.camera);
}
if (t_data.flip != undefined) {
flip();
} else {
flipH = false;
}
threedScale = __3D_SCALE;
isSpawned = false;
}
function spawn(camera) {
isSpawned = true;
reset();
if (__FORCE_INITAL_DRAW) {
smashing.keithm.Viewport.getInstance().draw({element:this});
} else if (__DRAW_ON_SPAWN) {
if (camera == undefined) {
return(undefined);
}
updateDraw(camera);
}
}
function reset() {
x = (nextX = startX);
y = (nextY = startY);
z = (nextZ = startZ);
__onscreen = false;
if (((mc == undefined) || (mc == null)) || (mc == "")) {
isDrawn = false;
}
isAlive = true;
isHidden = false;
}
function onDraw(t_newmc) {
isDrawn = true;
mc = t_newmc;
if (isHidden) {
mc._visible = false;
}
if (__USE_ACTUAL_DIMENSIONS) {
baseWidth = mc._width;
baseHeight = mc._height;
setHDRegistration();
if (__USE_DIMENSIONS_AS_HD) {
hdWidth = baseWidth / 2;
hdHeight = baseHeight / 2;
radius = hdWidth;
}
}
if (flipH) {
mc._xscale = -100;
}
mc._x = -1000 - baseWidth;
mc._y = -1000 - baseHeight;
}
function update(dt) {
}
function move(dt) {
}
function moveAndRender(camera, dt) {
}
function updateMoveAndRender(camera, dt) {
}
function render(camera, dt) {
updateDraw(camera);
if (!isDrawn) {
return(undefined);
}
if (threedScale) {
if (z < camera.z) {
return(undefined);
}
var _local3 = camera.fl / (z - camera.z);
if (scale != _local3) {
scale = _local3;
mc._xscale = (mc._yscale = 100 * (1 + (scale - startScale)));
if (flipH) {
mc._xscale = mc._xscale * -1;
}
}
}
mc._x = ((x - camera.x) * scale) + camera.__get__sc().x;
mc._y = ((y - camera.y) * scale) + camera.__get__sc().y;
}
function renderDirect(camera) {
mc._x = x;
mc._y = y;
}
function initScale(camera) {
startScale = (scale = camera.fl / (startZ - camera.z));
}
function updateDraw(camera) {
__onscreen = false;
if (CUSTOMDRAW) {
__onscreen = true;
} else if (z >= camera.z) {
if (((Math.abs((x - camera.x) * scale) < (camera.__get__sc().x + baseWidth)) && (Math.abs((y - camera.y) * scale) < (camera.__get__sc().y + baseHeight))) && ((z - camera.z) < camera.farClip)) {
__onscreen = true;
}
}
if ((!isDrawn) && (__onscreen)) {
smashing.keithm.Viewport.getInstance().draw({element:this});
} else if (isDrawn && (!__onscreen)) {
requestErase();
}
}
function onErase(t_viewport) {
isDrawn = false;
mc = null;
}
function despawn() {
isAlive = false;
isSpawned = false;
}
function requestErase() {
smashing.keithm.Viewport.getInstance().erase({element:this});
}
function requestDepthSort() {
smashing.keithm.Viewport.getInstance().requestGroupDepthSort(getDrawType());
}
function requestDepthChange() {
smashing.keithm.Viewport.getInstance().requestDepthChange(this);
}
function deleteMe() {
}
function kill() {
isAlive = false;
}
function hide() {
if (isDrawn) {
mc._visible = false;
}
isHidden = true;
}
function show() {
if (isDrawn) {
mc._visible = true;
}
isHidden = false;
}
function flip() {
flipH = true;
if (isDrawn) {
mc._xscale = -100;
}
}
function unflip() {
flipH = false;
if (isDrawn) {
mc._xscale = 100;
}
}
function toggleFlip() {
if (flipH) {
unflip();
} else {
flip();
}
}
function setHDRegistration() {
hdReg = {};
hdReg.x = 0;
hdReg.y = 0;
}
function runHD_entity_radius(t_target, dt) {
var _local4 = (nextX + hdReg.x) - (t_target.nextX + t_target.hdReg.x);
var _local3 = (nextY + hdReg.y) - (t_target.nextY + t_target.hdReg.y);
var _local5 = Math.sqrt((_local4 * _local4) + (_local3 * _local3));
if (_local5 <= (t_target.radius + radius)) {
return(true);
}
return(false);
}
function runHD_entity_box(t_target, dt) {
if (Math.abs((nextX + hdReg.x) - (t_target.nextX + t_target.hdReg.x)) < (hdWidth + t_target.hdWidth)) {
if (Math.abs((nextY + hdReg.y) - (t_target.nextY + t_target.hdReg.y)) < (hdHeight + t_target.hdHeight)) {
return(true);
}
}
return(false);
}
function runHD_entity_3D(t_target, dt) {
var _local3 = z - t_target.z;
var _local2 = (nextZ + radius) - t_target.z;
if ((_local3 * _local2) <= 0) {
return(runHD_entity_radius(t_target, dt));
}
return(false);
}
function runHD_line_sphere(t_lineStart, t_lineEnd, dt) {
var _local4 = new smashing.Point3D(t_lineStart.x, t_lineStart.y, 0);
var _local3 = new smashing.Point3D(t_lineEnd.x, t_lineEnd.y, 0);
var _local6 = _local4.x - _local3.x;
var _local7 = _local4.y - _local3.y;
var _local2 = getLineSeperation(_local3, {x:x, y:y}, _local6, _local7);
var _local5;
if (_local2.distance <= radius) {
_local5 = new smashing.Point3D(x + _local2.xSeparation, y + _local2.ySeparation);
return(true);
}
_local5.x = (_local5.y = 0);
return(false);
}
function runHD_line_sphere_complex(t_lineStart, t_lineEnd, dt) {
var _local5 = new smashing.Point3D(t_lineStart.x, t_lineStart.y, 0);
var _local7 = new smashing.Point3D(t_lineEnd.x, t_lineEnd.y, 0);
var _local8;
var _local16 = getDistBetween(_local5, {x:x, y:y});
var _local15 = getDistBetween(_local7, {x:x, y:y});
var _local11 = getDistBetween(_local5, _local7);
var _local4 = new smashing.Point3D(_local5.x, _local5.y);
var _local9 = new smashing.Point3D(_local7.x, _local7.y);
var _local12 = _local9.x - _local4.x;
var _local13 = _local9.y - _local4.y;
var _local3 = _local12 / _local11;
var _local2 = _local13 / _local11;
var _local10;
_local4.subtractScalarMe(_local3 * radius, _local2 * radius);
_local9.addScalarMe(_local3 * radius, _local2 * radius);
var _local6 = getLineSeperation(_local5, {x:x, y:y}, _local12, _local13);
_local12 = _local9.x - _local4.x;
_local13 = _local9.y - _local4.y;
var _local14 = getLineSeperation(_local4, {x:x, y:y}, _local12, _local13);
if (_local6.distance <= radius) {
if (_local15 > _local11) {
_local8 = Math.sqrt((radius * radius) - (_local14.distance * _local14.distance));
_local3 = _local3 * _local8;
_local2 = _local2 * _local8;
(x + _local14.xSeparation) + _local3;
_local10 = (y + _local14.ySeparation) + _local2;
} else {
_local8 = Math.sqrt((radius * radius) - (_local6.distance * _local6.distance));
_local3 = _local3 * _local8;
_local2 = _local2 * _local8;
(x + _local6.xSeparation) + _local3;
_local10 = (y + _local6.ySeparation) + _local2;
if (getDistBetween(_local5, _local10) >= _local11) {
_local10.copy(_local7);
}
}
return(true);
}
_local10.x = (_local10.y = 0);
return(false);
}
function getLineSeperation(p0, s, dx, dy) {
var _local1 = new Object();
var _local5 = p0.x - s.x;
var _local6 = p0.y - s.y;
var _local7 = (dx * dx) + (dy * dy);
var _local2 = (-((_local5 * dx) + (_local6 * dy))) / _local7;
_local2 = Math.min(Math.max(_local2, 0), 1);
_local1.xSeparation = _local5 + (_local2 * dx);
_local1.ySeparation = _local6 + (_local2 * dy);
_local1.distance = Math.sqrt((_local1.xSeparation * _local1.xSeparation) + (_local1.ySeparation * _local1.ySeparation));
return(_local1);
}
function getDistBetween(p0, p1) {
return(Math.sqrt((p1.x - p0.x) * (p1.x - p0.x)) + ((p1.y - p0.y) * (p1.y - p0.y)));
}
function hitReact(t_source) {
}
function getDrawType() {
return(DRAWTYPE);
}
function animate(t_frame, t_subFrame) {
mc.gotoAndStop(t_frame);
if (t_subFrame != undefined) {
mc.anim.gotoAndStop(t_subFrame);
}
}
function toString() {
return("Renderable: " + TYPE);
}
function drawHitBox() {
var _local3 = hdReg.x;
var _local4 = hdReg.y;
var _local2 = mc.createEmptyMovieClip("hitbox", 1);
_local2.beginFill(16751103, 50);
_local2.lineStyle(2, 16751103, 100);
_local2.moveTo(_local3 - hdWidth, _local4 - hdHeight);
_local2.lineTo(_local3 + hdWidth, _local4 - hdHeight);
_local2.lineTo(_local3 + hdWidth, _local4 + hdHeight);
_local2.lineTo(_local3 - hdWidth, _local4 + hdHeight);
_local2.lineTo(_local3 - hdWidth, _local4 - hdHeight);
_local2.endFill();
}
function drawReg() {
var _local2 = mc.createEmptyMovieClip("hitbox", 1);
_local2.beginFill(16751103, 50);
_local2.lineStyle(2, 16751103, 100);
_local2.moveTo(-5, -5);
_local2.lineTo(5, -5);
_local2.lineTo(5, 5);
_local2.lineTo(-5, 5);
_local2.lineTo(-5, -5);
}
var TYPE = "element";
var DRAWTYPE = "element";
var __DEF_ASSET = "";
var __DEF_Z = 1000;
var __3D_SCALE = false;
var __DEF_WIDTH = 50;
var __DEF_HEIGHT = 50;
var __USE_ACTUAL_DIMENSIONS = true;
var CUSTOMDRAW = false;
var __FORCE_INITAL_DRAW = false;
var __DRAW_ON_SPAWN = false;
var __DEF_HD_WIDTH = 25;
var __DEF_HD_HEIGHT = 25;
var __USE_DIMENSIONS_AS_HD = true;
var __DO_UPDATE = true;
}
Symbol 607 MovieClip [__Packages.smashing.keithm.BaseCamera] Frame 0
class smashing.keithm.BaseCamera
{
var __dimensions, x, y, z, fl, farClip, __bound_left, __bound_right, __bound_top, __bound_bottom, left, right, top, bottom;
function BaseCamera (t_data) {
__dimensions = t_data.dimensions;
x = (y = (z = 0));
if (t_data.x != undefined) {
x = t_data.x;
}
if (t_data.y != undefined) {
y = t_data.y;
}
if (t_data.z != undefined) {
z = t_data.z;
}
fl = fl_DEF;
farClip = __DEF_CLIP;
refreshEdges();
}
function update(dt) {
}
function setBounds(left, right, top, bottom) {
__bound_left = left + __dimensions.HALF_WIDTH;
__bound_right = right - __dimensions.HALF_WIDTH;
__bound_top = top + __dimensions.HALF_HEIGHT;
__bound_bottom = bottom - __dimensions.HALF_HEIGHT;
}
function enforceBounds() {
if (x < __bound_left) {
x = __bound_left;
} else if (x > __bound_right) {
x = __bound_right;
}
if (y < __bound_top) {
y = __bound_top;
} else if (y > __bound_bottom) {
y = __bound_bottom;
}
}
function refreshEdges() {
left = x - __dimensions.HALF_WIDTH;
right = x + __dimensions.HALF_WIDTH;
top = y - __dimensions.HALF_HEIGHT;
bottom = y + __dimensions.HALF_HEIGHT;
}
function get sc() {
return(__dimensions.sc);
}
function screenWidth() {
return(__dimensions.SCREEN_WIDTH);
}
function screenHeight() {
return(__dimensions.SCREEN_WIDTH);
}
function halfWidth() {
return(__dimensions.HALF_WIDTH);
}
function halfHeight() {
return(__dimensions.HALF_HEIGHT);
}
function toString() {
return((((("Camera : focus : " + x) + " , ") + y) + " , ") + z);
}
var __DEF_CLIP = 100000;
var fl_DEF = 1000;
var __EDGE_PADDING = 50;
}
Symbol 608 MovieClip [__Packages.smashing.Point3D] Frame 0
class smashing.Point3D
{
var x, y, z;
function Point3D (x, y, z) {
this.x = Number(x);
this.y = Number(y);
this.z = Number(z);
}
function get length() {
return(Math.sqrt(((x * x) + (y * y)) + (z * z)));
}
function set length(newLength) {
if (length != 0) {
var _local2 = newLength / length;
x = x * _local2;
y = y * _local2;
z = z * _local2;
}
//return(length);
}
function get lengthSqu() {
return(((x * x) + (y * y)) + (z * z));
}
function copy() {
return(new smashing.Point3D(x, y, z));
}
function addPoint(p) {
return(new smashing.Point3D(p.x + x, p.y + y, p.z + z));
}
function subtractPoint(p) {
return(new smashing.Point3D(x - p.x, y - p.y, z - p.z));
}
function addScalar(n) {
return(new smashing.Point3D(x + n, y + n, z + n));
}
function subtractScalar(n) {
return(new smashing.Point3D(x - n, y - n, z - n));
}
function addPointMe(p) {
x = x + p.x;
y = y + p.y;
z = z + p.z;
}
function subtractPointMe(p) {
x = x - p.x;
y = y - p.y;
z = z - p.z;
}
function addScalarMe(n) {
x = x + n;
y = y + n;
z = z + n;
}
function subtractScalarMe(n) {
x = x - n;
y = y - n;
z = z - n;
}
function multiply(n) {
var _local2 = copy();
_local2.x = _local2.x * n;
_local2.y = _local2.y * n;
_local2.z = _local2.z * n;
return(_local2);
}
function divide(n) {
var _local2 = copy();
if (n == 0) {
_local2.x = 0;
_local2.y = 0;
_local2.z = 0;
return(undefined);
}
_local2.x = _local2.x / n;
_local2.y = _local2.y / n;
_local2.z = _local2.z / n;
return(_local2);
}
function multiplyMe(n) {
x = x * n;
y = y * n;
z = z * n;
}
function divideMe(n) {
x = x / n;
y = y / n;
z = z / n;
}
function dot(p) {
return(((x * p.x) + (y * p.y)) + (z * p.z));
}
function cross(p) {
return(new smashing.Point3D((y * p.z) - (z * p.y), (z * p.x) - (x * p.z), (x * p.y) - (y * p.x)));
}
function pseudoCross() {
return(new smashing.Point3D(y, -x, z));
}
function normalize() {
if (((!x) && (!y)) && (!z)) {
return(undefined);
}
var _local2 = length;
return(new smashing.Point3D(x / _local2, y / _local2, z / _local2));
}
function normalizeMe() {
if ((!x) && (!y)) {
return(undefined);
}
var _local2 = length;
x = x / _local2;
y = y / _local2;
z = z / _local2;
}
function reverse() {
var _local2 = new smashing.Point3D(x * -1, y * -1, z * -1);
return(_local2);
}
function reverseMe() {
x = x * -1;
y = y * -1;
z = z * -1;
}
function findCosine(vOther) {
var _local3 = dot(vOther);
var _local4 = length * vOther.__get__length();
var _local2 = _local3 / _local4;
return(_local2);
}
function equals(p) {
if (((x == p.x) && (y == p.y)) && (z == p.z)) {
return(true);
}
return(false);
}
function zero() {
x = 0;
y = 0;
z = 0;
}
function distSqu(p) {
var _local4 = p.x - x;
var _local3 = p.y - y;
var _local2 = p.z - z;
return(((_local4 * _local4) + (_local3 * _local3)) + (_local2 * _local2));
}
function toString() {
var _local2 = ((((("Point3D (" + x) + ",") + y) + ",") + z) + ")";
return(_local2);
}
}
Symbol 609 MovieClip [__Packages.nick.santaShowdown.ents.Entity] Frame 0
class nick.santaShowdown.ents.Entity extends smashing.keithm.Renderable
{
var startSpin, startVelocity, owner, startGravity, doRemove, spawn, velocity, gravityVector, rotation, spin, isSpinning, __animation, kill, requestErase, isAlive, hdWidth, hdReg, nextX, hdHeight, nextY, mc, x, y, nextZ, z, __isAnimating, DRAWTYPE, specialDepth;
function Entity (t_data) {
super(t_data);
}
function init(t_data) {
if (t_data.spin != undefined) {
startSpin = t_data.spin;
} else {
startSpin = 0;
}
if (t_data.vel != undefined) {
startVelocity = t_data.vel;
} else {
startVelocity = new smashing.Point3D(0, 0, 0);
}
if (owner.gravity != undefined) {
startGravity = owner.gravity;
} else {
startGravity = new smashing.Point3D(0, 0, 0);
}
doRemove = false;
super.init(t_data);
spawn(t_data.camera);
}
function reset() {
velocity = startVelocity.copy();
gravityVector = startGravity.copy();
rotation = 0;
spin = startSpin;
if (startSpin == 0) {
isSpinning = false;
} else {
isSpinning = true;
}
super.reset();
__animation = __IDLE_ANIMATION;
}
function startDie() {
kill();
animate(__DEATH_ANIMATION);
if (__USES_VELOCITY) {
velocity.x = (velocity.y = 0);
}
}
function endDie() {
requestErase();
}
function onErase() {
super.onErase();
doRemove = true;
}
function updateDraw(camera) {
if (doRemove || (!isAlive)) {
return(undefined);
}
super.updateDraw(camera);
}
function runHD(t_target, dt) {
if (!(isAlive && (t_target.isAlive))) {
return(false);
}
if (Math.abs((nextX + hdReg.x) - (t_target.nextX + t_target.hdReg.x)) < (hdWidth + t_target.hdWidth)) {
if (Math.abs((nextY + hdReg.y) - (t_target.nextY + t_target.hdReg.y)) < (hdHeight + t_target.hdHeight)) {
return(true);
}
}
return(false);
}
function hitReact(t_source) {
}
function onDraw(t_newmc) {
super.onDraw(t_newmc);
animateLoop(__IDLE_ANIMATION);
if (__ROTATE_TO_MOVEMENT) {
var _local5 = velocity.x;
var _local4 = velocity.y;
var _local3;
if (_local5 >= 0) {
if (_local4 >= 0) {
_local3 = 0;
} else {
_local3 = 360;
}
} else {
_local3 = 180;
}
_local3 = _local3 + ((Math.atan(_local4 / _local5) * 57.2957795130823) - 90);
mc._rotation = _local3;
}
}
function update(dt) {
updateAnim();
if (__USES_VELOCITY) {
nextX = x + (velocity.x * dt);
nextY = y + (velocity.y * dt);
nextZ = z + (velocity.z * dt);
}
}
function move(dt) {
if (__USES_VELOCITY) {
x = x + (velocity.x * dt);
y = y + (velocity.y * dt);
z = z + (velocity.z * dt);
}
}
function render(camera, dt) {
super.render(camera, dt);
}
function moveAndRender(camera, dt) {
if (__USES_VELOCITY) {
nextX = (x = x + (velocity.x * dt));
nextY = (y = y + (velocity.y * dt));
nextZ = (z = z + (velocity.z * dt));
} else {
x = nextX;
y = nextY;
z = nextZ;
}
render(camera, dt);
}
function updateMoveAndRender(camera, dt) {
updateAnim();
if (__USES_VELOCITY) {
nextX = (x = x + (velocity.x * dt));
nextY = (y = y + (velocity.y * dt));
nextZ = (z = z + (velocity.z * dt));
} else {
x = nextX;
y = nextY;
z = nextZ;
}
render(camera, dt);
}
function animate(frame) {
if (frame != undefined) {
__animation = frame;
}
mc.gotoAndStop(__animation);
if (__animation == __IDLE_ANIMATION) {
__isAnimating = false;
} else {
__isAnimating = true;
}
}
function animateLoop(frame) {
if (frame != undefined) {
__animation = frame;
}
mc.gotoAndStop(__animation);
__isAnimating = false;
}
function updateAnim() {
if (__isAnimating) {
if (mc.anim._currentFrame == mc.anim._totalFrames) {
if (__animation == __DEATH_ANIMATION) {
endDie();
} else {
animateLoop(__IDLE_ANIMATION);
}
}
}
}
function freezeAnimation() {
mc.anim.stop();
}
function unfreezeAnimation() {
if (__isAnimating) {
mc.anim.play();
} else {
animate();
}
}
function replaceVelocity(t_vector) {
velocity = t_vector.copy();
}
function inputVelocity(t_vector) {
velocity.x = velocity.x + t_vector.x;
velocity.y = velocity.y + t_vector.y;
velocity.z = velocity.z + t_vector.z;
}
function addVelocity(t_vector, dt, maxVelocity, xMult, yMult, zMult) {
if (maxVelocity == undefined) {
maxVelocity = __MAX_VELOCITY;
}
zMult = 1;
yMult = zMult;
xMult = yMult;
if ((Math.abs(velocity.x) < maxVelocity) || ((velocity.x * t_vector.x) < 0)) {
velocity.x = velocity.x + ((t_vector.x * dt) * xMult);
}
if ((Math.abs(velocity.y) < maxVelocity) || ((velocity.y * t_vector.y) < 0)) {
velocity.y = velocity.y + ((t_vector.y * dt) * yMult);
}
if ((Math.abs(velocity.z) < maxVelocity) || ((velocity.z * t_vector.z) < 0)) {
velocity.z = velocity.z + ((t_vector.z * dt) * zMult);
}
}
function magnitudeToVector(t_magnitude, t_angle) {
var _local2;
var _local1;
var _local3 = t_angle * (Math.PI/180);
_local2 = t_magnitude * Math.cos(_local3);
_local2 = Math.round(_local2 * 100) / 100;
_local1 = t_magnitude * Math.sin(_local3);
_local1 = Math.round(_local1 * 100) / 100;
return(new smashing.Point3D(_local2, _local1, 0));
}
function getDrawType() {
return(((HAS_SPECIAL_DEPTH == true) ? ((DRAWTYPE + "_") + specialDepth) : (DRAWTYPE)));
}
function getIsAnimating() {
return(__isAnimating);
}
function setHDRegistration() {
hdReg = {};
hdReg.x = 0;
hdReg.y = 0;
}
var HAS_SPECIAL_DEPTH = false;
var __IDLE_ANIMATION = "idle";
var __DEATH_ANIMATION = "die";
var __MAX_VELOCITY = 300;
var __USES_VELOCITY = false;
var __ROTATE_TO_MOVEMENT = false;
}
Symbol 610 MovieClip [__Packages.nick.santaShowdown.GameCamera] Frame 0
class nick.santaShowdown.GameCamera extends smashing.keithm.BaseCamera
{
var __dimensions, x, y, __bound_top, __bound_bottom;
function GameCamera (t_data) {
super(t_data);
__dimensions = nick.santaShowdown.GameState.getInstance();
x = __dimensions.sc.x;
y = __dimensions.sc.y;
}
function update(dt, player) {
var _local3 = player.nextX - x;
var _local2 = player.nextY - y;
if (_local2 > __SCROLL_TETHER_V) {
y = y + (__SCROLL_RATE * dt);
} else if (_local2 < (-__SCROLL_TETHER_V)) {
y = y - (__SCROLL_RATE * dt);
}
if (y < __bound_top) {
y = __bound_top;
} else if (y > __bound_bottom) {
y = __bound_bottom;
}
}
var __ENFORCE_BOUNDS = true;
var __SCROLL_TETHER_V = 25;
var __SCROLL_RATE = 180;
}
Symbol 611 MovieClip [__Packages.nick.santaShowdown.GameState] Frame 0
class nick.santaShowdown.GameState
{
static var __instance;
function GameState () {
}
static function init() {
__instance = new nick.santaShowdown.GameState();
}
static function getInstance() {
return(__instance);
}
function get screenWidth() {
return(__SCREENWIDTH);
}
function get screenHeight() {
return(__SCREENHEIGHT);
}
function get sc() {
return(__sc);
}
var __SCREENWIDTH = Stage.width;
var __SCREENHEIGHT = Stage.height;
var __sc = {x:Stage.width / 2, y:Stage.height / 2};
var playerStart = {x:312, y:181};
}
Symbol 612 MovieClip [__Packages.nick.santaShowdown.ents.Player] Frame 0
class nick.santaShowdown.ents.Player extends nick.santaShowdown.ents.Entity
{
var __isFiring, __xAngleCalc, x, __yAngleCalc, y, __angle, __isAnimating, mc, owner, hasBeam, beamTarget, magnitudeToVector, __beamTimer, updateAnim, render, animate, animateLoop, hdReg;
function Player (t_data) {
super(t_data);
}
function init(t_data) {
super.init(t_data);
__isFiring = false;
}
function updateMoveAndRender(camera, el) {
__xAngleCalc = x - _xmouse;
__yAngleCalc = y - _ymouse;
if (__xAngleCalc >= 0) {
if (__yAngleCalc >= 0) {
__angle = 0;
} else {
__angle = 360;
}
} else {
__angle = 180;
}
__angle = __angle + (Math.atan(__yAngleCalc / __xAngleCalc) * 57.2957795130823);
if (__isAnimating) {
if (__isFiring) {
if (mc.anim._currentFrame >= __THROW_FRAME) {
owner.createProjectile(__angle);
__isFiring = false;
}
}
}
if (hasBeam) {
beamTarget = magnitudeToVector(300, __angle + 180);
__beamTimer = __beamTimer - el;
if (__beamTimer <= 0) {
powerDown();
}
}
mc._rotation = __angle;
updateAnim();
render(camera, el);
}
function fire() {
if (__isAnimating) {
return(undefined);
}
if (hasBeam) {
return(undefined);
}
animate("throw");
__isFiring = true;
}
function powerUp() {
if (hasBeam) {
__beamTimer = __BEAM_DURATION;
return(undefined);
}
hasBeam = true;
__beamTimer = __BEAM_DURATION;
animateLoop("beam");
owner.engine.playSound("beam");
}
function powerDown() {
if (!hasBeam) {
return(undefined);
}
hasBeam = false;
mc.anim.gotoAndPlay("off");
__isAnimating = false;
owner.engine.stopSound("beam");
}
function setHDRegistration() {
hdReg = {};
hdReg.x = 0;
hdReg.y = 0;
}
var TYPE = "player";
var DRAWTYPE = "player";
var __DEF_ASSET = "timmy_main";
var __DEF_WIDTH = 20;
var __DEF_HEIGHT = 20;
var __USE_ACTUAL_DIMENSIONS = false;
var __USE_DIMENSIONS_AS_HD = true;
var __THROW_FRAME = 5;
var __BEAM_DURATION = 7;
var CUSTOMDRAW = true;
}
Symbol 613 MovieClip [__Packages.nick.santaShowdown.ents.Factory] Frame 0
class nick.santaShowdown.ents.Factory extends nick.santaShowdown.ents.Entity
{
var mc, hdReg;
function Factory (t_data) {
super(t_data);
}
function init(t_data) {
t_data.x = 191;
t_data.y = 131;
super.init(t_data);
}
function damage() {
mc.gotoAndPlay("hit");
}
function setHDRegistration() {
hdReg = {};
hdReg.x = 100;
hdReg.y = 30;
}
var __DEF_WIDTH = 130;
var __DEF_HEIGHT = 50;
var __USE_ACTUAL_DIMENSIONS = false;
var __USE_DIMENSIONS_AS_HD = true;
var TYPE = "factory";
var DRAWTYPE = "factory";
var __DEF_ASSET = "factory";
var __USES_VELOCITY = false;
}
Symbol 614 MovieClip [__Packages.nick.santaShowdown.ents.Projectile] Frame 0
class nick.santaShowdown.ents.Projectile extends nick.santaShowdown.ents.Entity
{
var startVelocity, velocity, __spin, mc, isAlive, kill, requestErase, hdReg;
function Projectile (t_data) {
super(t_data);
}
function init(t_data) {
super.init(t_data);
startVelocity = (velocity = new smashing.Point3D(t_data.fireVector.x * __FLY_SPEED, t_data.fireVector.y * __FLY_SPEED, 0));
__spin = Math.random() * 180;
}
function updateMoveAndRender(camera, el) {
super.updateMoveAndRender(camera, el);
__spin = __spin + (__SPIN_RATE * el);
mc._rotation = __spin;
}
function hitReact() {
if (!isAlive) {
return(undefined);
}
kill();
velocity = new smashing.Point3D(0, 0, 0);
mc.gotoAndStop("hit");
requestErase();
}
function setHDRegistration() {
hdReg = {};
hdReg.x = 0;
hdReg.y = 0;
}
var TYPE = "projectile";
var DRAWTYPE = "projectile";
var __DEF_ASSET = "proj_player";
var __DEF_WIDTH = 20;
var __DEF_HEIGHT = 20;
var __USE_ACTUAL_DIMENSIONS = false;
var __USE_DIMENSIONS_AS_HD = true;
var __FLY_SPEED = 440;
var __MAX_VELOCITY = 800;
var __USES_VELOCITY = true;
var __SPIN_RATE = 80;
}
Symbol 615 MovieClip [__Packages.nick.santaShowdown.ents.Enemy] Frame 0
class nick.santaShowdown.ents.Enemy extends nick.santaShowdown.ents.Entity
{
var magnitudeToVector, startX, x, nextX, startY, y, nextY, velocity, __health, isDrawn, startDie, owner, endDie, mc, hdReg;
function Enemy (t_data) {
super(t_data);
}
function init(t_data) {
super.init(t_data);
var _local5 = nick.santaShowdown.GameState.getInstance();
var _local3 = new smashing.Point3D(_local5.__get__sc().x, _local5.__get__sc().y, 0);
var _local9 = 310;
if (((t_data.angle > 50) && (t_data.angle < 130)) || ((t_data.angle > 230) && (t_data.angle < 310))) {
_local9 = 260;
}
var _local10 = magnitudeToVector(_local9, t_data.angle);
_local3.addPointMe(_local10);
startX = (x = (nextX = _local3.x));
startY = (y = (nextY = _local3.y));
var _local8 = _local3.x - _local5.playerStart.x;
var _local7 = _local3.y - _local5.playerStart.y;
var _local4;
if (_local8 >= 0) {
if (_local7 >= 0) {
_local4 = 0;
} else {
_local4 = 360;
}
} else {
_local4 = 180;
}
_local4 = _local4 + ((Math.atan(_local7 / _local8) * 57.2957795130823) + 180);
velocity = magnitudeToVector(__MOVE_RATE, _local4);
__health = __START_HEALTH;
}
function hitReact(t_target) {
if (!isDrawn) {
return(undefined);
}
if (t_target.TYPE == "player") {
startDie();
} else if (t_target.TYPE == "projectile") {
__health--;
takeDamage();
if (__health <= 0) {
owner.addScore(__SCORE_VALUE);
startDie();
}
} else if (t_target.TYPE == "factory") {
endDie();
}
}
function pauseAnimations() {
mc.anim.stop();
}
function unpauseAnimations() {
mc.anim.play();
}
function takeDamage() {
}
function setHDRegistration() {
hdReg = {};
hdReg.x = 0;
hdReg.y = -17;
}
var CHARACTER = "elf";
var TYPE = "enemy";
var DRAWTYPE = "enemy";
var __DEF_ASSET = "";
var CUSTOMDRAW = true;
var __DEF_WIDTH = 40;
var __DEF_HEIGHT = 30;
var __USE_ACTUAL_DIMENSIONS = false;
var __USE_DIMENSIONS_AS_HD = true;
var __USES_VELOCITY = true;
var __ROTATE_TO_MOVEMENT = true;
var __MOVE_RATE = 100;
var __START_HEALTH = 1;
var __SCORE_VALUE = 100;
}
Symbol 616 MovieClip [__Packages.nick.santaShowdown.ents.Elf] Frame 0
class nick.santaShowdown.ents.Elf extends nick.santaShowdown.ents.Enemy
{
function Elf (t_data) {
super(t_data);
}
var __DEF_ASSET = "elf_main";
var __MOVE_RATE = 45;
var __START_HEALTH = 1;
}
Symbol 617 MovieClip [__Packages.nick.santaShowdown.ents.BlueElf] Frame 0
class nick.santaShowdown.ents.BlueElf extends nick.santaShowdown.ents.Enemy
{
function BlueElf (t_data) {
super(t_data);
}
var __DEF_ASSET = "elf_2_main";
var __MOVE_RATE = 70;
var __START_HEALTH = 1;
}
Symbol 618 MovieClip [__Packages.nick.santaShowdown.ents.Cupid] Frame 0
class nick.santaShowdown.ents.Cupid extends nick.santaShowdown.ents.Enemy
{
function Cupid (t_data) {
super(t_data);
}
var CHARACTER = "cupid";
var __DEF_ASSET = "cupid_main";
var __MOVE_RATE = 105;
var __START_HEALTH = 1;
var __SCORE_VALUE = 200;
}
Symbol 619 MovieClip [__Packages.nick.santaShowdown.ents.Easter] Frame 0
class nick.santaShowdown.ents.Easter extends nick.santaShowdown.ents.Enemy
{
var mc;
function Easter (t_data) {
super(t_data);
}
function takeDamage() {
mc.gotoAndStop("hit");
}
var CHARACTER = "easter";
var __DEF_ASSET = "bunny_main";
var __MOVE_RATE = 80;
var __START_HEALTH = 3;
var __SCORE_VALUE = 500;
}
Symbol 620 MovieClip [__Packages.nick.santaShowdown.ents.NewYear] Frame 0
class nick.santaShowdown.ents.NewYear extends nick.santaShowdown.ents.Enemy
{
var mc;
function NewYear (t_data) {
super(t_data);
}
function takeDamage() {
mc.gotoAndStop("hit");
}
var CHARACTER = "newyear";
var __DEF_ASSET = "baby_main";
var __MOVE_RATE = 25;
var __START_HEALTH = 5;
var __SCORE_VALUE = 300;
var __DEF_WIDTH = 55;
var __DEF_HEIGHT = 30;
var __USE_ACTUAL_DIMENSIONS = false;
var __USE_DIMENSIONS_AS_HD = true;
}
Symbol 621 MovieClip [__Packages.nick.santaShowdown.ents.Pickup] Frame 0
class nick.santaShowdown.ents.Pickup extends nick.santaShowdown.ents.Entity
{
var startDie;
function Pickup (t_data) {
super(t_data);
}
function hitReact(t_target) {
startDie();
}
var TYPE = "pickup";
var DRAWTYPE = "pickup";
var PICKUP_EFFECT = "none";
var __DEF_ASSET = "pickup";
var __USES_VELOCITY = false;
var __DEF_WIDTH = 30;
var __DEF_HEIGHT = 40;
var __USE_ACTUAL_DIMENSIONS = false;
var __USE_DIMENSIONS_AS_HD = true;
var __IDLE_ANIMATION = "popin";
var __DEATH_ANIMATION = "pickup";
var CUSTOMDRAW = true;
}
Symbol 622 MovieClip [__Packages.nick.santaShowdown.ents.PickupLaser] Frame 0
class nick.santaShowdown.ents.PickupLaser extends nick.santaShowdown.ents.Pickup
{
function PickupLaser (t_data) {
super(t_data);
}
var __DEF_ASSET = "pickup_present";
var PICKUP_EFFECT = "powerup";
}
Symbol 623 MovieClip [__Packages.nick.santaShowdown.ents.PickupNog] Frame 0
class nick.santaShowdown.ents.PickupNog extends nick.santaShowdown.ents.Pickup
{
function PickupNog (t_data) {
super(t_data);
}
var __DEF_ASSET = "pickup_eggnog";
var PICKUP_EFFECT = "health";
}
Symbol 624 MovieClip [__Packages.nick.santaShowdown.ents.PickupCandy] Frame 0
class nick.santaShowdown.ents.PickupCandy extends nick.santaShowdown.ents.Pickup
{
function PickupCandy (t_data) {
super(t_data);
}
function endDie() {
super.endDie();
}
var __DEF_ASSET = "pickup_candy_cane";
var PICKUP_EFFECT = "score";
}
Symbol 625 MovieClip [__Packages.nick.highscores.HighscoreEngine] Frame 0
class nick.highscores.HighscoreEngine
{
static var __userName, __loadState, __xml, __userPath, __scorePath, __game_id, __user_vars, __userScore, __highscoreMC, __scores, __functionToRunAfterLoad, __stateVerificationInterval, __score_vars;
function HighscoreEngine () {
}
static function init() {
__userName = "null";
__loadState = "loading";
if (__USE_XML) {
loadXML();
}
}
static function loadXML() {
__xml = new XML();
__xml.ignoreWhite = true;
__xml.onLoad = function (success) {
nick.highscores.HighscoreEngine.onXMLloaded(success);
};
var _local2 = _root._url.slice(0, _root._url.lastIndexOf("/"));
if (_local2 != "") {
_local2 = _local2 + "/";
}
log(("Loading XML file from " + (_local2 + __XML_FILE_URL)) + " ...");
__xml.load(_local2 + __XML_FILE_URL);
}
static function onXMLloaded(success) {
if (success) {
__userPath = __xml.firstChild.childNodes[0].firstChild.nodeValue;
__scorePath = __xml.firstChild.childNodes[1].firstChild.nodeValue;
__game_id = __xml.firstChild.childNodes[2].firstChild.nodeValue;
log("Xml loaded : ");
log("User : " + __userPath);
log("score: " + __scorePath);
log("gameID: " + __game_id);
} else {
log("XML Loading error");
}
updateUserLogin();
}
static function manualXML(userPath, scorePath, gameID) {
__userPath = userPath;
__scorePath = scorePath;
__game_id = gameID;
updateUserLogin();
}
static function updateUserLogin() {
log("Test user login...");
__user_vars = new LoadVars();
__user_vars.onLoad = function (success) {
nick.highscores.HighscoreEngine.onLogin(success);
};
__user_vars.load(__userPath);
}
static function onLogin(success) {
if (success) {
while (__user_vars.screenName.indexOf("/n") != -1) {
log("Cull login string - : " + __user_vars.screenName);
__user_vars.screenName = __user_vars.screenName.substr(0, __user_vars.screenName.length - 2);
log("Result: " + __user_vars.screenName);
}
__userName = __user_vars.screenName;
log("USER IS : " + __userName);
}
log("USER IS NOT LOGGED IN");
__loadState = "ready";
}
static function populateHighscoreBoard() {
if ((isLoggedIn && (__userScore > 0)) && (__userScore != undefined)) {
__highscoreMC.init(__scores, {name:__userName, score:__userScore});
} else {
__highscoreMC.init(__scores, {name:"", score:0});
}
}
static function runReadyTest(callback) {
if (__loadState != "ready") {
__functionToRunAfterLoad = callback;
startBoardReadyInterval();
return(false);
}
return(true);
}
static function startBoardReadyInterval() {
__stateVerificationInterval = setInterval(function () {
nick.highscores.HighscoreEngine.runBoardReadyInterval();
}, 5);
}
static function runBoardReadyInterval() {
if (__loadState == "ready") {
clearInterval(__stateVerificationInterval);
if (__functionToRunAfterLoad == "sendAndView") {
sendAndViewScore(__highscoreMC, __userScore);
} else {
viewScores(__highscoreMC);
}
} else if (__loadState == "error") {
__highscoreMC.showError();
clearInterval(__stateVerificationInterval);
}
}
static function sendAndViewScore(boardMC, score) {
__highscoreMC = boardMC;
__userScore = score;
if (runReadyTest("sendAndView") == false) {
return(undefined);
}
log("Send Score...");
if ((__userName == "null") && (__userName == undefined)) {
log(("Error: User name is : " + __userName) + ". Only logged in users may send scores.");
return(undefined);
}
__score_vars = new LoadVars();
__score_vars.onLoad = function (success) {
nick.highscores.HighscoreEngine.onHighscores(success);
};
log((((((((("Load ( " + __scorePath) + "?msg=S&game=") + __game_id) + "&name=") + __userName) + "&score=") + score) + "&limitEntries=true") + " )");
__score_vars.load(((((((__scorePath + "?msg=S&game=") + __game_id) + "&name=") + __userName) + "&score=") + score) + "&limitEntries=true");
}
static function viewScores(boardMC) {
__highscoreMC = boardMC;
__userScore = 0;
if (runReadyTest("view") == false) {
return(undefined);
}
log("View Scores...");
log(((("Load ( " + __scorePath) + "?msg=Q&game=") + __game_id) + " )");
__score_vars = new LoadVars();
__score_vars.onLoad = function (success) {
nick.highscores.HighscoreEngine.onHighscores(success);
};
__score_vars.load((__scorePath + "?msg=Q&game=") + __game_id);
}
static function onHighscores(success) {
log("Server callback recieved: ");
log("Success: " + success);
log("Returning game ID: " + __score_vars.game);
if ((!success) || (__score_vars.game != __game_id)) {
log("Highscore retrieval Failed.");
__highscoreMC.showError();
return(undefined);
}
__scores = [];
var _local1 = 0;
while (_local1 < __score_vars.count) {
__scores.push({name:__score_vars["pn" + _local1], score:__score_vars["ps" + _local1]});
_local1++;
}
populateHighscoreBoard();
}
static function set userPath(path) {
__userPath = path;
//return(userPath);
}
static function get userPath() {
return(__userPath);
}
static function set scorePath(path) {
__scorePath = path;
//return(scorePath);
}
static function get scorePath() {
return(__scorePath);
}
static function set gameID(id) {
__game_id = id;
//return(gameID);
}
static function get gameID() {
return(__game_id);
}
static function get scores() {
return(__scores);
}
static function get userName() {
return(__userName);
}
static function get isLoggedIn() {
return((((__userName == undefined) || (__userName == "null")) ? false : true));
}
static function log(message) {
var _local1 = new LocalConnection();
_local1.send("_SILCtrace", "trace", message);
_local1.close();
}
static var __USE_XML = true;
static var __XML_FILE_URL = "config.xml";
static var __SCORE_CALL = "onHighscores";
}
Symbol 626 MovieClip [__Packages.nick.highscores.HighscoreTable] Frame 0
class nick.highscores.HighscoreTable extends MovieClip
{
var gotoAndStop, __scores, __player, __page, __totalPages, playerScore_mc, pagination_txt;
function HighscoreTable () {
super();
}
function showLoading() {
gotoAndStop("loading");
}
function showError() {
gotoAndStop("error");
}
function showTable() {
gotoAndStop("ready");
emptyTable();
}
function init(t_scores, t_player) {
showTable();
__scores = t_scores;
__player = t_player;
__page = 1;
__totalPages = Math.ceil(__scores.length / __SCORES_PER_PAGE);
var _local2 = 0;
while (_local2 < __scores.length) {
if (__scores[_local2].name == "") {
__totalPages = Math.ceil(_local2 / __SCORES_PER_PAGE);
_local2 = __scores.length;
}
_local2++;
}
populatePlayer();
populateTable();
}
function calculatePlayerRank() {
var _local2 = 0;
while (_local2 < __scores.length) {
if (__scores[_local2].name == __player.name) {
return(String(_local2));
}
_local2++;
}
return("");
}
function populatePlayer() {
if ((((__player.name == "") || (__player.name == undefined)) || (__player.name == null)) || (__player.name == "null")) {
playerScore_mc._visible = false;
} else {
playerScore_mc._visible = true;
playerScore_mc.name.text = __player.name;
playerScore_mc.score.text = __player.score;
playerScore_mc.rank.text = calculatePlayerRank();
}
}
function populateTable() {
var c = ((__page - 1) * __SCORES_PER_PAGE);
var loop = 1;
while (loop <= __SCORES_PER_PAGE) {
if (__scores[c].name != "") {
eval ((this + ".hs_") + loop).rank.text = ((__page - 1) * 10) + loop;
eval ((this + ".hs_") + loop).name.text = __scores[c].name;
eval ((this + ".hs_") + loop).score.text = __scores[c].score;
} else {
eval ((this + ".hs_") + loop).rank.text = "";
eval ((this + ".hs_") + loop).name.text = "";
eval ((this + ".hs_") + loop).score.text = "";
}
loop++;
c++;
}
pagination_txt.text = (__page + " of ") + __totalPages;
if (__totalPages < 1) {
__totalPages = 1;
}
}
function emptyTable() {
playerScore_mc._visible = false;
var loop = 1;
while (loop <= __SCORES_PER_PAGE) {
eval ((this + ".hs_") + loop).rank.text = "";
eval ((this + ".hs_") + loop).name.text = "";
eval ((this + ".hs_") + loop).score.text = "";
loop++;
}
pagination_txt.text = "";
}
function nextPage() {
__page++;
if (__page > __totalPages) {
__page = 1;
}
populateTable();
}
function prevPage() {
__page--;
if (__page < 1) {
__page = __totalPages;
}
populateTable();
}
var __SCORES_PER_PAGE = 10;
}