Frame 3
var percentLoaded = Math.floor((100 * getBytesLoaded()) / getBytesTotal());
if (percentLoaded == 100) {
_root.TitleCard.gotoAndPlay(30);
stop();
} else {
_root.TitleCard.loader_mc.gotoAndStop(percentLoaded);
gotoAndPlay (2);
}
_global.myPreloadSound = new Sound(this);
_global.myPreloadSound.attachSound("music_title.wav");
_global.myPreloadSound.start(0, 99);
Symbol 7 MovieClip Frame 1
stop();
Symbol 7 MovieClip Frame 100
stop();
Symbol 15 MovieClip Frame 12
stop();
Symbol 19 MovieClip Frame 1
stop();
Symbol 19 MovieClip Frame 2
stop();
Symbol 19 MovieClip Frame 3
stop();
Symbol 19 MovieClip Frame 4
stop();
Symbol 21 Button
on (rollOver) {
playBtn.gotoAndStop(3);
}
on (rollOut, dragOut) {
playBtn.gotoAndStop(2);
}
on (press) {
playBtn.gotoAndStop(4);
}
on (release) {
_global.myPreloadSound.stop();
delete _global.myPreloadSound;
_root.gotoAndStop(10);
}
Symbol 22 MovieClip Frame 1
stop();
Symbol 22 MovieClip Frame 31
stop();
Symbol 23 MovieClip [GameEntry] Frame 1
#initclip 31
Object.registerClass("GameEntry", Base.GameEntry);
#endinitclip
Symbol 144 MovieClip Frame 1
stop();
Symbol 144 MovieClip Frame 3
stop();
Symbol 144 MovieClip Frame 5
stop();
Symbol 144 MovieClip Frame 7
stop();
Symbol 144 MovieClip Frame 9
stop();
Symbol 144 MovieClip Frame 11
stop();
Symbol 144 MovieClip Frame 13
stop();
Symbol 144 MovieClip Frame 15
stop();
Symbol 144 MovieClip Frame 17
stop();
Symbol 144 MovieClip Frame 19
stop();
Symbol 144 MovieClip Frame 21
stop();
Symbol 144 MovieClip Frame 23
stop();
Symbol 144 MovieClip Frame 25
stop();
Instance of Symbol 144 MovieClip "_vortexCharacter" in Symbol 145 MovieClip [NPCVortex2] Frame 1
onClipEvent (load) {
this.stop();
}
Instance of Symbol 144 MovieClip "_vortexCharacter" in Symbol 146 MovieClip [NPCVortex3] Frame 1
onClipEvent (load) {
this.stop();
}
Instance of Symbol 144 MovieClip "_vortexCharacter" in Symbol 147 MovieClip [NPCVortex4] Frame 1
onClipEvent (load) {
this.stop();
}
Instance of Symbol 144 MovieClip "_vortexCharacter" in Symbol 148 MovieClip [NPCVortex1] Frame 1
onClipEvent (load) {
this.stop();
}
Symbol 262 MovieClip [coiffiobullet] Frame 1
stop();
Symbol 262 MovieClip [coiffiobullet] Frame 2
play();
Symbol 262 MovieClip [coiffiobullet] Frame 9
_root.debris = _root.attachMovie("center", "center", 3, {_x:random(400) + 50, _y:random(300) + 50});
_root.debris.onEnterFrame = _root.wander;
this.removeMovieClip();
Symbol 313 MovieClip [shieldAnim] Frame 1
stop();
Symbol 313 MovieClip [shieldAnim] Frame 13
stop();
Symbol 332 MovieClip Frame 1
stop();
Symbol 360 MovieClip [missile] Frame 1
stop();
stop();
Symbol 360 MovieClip [missile] Frame 2
play();
Symbol 373 MovieClip Frame 1
stop();
Symbol 436 MovieClip Frame 1
stop();
Symbol 437 MovieClip [__Packages.Base.GameEntry] Frame 0
class Base.GameEntry extends MovieClip
{
static var _gamePaused, _gameOver;
var _multiplayer, _timeMgr, _padMgr, _gameMgr, _parent, _gameData, onEnterFrame;
function GameEntry () {
super();
_multiplayer = false;
if (_multiplayer) {
if (_root.gameName == undefined) {
_root.gameName = "mpdemo";
}
if (_root.host == undefined) {
_root.host = "localhost";
}
if (_root.port == undefined) {
_root.port = 5678;
}
if (_root.conference == undefined) {
_root.conference = "conference.adultswim.com";
}
if (_root.roomName == undefined) {
_root.roomName = "game1";
}
if (_root.loginName == undefined) {
_root.loginName = "test";
}
if (_root.userName == undefined) {
_root.userName = _root.loginName;
}
if (_root.password == undefined) {
_root.password = "test";
}
if (_root.resource == undefined) {
_root.resource = "Flash";
}
if (_root.chanId == undefined) {
_root.chanId = -1;
}
}
_gamePaused = false;
_gameOver = false;
_timeMgr = new Base.Time();
_padMgr = new Pad.PadManager();
_gameMgr = new Game.GameManager(_parent);
_gameData = new Game.GameData(this);
onEnterFrame = Update;
}
function getDT() {
return(_timeMgr.getElapsedTime());
}
function getParent() {
return(_parent);
}
function getTimeManager() {
return(_timeMgr);
}
function getGameManager() {
return(_gameMgr);
}
function getPadManager() {
return(_padMgr);
}
function getGameData() {
return(_gameData);
}
function isMultiplayer() {
return(_multiplayer);
}
function Update() {
_timeMgr.markTimeThisTick();
_padMgr.Update(this);
_gameMgr.Update(this);
return(undefined);
}
}
Symbol 438 MovieClip [__Packages.Game.GameData] Frame 0
class Game.GameData
{
var _gameContext, soundList, _players, _numPlayers, _playerStartingPositions, _mouseOnObject, _objectChoosing, _missileTargets, _debrisDistancesToGerald, _debrisAnglesToGerald, _numTargets, _maxMultiplier, _debrisManager, _npcManager, _enemyManager, _scoreBoard, _background, _hostPlayer, _soundModule, _soundMC;
function GameData (gameContext) {
_gameContext = gameContext;
_global.MUSIC_MUTE = false;
_global.MUSIC_VOL = 20;
soundList = ["button.wav", "EnemyAappears.wav", "EnemyBullet", "EnemyFlame.wav", "EnemyHairball.wav", "EnemyHairballTravel.wav", "EnemyHit.wav", "GeraldTalk.wav", "EndingVO0.wav", "EndingVO1.wav", "EndingVO2.wav", "EnemyLaser.wav", "BDExplosion0.wav", "BDExplosion1.wav", "BDExplosion2.wav", "RDExplosion0.wav", "RDExplosion1.wav", "RDExplosion2.wav", "HotDogBeam.wav", "HotDogShot.wav", "MissileFire.wav", "MissileTravel.wav", "ShieldHit.wav", "music_debris.wav", "music_generalenemy.wav", "music_title.wav", "music_coiffio.wav", "Brenda.wav", "King.wav", "Tree.wav", "UncleGrandfather.wav", "YoungMan.wav", "CatMan.wav", "ModelRobot.wav", "AnimeGod.wav", "Coiffio.wav", "FlameLoop.wav", "FlameLaunch.wav", "EnemyDeath.wav", "PlayerDeath.wav"];
setUpSoundsFx();
init();
}
function init() {
_players = [];
_numPlayers = 0;
_playerStartingPositions = new Array(new Array(300, 200));
_mouseOnObject = false;
_objectChoosing = -1;
_missileTargets = new Array(10000, 10000, 10000);
_debrisDistancesToGerald = new Array(-1, -1, -1, -1, -1, -1, -1, -1);
_debrisAnglesToGerald = new Array(-1, -1, -1, -1, -1, -1, -1, -1);
_numTargets = 0;
_maxMultiplier = 0;
}
function getMaxMultiplier() {
return(_maxMultiplier);
}
function setMaxMultiplier(newmultiplier) {
_maxMultiplier = newmultiplier;
}
function getPlayer(idx) {
return(_players[idx]);
}
function getNumPlayers() {
return(_numPlayers);
}
function getStartingPosition(x, y) {
return(_playerStartingPositions[x][y]);
}
function getSpriteName(idx) {
return(_pieces[idx].spriteName);
}
function getClipName(idx) {
return(_pieces[idx].clipName);
}
function getIsMouseOverObject() {
return(_mouseOnObject);
}
function getObjectMouseOver() {
return(_objectChoosing);
}
function setDebrisDistancesAndDotsToGerald() {
_numTargets = 0;
var _local4 = new Object();
var _local5 = new Object();
var _local2 = new Object();
var _local6 = new Object();
_local5.x = _players[0].getPositionX();
_local5.y = _players[0].getPositionY();
_local6 = Base.TwoDMath.getVector(_local5, _players[0].getHotDogPosition());
var _local3 = 0;
while (_local3 < _debrisManager._activeDebris.length) {
_local4.x = _debrisManager._activeDebris[_local3]._debris.getPositionX();
_local4.y = _debrisManager._activeDebris[_local3]._debris.getPositionY();
_local2 = Base.TwoDMath.getVector(_local5, _local4);
_debrisDistancesToGerald[_local3] = Math.sqrt((_local2.x * _local2.x) + (_local2.y * _local2.y));
_debrisAnglesToGerald[_local3] = Base.TwoDMath.dot(_local2, _local6);
if (_debrisAnglesToGerald[_local3] < 0) {
if (_numTargets == 0) {
_missileTargets[_numTargets] = _local3;
_numTargets++;
} else if (_debrisDistancesToGerald[_local3] < _debrisDistancesToGerald[_missileTargets[0]]) {
_missileTargets[2] = _missileTargets[1];
_missileTargets[1] = _missileTargets[0];
_missileTargets[0] = _local3;
if (_numTargets < 3) {
_numTargets++;
}
} else if ((_numTargets == 1) || (_debrisDistancesToGerald[_local3] < _debrisDistancesToGerald[_missileTargets[1]])) {
_missileTargets[2] = _missileTargets[1];
_missileTargets[1] = _local3;
if (_numTargets < 3) {
_numTargets++;
}
} else if ((_numTargets == 2) || (_debrisDistancesToGerald[_local3] < _debrisDistancesToGerald[_missileTargets[2]])) {
_missileTargets[2] = _local3;
if (_numTargets < 3) {
_numTargets++;
}
}
}
_local3++;
}
_local3 = 0;
while (_local3 < 3) {
_local3++;
}
if ((_debrisManager._activeDebris.length > 3) && (_numTargets < 3)) {
}
_numTargets = 0;
return(undefined);
}
function getMissileTarget(idx) {
return(_missileTargets[idx]);
}
function clearMissleTargets() {
_missileTargets[0] = 10000;
_missileTargets[1] = 10000;
_missileTargets[2] = 10000;
_numTargets = 0;
setDebrisDistancesAndDotsToGerald();
}
function getDebrisToTarget(x, y) {
return(_numTargets++);
}
function getNPCManager() {
return(_npcManager);
}
function getDebrisManager() {
return(_debrisManager);
}
function getEnemyManager() {
return(_enemyManager);
}
function getActiveEnemy() {
return(_enemyManager.getActiveEnemy());
}
function getScoreBoard() {
return(_scoreBoard);
}
function getBackground() {
return(_background);
}
function getSoundList() {
return(soundList);
}
function setBackground(eType, id, spName, clName, depth, posX, posY, centerPoint, w, h) {
_background = new Base.SpriteEntity(_gameContext, eType, id, spName, clName, depth, posX, posY, centerPoint, w, h);
}
function changeBackground(spName, clName) {
_background.changeSprite(spName, clName);
}
function setHostPlayer(num) {
_hostPlayer = num;
}
function moveHotDog(idx, GeraldX, GeraldY, degrees) {
_players[idx].moveHotDog(GeraldX, GeraldY, degrees);
}
function fireShot(idx) {
var _local2 = _debrisManager._activeDebris;
_players[idx].fireShot(_local2);
}
function fireMissile(idx) {
_players[idx].fireMissile();
}
function destroyDebris(i, xPos, yPos, byObj, comboMultiplier) {
_debrisManager.destroyDebris(i, xPos, yPos, byObj, comboMultiplier);
}
function getSoundModule() {
return(_soundModule);
}
function setUpSoundsFx() {
_soundMC = _root.createEmptyMovieClip("sound_mc", 12000);
_soundModule = new Game.SoundModule(_soundMC);
var _local3 = 0;
while (_local3 < soundList.length) {
var _local4 = _soundModule.LoadSound(soundList[_local3]);
_local4.attachSound(soundList[_local3]);
_local3++;
}
}
function StopAllSounds() {
var _local2 = 0;
while (_local2 < soundList.length) {
_soundModule.StopSound(soundList[_local2]);
_local2++;
}
}
function createGameboard() {
_players.push(new Game.Player(_gameContext, "Gerald", 0, 0, false, false));
_numPlayers++;
_debrisManager = new Game.DebrisManager(_gameContext);
_enemyManager = new Game.EnemyManager(_gameContext);
_npcManager = new Game.NPCManager(_gameContext);
_scoreBoard = new Game.ScoreBoard(_gameContext, 20010);
}
function resetGameData() {
_scoreBoard.getScoreBoardMC().removeMovieClip();
delete _scoreBoard;
_debrisManager.freeMemory();
delete _debrisManager;
_enemyManager.getActiveEnemy().Kill();
_enemyManager.getActiveEnemy().Remove();
_enemyManager.getActiveEnemy().getEnemyMC().removeMovieClip();
delete _enemyManager;
_npcManager.freeMemory();
delete _npcManager;
_background.getMovieClip().removeMovieClip();
delete _background;
var _local2 = 0;
while (_local2 < _numPlayers) {
delete _players[_local2];
_local2++;
}
init();
}
var _pieces = [{spriteName:"Gerald", clipName:"Gerald"}];
}
Symbol 439 MovieClip [__Packages.Base.SpriteEntity] Frame 0
class Base.SpriteEntity
{
var _entityType, _id, _spName, _clName, _gameContext, _mc, _clipWidth, _clipHeight, _centerPoint, _startFrame, _endFrame, _framerate, _loopAnim, _animate, _animateTimer, _lastFrame, _c, _flipped, _faceDir;
function SpriteEntity (gameContext, eType, id, spName, clName, depth, posX, posY, centerPoint, wth, hgt) {
_entityType = eType;
_id = id;
_spName = spName;
_clName = clName;
_gameContext = gameContext;
_mc = gameContext.getParent().attachMovie(spName, clName, depth);
_mc._visible = true;
_mc._x = posX;
_mc._y = posY;
_clipWidth = ((wth > 0) ? (wth) : (_mc._width));
_clipHeight = ((hgt > 0) ? (hgt) : (_mc._height));
_centerPoint = centerPoint;
_startFrame = 0;
_endFrame = 0;
_framerate = 30;
_loopAnim = false;
_animate = false;
_animateTimer = 0;
_lastFrame = 0;
_c = 1;
_flipped = false;
_mc.gotoAndStop(_c);
}
function getMovieClip() {
return(_mc);
}
function getSpriteName() {
return(_spName);
}
function setZDepth(depth) {
_mc.swapDepths(depth);
}
function getZDepth() {
return(_mc.getDepth());
}
function moveToFrame(frame) {
if (frame == _lastFrame) {
return(undefined);
}
_mc.gotoAndStop(frame);
_lastFrame = frame;
}
function getCurrentFrame() {
return(_mc._currentframe);
}
function setPosition(x, y) {
_mc._x = x;
_mc._y = y;
}
function setPositionX(x) {
_mc._x = x;
}
function setPositionY(y) {
_mc._y = y;
}
function setPositionXY(x, y) {
setPositionX(x);
setPositionY(y);
}
function setVisibility(vis) {
_mc._visible = vis;
}
function setRotation(angle) {
_mc._rotation = angle;
}
function setFaceDir(num) {
_faceDir = num;
}
function getFaceDir() {
return(_faceDir);
}
function setFlipped() {
_flipped = (_flipped ? false : true);
_mc._xscale = _mc._xscale * -1;
}
function isFlipped() {
return(_flipped);
}
function playFlipped() {
if (_flipped) {
return(undefined);
}
_flipped = true;
_mc._xscale = _mc._xscale * -1;
}
function playUnflipped() {
if (_flipped) {
_mc._xscale = _mc._xscale * -1;
}
_flipped = false;
}
function changeSprite(spName, clName) {
var _local4 = _mc.getDepth();
var _local3 = _mc._x;
var _local2 = _mc._y;
_mc.removeMovieClip();
_mc = _gameContext.getParent().attachMovie(spName, clName, _local4);
_mc._visible = true;
_mc._x = _local3;
_mc._y = _local2;
}
function startAnimating(startFrame, endFrame, framerate, loopAnim) {
_c = startFrame;
_startFrame = startFrame;
_endFrame = endFrame;
_framerate = 1 / framerate;
_loopAnim = loopAnim;
_animate = true;
_animateTimer = _framerate;
moveToFrame(startFrame);
}
function animateSprite() {
_animateTimer = _animateTimer - _gameContext.getDT();
if (_animateTimer <= 0) {
_animateTimer = _framerate;
_c++;
if (_c > _endFrame) {
if (_loopAnim) {
_c = _startFrame;
} else {
doneAnimating();
_c = _endFrame;
}
}
moveToFrame(_c);
return(_c);
}
}
function isAnimating() {
return(_animate);
}
function doneAnimating() {
_animate = false;
}
function getID() {
return(_id);
}
function getGameContext() {
return(_gameContext);
}
function getPositionX() {
return(_mc._x);
}
function getPositionY() {
return(_mc._y);
}
function getArea() {
return(_clipWidth * _clipHeight);
}
function getClipName() {
return(_clName);
}
function isVisible() {
return(_mc._visible);
}
function scaleSprite(scale) {
_mc._xscale = _mc._xscale * scale;
_mc._yscale = _mc._yscale * scale;
}
function removeSprite() {
_mc.removeMovieClip();
}
function isMouseOver() {
if (_mc._visible == false) {
return(false);
}
var _local4 = _mc._x - (_clipWidth / 2);
var _local5 = _mc._x + (_clipWidth / 2);
var _local2 = _mc._y - _clipHeight;
var _local3 = _mc._y;
if (_centerPoint == 1) {
_local2 = _mc._y - (_clipHeight / 2);
_local3 = _mc._y + (_clipHeight / 2);
}
if (_centerPoint == 2) {
_local4 = _mc._x;
_local5 = _mc._x + _clipWidth;
_local2 = _mc._y;
_local3 = _mc._y + _clipHeight;
}
if (_centerPoint == 3) {
_local4 = _mc.x - _clipWidth;
_local5 = _mc.x;
_local2 = _mc._y - (_clipHeight / 2);
_local3 = _mc._y + (_clipHeight / 2);
}
if ((((_gameContext.getPadManager().getMousePosX() < _local4) || (_gameContext.getPadManager().getMousePosX() > _local5)) || (_gameContext.getPadManager().getMousePosY() < _local2)) || (_gameContext.getPadManager().getMousePosY() > _local3)) {
return(false);
}
return(true);
}
}
Symbol 440 MovieClip [__Packages.Game.SoundModule] Frame 0
class Game.SoundModule
{
var _mc, _hash, _num, _active_sounds, _fade_interval, _music_mute, _defaultVol, _curr_music, _fade_interval2;
function SoundModule (mc) {
_mc = mc;
_hash = {};
_num = 0;
_active_sounds = [];
_fade_interval = null;
_music_mute = _global.MUSIC_MUTE;
_defaultVol = 70;
}
function SoundAvailable() {
return(_active_sounds.length < 8);
}
function LoadSound(sound_name) {
_num++;
var _local3 = "mySound" + _num;
_mc.createEmptyMovieClip(_local3, _num);
var _local2 = new Sound(_mc[_local3]);
_local2.parent = this;
_local2.lastStart = 0;
_local2.onSoundComplete = function () {
this.parent.DeactivateSound(sound_name);
};
_hash[sound_name] = _local2;
return(_local2);
}
function SetMusicMute(oBool) {
_music_mute = oBool;
if (_music_mute == true) {
StopMusic();
} else {
PlayMusic(_curr_music);
}
}
function GetMusicMute() {
return(_music_mute);
}
function StopMusic() {
var _local2 = _active_sounds.length;
while (_local2--) {
if (_active_sounds[_local2].indexOf("music") != -1) {
StopSound(_active_sounds[_local2]);
break;
}
}
}
function GetCurMusic(Void) {
return(_curr_music);
}
function PlayMusic(str) {
if (str == "none") {
FadeSound("music_" + _curr_music, _global.MUSIC_VOL, 0, 0.5);
} else {
CrossFade("music_" + _curr_music, "music_" + str, 0.5);
_curr_music = str;
}
}
function DeactivateSound(snd) {
var _local2 = _active_sounds.length;
while (_local2--) {
if (snd == _active_sounds[_local2]) {
_active_sounds.splice(_local2, 1);
break;
}
}
}
function DeactivateAllSounds() {
_active_sounds = [];
}
function StopSound(snd) {
var _local2 = _hash[snd];
_local2.stop();
DeactivateSound(snd);
}
function soundIsPlaying(snd) {
for (var _local2 in _active_sounds) {
if (_active_sounds[_local2] == snd) {
return(true);
}
}
return(false);
}
function PlaySound(snd, vol, pan, offset, loop) {
if ((snd.indexOf("music") != -1) && (_music_mute == true)) {
return(undefined);
}
if ((snd.indexOf("collect") == -1) && (snd.indexOf("bonus") == -1)) {
for (var _local3 in _active_sounds) {
if (_active_sounds[_local3] == snd) {
return(undefined);
}
}
} else {
StopSound(snd);
}
if (_active_sounds.length < MAX_SOUNDS) {
var _local4 = _hash[snd];
if (vol == null) {
_local4.setVolume(_defaultVol);
} else {
_local4.setVolume(vol);
}
if (pan != null) {
_local4.setPan(pan);
}
if (offset == null) {
offset = 0;
}
if (loop == null) {
loop = 0;
}
_local4.start(offset, loop);
_active_sounds.push(snd);
}
}
function CrossFade(snd1, snd2, dur) {
FadeSound(snd1, _global.MUSIC_VOL, 0, dur);
PlaySound(snd2, 0, 0, 0, 9999);
FadeSound2(snd2, 0, _global.MUSIC_VOL, dur);
}
function FadeSound(snd, startVol, endVol, duration) {
if (_fade_interval != null) {
clearInterval(_fade_interval);
}
_hash[snd].setVolume(startVol);
if (endVol < startVol) {
var _local5 = -1;
} else {
var _local5 = 1;
}
var _local4 = (duration / Math.abs(endVol - startVol)) * 1000;
_fade_interval = setInterval(this, "Fade_Sound_Update", _local4, [snd, endVol, _local5]);
}
function FadeSound2(snd, startVol, endVol, duration) {
if (_fade_interval2 != null) {
clearInterval(_fade_interval2);
}
_hash[snd].setVolume(startVol);
if (endVol < startVol) {
var _local5 = -1;
} else {
var _local5 = 1;
}
var _local4 = (duration / Math.abs(endVol - startVol)) * 1000;
_fade_interval2 = setInterval(this, "Fade_Sound_Update2", _local4, [snd, endVol, _local5]);
}
function Fade_Sound_Update(sndAr) {
var _local3 = sndAr[0];
var _local5 = sndAr[1];
var _local4 = sndAr[2];
var _local2 = _hash[_local3].getVolume() + _local4;
if (((_local4 > 0) && (_local2 <= _local5)) || ((_local4 < 0) && (_local2 >= _local5))) {
_hash[_local3].setVolume(_local2);
if (_local2 <= 0) {
StopSound(_local3);
}
} else {
clearInterval(_fade_interval);
}
}
function Fade_Sound_Update2(sndAr) {
var _local3 = sndAr[0];
var _local5 = sndAr[1];
var _local4 = sndAr[2];
var _local2 = _hash[_local3].getVolume() + _local4;
if (((_local4 > 0) && (_local2 <= _local5)) || ((_local4 < 0) && (_local2 >= _local5))) {
_hash[_local3].setVolume(_local2);
if (_local2 <= 0) {
StopSound(_local3);
}
} else {
clearInterval(_fade_interval2);
}
}
function getSound(snd) {
return(_hash[snd]);
}
function toString() {
return("SoundModule()");
}
function unload() {
for (var _local3 in _hash) {
delete _hash[_local3];
}
var _local2 = 0;
while (_local2 < _num) {
_mc["mySound" + _num].removeMovieClip();
_local2++;
}
delete _hash;
}
static var MAX_SOUNDS = 16;
}
Symbol 441 MovieClip [__Packages.Base.TwoDMath] Frame 0
class Base.TwoDMath
{
static var _ptX, _ptY;
function TwoDMath () {
_ptX = 0;
_ptY = 0;
}
static function getIntersectPtX() {
return(_ptX);
}
static function getIntersectPtY() {
return(_ptY);
}
static function dot(u, v) {
return((u.x * v.x) + (u.y * v.y));
}
static function getVector(p1, p2) {
var _local1 = new Object();
_local1.x = p2.x - p1.x;
_local1.y = p2.y - p1.y;
return(_local1);
}
static function getAngle(v1, v2) {
var _local5 = Math.sqrt((v1.x * v1.x) + (v1.y * v1.y));
var _local4 = Math.sqrt((v2.x * v2.x) + (v2.y * v2.y));
var _local3 = dot(v1, v2);
if (_local3 < 0) {
}
var _local7 = _local3 / (_local5 * _local4);
var _local6 = Math.acos(_local7) * 57.2957795130823;
return(_local6);
}
static function perp(u, v) {
return((u.x * v.y) - (u.y * v.x));
}
static function inSegment(p, s0, s1) {
if (s0.x != s1.x) {
if ((s0.x <= p.x) && (p.x <= s1.x)) {
return(1);
}
if ((s0.x >= p.x) && (p.x >= s1.x)) {
return(1);
}
} else {
if ((s0.y <= p.y) && (p.y <= s1.y)) {
return(1);
}
if ((s0.y >= p.y) && (p.y >= s1.y)) {
return(1);
}
}
return(0);
}
static function intersect2D(seg1X0, seg1Y0, seg1X1, seg1Y1, seg2X0, seg2Y0, seg2X1, seg2Y1) {
var _local18 = 1E-8;
var _local3 = new Object();
var _local1 = new Object();
var _local5 = new Object();
_local3.x = seg1X1 - seg1X0;
_local3.y = seg1Y1 - seg1Y0;
_local1.x = seg2X1 - seg2X0;
_local1.y = seg2Y1 - seg2Y0;
_local5.x = seg1X0 - seg2X0;
_local5.y = seg1Y0 - seg2Y0;
var _local13 = perp(_local3, _local1);
if (Math.abs(_local13) < _local18) {
if ((perp(_local3, _local5) != 0) || (perp(_local1, _local5) != 0)) {
return(0);
}
var _local17 = dot(_local3, _local3);
var _local16 = dot(_local1, _local1);
if ((_local17 == 0) && (_local16 == 0)) {
if ((seg1X0 != seg2X0) || (seg1Y0 != seg2Y0)) {
return(0);
}
_ptX = seg1X0;
_ptY = seg1Y0;
return(1);
}
var _local8 = new Object();
var _local2;
var _local4;
_local8.x = seg1X1 - seg2X0;
_local8.y = seg1Y1 - seg2Y0;
if (_local1.x != 0) {
_local2 = _local5.x / _local1.x;
_local4 = _local8.x / _local1.x;
} else {
_local2 = _local5.y / _local1.y;
_local4 = _local8.y / _local1.y;
}
if (_local2 > _local4) {
var _local15 = _local2;
_local2 = _local4;
_local4 = _local15;
}
if ((_local2 > 1) || (_local4 < 0)) {
return(0);
}
_local2 = ((_local2 < 0) ? 0 : (_local2));
_local4 = ((_local4 > 1) ? 1 : (_local4));
if (_local2 == _local4) {
_ptX = seg2X0 + (_local2 * _local1);
_ptY = seg2Y0 + (_local2 * _local1);
return(1);
}
}
var _local7 = perp(_local1, _local5) / _local13;
if ((_local7 < 0) || (_local7 > 1)) {
return(0);
}
var _local14 = perp(_local3, _local5) / _local13;
if ((_local14 < 0) || (_local14 > 1)) {
return(0);
}
var _local6 = new Object();
_local6.x = seg1X0 + (_local7 * _local3.x);
_local6.y = seg1Y0 + (_local7 * _local3.y);
_ptX = _local6.x;
_ptY = _local6.y;
return(1);
}
}
Symbol 442 MovieClip [__Packages.Game.Player] Frame 0
class Game.Player
{
var _gameContext, _idx, _cpuControlled, _networkControlled, _controllingPiece, _numPieces, _playerName, _charIdx, _pieces, _beamsArray, _missilesArray, _tempArray, _temp1Array, _tickCounter, _shieldUp, angle, _beamDepth, _missileDepth, _shieldState, _isPlayerDead, _hotdog, _shield;
function Player (gameContext, playerName, idx, charIdx, cpuControlled, networkControlled) {
_gameContext = gameContext;
_idx = idx;
_cpuControlled = cpuControlled;
_networkControlled = networkControlled;
_controllingPiece = -1;
_numPieces = 0;
_playerName = playerName;
_charIdx = charIdx;
_pieces = [];
_beamsArray = [];
_missilesArray = [];
_tempArray = [];
_temp1Array = [];
_tickCounter = 0;
_shieldUp = true;
angle = 30;
_beamDepth = 7000;
_missileDepth = 8001;
_shieldState = 0;
_isPlayerDead = false;
Init();
}
function getPositionX() {
return(_pieces[0].getPositionX());
}
function getPositionY() {
return(_pieces[0].getPositionY());
}
function getNumPieces() {
return(_numPieces);
}
function getIndex() {
return(_idx);
}
function getPiece(num) {
return(_pieces[num]);
}
function isPlayerDead() {
return(_isPlayerDead);
}
function isShieldDown() {
if (_shieldUp) {
return(false);
}
return(true);
}
function removePieces() {
var _local3 = _numPieces;
var _local2 = 0;
while (_local2 < _local3) {
removePiece(0);
_local2++;
}
}
function Init() {
var _local2 = 0;
while (_local2 < 1) {
_numPieces++;
var _local5 = _gameContext.getGameData().getStartingPosition(_idx, 0);
var _local4 = _gameContext.getGameData().getStartingPosition(_idx, 1);
var _local3 = _gameContext.getGameData().getSpriteName(_charIdx);
var _local6 = _gameContext.getGameData().getClipName(_charIdx);
_pieces.push(new Base.Entity(_gameContext, 0, _local2 + (_idx * 1), _idx, _local3, _local6, 1000, _local5, _local4, 2, Game.GameStates.PlayerInitState));
_pieces[_local2].moveToFrame(2);
_hotdog = new Base.SpriteEntity(_gameContext, 0, 10, "HotDog", "HotDog", 1005, 300, 200, -1, -1, -1);
_shield = new Base.SpriteEntity(_gameContext, 0, 10, "Shield", "Shield", 1010, 300, 200, -1, -1, -1);
_local2++;
}
_shieldState = 0;
_shield.changeSprite("shieldAnim", "animShield");
_shield.startAnimating(1, 12, 60, false);
}
function Update() {
var _local5 = _shield.animateSprite();
var _local4 = _pieces[0].animateSprite();
if (_local4 == 117) {
Remove();
}
switch (_shieldState) {
case 0 :
if (!_shield.isAnimating()) {
_shield.changeSprite("Shield", "Shield");
_shield.startAnimating(1, 4, 10, true);
_shieldState = 1;
}
break;
case 1 :
break;
case 2 :
break;
}
var _local2 = 0;
while (_local2 < _numPieces) {
_pieces[_local2].Update(false, false);
_local2++;
}
_local2 = 0;
while (_local2 < _beamsArray.length) {
moveBeam(_local2, _tempArray);
_local2++;
}
_temp1Array = _gameContext.getGameData().getDebrisManager().getActiveDebrisArray();
var _local6 = 0;
_local2 = 0;
while (_local2 < _missilesArray.length) {
var _local3 = _missilesArray[_local2].update();
if (_local3) {
_missilesArray.splice(_local2, 1);
_mc.removeMovieClip();
delete _mc;
}
_local2++;
}
_local2 = 0;
while (_local2 < _missilesArray.length) {
var _mc = _missilesArray[_local2].getMovieClip();
if ((((_mc._x < 0) || (_mc._x > 600)) || (_mc._y < 0)) || (_mc._y > 400)) {
_missilesArray.splice(_local2, 1);
_mc.removeMovieClip();
delete _mc;
}
_local2++;
}
if ((((_tickCounter % 180) == 0) && (_shieldUp == false)) && (!_gameContext.getPadManager().getKeyStillPressed(25))) {
activateShield();
}
_tickCounter++;
}
function removePiece(idx) {
_numPieces--;
_pieces[idx].removeSprite();
delete _pieces[idx];
_pieces.splice(idx, 1);
}
function moveHotDog(GeraldX, GeraldY, degrees) {
_shield.getMovieClip()._x = GeraldX;
_shield.getMovieClip()._y = GeraldY;
_hotdog.getMovieClip()._x = GeraldX;
_hotdog.getMovieClip()._y = GeraldY;
_hotdog.getMovieClip()._rotation = degrees;
return(undefined);
}
function fireShot(_activeDebrisArray) {
if (_beamDepth >= 8000) {
_beamDepth = 7000;
}
var _local3 = _root.attachMovie("beam2", "_beamDepth" + _beamDepth, _beamDepth);
var _local6 = _hotdog.getMovieClip()._rotation;
var _local4 = (_local6 * Math.PI) / 180;
var _local7 = Math.sin(_local4) * 49;
var _local5 = (-Math.cos(_local4)) * 49;
_local3._x = getPositionX() + _local7;
_local3._y = getPositionY() + _local5;
_local3._rotation = _hotdog.getMovieClip()._rotation;
_beamsArray.push(_local3);
_beamDepth++;
_tempArray = _activeDebrisArray;
if (_shieldState == 1) {
deactivateShield();
}
}
function activateShield() {
_shieldUp = true;
var _local2 = _hotdog.getMovieClip()._rotation - 180;
if (_local2 < 0) {
_local2 = _local2 + 360;
}
_shieldState = 0;
_shield.changeSprite("shieldAnim", "shield");
_shield.getMovieClip()._rotation = _local2;
_shield.startAnimating(1, 12, 60, false);
}
function deactivateShield() {
_shieldUp = false;
_shieldState = 2;
_gameContext.getGameData().getSoundModule().PlaySound("ShieldHit.wav");
_shield.changeSprite("shieldAnim", "shield");
_shield.getMovieClip()._rotation = _hotdog.getMovieClip()._rotation;
_shield.startAnimating(14, 26, 60, false);
}
function moveBeam(_beamIndex, _activeDebrisArray) {
var _local6 = 8;
var _local7 = (_beamsArray[_beamIndex]._rotation * Math.PI) / 180;
var _local9 = Math.sin(_local7) * _local6;
var _local8 = (-Math.cos(_local7)) * _local6;
_beamsArray[_beamIndex]._x = _beamsArray[_beamIndex]._x + _local9;
_beamsArray[_beamIndex]._y = _beamsArray[_beamIndex]._y + _local8;
if ((((_beamsArray[_beamIndex]._x < 0) || (_beamsArray[_beamIndex]._x > 600)) || (_beamsArray[_beamIndex]._y < 0)) || (_beamsArray[_beamIndex]._y > 400)) {
_beamsArray[_beamIndex].removeMovieClip();
_beamsArray.splice(_beamIndex, 1);
}
var _local2 = 0;
while (_local2 < _activeDebrisArray.length) {
if (_activeDebrisArray[_local2]._debris.getMovieClip().hitTest(_beamsArray[_beamIndex]._x, _beamsArray[_beamIndex]._y, false) == true) {
_beamsArray[_beamIndex].removeMovieClip();
_beamsArray.splice(_beamIndex, 1);
_gameContext.getGameData().destroyDebris(_local2, _activeDebrisArray[_local2]._debris.getMovieClip()._x, _activeDebrisArray[_local2]._debris.getMovieClip()._y, 0, 1);
}
_local2++;
}
var _local5 = _gameContext.getGameData().getActiveEnemy();
if (_local5 != undefined) {
if (_local5.getEnemyMC().hitTest(_beamsArray[_beamIndex]._x, _beamsArray[_beamIndex]._y, true) == true) {
_beamsArray[_beamIndex].removeMovieClip();
_beamsArray.splice(_beamIndex, 1);
if (!_local5.isKilled()) {
_local5.HitMe("shot");
}
}
}
}
function fireMissile() {
if (_missilesArray.length > 0) {
return(undefined);
}
_gameContext.getGameData().getSoundModule().PlaySound("MissileFire.wav");
_gameContext.getGameData().clearMissleTargets();
if (_missileDepth >= 9000) {
_missileDepth = 8001;
}
var _local6 = 3;
while (_local6--) {
var _local4 = (_hotdog.getMovieClip()._rotation * Math.PI) / 180;
var _local3 = Math.sin(_local4) * 49;
var _local2 = (-Math.cos(_local4)) * 49;
_local3 = getPositionX() + _local3;
_local2 = getPositionY() + _local2;
var _local5 = new Game.Missile(_gameContext, _local3, _local2, _missileDepth++, _hotdog.getMovieClip()._rotation);
_missilesArray.push(_local5);
}
if (_shieldState == 1) {
deactivateShield();
}
}
function killPlayer() {
_pieces[0].startAnimating(100, 117, 6, false);
_gameContext.getGameData().getSoundModule().PlaySound("PlayerDeath.wav", 100, 0, 0, false);
_isPlayerDead = true;
_tickCounter = 4;
}
function Remove() {
var _local2 = 0;
while (_local2 < 1) {
removePiece(_local2);
_local2++;
}
_hotdog.getMovieClip().removeMovieClip();
delete _hotdog;
_shield.getMovieClip().removeMovieClip();
delete _shield;
_local2 = 0;
while (_local2 < _beamsArray.length) {
_beamsArray[_local2].removeMovieClip();
_local2++;
}
delete _beamsArray;
delete _pieces;
_gameContext.getGameManager().setNextState(Game.GameStates.GameOverState);
}
}
Symbol 443 MovieClip [__Packages.Base.Entity] Frame 0
class Base.Entity extends Base.SpriteEntity
{
var _currentGameState, _nextGameState, _teamID, _followingGameState, _moveSpeed, _destPosX, _destPosY, _startingPositionX, getPositionX, _startingPositionY, getPositionY, _mc, _gameContext;
function Entity (gameContext, entType, id, teamID, spriteName, clipName, depth, posX, posY, centerPt, state) {
super(gameContext, entType, id, spriteName, clipName, depth, posX, posY, centerPt);
_currentGameState = null;
_nextGameState = new state[undefined](this);
_teamID = teamID;
}
function setNextState(state) {
_nextGameState = new state[undefined](this);
}
function setFollowingState(state) {
_followingGameState = state;
}
function getFollowingState() {
return(_followingGameState);
}
function setMoveSpeed(speed) {
_moveSpeed = speed;
}
function setDestPosX(pos) {
_destPosX = pos;
}
function setDestPosY(pos) {
_destPosY = pos;
}
function setStartingPositionToPosition() {
_startingPositionX = getPositionX();
_startingPositionY = getPositionY();
}
function getMoveSpeed() {
return(_moveSpeed);
}
function getDestPosX() {
return(_destPosX);
}
function getDestPosY() {
return(_destPosY);
}
function getStartingPositionX() {
return(_startingPositionX);
}
function getStartingPositionY() {
return(_startingPositionY);
}
function isAtDestination() {
return((((_mc._x == _destPosX) && (_mc._y == _destPosY)) ? true : false));
}
function Update(cpuControlled, networkControlled) {
if (_currentGameState != _nextGameState) {
_currentGameState = _nextGameState;
_currentGameState.Entry(_gameContext);
} else if (_currentGameState == _nextGameState) {
if (cpuControlled) {
_currentGameState.CPUDecision(_gameContext);
} else if (networkControlled) {
_currentGameState.NetworkDecision(_gameContext);
} else {
_currentGameState.PadInput(_gameContext);
}
_currentGameState.Update(_gameContext);
if (_currentGameState != _nextGameState) {
_currentGameState.Exit(_gameContext);
delete _currentGameState;
if (!_nextGameState) {
return(1);
}
}
}
return(0);
}
}
Symbol 444 MovieClip [__Packages.Base.GameState] Frame 0
class Base.GameState
{
function GameState () {
}
function CPUDecision(gameContext) {
return(undefined);
}
function NetworkDecision(gameContext) {
return(undefined);
}
function PadInput(gameContext) {
return(undefined);
}
function Entry(gameContext) {
return(undefined);
}
function Update(gameContext) {
return(undefined);
}
function Exit(gameContext) {
return(undefined);
}
}
Symbol 445 MovieClip [__Packages.Game.GameStates.PlayerInitState] Frame 0
class Game.GameStates.PlayerInitState extends Base.GameState
{
var _entity;
function PlayerInitState (entity) {
super();
_entity = entity;
}
function Entry(gameContext) {
return(undefined);
}
function Update(gameContext) {
_entity.setNextState(Game.GameStates.PlayerFlyingState);
return(undefined);
}
function Exit(gameContext) {
return(undefined);
}
}
Symbol 446 MovieClip [__Packages.Game.GameStates.PlayerFlyingState] Frame 0
class Game.GameStates.PlayerFlyingState extends Base.GameState
{
var _entity, degrees, speed, degSpeed, _tickCounter, _firingShot, _lastMoveDir, _startRight, _endRight, _startLeft, _endLeft, _shotCounter;
function PlayerFlyingState (entity) {
super();
_entity = entity;
degrees = 0;
speed = 10;
degSpeed = 10;
_tickCounter = 0;
_firingShot = false;
_lastMoveDir = 0;
_startRight = 22;
_endRight = 29;
_startLeft = 60;
_endLeft = 67;
_shotCounter = 1;
}
function moveDir(gameContext) {
var _local15;
var _local14;
var _local6 = 0;
var _local8 = 0;
var _local2 = 0;
var _local9 = 1;
var _local7 = 2;
var _local12 = 4;
var _local11 = 8;
if (gameContext.getPadManager().getKeyJustPressed(26)) {
_lastMoveDir = _local9;
} else if (gameContext.getPadManager().getKeyJustPressed(28)) {
_lastMoveDir = _local7;
} else if (gameContext.getPadManager().getKeyReleased(26) || (gameContext.getPadManager().getKeyReleased(28))) {
_lastMoveDir = 0;
}
var _local3 = _entity.getCurrentFrame();
if ((_lastMoveDir != _local7) && ((_lastMoveDir == _local9) || (gameContext.getPadManager().getKeyStillPressed(26)))) {
_local8 = _local8 | _local9;
_local14 = -1;
if ((_local3 == 2) || (_local3 == _startRight)) {
_entity.startAnimating(_startLeft, _endLeft, 60, false);
} else if ((_local3 >= _startRight) && (_local3 <= _endRight)) {
if (!_entity.isAnimating()) {
_entity.startAnimating(_local3, _startRight, 60, false);
}
} else if (!_entity.isAnimating()) {
_entity.startAnimating(_local3, _endLeft, 60, false);
}
} else if (gameContext.getPadManager().getKeyStillPressed(28)) {
_local8 = _local8 | _local7;
_local14 = 1;
if ((_local3 == 2) || (_local3 == _startLeft)) {
_entity.startAnimating(_startRight, _endRight, 60, false);
} else if ((_local3 >= _startLeft) && (_local3 <= _endLeft)) {
if (!_entity.isAnimating()) {
_entity.startAnimating(_local3, _startLeft, 60, false);
}
} else if (!_entity.isAnimating()) {
_entity.startAnimating(_local3, _endRight, 60, false);
}
}
if (gameContext.getPadManager().getKeyStillPressed(27) || (gameContext.getPadManager().getKeyJustPressed(27))) {
_local8 = _local8 | _local12;
_local15 = -1;
}
if (gameContext.getPadManager().getKeyStillPressed(29) || (gameContext.getPadManager().getKeyJustPressed(29))) {
_local8 = _local8 | _local11;
_local15 = 1;
}
if (_local8 == 0) {
_entity.moveToFrame(2);
return(undefined);
}
switch (_local8) {
case _local9 :
_local2 = 90;
break;
case _local7 :
_local2 = 270;
break;
case _local12 :
_local2 = 180;
break;
case _local11 :
_local2 = 0;
break;
case _local9 | _local12 :
_local2 = 135;
break;
case _local9 | _local11 :
_local2 = 45;
break;
case _local7 | _local12 :
_local2 = 225;
break;
case _local7 | _local11 :
_local2 = 315;
}
var _local13 = speed;
if (_firingShot || (gameContext.getPadManager().getKeyStillPressed(25))) {
_local13 = _local13 * 0.5;
}
_entity.getMovieClip()._x = _entity.getMovieClip()._x + (_local14 * _local13);
_entity.getMovieClip()._y = _entity.getMovieClip()._y + (_local15 * _local13);
var _local5 = degrees;
if (_local5 > _local2) {
if (((_local5 >= 180) && (_local2 >= 180)) || ((_local5 <= 180) && (_local2 <= 180))) {
_local6 = -1;
} else if (((_local5 + 180) % 360) < _local2) {
_local6 = -1;
} else {
_local6 = 1;
}
} else if (((_local5 >= 180) && (_local2 >= 180)) || ((_local5 <= 180) && (_local2 <= 180))) {
_local6 = 1;
} else if (((_local5 + 180) % 360) > _local2) {
_local6 = 1;
} else {
_local6 = -1;
}
var _local10 = _local5 - _local2;
if (_local10 < 0) {
_local10 = _local10 + 360;
}
var _local16 = ((degSpeed < _local10) ? (degSpeed) : (_local10));
if ((!_firingShot) && (!gameContext.getPadManager().getKeyStillPressed(25))) {
degrees = degrees + (_local6 * _local16);
degrees = (degrees + 360) % 360;
}
var _local18 = 3;
var _local17 = -5;
if (_entity.getMovieClip()._x < 60) {
_entity.getMovieClip()._x = 60;
}
if (_entity.getMovieClip()._y < 60) {
_entity.getMovieClip()._y = 60;
}
if (_entity.getMovieClip()._x > 540) {
_entity.getMovieClip()._x = 540;
}
if (_entity.getMovieClip()._y > 340) {
_entity.getMovieClip()._y = 340;
}
gameContext.getGameData().moveHotDog(0, _entity.getMovieClip()._x + _local18, _entity.getMovieClip()._y + _local17, degrees);
}
function Entry(gameContext) {
return(undefined);
}
function Update(gameContext) {
_firingShot = false;
if (!gameContext.getGameData().getPlayer(0).isPlayerDead()) {
if (gameContext.getPadManager().getKeyJustPressed(25)) {
gameContext.getGameData().fireShot(0);
gameContext.getGameData().getSoundModule().PlaySound("HotDogShot.wav");
_tickCounter = 1;
_firingShot = true;
} else if (gameContext.getPadManager().getKeyStillPressed(25) && (gameContext.getPadManager().getKeyTimePressed(25) > 0.5)) {
if ((_shotCounter % 6) == 0) {
gameContext.getGameData().fireShot(0);
gameContext.getGameData().getSoundModule().PlaySound("HotDogBeam.wav");
_firingShot = true;
}
_shotCounter++;
} else if (gameContext.getPadManager().getKeyJustPressed(23)) {
gameContext.getGameData().fireMissile(0);
_tickCounter = 1;
} else if (_tickCounter > 0) {
_tickCounter = _tickCounter - gameContext.getDT();
if ((_tickCounter <= 0) && (gameContext.getGameData().getPlayer(0).isShieldDown())) {
gameContext.getGameData().getPlayer(0).activateShield();
_tickCounter = 0;
}
}
moveDir(gameContext);
}
}
function Exit(gameContext) {
return(undefined);
}
}
Symbol 447 MovieClip [__Packages.Game.Missile] Frame 0
class Game.Missile
{
var _gameContext, _xPos, _yPos, _missileDepth, _missleStage, _launchTime, _currRotation, _seekTime, _mc, _launchDir, _launchSpeed, _debrisTarget, _turnSpeed;
function Missile (gameContext, xPos, yPos, depth, currentRotation) {
_gameContext = gameContext;
_xPos = xPos;
_yPos = yPos;
_missileDepth = depth;
_missleStage = 0;
_launchTime = 0;
_currRotation = currentRotation;
_seekTime = 5;
Init();
}
function getMovieClip() {
return(_mc);
}
function Init() {
_mc = _root.attachMovie("missile", "_missile" + _missileDepth, _missileDepth++);
_mc._x = _xPos;
_mc._y = _yPos;
var _local4 = _currRotation - 90;
var _local3 = Math.floor(Math.random() * 180);
_launchDir = _local4 + _local3;
if (_launchDir < 0) {
_launchDir = _launchDir + 360;
}
if (_launchDir > 360) {
_launchDir = _launchDir - 360;
}
_launchSpeed = Math.floor(Math.random() * 250);
_launchSpeed = _launchSpeed + 50;
_launchTime = Math.random() + 0.5;
_debrisTarget = -1;
_turnSpeed = 0;
}
function checkCollision() {
var _local6;
var _local5;
var _local4;
var _local3;
var _local7;
var _local2 = 0;
while (_local2 < _gameContext.getGameData().getDebrisManager()._activeDebris.length) {
_local6 = _gameContext.getGameData().getDebrisManager()._activeDebris[_local2].getPositionX();
_local5 = _gameContext.getGameData().getDebrisManager()._activeDebris[_local2].getPositionY();
_local4 = _local6 - _mc._x;
_local3 = _local5 - _mc._y;
_local7 = Math.sqrt((_local4 * _local4) + (_local3 * _local3));
if (_local7 < 15) {
_gameContext.getGameData().destroyDebris(_local2, _local6, _local5, 1, 1);
_mc.removeMovieClip();
delete _mc;
return(1);
}
_local2++;
}
if (_gameContext.getGameData().getEnemyManager().getActiveEnemy() != undefined) {
_local6 = _gameContext.getGameData().getEnemyManager().getActiveEnemy().getEnemyMC()._x;
_local5 = _gameContext.getGameData().getEnemyManager().getActiveEnemy().getEnemyMC()._y;
_local4 = _local6 - _mc._x;
_local3 = _local5 - _mc._y;
_local7 = Math.sqrt((_local4 * _local4) + (_local3 * _local3));
if (_local7 < 25) {
if (!_gameContext.getGameData().getEnemyManager().getActiveEnemy().isKilled()) {
_gameContext.getGameData().getEnemyManager().getActiveEnemy().HitMe("missile");
}
_mc.removeMovieClip();
delete _mc;
return(1);
}
}
return(0);
}
function update() {
switch (_missleStage) {
case 0 :
var _local9 = (_launchDir * Math.PI) / 180;
var _local10 = _gameContext.getDT();
var _local7 = _launchSpeed;
var _local2 = _local7 * _local10;
var _local4 = _local2 * Math.sin(_local9);
var _local3 = _local2 * (-Math.cos(_local9));
var _local11 = (((_launchDir < 90) || (_launchDir > 270)) ? -1 : 1);
var _local6 = _mc._x + _local4;
var _local5 = _mc._y + _local3;
_launchSpeed = _launchSpeed * 0.9;
if (checkCollision()) {
return(1);
}
_launchTime = _launchTime - _gameContext.getDT();
if ((_launchTime < 0) || (_local2 < 3)) {
_missleStage = 1;
_debrisTarget = _gameContext.getGameData().getDebrisToTarget(_local6, _local5);
_local9 = Math.atan2(_local3, _local4);
_currRotation = ((_local9 * 180) / Math.PI) + 90;
if (_currRotation < 0) {
_currRotation = _currRotation + 360;
}
_mc._rotation = _currRotation;
}
_mc._x = _local6;
_mc._y = _local5;
_turnSpeed = 2;
break;
case 1 :
if (_seekTime > 0) {
var _local8;
if (_debrisTarget == 25) {
} else {
_local8 = seekDebris(_debrisTarget, _gameContext.getGameData().getDebrisManager()._activeDebris[_debrisTarget].getDebrisMC());
}
if (_local8) {
return(1);
}
}
break;
case 2 :
}
return(0);
}
function getNewRotation(currRot, targetRot, targetSpeed) {
if (currRot == targetRot) {
return(currRot);
}
var _local3;
var _local2;
if ((!((targetRot <= 90) && (currRot >= 270))) && ((currRot > targetRot) || ((currRot <= 90) && (targetRot >= 270)))) {
_local2 = currRot - targetRot;
if (_local2 < 0) {
_local2 = _local2 + 360;
}
if (_local2 < targetSpeed) {
_local3 = currRot - _local2;
} else {
_local3 = currRot - targetSpeed;
}
} else {
_local2 = targetRot - currRot;
if (_local2 < 0) {
_local2 = _local2 + 360;
}
if (_local2 < targetSpeed) {
_local3 = currRot + _local2;
} else {
_local3 = currRot + targetSpeed;
}
}
if (_local3 < 0) {
_local3 = _local3 + 360;
}
if (_local3 >= 360) {
_local3 = _local3 - 360;
}
return(_local3);
}
function seekDebris(_index, _mcTarget) {
var _local9;
var _local7;
if (checkCollision()) {
return(1);
}
_local9 = _mcTarget._x;
_local7 = _mcTarget._y;
var _local13 = _local9 - _mc._x;
var _local12 = _local7 - _mc._y;
var _local3 = Math.atan2(_local12, _local13);
var _local2 = ((_local3 * 180) / Math.PI) + 90;
if (_local2 < 0) {
_local2 = _local2 + 360;
}
_currRotation = getNewRotation(_currRotation, _local2, 20);
_local3 = (_currRotation * Math.PI) / 180;
var _local14 = _gameContext.getDT();
var _local8 = 400;
var _local4 = _local8 * _local14;
var _local6 = _local4 * Math.sin(_local3);
var _local5 = _local4 * (-Math.cos(_local3));
var _local11 = _mc._x + _local6;
var _local10 = _mc._y + _local5;
_mc._x = _local11;
_mc._y = _local10;
_mc._rotation = _currRotation;
return(0);
}
}
Symbol 448 MovieClip [__Packages.Game.GameStates.GameOverState] Frame 0
class Game.GameStates.GameOverState extends Base.GameState
{
var _timer, _startGameBtn;
function GameOverState () {
super();
}
function Entry(gameContext) {
_timer = 1.5;
var _local5 = gameContext.getGameData().getDebrisManager().getScore();
var _local4 = gameContext.getGameData().getDebrisManager().getDebrisDestroyedCounter();
var _local7 = gameContext.getGameData().getMaxMultiplier();
gameContext.getGameData().resetGameData();
gameContext.getGameData().StopAllSounds();
if (!_global.MUSIC_MUTE) {
_global.titleSound.start(0, 10);
}
var _local6 = random(3);
gameContext.getGameData().getSoundModule().PlaySound(("EndingVO" + _local6) + ".wav", 60, 0, 0, false);
gameContext.getGameData().setBackground(0, 0, "GameOverCard", "GameOverCard", 10, 0, 0, 2, -1, -1);
gameContext.getGameData().getBackground().getMovieClip()._scoreText.text = _local5;
gameContext.getGameData().getBackground().getMovieClip()._debrisText.text = _local4;
gameContext.getGameData().getBackground().getMovieClip()._comboText.text = _local7;
_startGameBtn = new Base.SpriteEntity(gameContext, 0, 5, "StartGameBtn", "StartGameBtn", 500, 208, 319, 2, -1, -1);
}
function Update(gameContext) {
if (_startGameBtn.isMouseOver()) {
_startGameBtn.moveToFrame(2);
if (gameContext.getPadManager().getMouseJustPressed()) {
gameContext.getGameManager().setNextState(Game.GameStates.InplayGameState);
}
} else {
_startGameBtn.moveToFrame(1);
}
if ((gameContext.getPadManager().getKeyJustPressed(30) || (gameContext.getPadManager().getKeyJustPressed(23))) || (gameContext.getPadManager().getKeyJustPressed(25))) {
gameContext.getGameManager().setNextState(Game.GameStates.InplayGameState);
}
return(undefined);
}
function Exit(gameContext) {
}
}
Symbol 449 MovieClip [__Packages.Game.GameStates.InplayGameState] Frame 0
class Game.GameStates.InplayGameState extends Base.GameState
{
var _mc, my_color, _transitionInterval, _currentTransition, _transitionTime, myColorTransform;
function InplayGameState () {
super();
}
function Entry(gameContext) {
gameContext.getGameData().changeBackground("BackGround", "BackGround");
_mc = gameContext.getGameData().getBackground().getMovieClip();
_mc._x = 300;
_mc._y = 200;
gameContext.getGameData().setHostPlayer(0);
gameContext.getGameData().createGameboard();
gameContext.getGameData().StopAllSounds();
my_color = new Color(_mc);
_transitionInterval = 30;
_currentTransition = 0;
_transitionTime = _transitionInterval / 100;
myColorTransform = {ra:100, rb:0, ga:0, gb:0, ba:0, bb:0, aa:100, ab:0};
_global.titleSound.stop();
gameContext.getGameData().getSoundModule().PlayMusic("debris.wav");
gameContext.getGameData().getSoundModule().PlaySound("GeraldTalk.wav", 60, 0, 0, false);
return(undefined);
}
function Update(gameContext) {
if (gameContext.getPadManager().getKeyJustPressed(12)) {
_global.MUSIC_MUTE = !_global.MUSIC_MUTE;
gameContext.getGameData().getSoundModule().SetMusicMute(_global.MUSIC_MUTE);
}
gameContext.getGameData().getPlayer(0).Update();
if (!gameContext.getGameData().getPlayer(0).isPlayerDead()) {
gameContext.getGameData().getDebrisManager().Update();
gameContext.getGameData().getEnemyManager().Update();
gameContext.getGameData().getNPCManager().Update();
}
_transitionTime = _transitionTime - gameContext.getDT();
if (_transitionTime < 0) {
_transitionTime = _transitionInterval / 100;
switch (_currentTransition) {
case 0 :
myColorTransform.ba++;
if (myColorTransform.ba == 100) {
_currentTransition = 1;
}
break;
case 1 :
myColorTransform.ra--;
if (myColorTransform.ra == 0) {
_currentTransition = 2;
}
break;
case 2 :
myColorTransform.ga++;
if (myColorTransform.ga == 100) {
_currentTransition = 3;
}
break;
case 3 :
myColorTransform.ba--;
if (myColorTransform.ba == 0) {
_currentTransition = 4;
}
break;
case 4 :
myColorTransform.ra++;
if (myColorTransform.ra == 100) {
_currentTransition = 5;
}
break;
case 5 :
myColorTransform.ga--;
if (myColorTransform.ga == 0) {
_currentTransition = 0;
}
break;
}
}
my_color.setTransform(myColorTransform);
return(undefined);
}
function Exit(gameContext) {
delete my_color;
return(undefined);
}
var _tickCounter = 0;
}
Symbol 450 MovieClip [__Packages.Game.DebrisManager] Frame 0
class Game.DebrisManager
{
var _gameContext, _activeDebris, _comboDebris, _explosionArray, _comboDebrisDepth, _explosionDepth, _debrisDepth, temp1, temp2, _maxDebris, _increment, _comboArtArray, q, _posXY, _score, _debrisDestroyedCounter, dx, dy, d, comboArt;
function DebrisManager (gameContext) {
_gameContext = gameContext;
_activeDebris = [];
_comboDebris = [];
_explosionArray = [];
_comboDebrisDepth = 4000;
_explosionDepth = 50;
_debrisDepth = 3000;
temp1 = [];
temp2 = [];
_maxDebris = 7;
_increment = 0;
_comboArtArray = [];
q = 0;
_posXY = new Object();
_posXY.x = -1;
_posXY.y = -1;
Init();
}
function Init() {
_score = 0;
var _local2 = 0;
while (_local2 < _maxDebris) {
_posXY = getRandomXY();
_activeDebris.push(new Game.Debris(_gameContext, getRandom(), _posXY.x, _posXY.y, _debrisDepth++));
_local2++;
}
_debrisDestroyedCounter = 0;
}
function getRandomXY() {
if ((Math.random() * 10) < 5) {
_posXY.y = Math.random() * 400;
if ((Math.random() * 10) < 5) {
_posXY.x = -10;
} else {
_posXY.x = 610;
}
} else {
_posXY.x = Math.random() * 600;
if ((Math.random() * 10) < 5) {
_posXY.y = -10;
} else {
_posXY.y = 410;
}
}
return(_posXY);
}
function getActiveDebrisArray() {
return(_activeDebris);
}
function getComboDebrisArray() {
return(_comboDebris);
}
function getDebrisDestroyedCounter() {
return(_debrisDestroyedCounter);
}
function getScore() {
return(_score);
}
function getRandom() {
var _local1;
if (random(10) < 5) {
_local1 = 0;
} else {
_local1 = 1;
}
return(_local1);
}
function getRandomX() {
var _local3;
var _local2 = 0;
while (_local2 < 10) {
temp1[_local2] = _local2 - 20;
_local2++;
}
_local2 = 10;
while (_local2 < 20) {
temp1[_local2] = 610 + _local2;
_local2++;
}
_local3 = temp1[random(temp1.length)];
return(_local3);
}
function getRandomY() {
var _local3;
var _local2 = 0;
while (_local2 < 10) {
temp2[_local2] = _local2 - 10;
_local2++;
}
_local2 = 10;
while (_local2 < 20) {
temp2[_local2] = 400 + _local2;
_local2++;
}
_local3 = temp2[random(temp2.length)];
return(_local3);
}
function Update() {
var _local2 = 0;
while (_local2 < _comboArtArray.length) {
moveComboArt(_comboArtArray[_local2]);
_local2++;
}
if (_explosionDepth >= 150) {
_explosionDepth = 50;
}
if (_comboDebrisDepth >= 5000) {
_comboDebrisDepth = 4000;
}
if (_debrisDepth >= 4000) {
_debrisDepth = 3000;
}
if (_debrisDestroyedCounter == 25) {
_increment = 1;
}
if (_debrisDestroyedCounter == 50) {
_increment = 2;
}
if (_debrisDestroyedCounter == 75) {
_increment = 3;
}
if (_debrisDestroyedCounter == 100) {
_increment = 4;
}
if (_debrisDestroyedCounter == 125) {
_increment = 5;
}
if (_gameContext.getGameData().getEnemyManager().getActiveEnemy() != undefined) {
_maxDebris = 4;
} else {
_maxDebris = 7 + _increment;
}
if (_activeDebris.length < _maxDebris) {
_posXY = getRandomXY();
_activeDebris.push(new Game.Debris(_gameContext, getRandom(), _posXY.x, _posXY.y, _debrisDepth++));
}
_local2 = 0;
while (_local2 < _activeDebris.length) {
_activeDebris[_local2].Update();
dx = _activeDebris[_local2].getDebrisMC()._x - _gameContext.getGameData().getPlayer(0).getPositionX();
dy = _activeDebris[_local2].getDebrisMC()._y - _gameContext.getGameData().getPlayer(0).getPositionY();
d = Math.sqrt((dx * dx) + (dy * dy));
if (d < 75) {
if (!_gameContext.getGameData().getPlayer(0).isShieldDown()) {
_gameContext.getGameData().destroyDebris(_local2, _activeDebris[_local2].getDebrisMC()._x, _activeDebris[_local2].getDebrisMC()._y, 1);
_gameContext.getGameData().getPlayer(0).deactivateShield();
} else if (d < 20) {
_gameContext.getGameData().destroyDebris(_local2, _activeDebris[_local2].getDebrisMC()._x, _activeDebris[_local2].getDebrisMC()._y, 1);
_gameContext.getGameData().getPlayer(0).killPlayer();
}
break;
}
_local2++;
}
_local2 = 0;
while (_local2 < _comboDebris.length) {
_comboDebris[_local2].Update();
_local2++;
}
_local2 = 0;
while (_local2 < _explosionArray.length) {
var _local3 = _explosionArray[_local2].animateSprite();
if (_local3 > 12) {
_explosionArray[_local2].getMovieClip().removeMovieClip();
_explosionArray.splice(_local2, 1);
}
_local2++;
}
}
function destroyDebris(i, xPos, yPos, byObj, comboMultiplier) {
_debrisDestroyedCounter++;
_gameContext.getGameData().getScoreBoard().setDebrisDestroyedCounter(_debrisDestroyedCounter);
var _local7 = _activeDebris[i].getDebrisType();
var _local9 = _activeDebris[i]._debris.getMovieClip().getDepth();
_activeDebris[i]._debris.getMovieClip().removeMovieClip();
_activeDebris.splice(i, 1);
var _local4;
switch (byObj) {
case 0 :
if (_local7 == 1) {
_local4 = new Base.SpriteEntity(_gameContext, 27, 22, "RedExplosion", "RedExplosion" + _explosionDepth, _explosionDepth++, xPos, yPos, -1, -1, -1);
_gameContext.getGameData().getSoundModule().PlaySound(("RDExplosion" + random(3)) + ".wav", 30, 0, 0, 1);
_comboDebris.push(new Game.ComboDebris(_gameContext, xPos, yPos, _comboDebrisDepth, comboMultiplier));
_comboDebrisDepth = _comboDebrisDepth + 4;
_score = _score + (30 * comboMultiplier);
if (comboMultiplier != 1) {
comboArt = _root.attachMovie("ComboArt", "ComboArt" + comboMultiplier, (_comboDebrisDepth + 50000) + (q++));
comboArt.comboArtText.text = "x" + comboMultiplier;
comboArt._x = xPos;
comboArt._y = yPos;
_comboArtArray.push(comboArt);
}
if (comboMultiplier > _gameContext.getGameData().getMaxMultiplier()) {
_gameContext.getGameData().setMaxMultiplier(comboMultiplier);
}
_gameContext.getGameData().getScoreBoard().setScore(_score);
} else {
_local4 = new Base.SpriteEntity(_gameContext, 27, 22, "BlueExplosion", "BlueExplosion" + _explosionDepth, _explosionDepth++, xPos, yPos, -1, -1, -1);
_gameContext.getGameData().getSoundModule().PlaySound(("BDExplosion" + random(3)) + ".wav", 30, 0, 0, 1);
_score = _score + (10 * comboMultiplier);
_gameContext.getGameData().getScoreBoard().setScore(_score);
}
break;
case 1 :
if (_local7 == 1) {
_local4 = new Base.SpriteEntity(_gameContext, 27, 22, "RedExplosion", "RedExplosion" + _explosionDepth, _explosionDepth++, xPos, yPos, -1, -1, -1);
_gameContext.getGameData().getSoundModule().PlaySound(("RDExplosion" + random(3)) + ".wav", 30, 0, 0, 1);
_score = _score + 10;
_gameContext.getGameData().getScoreBoard().setScore(_score);
} else {
_local4 = new Base.SpriteEntity(_gameContext, 27, 22, "BlueExplosion", "BlueExplosion" + _explosionDepth, _explosionDepth++, xPos, yPos, -1, -1, -1);
_gameContext.getGameData().getSoundModule().PlaySound(("BDExplosion" + random(3)) + ".wav", 30, 0, 0, 1);
_score = _score + 10;
_gameContext.getGameData().getScoreBoard().setScore(_score);
}
}
_local4.startAnimating(1, 13, 50, false);
_explosionArray.push(_local4);
if (_gameContext.getGameData().getEnemyManager().getActiveEnemy() != undefined) {
_maxDebris = 4;
} else {
_maxDebris = 7 + _increment;
}
if (_activeDebris.length < _maxDebris) {
_posXY = getRandomXY();
_activeDebris.push(new Game.Debris(_gameContext, getRandom(), _posXY.x, _posXY.y, _local9));
}
}
function moveComboArt(obj) {
obj._y = obj._y - 8;
}
function freeMemory() {
var _local2 = 0;
while (_local2 < _activeDebris.length) {
_activeDebris[_local2].getDebrisMC().removeMovieClip();
_local2++;
}
delete _activeDebris;
_local2 = 0;
while (_local2 < _explosionArray.length) {
_explosionArray[_local2].getMovieClip().removeMovieClip();
_local2++;
}
delete _explosionArray;
_local2 = 0;
while (_local2 < _comboArtArray.length) {
_comboArtArray[_local2].removeMovieClip();
_local2++;
}
delete _comboArtArray;
_local2 = 0;
while (_local2 < _comboDebris.length) {
_comboDebris[_local2].destroyComboDebrisParts();
_local2++;
}
delete _comboDebris;
}
}
Symbol 451 MovieClip [__Packages.Game.Debris] Frame 0
class Game.Debris
{
var _gameContext, _debrisType, _xPos, _yPos, _depth, _angle, _velocity, _debris, myColorTransform, _debrisMC, my_color, _maxSpeed, _accel, _fric, _agility, _speed, _count, _aby;
function Debris (gameContext, type, xPos, yPos, depth) {
_gameContext = gameContext;
_debrisType = type;
_xPos = xPos;
_yPos = yPos;
_depth = depth;
Init();
_angle = Math.random() * 360;
_velocity = 25;
}
function getAngle() {
return(_angle);
}
function setAngle(toSet) {
_angle = toSet;
}
function getPositionX() {
return(_xPos);
}
function getPositionY() {
return(_yPos);
}
function Init() {
if (_debrisType == 0) {
_debris = new Base.Entity(_gameContext, 5, 20, 20, "Debris", "Debris" + _depth, _depth, _xPos, _yPos, -1, Game.GameStates.DebrisIdleState);
myColorTransform = {ra:100, rb:0, ga:100, gb:45, ba:100, bb:100, aa:100, ab:0};
} else {
_debris = new Base.Entity(_gameContext, 5, 21, 21, "Debris", "Debris" + _depth, _depth, _xPos, _yPos, -1, Game.GameStates.DebrisIdleState);
myColorTransform = {ra:100, rb:255, ga:100, gb:0, ba:100, bb:0, aa:100, ab:0};
}
_debrisMC = _debris.getMovieClip();
my_color = new Color(_debrisMC);
my_color.setTransform(myColorTransform);
_debris.startAnimating(1, 95, 22, true);
}
function getDebrisType() {
return(_debrisType);
}
function getDebrisMC() {
return(_debrisMC);
}
function getDebrisDepth() {
return(_depth);
}
function Update() {
Move();
var _local2 = _debris.animateSprite();
}
function Move() {
var _local18 = _gameContext.getDT();
var _local16 = _velocity;
var _local6 = _local16 * 2;
var _local12 = _local6 * Math.cos(((_angle - 90) * Math.PI) / 180);
var _local11 = _local6 * Math.sin(((_angle - 90) * Math.PI) / 180);
var _local15 = _debrisMC._x + _local12;
var _local14 = _debrisMC._y + _local11;
var _local13 = 20;
var _local19 = -1;
var _local7;
var _local4;
var _local3;
var _local10;
var _local9;
var _local17;
_local17 = new Object();
_local17.x = 0;
_local17.y = 0;
var _local2 = 0;
while (_local2 < _gameContext.getGameData().getDebrisManager()._activeDebris.length) {
if (_gameContext.getGameData().getDebrisManager()._activeDebris[_local2] == this) {
_local13 = _local2;
} else if (_local2 > _local13) {
} else {
_local7 = _gameContext.getGameData().getDebrisManager()._activeDebris[_local2].getAngle();
_local4 = _gameContext.getGameData().getDebrisManager()._activeDebris[_local2].getPositionX();
_local3 = _gameContext.getGameData().getDebrisManager()._activeDebris[_local2].getPositionY();
_local12 = _local6 * Math.cos(((_local7 - 90) * Math.PI) / 180);
_local11 = _local6 * Math.sin(((_local7 - 90) * Math.PI) / 180);
_local10 = _local4 + _local12;
_local9 = _local3 + _local11;
var _local8 = Math.sqrt(((_debrisMC._x - _local4) * (_debrisMC._x - _local4)) + ((_debrisMC._y - _local3) * (_debrisMC._y - _local3)));
var _local5 = 4 + (Math.random() * 4);
if ((_local8 < 35) || (Base.TwoDMath.intersect2D(_debrisMC._x, _debrisMC._y, _local15, _local14, _local4, _local3, _local10, _local9))) {
if (_local4 > _debrisMC.x) {
if (_local3 < _debrisMC.y) {
_angle = _angle + _local5;
} else {
_angle = _angle - _local5;
}
} else if (_local3 < _debrisMC.y) {
_angle = _angle - _local5;
} else {
_angle = _angle + _local5;
}
}
}
_local2++;
}
_local6 = _local16 * _local18;
_local12 = _local6 * Math.cos(((_angle - 90) * Math.PI) / 180);
_local11 = _local6 * Math.sin(((_angle - 90) * Math.PI) / 180);
_debrisMC._x = _debrisMC._x + _local12;
_debrisMC._y = _debrisMC._y + _local11;
_debrisMC._x = _debrisMC._x % 610;
_debrisMC._y = _debrisMC._y % 410;
if (_debrisMC._x < -10) {
_debrisMC._x = 610;
}
if (_debrisMC._y < -10) {
_debrisMC._y = 410;
}
_xPos = _debrisMC._x;
_yPos = _debrisMC._y;
}
function Wander() {
if (_maxSpeed == undefined) {
_maxSpeed = 15;
_velocity = 1;
_accel = 0.5;
_fric = 0.1;
_agility = 5;
_speed = 1;
_count = 0;
_angle = 30;
}
_velocity = _velocity + _accel;
_speed = _speed + (0.15 - random(2));
if (_speed > _maxSpeed) {
_speed = _maxSpeed;
}
if (_speed < 1) {
_speed = 1;
}
_aby = (1 - Math.round(Math.random() * 2)) * _agility;
_count++;
if ((_count % 200) == 0) {
_aby = 45 - random(90);
}
_angle = _angle + _aby;
_debrisMC._x = _debrisMC._x + (_speed * Math.cos((_angle * Math.PI) / 180));
_debrisMC._y = _debrisMC._y + (_speed * Math.sin((_angle * Math.PI) / 180));
_debrisMC._x = _debrisMC._x % 600;
_debrisMC._y = _debrisMC._y % 400;
if (_debrisMC._x < 0) {
_debrisMC._x = 400;
}
if (_debrisMC._y < 0) {
_debrisMC._y = 400;
}
}
function removeDebris() {
_debris.removeSprite();
delete my_color;
delete _debris;
}
}
Symbol 452 MovieClip [__Packages.Game.GameStates.DebrisIdleState] Frame 0
class Game.GameStates.DebrisIdleState extends Base.GameState
{
var _entity;
function DebrisIdleState (entity) {
super();
_entity = entity;
}
function Entry(gameContext) {
_entity.startAnimating(2, 9, 24, false);
return(undefined);
}
function Update(gameContext) {
_entity.animateSprite();
return(undefined);
}
function Exit(gameContext) {
return(undefined);
}
}
Symbol 453 MovieClip [__Packages.Game.ComboDebris] Frame 0
class Game.ComboDebris
{
var _gameContext, _xPos, _yPos, _depth, _clockTicks, _activeDebrisArray, q, _multiplier, _comboDebrisPart1, _comboDebrisPart2, _comboDebrisPart3, _comboDebrisPart4;
function ComboDebris (gameContext, xPos, yPos, depth, multiplier) {
_gameContext = gameContext;
_xPos = xPos;
_yPos = yPos;
_depth = depth;
_clockTicks = 1;
_activeDebrisArray = [];
q = 0;
_multiplier = multiplier;
Init();
}
function Init() {
_comboDebrisPart1 = new Base.Entity(_gameContext, 100, 100, 100, "ComboDebris", "ComboDebris" + _depth, _depth++, _xPos, _yPos, -1, Game.GameStates.DebrisIdleState);
_comboDebrisPart2 = new Base.Entity(_gameContext, 100, 100, 100, "ComboDebris", "ComboDebris" + _depth, _depth++, _xPos, _yPos, -1, Game.GameStates.DebrisIdleState);
_comboDebrisPart3 = new Base.Entity(_gameContext, 100, 100, 100, "ComboDebris", "ComboDebris" + _depth, _depth++, _xPos, _yPos, -1, Game.GameStates.DebrisIdleState);
_comboDebrisPart4 = new Base.Entity(_gameContext, 100, 100, 100, "ComboDebris", "ComboDebris" + _depth, _depth, _xPos, _yPos, -1, Game.GameStates.DebrisIdleState);
}
function Update() {
if ((_clockTicks++) > 30) {
destroyComboDebrisParts();
} else {
move();
checkCollision(_comboDebrisPart1);
checkCollision(_comboDebrisPart2);
checkCollision(_comboDebrisPart3);
checkCollision(_comboDebrisPart4);
}
}
function checkCollision(_comboDebris) {
var _local6;
var _local5;
var _local4;
_activeDebrisArray = _gameContext.getGameData().getDebrisManager().getActiveDebrisArray();
var _local2 = 0;
while (_local2 < _activeDebrisArray.length) {
_local5 = _activeDebrisArray[_local2].getDebrisMC()._x - _comboDebris.getMovieClip()._x;
_local4 = _activeDebrisArray[_local2].getDebrisMC()._y - _comboDebris.getMovieClip()._y;
_local6 = Math.sqrt((_local5 * _local5) + (_local4 * _local4));
if (_local6 < 25) {
_multiplier++;
var _local8 = _activeDebrisArray[_local2]._debris.getMovieClip()._x;
var _local7 = _activeDebrisArray[_local2]._debris.getMovieClip()._y;
_gameContext.getGameData().destroyDebris(_local2, _activeDebrisArray[_local2]._debris.getMovieClip()._x, _activeDebrisArray[_local2]._debris.getMovieClip()._y, 0, _multiplier);
_comboDebris.getMovieClip().removeMovieClip();
delete eval (_comboDebris());
break;
}
_local2++;
}
var _local9 = _gameContext.getGameData().getActiveEnemy();
if (_local9 != undefined) {
if (_local9.getEnemyMC().hitTest(_comboDebris.getMovieClip()._x, _comboDebris.getMovieClip()._y, false) == true) {
if (!_local9.isKilled()) {
_local9.HitMe("shot");
}
_comboDebris.getMovieClip().removeMovieClip();
delete eval (_comboDebris());
}
}
_local5 = _comboDebris.getMovieClip()._x - _gameContext.getGameData().getPlayer(0).getPositionX();
_local4 = _comboDebris.getMovieClip()._y - _gameContext.getGameData().getPlayer(0).getPositionY();
_local6 = Math.sqrt((_local5 * _local5) + (_local4 * _local4));
if ((_local6 < 25) && (_gameContext.getGameData().getPlayer(0).isShieldDown())) {
_gameContext.getGameData().getPlayer(0).killPlayer();
_comboDebris.getMovieClip().removeMovieClip();
delete eval (_comboDebris());
} else if ((_local6 < 60) && (!_gameContext.getGameData().getPlayer(0).isShieldDown())) {
_gameContext.getGameData().getPlayer(0).deactivateShield();
_comboDebris.getMovieClip().removeMovieClip();
delete eval (_comboDebris());
}
}
function destroyComboDebrisParts() {
_comboDebrisPart1.getMovieClip().removeMovieClip();
_comboDebrisPart2.getMovieClip().removeMovieClip();
_comboDebrisPart3.getMovieClip().removeMovieClip();
_comboDebrisPart4.getMovieClip().removeMovieClip();
delete _comboDebrisPart1;
delete _comboDebrisPart2;
delete _comboDebrisPart3;
delete _comboDebrisPart4;
}
function move() {
if (_comboDebrisPart1.getMovieClip() != undefined) {
_comboDebrisPart1.getMovieClip()._x = Math.round(_comboDebrisPart1.getMovieClip()._x) + 4;
_comboDebrisPart1.getMovieClip()._y = Math.round(_comboDebrisPart1.getMovieClip()._y) + 4;
}
if (_comboDebrisPart2.getMovieClip() != undefined) {
_comboDebrisPart2.getMovieClip()._x = Math.round(_comboDebrisPart2.getMovieClip()._x) + 4;
_comboDebrisPart2.getMovieClip()._y = Math.round(_comboDebrisPart2.getMovieClip()._y) - 4;
}
if (_comboDebrisPart3.getMovieClip() != undefined) {
_comboDebrisPart3.getMovieClip()._x = Math.round(_comboDebrisPart3.getMovieClip()._x) - 4;
_comboDebrisPart3.getMovieClip()._y = Math.round(_comboDebrisPart3.getMovieClip()._y) + 4;
}
if (_comboDebrisPart4.getMovieClip() != undefined) {
_comboDebrisPart4.getMovieClip()._x = Math.round(_comboDebrisPart4.getMovieClip()._x) - 4;
_comboDebrisPart4.getMovieClip()._y = Math.round(_comboDebrisPart4.getMovieClip()._y) - 4;
}
}
}
Symbol 454 MovieClip [__Packages.Game.EnemyManager] Frame 0
class Game.EnemyManager
{
var _gameContext, counter, relativeDebrisKilled, _activeEnemy;
function EnemyManager (gameContext) {
_gameContext = gameContext;
counter = 0;
relativeDebrisKilled = 20;
Init();
}
function Init() {
}
function getActiveEnemy() {
return(_activeEnemy);
}
function inRange(num, low, high) {
return((((num >= low) && (num <= high)) ? true : false));
}
function gotKilled(name) {
var _local2 = _gameContext.getGameData().getDebrisManager().getDebrisDestroyedCounter();
if (name == "Catman") {
relativeDebrisKilled = _local2 + 30;
}
if (name == "Robot") {
relativeDebrisKilled = _local2 + 50;
}
if (name == "Aerocat") {
relativeDebrisKilled = _local2 + 75;
}
if (name == "AnimeGod") {
relativeDebrisKilled = _local2 + 100;
}
if (name == "Coiffio") {
relativeDebrisKilled = _local2 + 30;
}
}
function Update() {
var _local2 = _gameContext.getGameData().getDebrisManager().getDebrisDestroyedCounter();
if (((counter % 5) == 0) && (inRange(_local2, relativeDebrisKilled, relativeDebrisKilled + 9))) {
if (_activeEnemy == undefined) {
counter++;
spawnEnemy(1);
}
} else if (((counter % 5) == 1) && (inRange(_local2, relativeDebrisKilled, relativeDebrisKilled + 9))) {
if (_activeEnemy == undefined) {
counter++;
spawnEnemy(2);
}
} else if (((counter % 5) == 2) && (inRange(_local2, relativeDebrisKilled, relativeDebrisKilled + 9))) {
if (_activeEnemy == undefined) {
counter++;
spawnEnemy(3);
}
} else if (((counter % 5) == 3) && (inRange(_local2, relativeDebrisKilled, relativeDebrisKilled + 9))) {
if (_activeEnemy == undefined) {
counter++;
spawnEnemy(4);
}
} else if (((counter % 5) == 4) && (inRange(_local2, relativeDebrisKilled, relativeDebrisKilled + 9))) {
if (_activeEnemy == undefined) {
counter++;
spawnEnemy(5);
}
}
if (_activeEnemy != undefined) {
_activeEnemy.Update();
if ((_activeEnemy.getHealth() <= 0) && (_activeEnemy.isKilled() == false)) {
_activeEnemy.Kill();
} else if (_activeEnemy.isKilled() == true) {
if (_activeEnemy.Remove()) {
delete _activeEnemy;
}
}
}
}
function spawnEnemy(enemyNum) {
switch (enemyNum) {
case 1 :
_activeEnemy = new Game.Catman(_gameContext, 6000);
_gameContext.getGameData().getSoundModule().PlaySound("EnemyAappears.wav", 100, 0, 0, 1);
_gameContext.getGameData().getSoundModule().StopMusic();
_gameContext.getGameData().getSoundModule().PlayMusic("generalenemy.wav");
break;
case 2 :
_activeEnemy = new Game.ModelRobot(_gameContext, 6100);
_gameContext.getGameData().getSoundModule().PlaySound("EnemyAappears.wav", 40, 0, 0, 1);
_gameContext.getGameData().getSoundModule().StopMusic();
_gameContext.getGameData().getSoundModule().PlayMusic("generalenemy.wav");
break;
case 3 :
_activeEnemy = new Game.Aerocat(_gameContext, 6050);
_gameContext.getGameData().getSoundModule().PlaySound("EnemyAappears.wav", 40, 0, 0, 1);
_gameContext.getGameData().getSoundModule().StopMusic();
_gameContext.getGameData().getSoundModule().PlayMusic("generalenemy.wav");
break;
case 4 :
_activeEnemy = new Game.AnimeGod(_gameContext, 6150);
_gameContext.getGameData().getSoundModule().PlaySound("EnemyAappears.wav", 40, 0, 0, 1);
_gameContext.getGameData().getSoundModule().StopMusic();
_gameContext.getGameData().getSoundModule().PlayMusic("generalenemy.wav");
break;
case 5 :
_activeEnemy = new Game.Coiffio(_gameContext, 20001);
_gameContext.getGameData().getSoundModule().PlaySound("EnemyAappears.wav", 40, 0, 0, 1);
_gameContext.getGameData().getSoundModule().StopMusic();
_gameContext.getGameData().getSoundModule().PlayMusic("coiffio.wav");
break;
default :
_activeEnemy = new Game.Catman(_gameContext, 6000);
_gameContext.getGameData().getSoundModule().PlaySound("EnemyAappears.wav", 100, 0, 0, 1);
_gameContext.getGameData().getSoundModule().StopMusic();
_gameContext.getGameData().getSoundModule().PlayMusic("generalenemy.wav");
}
}
}
Symbol 455 MovieClip [__Packages.Game.Catman] Frame 0
class Game.Catman
{
var _gameContext, _spawnPositions, _depth, _catman, _beamsArray, _tickCounter, _shotCount, _rotate, _health, _gotKilled, _gotHit, smallCounter, _isSpriteCatman, _toggle, _rotateToggle, _spriteFrame, speed, angle, vx, vy, dx, dy, d;
function Catman (gameContext, depth) {
_gameContext = gameContext;
_spawnPositions = [[140, 190], [440, 190], [300, 125], [300, 250], [75, 325], [525, 75], [525, 325]];
_depth = depth;
Init();
}
function Init() {
var _local2 = random(7);
_catman = new Base.Entity(_gameContext, 25, 21, 21, "CatMan", "CatMan", _depth + 205, _spawnPositions[_local2][0], _spawnPositions[_local2][1], -1, Game.GameStates.EnemyInitState);
_beamsArray = [];
_tickCounter = 0;
_shotCount = 0;
_rotate = true;
_health = 500;
_gotKilled = false;
_gotHit = false;
smallCounter = 1;
_isSpriteCatman = false;
_toggle = true;
_rotateToggle = false;
_catman.changeSprite("CatManAnim", "CatManAnim");
_catman.startAnimating(1, 9, 12, false);
}
function getName() {
return("catman");
}
function getEnemyMC() {
return(_catman.getMovieClip());
}
function getHealth() {
return(_health);
}
function isKilled() {
return(_gotKilled);
}
function getMyX() {
return(_catman.getMovieClip()._x);
}
function getMyY() {
return(_catman.getMovieClip()._y);
}
function Update() {
_spriteFrame = _catman.animateSprite();
if (_gotKilled == true) {
return(undefined);
}
if ((!_catman.isAnimating()) && (_catman.getClipName() == "CatManAnim")) {
_catman.changeSprite("CatMan", "CatMan");
_isSpriteCatman = true;
}
var _local2 = 0;
while (_local2 < _beamsArray.length) {
moveBeam(_local2, _beamsArray[_local2]);
_local2++;
}
if ((_tickCounter % 20) == 0) {
_rotate = false;
}
if ((_tickCounter % 100) == 0) {
if (smallCounter == 1) {
_rotate = false;
_gameContext.getGameData().getSoundModule().PlaySound("CatMan.wav", 100, 0, 0, false);
} else {
_rotate = true;
if (!_rotateToggle) {
_rotateToggle = true;
_catman.getMovieClip()._rotation = _catman.getMovieClip()._rotation + 18;
} else {
_catman.getMovieClip()._rotation = _catman.getMovieClip()._rotation - 18;
_rotateToggle = false;
}
}
smallCounter++;
}
if (_rotate == true) {
if (_toggle) {
fireShot();
_toggle = false;
} else {
_toggle = true;
}
_catman.getMovieClip()._rotation = _catman.getMovieClip()._rotation + 18;
}
if (((_tickCounter % 10) == 0) && (_gotHit)) {
_gotHit = false;
_catman.getMovieClip()._alpha = 100;
}
_tickCounter++;
}
function fireShot() {
if (_shotCount >= 200) {
_shotCount = 1;
}
var _local3 = _root.attachMovie("cmBeam", "b" + _shotCount, _depth + _shotCount);
_local3._x = _catman.getMovieClip()._x;
_local3._y = _catman.getMovieClip()._y;
_beamsArray.push(_local3);
_local3._rotation = _catman.getMovieClip()._rotation - 40;
_shotCount++;
_gameContext.getGameData().getSoundModule().PlaySound("EnemyBullet.wav", 60, 0, 0, false);
}
function moveBeam(i, _beamMC) {
speed = 8;
angle = (_beamMC._rotation * Math.PI) / 180;
vx = Math.sin(angle) * speed;
vy = (-Math.cos(angle)) * speed;
_beamMC._x = _beamMC._x + vx;
_beamMC._y = _beamMC._y + vy;
if ((((_beamMC._x > 620) || (_beamMC._x < -20)) || (_beamMC._y < -20)) || (_beamMC._y > 420)) {
_beamMC.removeMovieClip();
_beamsArray.splice(i, 1);
} else {
dx = _beamMC._x - _gameContext.getGameData().getPlayer(0).getPositionX();
dy = _beamMC._y - _gameContext.getGameData().getPlayer(0).getPositionY();
d = Math.sqrt((dx * dx) + (dy * dy));
if (d < 60) {
if (_gameContext.getGameData().getPlayer(0).isShieldDown()) {
if (d < 15) {
_gameContext.getGameData().getPlayer(0).killPlayer();
Kill();
}
} else {
_gameContext.getGameData().getPlayer(0).deactivateShield();
_beamMC.removeMovieClip();
_beamsArray.splice(i, 1);
}
}
}
}
function HitMe(hitbyObj) {
_gameContext.getGameData().getSoundModule().PlaySound("EnemyHit.wav", 100, 0, 0, false);
if (hitbyObj == "shot") {
_health = _health - 10;
} else if (hitbyObj == "missile") {
_health = _health - 5;
}
_catman.getMovieClip()._alpha = 50;
_gotHit = true;
}
function Kill() {
_gotKilled = true;
_catman.changeSprite("CatManAnim", "CatManAnim");
_catman.startAnimating(15, 19, 5, true);
_tickCounter = 2;
_gameContext.getGameData().getSoundModule().StopSound("CatMan.wav");
_gameContext.getGameData().getSoundModule().PlaySound("EnemyDeath.wav", 100, 0, 0, false);
var _local2 = 0;
while (_local2 < _beamsArray.length) {
_beamsArray[_local2].removeMovieClip();
_local2++;
}
_gameContext.getGameData().getSoundModule().StopMusic();
_gameContext.getGameData().getSoundModule().PlayMusic("debris.wav");
_gameContext.getGameData().getEnemyManager().gotKilled("Catman");
}
function Remove() {
_tickCounter = _tickCounter - _gameContext.getDT();
if (_tickCounter > 0) {
return(0);
}
_catman.removeSprite();
delete _catman;
return(1);
}
}
Symbol 456 MovieClip [__Packages.Game.GameStates.EnemyInitState] Frame 0
class Game.GameStates.EnemyInitState extends Base.GameState
{
var _entity;
function EnemyInitState (entity) {
super();
_entity = entity;
}
function Entry(gameContext) {
return(undefined);
}
function Update(gameContext) {
return(undefined);
}
function Exit(gameContext) {
return(undefined);
}
}
Symbol 457 MovieClip [__Packages.Game.ModelRobot] Frame 0
class Game.ModelRobot
{
var _gameContext, _spawnPositions, _depth, _health, _gotKilled, _gotHit, _tickCounter, _tickCounter1, _fiveSecondTicks, _moveRobotCounter, _isSpriteModelRobot, _modelRobot, _moveRobotDir, _bullet1, _bullet2, _bullet3, _bullet4, _bullet5;
function ModelRobot (gameContext, depth) {
_gameContext = gameContext;
_spawnPositions = [[40, 40], [560, 40], [40, 360], [560, 360]];
_depth = depth;
Init();
}
function Init() {
_health = 500;
_gotKilled = false;
_gotHit = false;
_tickCounter = 0;
_tickCounter1 = 0;
_fiveSecondTicks = 1;
_moveRobotCounter = 0;
_isSpriteModelRobot = false;
var _local2 = random(4);
_modelRobot = new Base.Entity(_gameContext, 27, 21, 21, "ModelRobot", "ModelRobot", _depth + 6, _spawnPositions[_local2][0], _spawnPositions[_local2][1], -1, Game.GameStates.EnemyInitState);
_modelRobot.changeSprite("ModelRobotAnim", "ModelRobotAnim");
_modelRobot.startAnimating(1, 9, 12, false);
if (_modelRobot.getMovieClip()._x == 40) {
_moveRobotDir = "R";
} else if (_modelRobot.getMovieClip()._x == 560) {
_moveRobotDir = "L";
}
if (_modelRobot.getMovieClip()._y == 360) {
_modelRobot.getMovieClip()._yscale = _modelRobot.getMovieClip()._yscale * -1;
}
_gameContext.getGameData().getSoundModule().PlaySound("ModelRobot.wav", 100, 0, 0, false);
}
function getEnemyMC() {
return(_modelRobot.getMovieClip());
}
function Update() {
var _local2 = _modelRobot.animateSprite();
if (_gotKilled == true) {
return(undefined);
}
if ((_moveRobotCounter > 0) && (_isSpriteModelRobot == false)) {
_modelRobot.changeSprite("ModelRobot", "ModelRobot");
_isSpriteModelRobot = true;
if (_modelRobot.getMovieClip()._y == 360) {
_modelRobot.getMovieClip()._yscale = _modelRobot.getMovieClip()._yscale * -1;
}
}
if ((_modelRobot.getMovieClip()._x == 40) || (_modelRobot.getMovieClip()._x == 560)) {
if ((_fiveSecondTicks % 120) == 0) {
_fiveSecondTicks = 1;
moveRobot();
_moveRobotCounter++;
} else {
_fiveSecondTicks++;
}
} else {
moveRobot();
_moveRobotCounter++;
}
moveBullet(_bullet1);
moveBullet(_bullet2);
moveBullet(_bullet3);
moveBullet(_bullet4);
moveBullet(_bullet5);
if (((_tickCounter1 % 10) == 0) && (_gotHit)) {
_gotHit = false;
_modelRobot.getMovieClip()._alpha = 100;
}
_tickCounter1++;
}
function fire() {
var _local3 = new Object();
if (_modelRobot.getMovieClip()._x == 60) {
_bullet1 = _root.attachMovie("MRBeam", ("bullet1" + _depth) + 1, _depth + 1);
_local3.x = _modelRobot.getMovieClip()._x;
_local3.y = _modelRobot.getMovieClip()._y;
_modelRobot.getMovieClip().modelrobotgunpoint.localToGlobal(_local3);
_bullet1._x = _modelRobot.getMovieClip()._x;
_bullet1._y = _modelRobot.getMovieClip()._y;
_gameContext.getGameData().getSoundModule().PlaySound("button.wav", 20, 0, 0, false);
}
if (_modelRobot.getMovieClip()._x == 180) {
_bullet2 = _root.attachMovie("MRBeam", ("bullet2" + _depth) + 1, _depth + 2);
_local3.x = _modelRobot.getMovieClip()._x;
_local3.y = _modelRobot.getMovieClip()._y;
_modelRobot.getMovieClip().modelrobotgunpoint.localToGlobal(_local3);
_bullet2._x = _local3.x;
_bullet2._y = _local3.y;
_gameContext.getGameData().getSoundModule().PlaySound("button.wav", 20, 0, 0, false);
}
if (_modelRobot.getMovieClip()._x == 300) {
_bullet3 = _root.attachMovie("MRBeam", ("bullet3" + _depth) + 1, _depth + 3);
_local3.x = _modelRobot.getMovieClip()._x;
_local3.y = _modelRobot.getMovieClip()._y;
_modelRobot.getMovieClip().modelrobotgunpoint.localToGlobal(_local3);
_bullet3._x = _local3.x;
_bullet3._y = _local3.y;
_gameContext.getGameData().getSoundModule().PlaySound("button.wav", 20, 0, 0, false);
}
if (_modelRobot.getMovieClip()._x == 420) {
_bullet4 = _root.attachMovie("MRBeam", ("bullet4" + _depth) + 1, _depth + 4);
_local3.x = _modelRobot.getMovieClip()._x;
_local3.y = _modelRobot.getMovieClip()._y;
_modelRobot.getMovieClip().modelrobotgunpoint.localToGlobal(_local3);
_bullet4._x = _local3.x;
_bullet4._y = _local3.y;
_gameContext.getGameData().getSoundModule().PlaySound("button.wav", 20, 0, 0, false);
}
if (_modelRobot.getMovieClip()._x == 540) {
_bullet5 = _root.attachMovie("MRBeam", ("bullet5" + _depth) + 1, _depth + 5);
_local3.x = _modelRobot.getMovieClip()._x;
_local3.y = _modelRobot.getMovieClip()._y;
_modelRobot.getMovieClip().modelrobotgunpoint.localToGlobal(_local3);
_bullet5._x = _local3.x;
_bullet5._y = _local3.y;
_gameContext.getGameData().getSoundModule().PlaySound("button.wav", 20, 0, 0, false);
}
}
function moveRobot() {
if (((((_modelRobot.getMovieClip()._x == 60) || (_modelRobot.getMovieClip()._x == 180)) || (_modelRobot.getMovieClip()._x == 300)) || (_modelRobot.getMovieClip()._x == 420)) || (_modelRobot.getMovieClip()._x == 540)) {
fire();
}
if (_moveRobotDir == "R") {
_modelRobot.getMovieClip()._x = _modelRobot.getMovieClip()._x + 10;
if (_modelRobot.getMovieClip()._x == 560) {
_moveRobotDir = "L";
}
} else if (_moveRobotDir == "L") {
_modelRobot.getMovieClip()._x = _modelRobot.getMovieClip()._x - 10;
if (_modelRobot.getMovieClip()._x == 40) {
_moveRobotDir = "R";
}
}
}
function moveBullet(obj) {
if (obj != undefined) {
if (_modelRobot.getMovieClip()._y == 40) {
obj._y = obj._y + 8;
} else if (_modelRobot.getMovieClip()._y == 360) {
obj._y = obj._y - 8;
}
}
var _local3 = _gameContext.getGameData().getPlayer(0).getPositionX();
var _local7 = _local3 - 45;
var _local6 = _local3 + 45;
var _local5 = _local3 - 15;
var _local8 = _local3 + 15;
var _local4 = Math.abs(obj._y - _gameContext.getGameData().getPlayer(0).getPositionY());
if (inRange(obj._x, _local7, _local6) && (_local4 < 60)) {
if (_gameContext.getGameData().getPlayer(0).isShieldDown()) {
if (inRange(obj._x, _local5, _local8) && (_local4 < 40)) {
_gameContext.getGameData().getPlayer(0).killPlayer();
Kill();
}
} else {
_gameContext.getGameData().getPlayer(0).deactivateShield();
obj.removeMovieClip();
}
}
}
function inRange(num, low, high) {
return((((num >= low) && (num <= high)) ? true : false));
}
function getMyX() {
return(_modelRobot.getMovieClip()._x);
}
function getMyY() {
return(_modelRobot.getMovieClip()._y);
}
function getName() {
return("modelrobot");
}
function HitMe(hitbyObj) {
_gameContext.getGameData().getSoundModule().PlaySound("EnemyHit.wav", 100, 0, 0, false);
if (hitbyObj == "shot") {
_health = _health - 10;
} else if (hitbyObj == "missile") {
_health = _health - 5;
}
_modelRobot.getMovieClip()._alpha = 50;
_gotHit = true;
}
function Kill() {
_gotKilled = true;
_gameContext.getGameData().getSoundModule().StopSound("ModelRobot.wav");
_gameContext.getGameData().getSoundModule().PlaySound("EnemyDeath.wav", 100, 0, 0, false);
_gameContext.getGameData().getSoundModule().StopMusic();
_gameContext.getGameData().getSoundModule().PlayMusic("debris.wav");
_modelRobot.changeSprite("ModelRobotAnim", "ModelRobotAnim");
if (_modelRobot.getMovieClip()._y == 360) {
_modelRobot.getMovieClip()._yscale = _modelRobot.getMovieClip()._yscale * -1;
}
_modelRobot.startAnimating(15, 19, 5, true);
_tickCounter = 2;
_bullet1.removeMovieClip();
_bullet2.removeMovieClip();
_bullet3.removeMovieClip();
_bullet4.removeMovieClip();
_bullet5.removeMovieClip();
_gameContext.getGameData().getEnemyManager().gotKilled("Robot");
}
function Remove() {
_tickCounter = _tickCounter - _gameContext.getDT();
if (_tickCounter > 0) {
return(0);
}
_modelRobot.removeSprite();
delete _modelRobot;
return(1);
}
function getHealth() {
return(_health);
}
function isKilled() {
return(_gotKilled);
}
}
Symbol 458 MovieClip [__Packages.Game.Aerocat] Frame 0
class Game.Aerocat
{
var _gameContext, _spawnPositions, b, _shotCount, _depth, _health, _gotKilled, _gotHit, _tickCounter, smallCounter, _aerocat, _hairballAngleRad, _hairballAngle, _missile1Angle, _missile2Angle, _isSpriteAerocat, _hairball, _missile1, _missile2;
function Aerocat (gameContext, depth) {
_gameContext = gameContext;
_spawnPositions = [[230, 50], [300, 390]];
b = 0;
_shotCount = 0;
_depth = depth;
Init();
}
function Init() {
_health = 500;
_gotKilled = false;
_gotHit = false;
var _local2;
if (random(10) < 5) {
_local2 = 0;
} else {
_local2 = 1;
}
_tickCounter = 0;
smallCounter = 0;
_aerocat = new Base.Entity(_gameContext, 26, 21, 21, "Aerocat", "Aerocat", _depth + 4, _spawnPositions[_local2][0], _spawnPositions[_local2][1], -1, Game.GameStates.EnemyInitState);
var _local4 = _gameContext.getGameData().getPlayer(0).getPositionX();
var _local3 = _gameContext.getGameData().getPlayer(0).getPositionY();
_hairballAngleRad = Math.atan2(_local3 - _aerocat.getMovieClip()._y, _local4 - _aerocat.getMovieClip()._x);
_hairballAngle = ((_hairballAngleRad * 180) / Math.PI) + 90;
_missile1Angle = _hairballAngle + 20;
_missile2Angle = _hairballAngle - 20;
_aerocat.changeSprite("AerocatAnim", "AerocatAnim");
_aerocat.startAnimating(1, 9, 24, false);
_isSpriteAerocat = false;
}
function getEnemyMC() {
return(_aerocat.getMovieClip());
}
function Update() {
var _local2 = _aerocat.animateSprite();
if (_gotKilled == true) {
return(undefined);
}
if ((smallCounter > 1) && (_isSpriteAerocat == false)) {
_aerocat.changeSprite("Aerocat", "Aerocat");
_aerocat.startAnimating(1, 20, 24, true);
_isSpriteAerocat = true;
}
if ((_tickCounter % 90) == 0) {
smallCounter++;
if (smallCounter == 1) {
_gameContext.getGameData().getSoundModule().PlaySound("EnemyHairball.wav");
}
if (smallCounter > 1) {
_hairballAngleRad = Math.atan2(_gameContext.getGameData().getPlayer(0).getPositionY() - _aerocat.getMovieClip()._y, _gameContext.getGameData().getPlayer(0).getPositionX() - _aerocat.getMovieClip()._x);
_hairballAngle = ((_hairballAngleRad * 180) / Math.PI) + 90;
_missile1Angle = _hairballAngle + 20;
_missile2Angle = _hairballAngle - 20;
fire();
}
}
move(_hairball, (_hairballAngle * Math.PI) / 180, 5);
move(_missile1, (_missile1Angle * Math.PI) / 180, 8);
move(_missile2, (_missile2Angle * Math.PI) / 180, 8);
if (((_tickCounter % 10) == 0) && (_gotHit)) {
_gotHit = false;
_aerocat.getMovieClip()._alpha = 100;
}
_tickCounter++;
}
function fire() {
_hairball = _root.attachMovie("HairBall", "HairBall", _depth + 3);
_hairball._x = _aerocat.getMovieClip()._x;
_hairball._y = _aerocat.getMovieClip()._y;
_gameContext.getGameData().getSoundModule().PlaySound("EnemyHairballTravel.wav");
_missile1 = _root.attachMovie("ACBeam", "missile1", _depth + 2);
_missile1._x = _aerocat.getMovieClip()._x;
_missile1._y = _aerocat.getMovieClip()._y;
_missile1._rotation = _missile1Angle;
_missile2 = _root.attachMovie("ACBeam", "missile2", _depth + 1);
_missile2._x = _aerocat.getMovieClip()._x;
_missile2._y = _aerocat.getMovieClip()._y;
_missile2._rotation = _missile2Angle;
}
function move(obj, angle, speed) {
var _local4 = Math.sin(angle) * speed;
var _local3 = (-Math.cos(angle)) * speed;
obj._x = obj._x + _local4;
obj._y = obj._y + _local3;
if (obj.hitTest(_gameContext.getGameData().getPlayer(0).getPositionX(), _gameContext.getGameData().getPlayer(0).getPositionY(), false) == true) {
if (_gameContext.getGameData().getPlayer(0).isShieldDown()) {
_gameContext.getGameData().getPlayer(0).killPlayer();
Kill();
} else {
_gameContext.getGameData().getPlayer(0).deactivateShield();
obj.removeMovieClip();
}
}
if ((((obj._x < -50) || (obj._x > 660)) || (obj._y < -50)) || (obj._y > 460)) {
obj.removeMovieClip();
}
}
function getMyX() {
return(_aerocat.getMovieClip()._x);
}
function getMyY() {
return(_aerocat.getMovieClip()._y);
}
function getName() {
return("aerocat");
}
function HitMe(hitbyObj) {
_gameContext.getGameData().getSoundModule().PlaySound("EnemyHit.wav", 100, 0, 0, false);
if (hitbyObj == "shot") {
_health = _health - 10;
} else if (hitbyObj == "missile") {
_health = _health - 5;
}
_aerocat.getMovieClip()._alpha = 50;
_gotHit = true;
}
function Kill() {
_gotKilled = true;
_gameContext.getGameData().getSoundModule().StopSound("EnemyHairball.wav");
_gameContext.getGameData().getSoundModule().PlaySound("EnemyDeath.wav", 100, 0, 0, false);
_gameContext.getGameData().getSoundModule().StopMusic();
_gameContext.getGameData().getSoundModule().PlayMusic("debris.wav");
_aerocat.changeSprite("AerocatAnim", "AerocatAnim");
_aerocat.startAnimating(15, 19, 5, true);
_tickCounter = 2;
_missile1.removeMovieClip();
_missile2.removeMovieClip();
_hairball.removeMovieClip();
_gameContext.getGameData().getEnemyManager().gotKilled("Aerocat");
}
function Remove() {
_tickCounter = _tickCounter - _gameContext.getDT();
if (_tickCounter > 0) {
return(0);
}
_aerocat.removeSprite();
delete _aerocat;
return(1);
}
function getHealth() {
return(_health);
}
function isKilled() {
return(_gotKilled);
}
}
Symbol 459 MovieClip [__Packages.Game.AnimeGod] Frame 0
class Game.AnimeGod
{
var _gameContext, _spawnPositions, _depth, _fiveSecondTicks, _health, _gotKilled, _fireCounter, _clockTick, _tickCounter, _tickCounter1, _gotHit, _animeGod, _isSpriteAnimeGod, _bullet1, _bullet2;
function AnimeGod (gameContext, depth) {
_gameContext = gameContext;
_spawnPositions = [[200, 50], [400, 50], [30, 200]];
_depth = depth;
Init();
}
function Init() {
_fiveSecondTicks = 1;
_health = 750;
_gotKilled = false;
_fireCounter = 0;
_clockTick = 0;
_tickCounter = 0;
_tickCounter1 = 0;
_gotHit = false;
var _local2 = random(3);
_animeGod = new Base.Entity(_gameContext, 27, 21, 21, "AnimeGod", "AnimeGod", _depth + 3, _spawnPositions[_local2][0], _spawnPositions[_local2][1], -1, Game.GameStates.EnemyInitState);
_animeGod.changeSprite("AnimeGodAnim", "AnimeGodAnim");
_animeGod.startAnimating(1, 10, 12, false);
_isSpriteAnimeGod = false;
_gameContext.getGameData().getSoundModule().PlaySound("AnimeGod.wav", 100, 0, 0, false);
}
function getEnemyMC() {
return(_animeGod.getMovieClip());
}
function Update() {
var _local3 = _animeGod.animateSprite();
if (_gotKilled == true) {
return(undefined);
}
if ((_fireCounter > 0) && (_isSpriteAnimeGod == false)) {
_animeGod.changeSprite("AnimeGod", "AnimeGod");
_animeGod.startAnimating(1, 12, 24, true);
_isSpriteAnimeGod = true;
}
if ((_animeGod.getMovieClip()._x == 200) || (_animeGod.getMovieClip()._x == 400)) {
if ((_clockTick % 70) == 0) {
if (_animeGod.getMovieClip()._x == 200) {
_animeGod.getMovieClip()._x = 400;
_bullet1.removeMovieClip();
delete _bullet1;
_bullet1 = _root.attachMovie("AGBeam", "bullet1", _depth + 2);
_bullet1._x = _animeGod.getMovieClip()._x;
_bullet1._y = _animeGod.getMovieClip()._y + 500;
} else {
_animeGod.getMovieClip()._x = 200;
_bullet2.removeMovieClip();
delete _bullet2;
_bullet2 = _root.attachMovie("AGBeam", "bullet2", _depth + 1);
_bullet2._x = _animeGod.getMovieClip()._x;
_bullet2._y = _animeGod.getMovieClip()._y + 500;
}
}
_clockTick++;
} else if (_animeGod.getMovieClip()._x == 30) {
if ((_fiveSecondTicks % 120) == 0) {
_fiveSecondTicks = 1;
_bullet1 = _root.attachMovie("AGBeam", "bullet1", _depth + 1);
_bullet1._x = _animeGod.getMovieClip()._x + 500;
_bullet1._y = _animeGod.getMovieClip()._y + 10;
_bullet1._rotation = -90;
_fireCounter++;
_gameContext.getGameData().getSoundModule().PlaySound("FlameLaunch.wav", 100, 0, 0, false);
} else {
_fiveSecondTicks++;
}
}
_tickCounter1++;
if (((_tickCounter1 % 10) == 0) && (_gotHit)) {
_gotHit = false;
_animeGod.getMovieClip()._alpha = 100;
}
if (_bullet1.fireHit.hitTest(_gameContext.getGameData().getPlayer(0).getPositionX(), _gameContext.getGameData().getPlayer(0).getPositionY(), false) == true) {
if (_gameContext.getGameData().getPlayer(0).isShieldDown()) {
_gameContext.getGameData().getPlayer(0).killPlayer();
Kill();
} else {
_gameContext.getGameData().getPlayer(0).deactivateShield();
}
}
if (_bullet2.fireHit.hitTest(_gameContext.getGameData().getPlayer(0).getPositionX(), _gameContext.getGameData().getPlayer(0).getPositionY(), false) == true) {
if (_gameContext.getGameData().getPlayer(0).isShieldDown()) {
_gameContext.getGameData().getPlayer(0).killPlayer();
Kill();
} else {
_gameContext.getGameData().getPlayer(0).deactivateShield();
}
}
}
function moveBullet(obj) {
if (obj != undefined) {
if (_animeGod.getMovieClip()._x != 30) {
obj._y = obj._y + 8;
if (obj._y >= 400) {
obj.removeMovieClip();
}
var _local6 = _gameContext.getGameData().getPlayer(0).getPositionX();
var _local5 = _gameContext.getGameData().getPlayer(0).getPositionY();
if ((((obj._y != undefined) && (obj._x != undefined)) && (inRange(obj._x, _local6 - 45, _local6 + 45))) && (inRange(_local5, obj._y - 350, obj._y + 350))) {
if (_gameContext.getGameData().getPlayer(0).isShieldDown() && (inRange(obj._x, _local6 - 20, _local6 + 20))) {
_gameContext.getGameData().getPlayer(0).killPlayer();
Kill();
} else {
_gameContext.getGameData().getPlayer(0).deactivateShield();
obj.removeMovieClip();
}
}
} else {
obj._x = obj._x + 8;
if (obj._x >= 600) {
obj.removeMovieClip();
}
_gameContext.getGameData().getSoundModule().PlaySound("FlameLoop.wav", 100, 0, 0, false);
var _local4 = _gameContext.getGameData().getPlayer(0).getPositionY() - 20;
var _local3 = _gameContext.getGameData().getPlayer(0).getPositionY() + 20;
var _local6 = _gameContext.getGameData().getPlayer(0).getPositionX();
if ((((obj._y != undefined) && (obj._x != undefined)) && (inRange(obj._y, _local4, _local3))) && (inRange(_local6, obj._x - 350, obj._x + 350))) {
if (_gameContext.getGameData().getPlayer(0).isShieldDown()) {
_gameContext.getGameData().getPlayer(0).killPlayer();
Kill();
} else {
_gameContext.getGameData().getPlayer(0).deactivateShield();
obj.removeMovieClip();
}
}
}
}
}
function inRange(num, low, high) {
return((((num >= low) && (num <= high)) ? true : false));
}
function getMyX() {
return(_animeGod.getMovieClip()._x);
}
function getMyY() {
return(_animeGod.getMovieClip()._y);
}
function getName() {
return("animegod");
}
function HitMe(hitbyObj) {
if (hitbyObj == "shot") {
_health = _health - 10;
} else if (hitbyObj == "missile") {
_health = _health - 5;
}
_animeGod.getMovieClip()._alpha = 50;
_gotHit = true;
_gameContext.getGameData().getSoundModule().PlaySound("EnemyHit.wav", 100, 0, 0, false);
}
function Kill() {
_gotKilled = true;
_gameContext.getGameData().getSoundModule().StopSound("AnimeGod.wav");
_gameContext.getGameData().getSoundModule().PlaySound("EnemyDeath.wav", 100, 0, 0, false);
_gameContext.getGameData().getSoundModule().StopMusic();
_gameContext.getGameData().getSoundModule().PlayMusic("debris.wav");
_animeGod.changeSprite("AnimeGodAnim", "AnimeGodAnim");
_animeGod.startAnimating(15, 19, 5, true);
_tickCounter = 2;
_bullet1.removeMovieClip();
_bullet2.removeMovieClip();
_gameContext.getGameData().getEnemyManager().gotKilled("AnimeGod");
}
function Remove() {
_tickCounter = _tickCounter - _gameContext.getDT();
if (_tickCounter > 0) {
return(0);
}
_animeGod.getMovieClip().removeMovieClip();
delete _animeGod;
return(1);
}
function getHealth() {
return(_health);
}
function isKilled() {
return(_gotKilled);
}
}
Symbol 460 MovieClip [__Packages.Game.Coiffio] Frame 0
class Game.Coiffio
{
var _gameContext, _spawnPositions, _depth, _coiffio, _health, _gotKilled, _gotHit, _toggle, movePattern, _initial3Seconds, _isSpriteCoiffio, _beamsArray, _shotCount, _rotate, smallCounter, _tickCounter, cnt, _beamsArray2, _innerCount, cnt3, _beamsArray3, _innerCount3, cnt5, _beamsArray5, _innerCount5, rep, _rot1, _rot2, _rot3, _rot4;
function Coiffio (gameContext, depth) {
_gameContext = gameContext;
_spawnPositions = [[300, 200]];
_depth = depth;
Init();
}
function Init() {
var _local2 = random(6);
_coiffio = new Base.Entity(_gameContext, 25, 21, 21, "Coiffio", "Coiffio", 20005, _spawnPositions[0][0], _spawnPositions[0][1], -1, Game.GameStates.EnemyInitState);
_health = 1500;
_gotKilled = false;
_gotHit = false;
_toggle = true;
movePattern = 0;
_initial3Seconds = 0;
initializeVariables();
_coiffio.changeSprite("CoiffioAnim", "CoiffioAnim");
_coiffio.startAnimating(1, 9, 24, false);
_isSpriteCoiffio = false;
_gameContext.getGameData().getSoundModule().PlaySound("Coiffio.wav", 100, 0, 0, false);
}
function initializeVariables() {
_beamsArray = [];
_shotCount = 18000;
_rotate = true;
smallCounter = 1;
_tickCounter = 0;
_coiffio.getMovieClip()._rotation = 0;
cnt = 0;
_beamsArray2 = [];
_innerCount = 1;
cnt3 = 0;
_beamsArray3 = [];
_innerCount3 = 1;
cnt5 = 0;
_beamsArray5 = [];
_innerCount5 = 1;
rep = 0;
_rot1 = 0;
_rot2 = 0;
_rot3 = 0;
_rot4 = 0;
}
function getName() {
return("coiffio");
}
function getEnemyMC() {
return(_coiffio.getMovieClip());
}
function Update() {
var _local3 = _coiffio.animateSprite();
if (_gotKilled == true) {
return(undefined);
}
if ((smallCounter > 1) && (_isSpriteCoiffio == false)) {
_coiffio.changeSprite("Coiffio", "Coiffio");
_coiffio.startAnimating(1, 20, 24, true);
_isSpriteCoiffio = true;
}
if (movePattern == 0) {
_initial3Seconds++;
}
if (_initial3Seconds == 60) {
_initial3Seconds = 1;
smallCounter = 5;
}
if (smallCounter == 5) {
smallCounter = 1;
movePattern++;
if (movePattern > 5) {
movePattern = 1;
}
clearBeamsArrays();
initializeVariables();
}
if (movePattern == 1) {
var _local2 = 0;
while (_local2 < _beamsArray.length) {
moveBeam(_local2, _beamsArray[_local2]);
_local2++;
}
if ((_tickCounter % 20) == 0) {
_rotate = false;
}
if ((_tickCounter % 60) == 0) {
smallCounter++;
if (smallCounter == 1) {
_rotate = false;
} else {
_rotate = true;
}
}
if (_rotate == true) {
if (_toggle) {
fireShot();
_toggle = false;
} else {
_toggle = true;
}
_rot1 = _rot1 + 18;
}
_tickCounter++;
} else if (movePattern == 2) {
var _local2 = 0;
while (_local2 < _beamsArray2.length) {
moveBeam2(_local2, _beamsArray2[_local2]);
_local2++;
}
if ((_tickCounter % 60) == 0) {
_innerCount = 1;
smallCounter++;
}
if ((_innerCount <= 3) && ((_tickCounter % 5) == 0)) {
if (_innerCount == 1) {
_rot2 = _rot2 + 18;
} else {
_rot2 = _rot2 - 18;
}
_local2 = 0;
while (_local2 < 6) {
fireShot2(cnt);
cnt++;
_local2++;
}
_innerCount++;
}
_tickCounter++;
} else if (movePattern == 3) {
var _local2 = 0;
while (_local2 < _beamsArray3.length) {
moveBeam3(_local2, _beamsArray3[_local2]);
_local2++;
}
if ((_tickCounter % 60) == 0) {
_innerCount3 = 1;
smallCounter++;
}
if ((_innerCount3 <= 2) && ((_tickCounter % 20) == 0)) {
_local2 = 0;
while (_local2 < 4) {
fireShot3(cnt3);
cnt3++;
_local2++;
}
_innerCount3++;
}
_tickCounter++;
} else if (movePattern == 4) {
var _local2 = 0;
while (_local2 < _beamsArray2.length) {
moveBeam2(_local2, _beamsArray2[_local2]);
_local2++;
}
if ((_tickCounter % 100) == 0) {
_innerCount = 1;
smallCounter++;
}
if ((_innerCount <= 5) && ((_tickCounter % 5) == 0)) {
_rot2 = _rot2 + 9;
_local2 = 0;
while (_local2 < 10) {
fireShot2(cnt);
cnt++;
_local2++;
}
_innerCount++;
}
_tickCounter++;
} else if (movePattern == 5) {
var _local2 = 0;
while (_local2 < _beamsArray5.length) {
moveBeam5(_local2, _beamsArray5[_local2]);
_local2++;
}
if ((_tickCounter % 100) == 0) {
_innerCount5 = 1;
smallCounter++;
}
if ((_innerCount5 <= 15) && ((_tickCounter % 5) == 0)) {
if (_innerCount5 == 5) {
rep++;
}
_local2 = 0;
while (_local2 < 4) {
fireShot5(cnt5);
cnt5++;
_local2++;
}
_innerCount5++;
}
_tickCounter++;
}
if (((_tickCounter % 10) == 0) && (_gotHit)) {
_gotHit = false;
_coiffio.getMovieClip()._alpha = 100;
}
}
function fireShot5(num) {
if (_shotCount >= 20000) {
_shotCount = 18000;
}
_shotCount++;
num = num % 4;
var _local3 = 90 * num;
if ((rep % 2) == 0) {
_local3 = _local3 + (_tickCounter * 10);
} else {
_local3 = _local3 - (_tickCounter * 10);
}
var _local5 = _local3 * (Math.PI/180);
var _local6 = 25;
var _local9 = _local6 * Math.cos(_local5);
var _local8 = _local6 * Math.sin(_local5);
var _local4 = _root.attachMovie("coiffiobullet", "b" + _shotCount, _shotCount);
_local4._x = _local9 + _coiffio.getMovieClip()._x;
_local4._y = _local8 + _coiffio.getMovieClip()._y;
_local4._ang = _local5;
_local4._rotation = _local3 + 90;
_beamsArray5.push(_local4);
}
function moveBeam5(i, _beamMC) {
var _local4 = 5;
var _local7 = (_beamMC._rotation * Math.PI) / 180;
var _local9 = Math.sin(_local7) * _local4;
var _local8 = (-Math.cos(_local7)) * _local4;
_beamMC._x = _beamMC._x + _local9;
_beamMC._y = _beamMC._y + _local8;
if ((((_beamMC._x > 620) || (_beamMC._x < -20)) || (_beamMC._y < -20)) || (_beamMC._y > 420)) {
_beamMC.removeMovieClip();
_beamsArray5.splice(i, 1);
} else {
var _local6 = _beamMC._x - _gameContext.getGameData().getPlayer(0).getPositionX();
var _local5 = _beamMC._y - _gameContext.getGameData().getPlayer(0).getPositionY();
var _local3 = Math.sqrt((_local6 * _local6) + (_local5 * _local5));
if (_local3 < 60) {
if (_gameContext.getGameData().getPlayer(0).isShieldDown()) {
if (_local3 < 10) {
_gameContext.getGameData().getPlayer(0).killPlayer();
Kill();
}
} else {
_gameContext.getGameData().getPlayer(0).deactivateShield();
_beamMC.removeMovieClip();
_beamsArray5.splice(i, 1);
}
}
}
}
function fireShot2(num) {
if (_shotCount >= 20000) {
_shotCount = 18000;
}
_shotCount++;
var _local5 = 36 * num;
var _local4 = _local5 * (Math.PI/180);
var _local6 = 25;
var _local8 = _local6 * Math.cos(_local4);
var _local7 = _local6 * Math.sin(_local4);
var _local3 = _root.attachMovie("coiffiobullet", "b" + _shotCount, _shotCount);
_local3._x = _local8 + _coiffio.getMovieClip()._x;
_local3._y = _local7 + _coiffio.getMovieClip()._y;
_local3._ang = _local4;
_local3._rotation = (_rot2 + _local5) + 90;
_beamsArray2.push(_local3);
}
function moveBeam2(i, _beamMC) {
var _local4 = 5;
var _local7 = (_beamMC._rotation * Math.PI) / 180;
var _local9 = Math.sin(_local7) * _local4;
var _local8 = (-Math.cos(_local7)) * _local4;
_beamMC._x = _beamMC._x + _local9;
_beamMC._y = _beamMC._y + _local8;
if ((((_beamMC._x > 620) || (_beamMC._x < -20)) || (_beamMC._y < -20)) || (_beamMC._y > 420)) {
_beamMC.removeMovieClip();
_beamsArray2.splice(i, 1);
} else {
var _local6 = _beamMC._x - _gameContext.getGameData().getPlayer(0).getPositionX();
var _local5 = _beamMC._y - _gameContext.getGameData().getPlayer(0).getPositionY();
var _local3 = Math.sqrt((_local6 * _local6) + (_local5 * _local5));
if (_local3 < 60) {
if (_gameContext.getGameData().getPlayer(0).isShieldDown()) {
if (_local3 < 10) {
_gameContext.getGameData().getPlayer(0).killPlayer();
Kill();
}
} else {
_gameContext.getGameData().getPlayer(0).deactivateShield();
_beamMC.removeMovieClip();
_beamsArray2.splice(i, 1);
}
}
}
}
function fireShot3(num) {
if (_shotCount >= 20000) {
_shotCount = 18000;
}
_shotCount++;
num = num % 4;
var _local4 = 90 * num;
if (_innerCount3 == 2) {
_local4 = _local4 + 45;
}
var _local5 = _local4 * (Math.PI/180);
var _local6 = 25;
var _local9 = _local6 * Math.cos(_local5);
var _local8 = _local6 * Math.sin(_local5);
var _local3 = _root.attachMovie("coiffiobeam", "b" + _shotCount, _shotCount);
_local3._x = _local9 + _coiffio.getMovieClip()._x;
_local3._y = _local8 + _coiffio.getMovieClip()._y;
_local3._ang = _local5;
_local3._rotation = _local4 + 90;
_beamsArray3.push(_local3);
}
function moveBeam3(i, _beamMC) {
var _local4 = 5;
var _local7 = (_beamMC._rotation * Math.PI) / 180;
var _local9 = Math.sin(_local7) * _local4;
var _local8 = (-Math.cos(_local7)) * _local4;
_beamMC._x = _beamMC._x + _local9;
_beamMC._y = _beamMC._y + _local8;
if ((((_beamMC._x > 620) || (_beamMC._x < -20)) || (_beamMC._y < -20)) || (_beamMC._y > 420)) {
_beamMC.removeMovieClip();
_beamsArray3.splice(i, 1);
} else {
var _local6 = _beamMC._x - _gameContext.getGameData().getPlayer(0).getPositionX();
var _local5 = _beamMC._y - _gameContext.getGameData().getPlayer(0).getPositionY();
var _local3 = Math.sqrt((_local6 * _local6) + (_local5 * _local5));
if (_local3 < 60) {
if (_gameContext.getGameData().getPlayer(0).isShieldDown()) {
if (_local3 < 10) {
_gameContext.getGameData().getPlayer(0).killPlayer();
Kill();
}
} else {
_gameContext.getGameData().getPlayer(0).deactivateShield();
_beamMC.removeMovieClip();
_beamsArray3.splice(i, 1);
}
}
}
}
function getHealth() {
return(_health);
}
function isKilled() {
return(_gotKilled);
}
function fireShot() {
if (_shotCount >= 20000) {
_shotCount = 18000;
}
_shotCount++;
var _local3 = _root.attachMovie("coiffiobullet", "b" + _shotCount, _shotCount);
_local3._x = _coiffio.getMovieClip()._x;
_local3._y = _coiffio.getMovieClip()._y;
_beamsArray.push(_local3);
_local3._rotation = _rot1;
_gameContext.getGameData().getSoundModule().PlaySound("EnemyBullet.wav");
}
function getMyX() {
return(_coiffio.getMovieClip()._x);
}
function getMyY() {
return(_coiffio.getMovieClip()._y);
}
function moveBeam(i, _beamMC) {
var _local4 = 12;
var _local7 = (_beamMC._rotation * Math.PI) / 180;
var _local9 = Math.sin(_local7) * _local4;
var _local8 = (-Math.cos(_local7)) * _local4;
_beamMC._x = _beamMC._x + _local9;
_beamMC._y = _beamMC._y + _local8;
if ((((_beamMC._x > 620) || (_beamMC._x < -20)) || (_beamMC._y < -20)) || (_beamMC._y > 420)) {
_beamMC.removeMovieClip();
_beamsArray.splice(i, 1);
} else {
var _local6 = _beamMC._x - _gameContext.getGameData().getPlayer(0).getPositionX();
var _local5 = _beamMC._y - _gameContext.getGameData().getPlayer(0).getPositionY();
var _local3 = Math.sqrt((_local6 * _local6) + (_local5 * _local5));
if (_local3 < 60) {
if (_gameContext.getGameData().getPlayer(0).isShieldDown()) {
if (_local3 < 10) {
_gameContext.getGameData().getPlayer(0).killPlayer();
Kill();
}
} else {
_gameContext.getGameData().getPlayer(0).deactivateShield();
_beamMC.removeMovieClip();
_beamsArray.splice(i, 1);
}
}
}
}
function HitMe(hitbyObj) {
_gameContext.getGameData().getSoundModule().PlaySound("EnemyHit.wav", 100, 0, 0, false);
if (hitbyObj == "shot") {
_health = _health - 10;
} else if (hitbyObj == "missile") {
_health = _health - 5;
}
_coiffio.getMovieClip()._alpha = 50;
_gotHit = true;
}
function Kill() {
_gotKilled = true;
_coiffio.changeSprite("CoiffioAnim", "CoiffioAnim");
_coiffio.startAnimating(15, 19, 5, true);
_tickCounter = 2;
clearBeamsArrays();
_gameContext.getGameData().getSoundModule().StopSound("Coiffio.wav");
_gameContext.getGameData().getSoundModule().PlaySound("EnemyDeath.wav", 100, 0, 0, false);
_gameContext.getGameData().getSoundModule().StopMusic();
_gameContext.getGameData().getSoundModule().PlayMusic("debris.wav");
_gameContext.getGameData().getEnemyManager().gotKilled("Coiffio");
}
function Remove() {
_tickCounter = _tickCounter - _gameContext.getDT();
if (_tickCounter > 0) {
return(0);
}
_coiffio.removeSprite();
delete _coiffio;
return(1);
}
function clearBeamsArrays() {
var _local2 = 0;
while (_local2 < _beamsArray.length) {
_beamsArray[_local2].removeMovieClip();
_local2++;
}
delete _beamsArray;
_local2 = 0;
while (_local2 < _beamsArray2.length) {
_beamsArray2[_local2].removeMovieClip();
_local2++;
}
delete _beamsArray2;
_local2 = 0;
while (_local2 < _beamsArray3.length) {
_beamsArray3[_local2].removeMovieClip();
_local2++;
}
delete _beamsArray3;
_local2 = 0;
while (_local2 < _beamsArray5.length) {
_beamsArray5[_local2].removeMovieClip();
_local2++;
}
delete _beamsArray5;
}
}
Symbol 461 MovieClip [__Packages.Game.NPCManager] Frame 0
class Game.NPCManager
{
var _gameContext, _angle, _tickCounter, _npcVortex;
function NPCManager (gameContext) {
_gameContext = gameContext;
Init();
}
function Init() {
_angle = 0;
_tickCounter = 0;
}
function getRandomVortex() {
var _local1;
_local1 = random(5);
return(_local1);
}
function getRandomCharacter() {
var _local2;
var _local1;
_local1 = [1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25];
_local2 = random(13);
return(_local1[_local2]);
}
function Update() {
var _local4 = _npcVortex.animateSprite();
_tickCounter++;
if ((_tickCounter % 700) == 0) {
var _local2 = getRandomVortex();
var _local3 = getRandomCharacter();
if (_local2 == 0) {
_local2 = 1;
}
_npcVortex = new Base.Entity(_gameContext, 50, 50, 50, "NPCVortex2", "NPCVortex" + _local2, 700 + _local2, 300, 200, -1, Game.GameStates.EnemyInitState);
_npcVortex.startAnimating(1, 502, 60, false);
_npcVortex.getMovieClip()._vortexCharacter.gotoAndStop(_local3);
switch (_local3) {
case 1 :
break;
case 3 :
_gameContext.getGameData().getSoundModule().PlaySound("King.wav", 100, 0, 0, 1);
break;
case 5 :
_gameContext.getGameData().getSoundModule().PlaySound("Tree.wav", 100, 0, 0, 1);
break;
case 7 :
break;
case 9 :
break;
case 11 :
break;
case 13 :
break;
case 15 :
_gameContext.getGameData().getSoundModule().PlaySound("UncleGrandfather.wav", 100, 0, 0, 1);
break;
case 17 :
break;
case 19 :
_gameContext.getGameData().getSoundModule().PlaySound("Brenda.wav", 100, 0, 0, 1);
break;
case 21 :
_gameContext.getGameData().getSoundModule().PlaySound("Brenda.wav", 100, 0, 0, 1);
break;
case 23 :
_gameContext.getGameData().getSoundModule().PlaySound("Brenda.wav", 100, 0, 0, 1);
break;
case 25 :
_gameContext.getGameData().getSoundModule().PlaySound("Brenda.wav", 100, 0, 0, 1);
}
}
}
function freeMemory() {
_npcVortex.getMovieClip().removeMovieClip();
delete _npcVortex;
}
}
Symbol 462 MovieClip [__Packages.Game.ScoreBoard] Frame 0
class Game.ScoreBoard
{
var _gameContext, _mc;
function ScoreBoard (gameContext, depth) {
_gameContext = gameContext;
_mc = new Base.SpriteEntity(gameContext, 10, 0, "ScoreBoard", "ScoreBoard", depth, 500, 0, 2, -1, -1);
_mc.getMovieClip()._scoreText.text = "0000";
_mc.getMovieClip()._debrisText.text = "0000";
}
function getScoreBoardMC() {
return(_mc.getMovieClip());
}
function removeBoard() {
_mc.removeSprite();
delete _mc;
}
function showBoard() {
if (!_mc.isVisible()) {
_mc.setVisibility(true);
}
}
function hideBoard() {
if (_mc.isVisible()) {
_mc.setVisibility(false);
}
}
function setScore(score) {
_mc.getMovieClip()._scoreText.text = score;
}
function setDebrisDestroyedCounter(score) {
_mc.getMovieClip()._debrisText.text = score;
}
}
Symbol 463 MovieClip [__Packages.Base.Time] Frame 0
class Base.Time
{
var _currentTime, _timeLastTick, _gameSpeed, _startTime, _averageTime, _currentPlaceInAvgArray;
function Time () {
_currentTime = 0;
_timeLastTick = 0.001;
_gameSpeed = INITIAL_GAME_SPEED;
_startTime = (getTimer() * INITIAL_GAME_SPEED) / 1000;
_averageTime = new Array(0.01666, 0.01666, 0.01666, 0.01666, 0.01666, 0.01666, 0.01666, 0.01666, 0.01666, 0.01666);
_currentPlaceInAvgArray = 0;
}
function getElapsedTime() {
return(_timeLastTick);
}
function getCurTime() {
return(_currentTime);
}
function getGameSpeed() {
return(_gameSpeed);
}
function getAverageTime() {
var _local3 = 0;
var _local2 = 0;
while (_local2 < 10) {
_local3 = _local3 + _averageTime[_local2];
_local2++;
}
_local3 = _local3 / 10;
return(_local3);
}
function markTimeThisTick() {
var _local2 = ((getTimer() * _gameSpeed) / 1000) - _startTime;
_timeLastTick = _local2 - _currentTime;
_currentTime = _local2;
_averageTime[_currentPlaceInAvgArray++] = _timeLastTick;
if (_currentPlaceInAvgArray >= 10) {
_currentPlaceInAvgArray = 0;
}
if (_timeLastTick <= 0) {
_timeLastTick = 0.001;
}
}
function setGameSpeed(speed) {
_gameSpeed = speed;
if (_gameSpeed < MIN_GAME_SPEED) {
_gameSpeed = MIN_GAME_SPEED;
} else if (_gameSpeed > MAX_GAME_SPEED) {
_gameSpeed = MIN_GAME_SPEED;
}
}
static var INITIAL_GAME_SPEED = 1;
static var MIN_GAME_SPEED = 0.001;
static var MAX_GAME_SPEED = 100;
}
Symbol 464 MovieClip [__Packages.Pad.PadManager] Frame 0
class Pad.PadManager
{
var _padData, _mouseData, _lastKeyPressed;
function PadManager () {
_padData = new Array();
_mouseData = new Object();
var _local2 = 0;
while (_local2 < 31) {
_padData[_local2] = {keyPressed:false, keyReleased:false, keyStillPressed:false, timePressed:Number};
_local2++;
}
_mouseData.mouseJustPressed = false;
_mouseData.mouseStillPressed = false;
_mouseData.mouseReleased = false;
_mouseData.mouseTimePressed = 0;
_mouseData.mousePressedPosX = 0;
_mouseData.mousePressedPosY = 0;
_mouseData.mousePosX = 0;
_mouseData.mousePosY = 0;
_lastKeyPressed = 0;
Init();
}
function getPadData() {
return(_padData);
}
function getPadDataLength() {
return(_padData.length);
}
function getKeyJustPressed(id) {
return(_padData[id].keyPressed);
}
function getKeyStillPressed(id) {
return(_padData[id].keyStillPressed);
}
function getKeyTimePressed(id) {
return(_padData[id].timePressed);
}
function getKeyReleased(id) {
return(_padData[id].keyReleased);
}
function getMouseJustPressed() {
return(_mouseData.mouseJustPressed);
}
function getMouseStillPressed() {
return(_mouseData.mouseStillPressed);
}
function getMouseReleased() {
return(_mouseData.mouseReleased);
}
function getMouseTimePressed() {
return(_mouseData.mouseTimePressed);
}
function getMousePressedPosX() {
return(_mouseData.mousePressedPosX);
}
function getMousePressedPosY() {
return(_mouseData.mousePressedPosY);
}
function getMousePosX() {
return(_mouseData.mousePosX);
}
function getMousePosY() {
return(_mouseData.mousePosY);
}
function Init() {
mouseListener.onMouseDown = function () {
_global.handleMousePress = true;
return(undefined);
};
mouseListener.onMouseUp = function () {
_global.handleMouseRelease = true;
return(undefined);
};
Mouse.addListener(mouseListener);
return(undefined);
}
function Update(gameContext) {
var _local6 = Key.getCode();
if (_mouseData.mouseReleased) {
_mouseData.mouseReleased = false;
}
if (_global.handleMouseRelease) {
_global.handleMouseRelease = false;
_mouseData.mouseJustPressed = false;
_mouseData.mouseStillPressed = false;
_mouseData.mouseReleased = true;
} else {
if (_mouseData.mouseJustPressed) {
_mouseData.mouseJustPressed = false;
_mouseData.mouseReleased = false;
_mouseData.mouseStillPressed = true;
}
if (_mouseData.mouseStillPressed) {
_mouseData.mouseTimePressed = _mouseData.mouseTimePressed + gameContext.getDT();
}
}
if (_global.handleMousePress) {
_global.handleMousePress = false;
_mouseData.mouseJustPressed = true;
_mouseData.mousePressedPosX = _xmouse;
_mouseData.mousePressedPosY = _ymouse;
_mouseData.mouseReleased = false;
_mouseData.mouseStillPressed = false;
_mouseData.mouseTimePressed = 0;
}
_mouseData.mousePosX = _xmouse;
_mouseData.mousePosY = _ymouse;
var _local3 = 0;
while (_local3 < 31) {
var _local4 = _local3 + 65;
if (_local3 == 26) {
_local4 = 37;
} else if (_local3 == 27) {
_local4 = 38;
} else if (_local3 == 28) {
_local4 = 39;
} else if (_local3 == 29) {
_local4 = 40;
} else if (_local3 == 30) {
_local4 = 32;
}
if (Key.isDown(_local4)) {
if ((!_padData[_local3].keyPressed) && (!_padData[_local3].keyStillPressed)) {
_padData[_local3].keyPressed = true;
_padData[_local3].keyStillPressed = false;
_padData[_local3].keyReleased = false;
_padData[_local3].timePressed = 0;
} else if (_padData[_local3].keyPressed || (_padData[_local3].keyStillPressed)) {
_padData[_local3].keyPressed = false;
_padData[_local3].keyStillPressed = true;
_padData[_local3].keyReleased = false;
_padData[_local3].timePressed = _padData[_local3].timePressed + gameContext.getDT();
}
} else if (_padData[_local3].keyStillPressed || (_padData[_local3].keyPressed)) {
_padData[_local3].keyPressed = false;
_padData[_local3].keyStillPressed = false;
_padData[_local3].keyReleased = true;
}
_local3++;
}
return(undefined);
}
var mouseListener = new Object();
}
Symbol 465 MovieClip [__Packages.Game.GameManager] Frame 0
class Game.GameManager
{
var _currentGameState, _nextGameState;
function GameManager (parentMC) {
_currentGameState = null;
setNextState(Game.GameStates.InitGameState);
}
function setNextState(state) {
_nextGameState = new state[undefined]();
}
function getState() {
}
function Update(gameContext) {
if (_currentGameState != _nextGameState) {
_currentGameState = _nextGameState;
_currentGameState.Entry(gameContext);
} else if (_currentGameState == _nextGameState) {
_currentGameState.Update(gameContext);
if (_currentGameState != _nextGameState) {
_currentGameState.Exit(gameContext);
delete _currentGameState;
if (!_nextGameState) {
}
}
}
}
}
Symbol 466 MovieClip [__Packages.Game.GameStates.InitGameState] Frame 0
class Game.GameStates.InitGameState extends Base.GameState
{
var _timer, _startGameBtn;
function InitGameState () {
super();
}
function Entry(gameContext) {
_timer = 1.5;
_startGameBtn = new Base.SpriteEntity(gameContext, 0, 5, "StartGameBtn", "StartGameBtn", 499, 208, 319, 2, -1, -1);
_global.soundmc = _root.createEmptyMovieClip("souncd_mc", 2000);
_global.titleSound = new Sound(_global.soundmc);
_global.titleSound.attachSound("music_title.wav");
_global.titleSound.setVolume(20);
_global.titleSound.start(0, 10);
gameContext.getGameData().setBackground(0, 0, "InstructionsCard", "InstructionsCard", 0, 0, 0, 2, -1, -1);
}
function Update(gameContext) {
if (_startGameBtn.isMouseOver()) {
_startGameBtn.moveToFrame(2);
if (gameContext.getPadManager().getMouseJustPressed()) {
gameContext.getGameManager().setNextState(Game.GameStates.InplayGameState);
}
} else {
_startGameBtn.moveToFrame(1);
}
return(undefined);
}
function Exit(gameContext) {
_startGameBtn.removeSprite();
delete _startGameBtn;
}
}