Frame 1
function _getHighScore(Void) {
return(score);
}
function ShowHighScore(Void) {
loadMovie ((("WBHighScores.swf?GameID=" + NGameID) + "&GameScore=") + _getHighScore(), this.createEmptyMovieClip("mcHSBoard", this.getNextHighestDepth()));
}
Stage.showMenu = false;
_focusrect = false;
Frame 10
MainGameHub.init(this);
Frame 79
score = screen_mc.score_txt.text;
ShowHighScore();
Symbol 15 MovieClip Frame 48
stop();
Symbol 39 MovieClip Frame 36
stop();
Symbol 43 MovieClip Frame 36
stop();
Symbol 47 MovieClip Frame 36
stop();
Symbol 51 MovieClip Frame 36
stop();
Symbol 55 MovieClip Frame 36
stop();
Symbol 59 MovieClip Frame 36
stop();
Symbol 63 MovieClip Frame 36
stop();
Symbol 67 MovieClip Frame 36
stop();
Symbol 71 MovieClip Frame 36
stop();
Symbol 75 MovieClip Frame 36
stop();
Symbol 80 MovieClip Frame 36
stop();
Symbol 138 Button
on (release) {
_parent.play();
MainGameHub.__get__S().btnClick();
}
on (rollOver) {
MainGameHub.__get__S().btnRoll();
}
Symbol 164 MovieClip Frame 1
if (MainGameHub.bGA == true) {
this.gotoAndPlay(20);
} else {
MainGameHub.bGA = true;
stop();
}
Symbol 164 MovieClip Frame 20
MainGameHub.__get__S().playSound("SFX_TransitionInGame", 80);
Symbol 164 MovieClip Frame 62
_parent.gotoAndStop(10);
Symbol 189 MovieClip Frame 1
this._visible = false;
Symbol 218 MovieClip Frame 1
stop();
Symbol 232 MovieClip Frame 135
stop();
Symbol 313 MovieClip [GreenArrow] Frame 3
stop();
Symbol 313 MovieClip [GreenArrow] Frame 10
Greenarrow.MainGame.init(this.mcScreen);
Symbol 334 MovieClip Frame 1
_parent.stop();
stop();
this.onEnterFrame = function () {
var _local3 = Math.round((_parent.getBytesLoaded() * 100) / _parent.getBytesTotal());
loadPercent_txt.text = _local3 + "%";
if (_local3 >= 100) {
delete this.onEnterFrame;
this.play();
}
};
Symbol 334 MovieClip Frame 39
_parent.gotoAndStop("FirstTransition");
Symbol 339 MovieClip Frame 1
btnLocker_btn.useHandCursor = false;
Symbol 346 MovieClip Frame 1
stop();
Symbol 385 MovieClip Frame 1
stop();
Symbol 531 MovieClip [__Packages.MainGameHub] Frame 0
class MainGameHub
{
static var mcRef, nStarHawkGirl, nStarSuperMan, nStarGreenArrow, nScoreSuperMan, nScoreHawkGirl, nScoreGreenArrow, nScoreTotal, bRecord, oPackaging, oController, oTransition, oHud, oSounds, oPopup, nLastScore, __get__ScoreSM, __get__ScoreHG, __get__ScoreGA, nLastStar, __get__StarSM, __get__StarHG, __get__StarGA;
function MainGameHub () {
}
static function init(_mcRef) {
mcRef = _mcRef;
mcRef.stop();
nStarHawkGirl = 0;
nStarSuperMan = 0;
nStarGreenArrow = 0;
nScoreSuperMan = 0;
nScoreHawkGirl = 0;
nScoreGreenArrow = 0;
nScoreTotal = 0;
bRecord = false;
oPackaging = new Packaging(mcRef.screen_mc);
oController = new Controller(mcRef.screen_mc);
oTransition = new Transition(mcRef.transition_mc);
oHud = new Hud(mcRef.hud_mc);
oSounds = new Sounds(mcRef);
S.playMusic("BGM_Pack", 60, -1);
oPopup = new PopUp(mcRef.popup_mc);
}
static function destroy() {
for (var _local1 in MainGameHub) {
delete MainGameHub[_local1];
}
}
static function updateScore() {
var _local1 = (Number(nScoreGreenArrow) + Number(nScoreHawkGirl)) + Number(nScoreSuperMan);
bRecord = false;
if (nScoreTotal < _local1) {
nScoreTotal = _local1;
bRecord = true;
}
trace("bRecord : " + bRecord);
}
static function get P() {
return(oPackaging);
}
static function get PP() {
return(oPopup);
}
static function get C() {
return(oController);
}
static function get T() {
return(oTransition);
}
static function get H() {
return(oHud);
}
static function get S() {
return(oSounds);
}
static function set ScoreSM(_nScore) {
nLastScore = _nScore;
if (_nScore > nScoreSuperMan) {
nScoreSuperMan = _nScore;
}
updateScore();
//return(__get__ScoreSM());
}
static function set ScoreHG(_nScore) {
nLastScore = _nScore;
if (_nScore > nScoreHawkGirl) {
nScoreHawkGirl = _nScore;
}
updateScore();
//return(__get__ScoreHG());
}
static function set ScoreGA(_nScore) {
nLastScore = _nScore;
if (_nScore > nScoreGreenArrow) {
nScoreGreenArrow = _nScore;
}
updateScore();
//return(__get__ScoreGA());
}
static function set StarSM(_nScore) {
nLastStar = _nScore;
if (_nScore > nStarSuperMan) {
nStarSuperMan = _nScore;
}
//return(__get__StarSM());
}
static function set StarHG(_nScore) {
nLastStar = _nScore;
if (_nScore > nStarHawkGirl) {
nStarHawkGirl = _nScore;
}
//return(__get__StarHG());
}
static function set StarGA(_nScore) {
nLastStar = _nScore;
if (_nScore > nStarGreenArrow) {
nStarGreenArrow = _nScore;
}
//return(__get__StarGA());
}
}
Symbol 532 MovieClip [__Packages.Packaging] Frame 0
class Packaging
{
var mcRef, bMusicSMStarted, bMusicHGStarted, bMusicGAStarted, sGameToLoad;
function Packaging (_mcRef) {
mcRef = _mcRef;
bMusicSMStarted = false;
bMusicHGStarted = false;
bMusicGAStarted = false;
}
function goto(_sLabel) {
mcRef._parent.gotoAndStop(_sLabel);
switch (_sLabel) {
case "Splash" :
initSplash();
break;
case "FirstTutorial" :
initFirstTut(1);
break;
case "TrainingMenu" :
initTrainingMenu();
break;
case "Game" :
initGame();
break;
case "ResumeGame" :
initResumeGame();
break;
case "InGameTutorial" :
initInGameTut(1);
break;
case "WinScreen" :
initWinScreen();
}
}
function clickAction(_fAction) {
MainGameHub.__get__S().btnClick();
_fAction();
}
function callTransition(_sLabel) {
MainGameHub.__get__T().transitTo(_sLabel);
}
function gotoGame(_sGame) {
sGameToLoad = _sGame;
callTransition("Game");
}
function loadGame(_sGame) {
trace("Loading game: " + _sGame);
switch (_sGame) {
case "SuperMan" :
MainGameHub.__get__S().playMusic("BGM_3", 60, -1);
MainGameHub.__get__S().fadeOutAMusic("BGM_Pack");
break;
case "HawkGirl" :
MainGameHub.__get__S().playMusic("BGM_2", 60, -1);
MainGameHub.__get__S().fadeOutAMusic("BGM_Pack");
break;
case "GreenArrow" :
MainGameHub.__get__S().playMusic("BGM_1", 60, -1);
MainGameHub.__get__S().fadeOutAMusic("BGM_Pack");
}
mcRef.gameMc.swapDepths(100);
mcRef.gameMc.removeMovieClip();
mcRef.createEmptyMovieClip("gameMc", mcRef.getNextHighestDepth());
trace((("trying to attach: " + mcRef) + ", ") + _sGame);
mcRef.gameMc.attachMovie(_sGame, "gameMc", 0);
}
function swapOverState(_mcRef) {
MainGameHub.__get__S().btnRoll();
_mcRef.swapDepths(5);
}
function checkRank() {
var _local2 = "Civilian";
var _local3 = (MainGameHub.nStarGreenArrow + MainGameHub.nStarHawkGirl) + MainGameHub.nStarSuperMan;
if (_local3 > nCIVILIAN) {
_local2 = "Trainee";
if (_local3 > nSIDEKICK) {
_local2 = "Sidekick";
if (_local3 > nSUPERHUMAN) {
_local2 = "Vigilante";
if (_local3 > nGLOBALHERO) {
_local2 = "Hero";
if (_local3 > nCOSMICHERO) {
_local2 = "Superhero ";
if (_local3 > nMASTER) {
_local2 = "Leaguer";
}
}
}
}
}
}
mcRef.rankTxt.text = _local2;
mcRef.mcMiniHud.rankTxt.text = _local2;
}
function initSplash() {
MainGameHub.bSM = false;
MainGameHub.bHG = false;
MainGameHub.bGA = false;
MainGameHub.__get__H().hide();
mcRef.play_btn.onRelease = Delegate.create(this, clickAction, Delegate.create(this, gotoGame, "GreenArrow"));
mcRef.play_btn.onRollOver = Delegate.create(MainGameHub.__get__S(), MainGameHub.__get__S().btnRoll);
}
function initTrainingMenu() {
mcRef.mcSM.SuperMan_btn.onRollOver = Delegate.create(this, swapOverState, mcRef.mcSM);
mcRef.mcHG.HawkGirl_btn.onRollOver = Delegate.create(this, swapOverState, mcRef.mcHG);
mcRef.mcGA.GreenArrow_btn.onRollOver = Delegate.create(this, swapOverState, mcRef.mcGA);
mcRef.mcMiniHud.swapDepths(10);
mcRef.mcSM.SuperMan_btn.onRelease = Delegate.create(this, clickAction, Delegate.create(this, gotoGame, "SuperMan"));
mcRef.mcHG.HawkGirl_btn.onRelease = Delegate.create(this, clickAction, Delegate.create(this, gotoGame, "HawkGirl"));
mcRef.mcGA.GreenArrow_btn.onRelease = Delegate.create(this, clickAction, Delegate.create(this, gotoGame, "GreenArrow"));
mcRef.mcMiniHud.scoreTxt.text = MainGameHub.nScoreTotal;
checkRank();
}
function initFirstTut(_nPage) {
if (_nPage == undefined) {
_nPage = 1;
}
mcRef.gotoAndStop(_nPage);
switch (_nPage) {
case 1 :
mcRef.next_btn.onRelease = Delegate.create(this, clickAction, Delegate.create(this, initFirstTut, 2));
break;
case 2 :
mcRef.next_btn.onRelease = Delegate.create(this, clickAction, Delegate.create(this, initFirstTut, 3));
mcRef.prev_btn.onRelease = Delegate.create(this, clickAction, Delegate.create(this, initFirstTut, 1));
break;
case 3 :
mcRef.next_btn.onRelease = Delegate.create(this, clickAction, Delegate.create(this, initFirstTut, 4));
mcRef.prev_btn.onRelease = Delegate.create(this, clickAction, Delegate.create(this, initFirstTut, 2));
break;
case 4 :
mcRef.prev_btn.onRelease = Delegate.create(this, clickAction, Delegate.create(this, initFirstTut, 3));
mcRef.play_btn.onRelease = Delegate.create(this, clickAction, Delegate.create(this, callTransition, "Game"));
}
}
function initGame() {
loadGame(sGameToLoad);
}
function initResumeGame() {
}
function initWinScreen() {
MainGameHub.updateScore();
mcRef.btnBackMenu.onRelease = Delegate.create(this, clickAction, Delegate.create(this, callTransition, "TrainingMenu"));
mcRef.btnBackMenu.onRollOver = Delegate.create(MainGameHub.__get__S(), MainGameHub.__get__S().btnRoll);
mcRef.btnPlayAgain.onRelease = Delegate.create(this, clickAction, Delegate.create(this, callTransition, "Game"));
mcRef.btnPlayAgain.onRollOver = Delegate.create(MainGameHub.__get__S(), MainGameHub.__get__S().btnRoll);
mcRef.score_txt.text = MainGameHub.nLastScore;
mcRef.reward_mc.gotoAndStop("Lose");
if (MainGameHub.bRecord == true) {
mcRef.reward_mc.gotoAndStop("Record");
}
if (MainGameHub.nLastStar == 6) {
switch (sGameToLoad) {
case "SuperMan" :
mcRef.reward_mc.gotoAndStop("SupermanEnd");
break;
case "HawkGirl" :
mcRef.reward_mc.gotoAndStop("HawkgirlEnd");
break;
case "GreenArrow" :
mcRef.reward_mc.gotoAndStop("GreenArrowEnd");
}
}
checkRank();
trace("MainGameHub.nStarGreenArrow : " + MainGameHub.nStarGreenArrow);
trace("MainGameHub.nStarHawkGirl : " + MainGameHub.nStarHawkGirl);
trace("MainGameHub.nStarSuperMan : " + MainGameHub.nStarSuperMan);
}
function initInGameTut(_nPage) {
if (_nPage == undefined) {
_nPage = 1;
}
var _local2 = mcRef._parent.InGame_mc;
_local2.gotoAndStop(_nPage);
switch (_nPage) {
case 1 :
_local2.next_btn.onRelease = Delegate.create(this, initInGameTut, 2);
break;
case 2 :
_local2.next_btn.onRelease = Delegate.create(this, initInGameTut, 3);
_local2.prev_btn.onRelease = Delegate.create(this, initInGameTut, 1);
break;
case 3 :
_local2.next_btn.onRelease = Delegate.create(this, initInGameTut, 4);
_local2.prev_btn.onRelease = Delegate.create(this, initInGameTut, 2);
break;
case 4 :
_local2.prev_btn.onRelease = Delegate.create(this, initInGameTut, 3);
_local2.play_btn.onRelease = Delegate.create(this, callTransition, "ResumeGame");
}
}
var nCIVILIAN = 2;
var nSIDEKICK = 5;
var nSUPERHUMAN = 8;
var nGLOBALHERO = 11;
var nCOSMICHERO = 14;
var nMASTER = 17;
}
Symbol 533 MovieClip [__Packages.Delegate] Frame 0
class Delegate extends Object
{
var func;
function Delegate () {
super();
}
function DelegateArgs(f) {
func = f;
}
static function create(obj, func) {
var _local2 = function () {
var _local3 = arguments.callee.target;
func = arguments.callee.func;
var _local2 = arguments.callee.arg;
_local2 = _local2.concat(arguments);
return(func.apply(_local3, _local2));
};
_local2.target = obj;
_local2.func = func;
_local2.arg = arguments.slice(2);
return(_local2);
}
function createDelegate(obj) {
return(create(obj, func));
}
}
Symbol 534 MovieClip [__Packages.Hud] Frame 0
class Hud
{
var mcRef, nScore;
function Hud (_mcRef) {
mcRef = _mcRef;
mcRef.gotoAndStop(1);
nScore = 0;
}
function init() {
mcRef.gotoAndStop(2);
mcRef.btnLocker_btn.useHandCursor = false;
mcRef.btnLocker_btn._visible = false;
score = (0);
mcRef.menu_btn.onRelease = Delegate.create(MainGameHub.__get__PP(), MainGameHub.__get__PP().openPopUp, "Menu");
}
function hide() {
mcRef.gotoAndStop(1);
}
function get score() {
return(nScore);
}
function set score(_nScore) {
nScore = _nScore;
mcRef.score_txt.text = nScore;
//return(score);
}
function callTransition(_sLabel) {
MainGameHub.__get__T().transitTo(_sLabel);
}
}
Symbol 535 MovieClip [__Packages.Controller] Frame 0
class Controller
{
var mcRef;
function Controller (_mcRef) {
mcRef = _mcRef;
}
}
Symbol 536 MovieClip [__Packages.State] Frame 0
class State
{
var mcRef, sState;
function State (_mcRef) {
mcRef = _mcRef;
}
function get _state() {
return(sState);
}
function set _state(_sState) {
if (_sState != "") {
sState = _sState;
mcRef.gotoAndStop(sState);
updateState();
}
//return(_state);
}
function get _stateFinished() {
return(_currentFrame == _totalFrames);
}
function get _totalFrames() {
return(mcRef.state._totalFrames);
}
function get _currentFrame() {
return(mcRef.state._currentFrame);
}
function updateState() {
this[sState]();
}
function pause() {
mcRef.state.stop();
}
function resume() {
mcRef.state.play();
}
}
Symbol 537 MovieClip [__Packages.Transition] Frame 0
class Transition extends State
{
var mcRef, bRunning, __set___state, sLabelToGo, __get___stateFinished, updateState;
function Transition (_mcRef) {
super(_mcRef);
mcRef.onEnterFrame = Delegate.create(this, update);
bRunning = true;
__set___state("Idle");
sLabelToGo = "Splash";
MainGameHub.__get__P().goto(sLabelToGo);
}
function transitTo(_sLabelToGo) {
sLabelToGo = _sLabelToGo;
bRunning = true;
__set___state("Closing");
}
function Idle() {
}
function Opening() {
if (__get___stateFinished()) {
bRunning = false;
__set___state("Idle");
}
}
function Closing() {
if (__get___stateFinished()) {
MainGameHub.__get__P().goto(sLabelToGo);
__set___state("Opening");
}
}
function update() {
if (bRunning) {
updateState();
}
}
}
Symbol 538 MovieClip [__Packages.Sounds] Frame 0
class Sounds
{
var mcRef, aSounds, aMusics, bMuted;
function Sounds (_mcRef) {
mcRef = _mcRef;
aSounds = new Array();
aMusics = new Array();
bMuted = false;
}
function playSound(_sLinkage, _nVolume, _nLoop) {
if (_nVolume == undefined) {
_nVolume = 100;
}
if (_nLoop == undefined) {
_nLoop = 0;
} else if (_nLoop == -1) {
_nLoop = 99999999 /* 0x5F5E0FF */;
}
var _local2 = findSound(_sLinkage);
if (_local2 == -1) {
var _local6 = new Sound(mcRef.createEmptyMovieClip(_sLinkage, mcRef.getNextHighestDepth()));
_local6.attachSound(_sLinkage);
var _local7 = new Object({name:_sLinkage, sound:_local6, maxVolume:_nVolume});
aSounds.push(_local7);
_local2 = aSounds.length - 1;
}
aSounds[_local2].sound.setVolume(_nVolume);
aSounds[_local2].volume = _nVolume;
aSounds[_local2].maxVolume = _nVolume;
if (!bMuted) {
aSounds[_local2].sound.start(0, _nLoop);
}
}
function playMusic(_sLinkage, _nVolume, _nLoop) {
if (_nVolume == undefined) {
_nVolume = 100;
}
if (_nLoop == undefined) {
_nLoop = 0;
} else if (_nLoop == -1) {
_nLoop = 99999999 /* 0x5F5E0FF */;
}
var _local2 = findMusic(_sLinkage);
if (_local2 == -1) {
var _local6 = new Sound(mcRef.createEmptyMovieClip(_sLinkage, mcRef.getNextHighestDepth()));
_local6.attachSound(_sLinkage);
var _local7 = new Object({name:_sLinkage, sound:_local6, maxVolume:_nVolume});
aMusics.push(_local7);
_local2 = aMusics.length - 1;
}
aMusics[_local2].sound.setVolume(_nVolume);
aMusics[_local2].volume = _nVolume;
aMusics[_local2].maxVolume = _nVolume;
if (bMuted) {
aMusics[_local2].sound.setVolume(0);
aMusics[_local2].volume = 0;
}
aMusics[_local2].sound.start(0, _nLoop);
}
function stopMusic(_sLinkage) {
var _local2 = findMusic(_sLinkage);
aMusics[_local2].sound.stop();
}
function stopSound(_sLinkage) {
var _local2 = findSound(_sLinkage);
aSounds[_local2].sound.stop();
}
function fadeInMusic() {
for (var _local4 in aMusics) {
var _local2 = aMusics[_local4];
var _local3 = new mx.transitions.Tween(_local2, "volume", mx.transitions.easing.Regular.easeOut, 0, _local2.maxVolume, 2, true);
_local3.onMotionChanged = Delegate.create(this, changeVolume, _local2);
}
}
function fadeOutMusic() {
for (var _local4 in aMusics) {
var _local2 = aMusics[_local4];
var _local3 = new mx.transitions.Tween(_local2, "volume", mx.transitions.easing.Regular.easeOut, _local2.sound.getVolume(), 0, 2, true);
_local3.onMotionChanged = Delegate.create(this, changeVolume, _local2);
}
}
function fadeInSound() {
for (var _local4 in aSounds) {
var _local2 = aSounds[_local4];
var _local3 = new mx.transitions.Tween(_local2, "volume", mx.transitions.easing.Regular.easeOut, 0, _local2.maxVolume, 2, true);
_local3.onMotionChanged = Delegate.create(this, changeVolume, _local2);
}
}
function fadeOutSound() {
for (var _local4 in aSounds) {
var _local2 = aSounds[_local4];
var _local3 = new mx.transitions.Tween(_local2, "volume", mx.transitions.easing.Regular.easeOut, _local2.sound.getVolume(), 0, 2, true);
_local3.onMotionChanged = Delegate.create(this, changeVolume, _local2);
}
}
function fadeInAMusic(_sLinkage) {
if (!bMuted) {
var _local2 = aMusics[findMusic(_sLinkage)];
var _local3 = new mx.transitions.Tween(_local2, "volume", mx.transitions.easing.Regular.easeOut, _local2.volume, _local2.maxVolume, 2, true);
_local3.onMotionChanged = Delegate.create(this, changeVolume, _local2);
}
}
function fadeOutAMusic(_sLinkage) {
if (!bMuted) {
var _local2 = aMusics[findMusic(_sLinkage)];
var _local3 = new mx.transitions.Tween(_local2, "volume", mx.transitions.easing.Regular.easeOut, _local2.sound.getVolume(), 0, 2, true);
_local3.onMotionChanged = Delegate.create(this, changeVolume, _local2);
}
}
function fadeInAll() {
for (var _local5 in aSounds) {
var _local3 = aSounds[_local5];
var _local4 = new mx.transitions.Tween(_local3, "volume", mx.transitions.easing.Regular.easeOut, 0, _local3.maxVolume, 2, true);
_local4.onMotionChanged = Delegate.create(this, changeVolume, _local3);
}
for (var _local5 in aMusics) {
var _local2 = aMusics[_local5];
var _local4 = new mx.transitions.Tween(_local2, "volume", mx.transitions.easing.Regular.easeOut, 0, _local2.maxVolume, 2, true);
_local4.onMotionChanged = Delegate.create(this, changeVolume, _local2);
}
}
function fadeOutAll() {
for (var _local5 in aSounds) {
var _local3 = aSounds[_local5];
var _local4 = new mx.transitions.Tween(_local3, "volume", mx.transitions.easing.Regular.easeOut, _local3.sound.getVolume(), 0, 2, true);
_local4.onMotionChanged = Delegate.create(this, changeVolume, _local3);
}
for (var _local5 in aMusics) {
var _local2 = aMusics[_local5];
var _local4 = new mx.transitions.Tween(_local2, "volume", mx.transitions.easing.Regular.easeOut, _local2.sound.getVolume(), 0, 2, true);
_local4.onMotionChanged = Delegate.create(this, changeVolume, _local2);
}
}
function muteAll() {
bMuted = true;
}
function unMuteAll() {
bMuted = false;
}
function btnClick() {
playSound("BTN_Click", 60);
}
function btnRoll() {
playSound("BTN_Roll", 60);
}
function get muted() {
return(bMuted);
}
function findSound(_sLinkage) {
var _local2 = -1;
for (var _local4 in aSounds) {
if (aSounds[_local4].name == _sLinkage) {
_local2 = _local4;
break;
}
}
return(_local2);
}
function findMusic(_sLinkage) {
var _local2 = -1;
for (var _local4 in aMusics) {
if (aMusics[_local4].name == _sLinkage) {
_local2 = _local4;
break;
}
}
return(_local2);
}
function changeVolume(_oSound) {
_oSound.sound.setVolume(_oSound.volume);
}
}
Symbol 539 MovieClip [__Packages.mx.transitions.OnEnterFrameBeacon] Frame 0
class mx.transitions.OnEnterFrameBeacon
{
function OnEnterFrameBeacon () {
}
static function init() {
var _local4 = _global.MovieClip;
if (!_root.__OnEnterFrameBeacon) {
mx.transitions.BroadcasterMX.initialize(_local4);
var _local3 = _root.createEmptyMovieClip("__OnEnterFrameBeacon", 9876);
_local3.onEnterFrame = function () {
_global.MovieClip.broadcastMessage("onEnterFrame");
};
}
}
static var version = "1.1.0.52";
}
Symbol 540 MovieClip [__Packages.mx.transitions.BroadcasterMX] Frame 0
class mx.transitions.BroadcasterMX
{
var _listeners;
function BroadcasterMX () {
}
static function initialize(o, dontCreateArray) {
if (o.broadcastMessage != undefined) {
delete o.broadcastMessage;
}
o.addListener = mx.transitions.BroadcasterMX.prototype.addListener;
o.removeListener = mx.transitions.BroadcasterMX.prototype.removeListener;
if (!dontCreateArray) {
o._listeners = new Array();
}
}
function addListener(o) {
removeListener(o);
if (broadcastMessage == undefined) {
broadcastMessage = mx.transitions.BroadcasterMX.prototype.broadcastMessage;
}
return(_listeners.push(o));
}
function removeListener(o) {
var _local2 = _listeners;
var _local3 = _local2.length;
while (_local3--) {
if (_local2[_local3] == o) {
_local2.splice(_local3, 1);
if (!_local2.length) {
broadcastMessage = undefined;
}
return(true);
}
}
return(false);
}
function broadcastMessage() {
var _local5 = String(arguments.shift());
var _local4 = _listeners.concat();
var _local6 = _local4.length;
var _local3 = 0;
while (_local3 < _local6) {
_local4[_local3][_local5].apply(_local4[_local3], arguments);
_local3++;
}
}
static var version = "1.1.0.52";
}
Symbol 541 MovieClip [__Packages.mx.transitions.Tween] Frame 0
class mx.transitions.Tween
{
var obj, prop, begin, useSeconds, _listeners, addListener, prevTime, _time, looping, _duration, broadcastMessage, isPlaying, _fps, prevPos, _pos, change, _intervalID, _startTime;
function Tween (obj, prop, func, begin, finish, duration, useSeconds) {
mx.transitions.OnEnterFrameBeacon.init();
if (!arguments.length) {
return;
}
this.obj = obj;
this.prop = prop;
this.begin = begin;
position = (begin);
this.duration = (duration);
this.useSeconds = useSeconds;
if (func) {
this.func = func;
}
this.finish = (finish);
_listeners = [];
addListener(this);
start();
}
function set time(t) {
prevTime = _time;
if (t > duration) {
if (looping) {
rewind(t - _duration);
update();
broadcastMessage("onMotionLooped", this);
} else {
if (useSeconds) {
_time = _duration;
update();
}
stop();
broadcastMessage("onMotionFinished", this);
}
} else if (t < 0) {
rewind();
update();
} else {
_time = t;
update();
}
//return(time);
}
function get time() {
return(_time);
}
function set duration(d) {
_duration = (((d == null) || (d <= 0)) ? (_global.Infinity) : (d));
//return(duration);
}
function get duration() {
return(_duration);
}
function set FPS(fps) {
var _local2 = isPlaying;
stopEnterFrame();
_fps = fps;
if (_local2) {
startEnterFrame();
}
//return(FPS);
}
function get FPS() {
return(_fps);
}
function set position(p) {
setPosition(p);
//return(position);
}
function setPosition(p) {
prevPos = _pos;
obj[prop] = (_pos = p);
broadcastMessage("onMotionChanged", this, _pos);
updateAfterEvent();
}
function get position() {
return(getPosition());
}
function getPosition(t) {
if (t == undefined) {
t = _time;
}
return(func(t, begin, change, _duration));
}
function set finish(f) {
change = f - begin;
//return(finish);
}
function get finish() {
return(begin + change);
}
function continueTo(finish, duration) {
begin = position;
this.finish = (finish);
if (duration != undefined) {
this.duration = (duration);
}
start();
}
function yoyo() {
continueTo(begin, time);
}
function startEnterFrame() {
if (_fps == undefined) {
_global.MovieClip.addListener(this);
} else {
_intervalID = setInterval(this, "onEnterFrame", 1000 / _fps);
}
isPlaying = true;
}
function stopEnterFrame() {
if (_fps == undefined) {
_global.MovieClip.removeListener(this);
} else {
clearInterval(_intervalID);
}
isPlaying = false;
}
function start() {
rewind();
startEnterFrame();
broadcastMessage("onMotionStarted", this);
}
function stop() {
stopEnterFrame();
broadcastMessage("onMotionStopped", this);
}
function resume() {
fixTime();
startEnterFrame();
broadcastMessage("onMotionResumed", this);
}
function rewind(t) {
_time = ((t == undefined) ? 0 : (t));
fixTime();
update();
}
function fforward() {
time = (_duration);
fixTime();
}
function nextFrame() {
if (useSeconds) {
time = ((getTimer() - _startTime) / 1000);
} else {
time = (_time + 1);
}
}
function onEnterFrame() {
nextFrame();
}
function prevFrame() {
if (!useSeconds) {
time = (_time - 1);
}
}
function toString() {
return("[Tween]");
}
function fixTime() {
if (useSeconds) {
_startTime = getTimer() - (_time * 1000);
}
}
function update() {
position = (getPosition(_time));
}
static var version = "1.1.0.52";
static var __initBeacon = mx.transitions.OnEnterFrameBeacon.init();
static var __initBroadcaster = mx.transitions.BroadcasterMX.initialize(mx.transitions.Tween.prototype, true);
function func(t, b, c, d) {
return(((c * t) / d) + b);
}
}
Symbol 542 MovieClip [__Packages.mx.transitions.easing.Regular] Frame 0
class mx.transitions.easing.Regular
{
function Regular () {
}
static function easeIn(t, b, c, d) {
t = t / d;
return(((c * t) * t) + b);
}
static function easeOut(t, b, c, d) {
t = t / d;
return((((-c) * t) * (t - 2)) + b);
}
static function easeInOut(t, b, c, d) {
t = t / (d / 2);
if (t < 1) {
return((((c / 2) * t) * t) + b);
}
t--;
return((((-c) / 2) * ((t * (t - 2)) - 1)) + b);
}
static var version = "1.1.0.52";
}
Symbol 543 MovieClip [__Packages.PopUp] Frame 0
class PopUp extends State
{
var mcRef, oListener, sActivePopUp, updateState, __get___stateFinished;
function PopUp (_mcRef) {
super();
mcRef = _mcRef;
oListener = new Object();
_state = ("Idle");
sActivePopUp = "";
mcRef.onEnterFrame = Delegate.create(this, update);
mcRef._visible = false;
}
function update() {
updateState();
}
function openPopUp(_sPopUp) {
_state = ("Opening");
mcRef._visible = true;
sActivePopUp = _sPopUp;
initState();
}
function clickAction(_fAction) {
MainGameHub.__get__S().btnClick();
_fAction();
}
function get _state() {
return(super.__get___state());
}
function set _state(_sState) {
super.__set___state(_sState);
if (_sState == "Closing") {
initState();
initButtons();
}
//return(_state);
}
function Idle() {
}
function Opening() {
if (__get___stateFinished()) {
_state = ("Open");
initState();
initButtons();
}
}
function Open() {
}
function Closing() {
if (__get___stateFinished()) {
_state = ("Idle");
mcRef._visible = false;
}
}
function initState() {
mcRef.state.menu_mc.gotoAndStop(sActivePopUp);
initButtons();
updateSoundBtn();
}
function initButtons() {
switch (sActivePopUp) {
case "Menu" :
initMenu();
break;
case "Quit" :
initQuit();
break;
case "HelpHawk" :
initHelpHawk();
break;
case "HelpSuper" :
initHelpSuper();
break;
case "HelpGreen" :
initHelpGreen();
break;
case "HGLevel1" :
case "HGLevel2" :
case "HGLevel3" :
case "HGLevel4" :
case "HGLevel5" :
case "HGLevel6" :
case "SMLevel1" :
case "SMLevel2" :
case "SMLevel3" :
case "SMLevel4" :
case "SMLevel5" :
case "SMLevel6" :
case "GALevel1" :
case "GALevel2" :
case "GALevel3" :
case "GALevel4" :
case "GALevel5" :
case "GALevel6" :
initLevelPopup();
}
}
function initMenu() {
mcRef.state.menu_mc.resume_btn.onRelease = Delegate.create(this, clickAction, Delegate.create(this, resumeGame));
mcRef.state.menu_mc.resume_btn.onRollOver = Delegate.create(MainGameHub.__get__S(), MainGameHub.__get__S().btnRoll);
mcRef.state.menu_mc.help_btn.onRelease = Delegate.create(this, clickAction, Delegate.create(this, helpInGame));
mcRef.state.menu_mc.help_btn.onRollOver = Delegate.create(MainGameHub.__get__S(), MainGameHub.__get__S().btnRoll);
mcRef.state.menu_mc.quit_btn.onRelease = Delegate.create(this, clickAction, Delegate.create(this, quitGame));
mcRef.state.menu_mc.quit_btn.onRollOver = Delegate.create(MainGameHub.__get__S(), MainGameHub.__get__S().btnRoll);
}
function initQuit() {
mcRef.state.menu_mc.yes_btn.onRelease = Delegate.create(this, clickAction, Delegate.create(this, quitGame));
mcRef.state.menu_mc.yes_btn.onRollOver = Delegate.create(MainGameHub.__get__S(), MainGameHub.__get__S().btnRoll);
mcRef.state.menu_mc.no_btn.onRelease = Delegate.create(this, clickAction, Delegate.create(this, resumePopup));
mcRef.state.menu_mc.no_btn.onRollOver = Delegate.create(MainGameHub.__get__S(), MainGameHub.__get__S().btnRoll);
}
function initHelpHawk() {
mcRef.state.menu_mc.okBtn.onRelease = Delegate.create(this, clickAction, Delegate.create(this, resumeGame));
mcRef.state.menu_mc.okBtn.onRollOver = Delegate.create(MainGameHub.__get__S(), MainGameHub.__get__S().btnRoll);
}
function initHelpSuper() {
mcRef.state.menu_mc.okBtn.onRelease = Delegate.create(this, clickAction, Delegate.create(this, resumeGame));
mcRef.state.menu_mc.okBtn.onRollOver = Delegate.create(MainGameHub.__get__S(), MainGameHub.__get__S().btnRoll);
}
function initHelpGreen() {
mcRef.state.menu_mc.okBtn.onRelease = Delegate.create(this, clickAction, Delegate.create(this, resumeGame));
mcRef.state.menu_mc.okBtn.onRollOver = Delegate.create(MainGameHub.__get__S(), MainGameHub.__get__S().btnRoll);
}
function initLevelPopup() {
if (_state == "Open") {
Key.addListener(oListener);
oListener.onKeyDown = Delegate.create(this, checkKey);
}
mcRef.state.menu_mc.txtDist.text = Math.round((Greenarrow.MainGame.__get__A().aimX() / 12) + 35);
mcRef.state.menu_mc.okBtn.onRelease = Delegate.create(this, clickAction, Delegate.create(this, resumeGame));
mcRef.state.menu_mc.okBtn.onRollOver = Delegate.create(MainGameHub.__get__S(), MainGameHub.__get__S().btnRoll);
}
function resumePopup() {
mcRef.state.menu_mc.gotoAndStop("Menu");
sActivePopUp = "Menu";
initButtons();
initState();
}
function checkKey() {
if (Key.getCode() == 32) {
resumeGame();
}
}
function resumeGame() {
Key.removeListener(oListener);
_state = ("Closing");
switch (MainGameHub.__get__P().sGameToLoad) {
case "SuperMan" :
Superman.MainGame.resume();
break;
case "HawkGirl" :
Hawkgirl.MainGame.resume();
break;
case "GreenArrow" :
Greenarrow.MainGame.resume();
}
initButtons();
}
function quitGame() {
_state = ("Closing");
switch (MainGameHub.__get__P().sGameToLoad) {
case "SuperMan" :
Superman.MainGame.destroyAndQuit();
break;
case "HawkGirl" :
Hawkgirl.MainGame.destroyAndQuit();
break;
case "GreenArrow" :
Greenarrow.MainGame.destroyAndQuit();
}
}
function helpInGame() {
_state = ("Closing");
MainGameHub.__get__T().transitTo("InGameTutorial");
}
function openQuit() {
mcRef.state.menu_mc.gotoAndStop("Quit");
sActivePopUp = "Quit";
initButtons();
}
function muteUnMute() {
if (MainGameHub.__get__S().__get__muted()) {
MainGameHub.__get__S().unMuteAll();
switch (MainGameHub.__get__P().sGameToLoad) {
case "SuperMan" :
MainGameHub.__get__S().fadeInAMusic("BGM_3");
break;
case "HawkGirl" :
MainGameHub.__get__S().fadeInAMusic("BGM_2");
break;
case "GreenArrow" :
MainGameHub.__get__S().fadeInAMusic("BGM_1");
}
} else {
MainGameHub.__get__S().fadeOutAll();
MainGameHub.__get__S().muteAll();
}
updateSoundBtn();
}
function updateSoundBtn() {
var _local2 = 2;
if (MainGameHub.__get__S().__get__muted()) {
_local2 = 1;
}
mcRef.state.menu_mc.soundBtn_mc.gotoAndStop(_local2);
mcRef.state.menu_mc.soundBtn_mc.sound_btn.onRelease = Delegate.create(this, clickAction, Delegate.create(this, muteUnMute));
mcRef.state.menu_mc.soundBtn_mc.sound_btn.onRollOver = Delegate.create(MainGameHub.__get__S(), MainGameHub.__get__S().btnRoll);
}
}
Symbol 544 MovieClip [__Packages.Greenarrow.MainGame] Frame 0
class Greenarrow.MainGame
{
static var mcRef, oBroadcaster, bZoomed, oRobot, oRobot2, bRobot1, bRobot2, oTransition, oAim, oGreenarrow, oBG, nArrow, nLevel, nScore, nHits, nBullEyeHits, nAimInterval, bRunning;
function MainGame () {
}
static function init(_mcRef) {
mcRef = _mcRef;
oBroadcaster = new Object();
bZoomed = false;
AsBroadcaster.initialize(oBroadcaster);
oRobot = new Greenarrow.Aim(mcRef.mcWorld.mcRobot);
oRobot2 = new Greenarrow.Aim(mcRef.mcWorld.mcRobot2);
mcRef.mcWorld.mcRobot._visible = false;
mcRef.mcWorld.arrowMc._visible = false;
bRobot1 = false;
mcRef.mcWorld.mcRobot2._visible = false;
mcRef.mcWorld.arrow2Mc._visible = false;
bRobot2 = false;
oBroadcaster.addListener(oRobot);
oBroadcaster.addListener(oRobot2);
oTransition = new Greenarrow.GameTransition(mcRef.transitionMc);
oBroadcaster.addListener(oTransition);
oAim = new Greenarrow.Aim(mcRef.mcWorld.mcAim);
oGreenarrow = new Greenarrow.GreenarrowPlayer(mcRef.mcWorld.mcGreenarrow);
oBG = new Greenarrow.Background(mcRef.mcWorld, mcRef.mcWorld.mcAim);
nArrow = 5;
nLevel = 1;
nScore = 0;
nHits = 0;
nBullEyeHits = 0;
mcRef.onEnterFrame = Delegate.create(Greenarrow.MainGame, update);
mcRef.btnMenu.onRelease = Delegate.create(Greenarrow.MainGame, openMenu);
mcRef.btnHelp.onRelease = Delegate.create(Greenarrow.MainGame, openHelp);
mcRef.btnMenu.onRollOver = Delegate.create(MainGameHub.__get__S(), MainGameHub.__get__S().btnRoll);
mcRef.btnHelp.onRollOver = Delegate.create(MainGameHub.__get__S(), MainGameHub.__get__S().btnRoll);
mcRef.btnZoom.onRollOver = Delegate.create(MainGameHub.__get__S(), MainGameHub.__get__S().btnRoll);
mcRef.btnZoom.onRelease = Delegate.create(Greenarrow.MainGame, setZoom);
MainGameHub.__get__PP().openPopUp("GALevel1");
updateHud();
mcRef.mcMeter.mcPower.gotoAndStop(1);
mcRef.mcWon.gotoAndStop(1);
mcRef.mcMeter.gotoAndStop(1);
changeAimToPlayer();
}
static function nextLevel() {
oTransition.transit();
mcRef.mcWon.gotoAndStop(1);
nLevel++;
nHits = 0;
nBullEyeHits = 0;
nArrow = 5;
updateHud();
clearArrow();
BG.changeTarget(oGreenarrow.__get__mc());
oGreenarrow.__set___state("Idle");
trace("nLevel : " + nLevel);
if (nLevel >= 3) {
mcRef.mcWorld.arrowMc._visible = true;
mcRef.mcWorld.mcRobot._visible = true;
oRobot.randomPos();
bRobot1 = true;
}
if (nLevel >= 4) {
oRobot2.randomPos();
mcRef.mcWorld.arrow2Mc._visible = true;
mcRef.mcWorld.mcRobot2._visible = true;
bRobot2 = true;
}
A.randomPos();
pause();
MainGameHub.__get__PP().openPopUp("GALevel" + nLevel);
}
static function clearArrow() {
for (var _local1 in BG.mcRef) {
if (BG.mcRef[_local1]._name.indexOf("mcArrow") != -1) {
BG.mcRef[_local1].removeMovieClip();
}
}
}
static function setZoom() {
if (bZoomed) {
bZoomed = false;
BG.zoomOut();
} else if (oGreenarrow.__get___state() == "Idle") {
bZoomed = true;
BG.zoomIn();
}
}
static function changeAimToPlayer() {
clearInterval(nAimInterval);
BG.changeTarget(mcRef.mcWorld.mcGreenarrow);
}
static function resume() {
oBroadcaster.broadcastMessage("resume");
bRunning = true;
}
static function pause() {
oBroadcaster.broadcastMessage("pause");
bRunning = false;
}
static function throwArrow(_nForce, _nAngle, _oPt) {
var _local2 = BG.mcRef.getNextHighestDepth();
var _local1 = BG.mcRef.attachMovie("mcArrow", "mcArrow" + _local2, _local2);
BG.changeTarget(_local1);
var _local3 = new Greenarrow.Arrow(_local1, _nForce, _nAngle, _oPt);
nArrow--;
updateHud();
}
static function destroyAndQuit() {
pause();
for (var _local1 in Greenarrow.MainGame) {
if (typeof(Greenarrow.MainGame[_local1]) != "function") {
delete Greenarrow.MainGame[_local1];
trace(Greenarrow.MainGame[_local1]);
}
}
MainGameHub.__get__S().stopMusic("BGM_1");
MainGameHub.__get__S().fadeInAMusic("BGM_Pack");
MainGameHub.__get__T().transitTo("Splash");
}
static function updateHud() {
mcRef.nbArrow_txt.text = nArrow;
mcRef.score_txt.text = nScore;
}
static function endGame() {
MainGameHub.__set__ScoreGA(nScore);
MainGameHub.__set__StarGA(nLevel - 1);
pause();
for (var _local1 in Greenarrow.MainGame) {
if (typeof(Greenarrow.MainGame[_local1]) != "function") {
delete Greenarrow.MainGame[_local1];
trace(Greenarrow.MainGame[_local1]);
}
}
MainGameHub.__get__S().stopMusic("BGM_1");
MainGameHub.__get__S().fadeInAMusic("BGM_Pack");
MainGameHub.__get__T().transitTo("WinScreen");
}
static function get BG() {
return(oBG);
}
static function get A() {
return(oAim);
}
static function get Broadcaster() {
return(oBroadcaster);
}
static function update() {
if (bRunning) {
if (bRobot1 == true) {
trace(oRobot.mcRef._y);
mcRef.mcWorld.arrowMc._y = oRobot.mcRef._y + oRobot.mcRef.state._y;
}
if (bRobot2 == true) {
mcRef.mcWorld.arrow2Mc._y = oRobot2.mcRef._y + oRobot2.mcRef.state._y;
}
oBroadcaster.broadcastMessage("update");
}
}
static function openMenu() {
MainGameHub.__get__S().btnClick();
pause();
MainGameHub.__get__PP().openPopUp("Menu");
}
static function openHelp() {
MainGameHub.__get__S().btnClick();
pause();
MainGameHub.__get__PP().openPopUp("HelpGreen");
}
}
Symbol 545 MovieClip [__Packages.Greenarrow.State] Frame 0
class Greenarrow.State
{
var mcRef, sState;
function State (_mcRef) {
mcRef = _mcRef;
}
function get _state() {
return(sState);
}
function set _state(_sState) {
if (_sState != "") {
sState = _sState;
mcRef.gotoAndStop(sState);
updateState();
}
//return(_state);
}
function get _stateFinished() {
return(_currentFrame == _totalFrames);
}
function get _totalFrames() {
return(mcRef.state._totalframes);
}
function get _currentFrame() {
return(mcRef.state._currentframe);
}
function updateState() {
this[sState]();
}
function pause() {
mcRef.state.stop();
}
function resume() {
mcRef.state.play();
}
}
Symbol 546 MovieClip [__Packages.Greenarrow.GreenarrowPlayer] Frame 0
class Greenarrow.GreenarrowPlayer extends Greenarrow.State
{
var nRotation, nForce, oPointStart, bMousePress, mcRef, __set___state, updateState, __get___state, __get___stateFinished;
function GreenarrowPlayer (_mcRef) {
super(_mcRef);
Greenarrow.MainGame.__get__Broadcaster().addListener(this);
nRotation = 1;
nForce = 1;
oPointStart = new flash.geom.Point(0, 0);
Mouse.addListener(this);
bMousePress = false;
mcRef.state.mcLeftArm.mcArrow.gotoAndStop("Idle");
Greenarrow.MainGame.mcRef.mcMeter.mcPower.gotoAndStop(1);
Greenarrow.MainGame.mcRef.mcMeter.mcAngle.gotoAndStop(1);
Greenarrow.MainGame.mcRef.mcMeter.txtAngle.text = "0";
__set___state("Idle");
}
function get mc() {
return(mcRef);
}
function update() {
updateState();
}
function onMouseDown() {
if (Greenarrow.MainGame.bRunning && (Greenarrow.MainGame.bZoomed == false)) {
bMousePress = true;
if ((__get___state() == "Idle") && (Greenarrow.MainGame.__get__BG().mcRef.mcHitMouse.hitTest(Greenarrow.MainGame.mcRef._xmouse, Greenarrow.MainGame.mcRef._ymouse))) {
oPointStart.x = mcRef._xmouse;
oPointStart.y = mcRef._ymouse;
mcRef.localToGlobal(oPointStart);
__set___state("Charge");
MainGameHub.__get__S().playSound("SFX_ArrowTake", 50);
mcRef.state.mcLeftArm.mcArrow.gotoAndStop("Idle");
}
}
}
function onMouseUp() {
if (Greenarrow.MainGame.bRunning && (Greenarrow.MainGame.bZoomed == false)) {
bMousePress = false;
if (__get___state() == "Aim") {
var _local2 = new flash.geom.Point(mcRef.state.mcLeftArm.mcArrow._x, mcRef.state.mcLeftArm.mcArrow._y);
mcRef.state.mcLeftArm.localToGlobal(_local2);
Greenarrow.MainGame.oBG.mcRef.globalToLocal(_local2);
Greenarrow.MainGame.throwArrow(nForce, nRotation, _local2);
__set___state("Launch");
MainGameHub.__get__S().playSound("SFX_Arrow_Shoot", 60);
nForce = 1;
nRotation = 1;
mcRef.state.mcLeftArm.gotoAndPlay(100);
Greenarrow.MainGame.mcRef.mcMeter.mcPower.gotoAndStop(100);
mcRef.state.mcLeftArm.mcArrow._visible = false;
}
}
}
function checkForce() {
var _local2 = new flash.geom.Point(0, 0);
_local2.x = mcRef._xmouse;
_local2.y = mcRef._ymouse;
mcRef.localToGlobal(_local2);
var _local3 = _local2.x - oPointStart.x;
var _local5 = _local2.y - oPointStart.y;
var _local4 = Math.sqrt((_local3 * _local3) + (_local5 * _local5));
if (_local3 > 0) {
_local4 = 0;
}
nForce = _local4;
if (nForce > nMAX_FORCE) {
nForce = nMAX_FORCE;
}
if (nForce < 1) {
nForce = 1;
}
}
function checkRotation() {
var _local2 = new flash.geom.Point(0, 0);
_local2.x = mcRef._xmouse;
_local2.y = mcRef._ymouse;
mcRef.localToGlobal(_local2);
var _local4 = _local2.x - oPointStart.x;
var _local6 = _local2.y - oPointStart.y;
var _local5 = _local6 / _local4;
var _local3 = MoreMath.RadToDeg(Math.atan(_local5));
if (_local4 > 0) {
_local3 = -nRotation;
}
nRotation = -_local3;
if (nRotation > nMAX_ROTATION) {
nRotation = nMAX_ROTATION;
}
if (nRotation < 1) {
nRotation = 1;
}
if (isNaN(nRotation)) {
nRotation = 1;
}
}
function changeAnim() {
var _local3 = Math.round((nRotation * 100) / nMAX_ROTATION);
var _local2 = Math.round((nForce * 100) / nMAX_FORCE);
mcRef.state.gotoAndStop(_local3);
Greenarrow.MainGame.mcRef.mcMeter.mcAngle.gotoAndStop(_local3);
Greenarrow.MainGame.mcRef.mcMeter.mcPower.gotoAndStop(_local2);
Greenarrow.MainGame.mcRef.mcMeter.txtAngle.text = Math.round(nRotation).toString();
mcRef.state.mcRightArm.gotoAndStop(_local2);
mcRef.state.mcLeftArm.gotoAndStop(_local2);
}
function Idle() {
}
function Charge() {
if (__get___stateFinished()) {
__set___state("Aim");
nForce = 1;
nRotation = 1;
mcRef.state.mcLeftArm.mcArrow.gotoAndStop("Idle");
}
}
function Aim() {
if (bMousePress) {
mcRef.state.mcLeftArm.mcArrow._visible = true;
checkForce();
checkRotation();
}
changeAnim();
}
static var nPLAYER_SPEED = 3;
static var nMAX_X_SCREEN = 945;
static var nMIN_X_SCREEN = 35;
static var nMAX_ROTATION = 85;
static var nMAX_FORCE = 160;
}
Symbol 547 MovieClip [__Packages.MoreMath] Frame 0
class MoreMath
{
function MoreMath () {
}
static function RoundedRandom(_nStart, _nEnd) {
return(_nStart + Math.floor(Math.random() * ((_nEnd - _nStart) + 1)));
}
static function Random(_nStart, _nEnd) {
return(_nStart + (Math.random() * ((_nEnd - _nStart) + 1)));
}
static function PtDist(_oPt1, _oPt2) {
var _local1 = new flash.geom.Point(0, 0);
if (_oPt1.x > _oPt2.x) {
_local1.x = _oPt1.x - _oPt2.x;
} else {
_local1.x = _oPt2.x - _oPt1.x;
}
if (_oPt1.y > _oPt2.y) {
_local1.y = _oPt1.y - _oPt2.y;
} else {
_local1.y = _oPt2.y - _oPt1.y;
}
return(_local1);
}
static function PtAngle(_oPt1, _oPt2) {
var _local1 = 0;
var _local3 = PtDist(_oPt1, _oPt2).x;
var _local2 = PtDist(_oPt1, _oPt2).y;
_local1 = RadToDeg(Math.atan(_local2 / _local3));
return(_local1);
}
static function CoordRotation(_nX, _nY) {
return(RadToDeg(Math.atan2(_nY, _nX)));
}
static function RadToDeg(_nRad) {
return((_nRad * 180) / Math.PI);
}
static function DegToRad(_nDeg) {
return((_nDeg / 180) * Math.PI);
}
}
Symbol 548 MovieClip [__Packages.Greenarrow.Background] Frame 0
class Greenarrow.Background
{
var mcRef, mcTarget, mcLastTarget, nScale, bZooming;
function Background (_mcRef, _mcTarget) {
mcRef = _mcRef;
mcTarget = _mcTarget;
mcLastTarget = new MovieClip();
nScale = mcRef._xscale;
bZooming = false;
Greenarrow.MainGame.__get__Broadcaster().addListener(this);
}
function changeTarget(_mcRef) {
mcTarget = _mcRef;
}
function zoomIn() {
mcLastTarget = mcTarget;
mcTarget = mcRef.centerMc;
nScale = 14;
bZooming = true;
}
function zoomOut() {
mcTarget = mcLastTarget;
nScale = 100;
bZooming = true;
}
function update() {
checkTargetPos();
}
function checkTargetPos() {
var _local3 = 0;
var _local2 = 0;
var _local8 = nSTAGE_WIDTH / 2;
var _local7 = nSTAGE_HEIGTH / 2;
var _local6 = getMainGameCoord().x;
var _local5 = getMainGameCoord().y;
var _local4 = 0;
if (bZooming) {
if (mcRef._xscale < nScale) {
_local4 = nScale - mcRef._xscale;
if (_local4 < 0.5) {
mcRef._xscale = nScale;
} else {
mcRef._xscale = mcRef._xscale + _local4;
}
mcRef._yscale = mcRef._xscale;
} else if (mcRef._xscale > (nScale + 1)) {
_local4 = (mcRef._xscale - nScale) / nSLOW_DOWN_RATIO;
if (_local4 < 0.5) {
mcRef._xscale = nScale + 1;
} else {
mcRef._xscale = mcRef._xscale - _local4;
}
mcRef._yscale = mcRef._xscale;
}
if (mcRef._xscale == nScale) {
bZooming = false;
}
}
if ((_local6 < _local8) && (mcRef._x < nMAX_X_POS)) {
_local3 = (_local8 - _local6) / nSLOW_DOWN_RATIO;
} else if ((_local6 > _local8) && (mcRef._x > nMIN_X_POS)) {
_local3 = (-(_local6 - _local8)) / nSLOW_DOWN_RATIO;
}
if ((_local3 > 0) && (_local3 <= nSPEED_MIN)) {
_local3 = 0;
} else if ((_local3 < 0) && (_local3 >= (-nSPEED_MIN))) {
_local3 = 0;
}
if ((_local5 < _local7) && (mcRef._y < nMAX_Y_POS)) {
_local2 = (_local7 - _local5) / nSLOW_DOWN_RATIO;
} else if ((_local5 > _local7) && (mcRef._y > nMIN_Y_POS)) {
_local2 = (-(_local5 - _local7)) / nSLOW_DOWN_RATIO;
}
if ((_local2 > 0) && (_local2 <= nSPEED_MIN)) {
_local2 = 0;
} else if ((_local2 < 0) && (_local2 >= (-nSPEED_MIN))) {
_local2 = 0;
}
if ((_local3 != 0) || (_local2 != 0)) {
move(_local3, _local2);
}
}
function getMainGameCoord() {
var _local2 = new Object();
_local2.x = 0;
_local2.y = 0;
_local2.x = mcTarget._x;
_local2.y = mcTarget._y;
mcRef.localToGlobal(_local2);
return(_local2);
}
function move(_nXSpeed, _nYSpeed) {
mcRef._x = mcRef._x + _nXSpeed;
mcRef._y = mcRef._y + _nYSpeed;
mcRef.mcMontain._x = mcRef.mcMontain._x + (_nXSpeed / nRATIO_MONTAIN);
mcRef.mcCity._x = mcRef.mcCity._x + (_nXSpeed / nRATIO_CITY);
if (mcRef._x < nMIN_X_POS) {
mcRef._x = nMIN_X_POS;
} else if (mcRef._x > nMAX_X_POS) {
mcRef._x = nMAX_X_POS;
}
if (mcRef._y < nMIN_Y_POS) {
mcRef._y = nMIN_Y_POS;
} else if (mcRef._y > nMAX_Y_POS) {
mcRef._y = nMAX_Y_POS;
}
}
var nSLOW_DOWN_RATIO = 4;
var nSPEED_MIN = 0.5;
var nMAX_X_POS = -14;
var nMIN_X_POS = -3055;
var nSTAGE_WIDTH = 500;
var nSTAGE_HEIGTH = 375;
var nMIN_Y_POS = -44;
var nMAX_Y_POS = 1044.8;
var nRATIO_MONTAIN = 1.2;
var nRATIO_CITY = 2;
}
Symbol 549 MovieClip [__Packages.Greenarrow.Aim] Frame 0
class Greenarrow.Aim extends Greenarrow.State
{
var nXOrg, mcRef;
function Aim (_mcRef) {
super(_mcRef);
nXOrg = mcRef._x;
mcRef._x = MoreMath.Random(mcRef._x - nOFFSET_RANDOM, mcRef._x + nOFFSET_RANDOM);
mcRef._parent.aimFoot_mc._x = mcRef._x;
}
function randomPos() {
mcRef._x = MoreMath.Random(nXOrg - nOFFSET_RANDOM, nXOrg + nOFFSET_RANDOM);
mcRef._parent.aimFoot_mc._x = mcRef._x;
}
function aimX() {
return(mcRef._x);
}
function checkAim(_nY) {
var _local2 = false;
if ((_nY >= ((mcRef._y - (mcRef._height / 2)) + nOFFSET_Y)) && (_nY <= ((mcRef._y + (mcRef._height / 2)) - nOFFSET_Y))) {
_local2 = true;
}
return(_local2);
}
function pause() {
mcRef.stop();
}
function resume() {
mcRef.play();
}
function checkPoint(_nY) {
var _local5 = new flash.geom.Point(0, _nY);
mcRef._parent.localToGlobal(_local5);
mcRef.globalToLocal(_local5);
var _local4 = Math.abs(_local5.y);
var _local3 = 0;
var _local2 = "White";
if (_local4 <= nWHITE_SHOT2) {
_local2 = "White2";
_local3 = nWHITE_SCORE2;
if (_local4 <= nWHITE_SHOT) {
_local2 = "White";
_local3 = nWHITE_SCORE;
if (_local4 <= nBLACK_SHOT2) {
_local2 = "Black2";
_local3 = nBLACK_SCORE2;
if (_local4 <= nBLACK_SHOT) {
_local2 = "Black";
_local3 = nBLACK_SCORE;
if (_local4 <= nBLUE_SHOT2) {
_local2 = "Blue2";
_local3 = nBLUE_SCORE2;
if (_local4 <= nBLUE_SHOT) {
_local2 = "Blue";
_local3 = nBLUE_SCORE;
if (_local4 <= nRED_SHOT2) {
_local2 = "Red2";
_local3 = nRED_SCORE2;
if (_local4 <= nRED_SHOT) {
_local2 = "Red";
_local3 = nRED_SCORE;
if (_local4 <= nYELLOW_SHOT2) {
_local2 = "Yellow2";
_local3 = nYELLOW_SCORE2;
if (_local4 <= nYELLOW_SHOT) {
_local2 = "Yellow";
_local3 = nYELLOW_SCORE;
if (_local4 <= nBULL_EYE_SHOT) {
_local2 = "BullsEye";
_local3 = nBULL_EYE_SCORE;
}
}
}
}
}
}
}
}
}
}
}
Greenarrow.MainGame.nScore = Greenarrow.MainGame.nScore + _local3;
Greenarrow.MainGame.updateHud();
return(_local2);
}
static var nOFFSET_X = 6;
static var nOFFSET_RANDOM = 320;
static var nOFFSET_Y = 10;
static var nBULL_EYE_SCORE = 5000;
static var nYELLOW_SCORE = 4000;
static var nYELLOW_SCORE2 = 3000;
static var nRED_SCORE = 2500;
static var nRED_SCORE2 = 2000;
static var nBLUE_SCORE = 1750;
static var nBLUE_SCORE2 = 1500;
static var nBLACK_SCORE = 1250;
static var nBLACK_SCORE2 = 1000;
static var nWHITE_SCORE = 750;
static var nWHITE_SCORE2 = 500;
static var nBULL_EYE_SHOT = 5;
static var nYELLOW_SHOT = 9;
static var nYELLOW_SHOT2 = 15;
static var nRED_SHOT = 24;
static var nRED_SHOT2 = 32;
static var nBLUE_SHOT = 40;
static var nBLUE_SHOT2 = 48;
static var nBLACK_SHOT = 57;
static var nBLACK_SHOT2 = 65;
static var nWHITE_SHOT = 74;
static var nWHITE_SHOT2 = 83;
}
Symbol 550 MovieClip [__Packages.Greenarrow.GameTransition] Frame 0
class Greenarrow.GameTransition
{
var mcRef;
function GameTransition (_mcRef) {
mcRef = _mcRef;
mcRef.onEnterFrame = Delegate.create(this, update);
mcRef.gotoAndStop(1);
}
function transit() {
mcRef.play();
}
function update() {
if (mcRef._currentframe == mcRef._totalframes) {
mcRef.gotoAndStop(1);
}
}
}
Symbol 551 MovieClip [__Packages.Greenarrow.Arrow] Frame 0
class Greenarrow.Arrow extends Greenarrow.State
{
var mcRef, nForce, nAngle, oPointStart, nTime, nColTime, nRobotColTime, nRobot2ColTime, __set___state, bColided, LandPaperWhite, LandPaperBlack, LandPaperBlue, LandPaperRed, LandPaperYellow, LandPaperWhite2, LandPaperBlack2, LandPaperBlue2, LandPaperRed2, LandPaperYellow2, LandPaperBullsEye, LandGrass, updateState, __get___currentFrame, __get___stateFinished;
function Arrow (_mcRef, _nForce, _nAngle, _oPt) {
super();
mcRef = _mcRef;
nForce = _nForce / 2.5;
nAngle = MoreMath.DegToRad(_nAngle);
oPointStart = _oPt;
nTime = 0;
nColTime = ((Greenarrow.MainGame.__get__A().aimX() - oPointStart.x) / nForce) / Math.cos(nAngle);
nRobotColTime = ((Greenarrow.MainGame.oRobot.aimX() - oPointStart.x) / nForce) / Math.cos(nAngle);
nRobot2ColTime = ((Greenarrow.MainGame.oRobot2.aimX() - oPointStart.x) / nForce) / Math.cos(nAngle);
Greenarrow.MainGame.__get__Broadcaster().addListener(this);
nTIME_SPEED = 1;
__set___state("Fly");
bColided = false;
LandPaperWhite = Delegate.create(this, Land);
LandPaperBlack = Delegate.create(this, Land);
LandPaperBlue = Delegate.create(this, Land);
LandPaperRed = Delegate.create(this, Land);
LandPaperYellow = Delegate.create(this, Land);
LandPaperWhite2 = Delegate.create(this, Land);
LandPaperBlack2 = Delegate.create(this, Land);
LandPaperBlue2 = Delegate.create(this, Land);
LandPaperRed2 = Delegate.create(this, Land);
LandPaperYellow2 = Delegate.create(this, Land);
LandPaperBullsEye = Delegate.create(this, Land);
LandGrass = Delegate.create(this, Land);
}
function update() {
updateState();
}
function checkTime() {
if (((nTime > (nColTime - 10)) && (nTime < (nColTime + 1))) && (mcRef._y > (Greenarrow.MainGame.__get__A().mcRef._y - nOFFSET_AIM))) {
nTIME_SPEED = nTIME_SPEED * 0.9;
if (nTIME_SPEED < 0.1) {
nTIME_SPEED = 0.1;
}
} else {
nTIME_SPEED = nTIME_SPEED * 1.05;
if (nTIME_SPEED > 1) {
nTIME_SPEED = 1;
}
}
checkBlur();
}
function checkBlur() {
var _local2 = nTIME_SPEED * 5;
var _local3 = new flash.filters.BlurFilter(_local2, _local2, 1);
mcRef.filters = [_local3];
}
function Fly() {
nTime = nTime + nTIME_SPEED;
var _local6 = false;
checkTime();
mcRef.state.gotoAndPlay(Math.round(__get___currentFrame() + (nTIME_SPEED * 3)));
if ((nTime > nColTime) && (nTime < (nColTime + nTIME_SPEED))) {
if (Greenarrow.MainGame.__get__A().checkAim(mcRef._y)) {
Greenarrow.MainGame.nHits++;
_local6 = true;
bColided = true;
mcRef._x = Greenarrow.MainGame.__get__A().aimX();
var _local4 = Greenarrow.MainGame.__get__A().checkPoint(mcRef._Y);
__set___state("LandPaper" + _local4);
if (_local4 == "BullsEye") {
Greenarrow.MainGame.nBullEyeHits++;
}
MainGameHub.__get__S().playSound("SFX_HitTarget", 50);
mcRef.filters = [];
}
}
if (((nTime > nRobotColTime) && (nTime < (nRobotColTime + nTIME_SPEED))) && (Greenarrow.MainGame.bRobot1 == true)) {
if (mcRef.hitTest(Greenarrow.MainGame.oRobot.mcRef)) {
bColided = true;
mcRef._x = Greenarrow.MainGame.oRobot.aimX();
mcRef.filters = [];
__set___state("Disapear");
}
}
if (((nTime > nRobot2ColTime) && (nTime < (nRobot2ColTime + nTIME_SPEED))) && (Greenarrow.MainGame.bRobot2 == true)) {
if (mcRef.hitTest(Greenarrow.MainGame.oRobot2.mcRef)) {
bColided = true;
mcRef._x = Greenarrow.MainGame.oRobot2.aimX();
mcRef.filters = [];
__set___state("Disapear");
}
}
if (!_local6) {
var _local5 = new flash.geom.Point(mcRef._x, mcRef._y);
mcRef._x = oPointStart.x + ((nForce * nTime) * Math.cos(nAngle));
mcRef._y = oPointStart.y - (((nForce * nTime) * Math.sin(nAngle)) - ((0.5 * nGRAVITY) * (nTime * nTime)));
var _local3 = new flash.geom.Point(mcRef._x, mcRef._y);
var _local2 = MoreMath.PtAngle(_local5, _local3);
if (_local5.y > _local3.y) {
_local2 = -_local2;
}
if (mcRef._y >= nGROUD_LEVEL) {
__set___state("LandGrass");
MainGameHub.__get__S().playSound("SFX_HitTarget", 50);
mcRef.filters = [];
mcRef._y = nGROUD_LEVEL;
}
mcRef._rotation = _local2;
}
}
function Land() {
if (__get___currentFrame() == 1) {
mcRef.state.mcImpact._rotation = -mcRef._rotation;
}
if ((__get___currentFrame() == 10) && (bColided == true)) {
var _local2 = MoreMath.RoundedRandom(1, 3);
MainGameHub.__get__S().playSound("SFX_GA_Bonus" + _local2, 60);
}
if (__get___stateFinished()) {
if (Greenarrow.MainGame.nArrow > 0) {
Greenarrow.MainGame.__get__BG().changeTarget(Greenarrow.MainGame.oGreenarrow.__get__mc());
Greenarrow.MainGame.oGreenarrow.__set___state("Idle");
checkLevel(true);
} else {
checkLevel();
}
mcRef.state.stop();
Greenarrow.MainGame.__get__Broadcaster().removeListener(this);
}
}
function Disapear() {
if (__get___stateFinished()) {
if (Greenarrow.MainGame.nArrow > 0) {
Greenarrow.MainGame.__get__BG().changeTarget(Greenarrow.MainGame.oGreenarrow.__get__mc());
Greenarrow.MainGame.oGreenarrow.__set___state("Idle");
} else {
checkLevel();
}
mcRef.state.stop();
Greenarrow.MainGame.__get__Broadcaster().removeListener(this);
}
}
function checkLevel(_bNoChange) {
var _local1 = false;
switch (Greenarrow.MainGame.nLevel) {
case 1 :
if (Greenarrow.MainGame.nHits >= 1) {
_local1 = true;
}
break;
case 2 :
if (Greenarrow.MainGame.nHits >= 3) {
_local1 = true;
}
break;
case 3 :
if (Greenarrow.MainGame.nHits >= 3) {
_local1 = true;
}
break;
case 4 :
if (Greenarrow.MainGame.nBullEyeHits >= 1) {
_local1 = true;
}
break;
case 5 :
if (Greenarrow.MainGame.nBullEyeHits >= 1) {
_local1 = true;
}
break;
case 5 :
if (Greenarrow.MainGame.nBullEyeHits < 3) {
break;
}
_local1 = true;
}
trace("_bNoChange : " + _bNoChange);
trace("_bNextLevel : " + _local1);
if ((_bNoChange == true) && (_local1 == true)) {
Greenarrow.MainGame.mcRef.mcWon.gotoAndStop(2);
}
if (_local1 && (_bNoChange != true)) {
Greenarrow.MainGame.nScore = Greenarrow.MainGame.nScore + (5000 * Greenarrow.MainGame.nLevel);
Greenarrow.MainGame.nextLevel();
} else if (_bNoChange != true) {
Greenarrow.MainGame.endGame();
}
}
static var nGRAVITY = 1;
static var nTIME_SPEED = 1;
static var nGROUD_LEVEL = 400;
static var nAIM_X = 2770;
static var nOFFSET_AIM = 300;
}
Symbol 552 MovieClip [__Packages.Superman.MainGame] Frame 0
class Superman.MainGame
{
static var mcRef, aRobot, nDepth, nLevel, oBroadcaster, oTransition, oSuperman, oBG, nKilledRobot, nHealt, nScore, oTimer, bRunning;
function MainGame () {
}
static function init(_mcRef) {
mcRef = _mcRef;
aRobot = new Array();
nDepth = 0;
nLevel = 1;
nMaxRobot = 10;
oBroadcaster = new Object();
AsBroadcaster.initialize(oBroadcaster);
oTransition = new Superman.GameTransition(_mcRef.transitionMc);
mcRef.mcWorld.mcSuperMan.swapDepths(1);
oSuperman = new Superman.SupermanPlayer(mcRef.mcWorld.mcSuperman);
oBG = new Superman.Background(mcRef.mcWorld, mcRef.mcWorld.mcSuperman);
mcRef.onEnterFrame = Delegate.create(Superman.MainGame, update);
nKilledRobot = 0;
nHealt = 100;
nScore = 0;
mcRef.btnMenu.onRelease = Delegate.create(Superman.MainGame, openMenu);
mcRef.btnHelp.onRelease = Delegate.create(Superman.MainGame, openHelp);
mcRef.btnMenu.onRollOver = Delegate.create(MainGameHub.__get__S(), MainGameHub.__get__S().btnRoll);
mcRef.btnHelp.onRollOver = Delegate.create(MainGameHub.__get__S(), MainGameHub.__get__S().btnRoll);
oTimer = new Superman.Timer();
updateHud();
oSuperman.__set___state("Idle");
MainGameHub.__get__PP().openPopUp("SMLevel1");
oSuperman.__set___state("Idle");
}
static function nextLevel() {
oTransition.transit();
oSuperman.__set___state("Idle");
nLevel++;
oTimer = new Superman.Timer();
nKilledRobot = 0;
nHealt = 100;
nMaxRobot = aMAX_ROBOT[nLevel - 1];
aRobot = new Array();
updateHud();
MainGameHub.__get__PP().openPopUp("SMLevel" + nLevel);
pause();
oSuperman.__set___state("Idle");
}
static function addRobot(_nBig) {
nDepth++;
var _local2 = nMAX_DEPTH - nDepth;
var _local1 = new MovieClip();
if (_nBig < 3) {
switch (_nBig) {
case 0 :
_local1 = mcRef.mcWorld.attachMovie("mcRobot", "mcRobot" + _local2, _local2);
break;
case 1 :
_local1 = mcRef.mcWorld.attachMovie("mcRobot2", "mcRobot2" + _local2, _local2);
break;
case 2 :
_local1 = mcRef.mcWorld.attachMovie("mcRobot3", "mcRobot3" + _local2, _local2);
}
var _local6 = MoreMath.RoundedRandom(0, 1);
_local1._x = mcRef.mcWorld.mcRobotLeft._x;
_local1._y = mcRef.mcWorld.mcRobotLeft._y;
var _local3 = 1;
if (_local6 == 1) {
_local1._x = mcRef.mcWorld.mcRobotRight._x;
_local1._y = mcRef.mcWorld.mcRobotRight._y;
_local3 = -1;
}
var _local4;
switch (_nBig) {
case 0 :
_local4 = new Superman.Robot(_local1, _local3);
break;
case 1 :
_local4 = new Superman.BigRobot(_local1, _local3);
break;
case 2 :
_local4 = new Superman.BiggerRobot(_local1, _local3);
}
aRobot.push(_local4);
trace("MainGame.aRobot.length : " + aRobot.length);
} else {
_local1 = mcRef.mcWorld.attachMovie("mcBomb", "mcBomb" + _local2, _local2);
_local1._x = oSuperman.__get__mc()._x;
_local1._y = -50;
var _local7 = new Superman.Bomb(_local1);
}
}
static function resume() {
oBroadcaster.broadcastMessage("resume");
bRunning = true;
}
static function pause() {
oBroadcaster.broadcastMessage("pause");
bRunning = false;
}
static function attackRobot(_xPos) {
for (var _local2 in aRobot) {
aRobot[_local2].hitRobot(_xPos);
}
}
static function hurtSuperMan() {
nHealt = nHealt - nHEALT_HURT;
updateHud();
if (nHealt <= 0) {
oSuperman.__set___state("Die");
delete oTimer;
for (var _local1 in aRobot) {
aRobot[_local1]._state = "Explode";
}
} else {
oSuperman.__set___state("Hurt");
}
}
static function destroyAndQuit() {
pause();
for (var _local1 in Superman.MainGame) {
if (((((typeof(Superman.MainGame[_local1]) != "function") && (Superman.MainGame[_local1] != nROBOT_SCORE)) && (Superman.MainGame[_local1] != nHEALT_HURT)) && (Superman.MainGame[_local1] != aMAX_ROBOT)) && (Superman.MainGame[_local1] != nMAX_DEPTH)) {
trace(Superman.MainGame[_local1]);
delete Superman.MainGame[_local1];
trace(Superman.MainGame[_local1]);
}
}
MainGameHub.__get__S().stopMusic("BGM_3");
MainGameHub.__get__S().fadeInAMusic("BGM_Pack");
MainGameHub.__get__T().transitTo("Splash");
}
static function killRobot(_oRobot) {
nKilledRobot++;
updateHud();
trace("nKilledRobot : " + nKilledRobot);
if ((nKilledRobot >= nMaxRobot) && (nHealt > 0)) {
if (nLevel > 6) {
endGame();
} else {
nextLevel();
}
}
}
static function addScore(_nScore) {
nScore = nScore + _nScore;
updateHud();
}
static function updateHud() {
mcRef.score_txt.text = nScore;
mcRef.bot_txt.text = nMaxRobot - nKilledRobot;
mcRef.mcHealt.gotoAndStop(nHealt + 1);
}
static function endGame() {
MainGameHub.__set__StarSM(nLevel - 1);
pause();
MainGameHub.__set__ScoreSM(nScore);
for (var _local1 in Superman.MainGame) {
if ((((((typeof(Superman.MainGame[_local1]) != "function") && (Superman.MainGame[_local1] != nMaxRobot)) && (Superman.MainGame[_local1] != nROBOT_SCORE)) && (Superman.MainGame[_local1] != nHEALT_HURT)) && (Superman.MainGame[_local1] != aMAX_ROBOT)) && (Superman.MainGame[_local1] != nMAX_DEPTH)) {
trace(Superman.MainGame[_local1]);
delete Superman.MainGame[_local1];
trace(Superman.MainGame[_local1]);
}
}
MainGameHub.__get__S().stopMusic("BGM_3");
MainGameHub.__get__S().fadeInAMusic("BGM_Pack");
MainGameHub.__get__T().transitTo("WinScreen");
}
static function get BG() {
return(oBG);
}
static function get Broadcaster() {
return(oBroadcaster);
}
static function update() {
if (bRunning) {
oBroadcaster.broadcastMessage("update");
}
}
static function openMenu() {
MainGameHub.__get__S().btnClick();
pause();
MainGameHub.__get__PP().openPopUp("Menu");
}
static function openHelp() {
MainGameHub.__get__S().btnClick();
pause();
MainGameHub.__get__PP().openPopUp("HelpSuper");
}
static var nROBOT_SCORE = 500;
static var nHEALT_HURT = 20;
static var nMaxRobot = 160;
static var nMAX_DEPTH = 1000;
static var aMAX_ROBOT = [10, 20, 30, 40, 50, 65];
}
Symbol 553 MovieClip [__Packages.Superman.State] Frame 0
class Superman.State
{
var mcRef, sState;
function State (_mcRef) {
mcRef = _mcRef;
}
function get _state() {
return(sState);
}
function set _state(_sState) {
if (_sState != "") {
sState = _sState;
mcRef.gotoAndStop(sState);
updateState();
}
//return(_state);
}
function get _stateFinished() {
return(_currentFrame == _totalFrames);
}
function get _totalFrames() {
return(mcRef.state._totalframes);
}
function get _currentFrame() {
return(mcRef.state._currentframe);
}
function updateState() {
this[sState]();
}
function pause() {
mcRef.state.stop();
}
function resume() {
mcRef.state.play();
}
}
Symbol 554 MovieClip [__Packages.Superman.SupermanPlayer] Frame 0
class Superman.SupermanPlayer extends Superman.State
{
var nMoveDir, WalkLeft, WalkRight, sPunchDir, PunchLeft, PunchRight, __set___state, bSpaceUp, mcRef, updateState, __get___state, __get___currentFrame, __get___stateFinished;
function SupermanPlayer (_mcRef) {
super(_mcRef);
Key.addListener(this);
Superman.MainGame.__get__Broadcaster().addListener(this);
nMoveDir = 1;
WalkLeft = Delegate.create(this, Walk);
WalkRight = Delegate.create(this, Walk);
sPunchDir = "Left";
PunchLeft = Delegate.create(this, Punch);
PunchRight = Delegate.create(this, Punch);
__set___state("Idle");
bSpaceUp = true;
}
function hitRobot() {
__set___state("Hurt");
}
function get mc() {
return(mcRef);
}
function update() {
updateState();
}
function move() {
var _local2 = false;
if (nMoveDir < 0) {
if ((mcRef._x - (nPLAYER_WIDTH / 2)) > nMIN_X_SCREEN) {
_local2 = true;
}
}
if (nMoveDir > 0) {
if ((mcRef._x + (nPLAYER_WIDTH / 2)) < nMAX_X_SCREEN) {
_local2 = true;
}
}
if (_local2) {
mcRef._x = mcRef._x + (nMoveDir * nPLAYER_SPEED);
}
mcRef._xscale = 100 * nMoveDir;
}
function onKeyUp() {
if ((Key.getCode() == 32) && (Superman.MainGame.bRunning)) {
bSpaceUp = true;
}
}
function onKeyDown() {
if ((Key.getCode() == 32) && (Superman.MainGame.bRunning)) {
checkSpaceBar();
bSpaceUp = false;
}
}
function checkSpaceBar() {
if (((((__get___state() != "PunchLeft") && (__get___state() != "PunchRight")) && (__get___state() != "Hurt")) && (__get___state() != "Die")) && (bSpaceUp)) {
__set___state("Punch" + sPunchDir);
switchPunchDir();
}
}
function switchPunchDir() {
if (sPunchDir == "Left") {
sPunchDir = "Right";
} else {
sPunchDir = "Left";
}
}
function Idle() {
if (Superman.MainGame.bRunning) {
if (Key.isDown(37)) {
nMoveDir = -1;
__set___state("WalkLeft");
} else if (Key.isDown(39)) {
nMoveDir = 1;
__set___state("WalkRight");
}
}
}
function Hurt() {
if (__get___currentFrame() == 1) {
var _local2 = MoreMath.RoundedRandom(1, 3);
MainGameHub.__get__S().playSound("SFX_Hurt" + _local2, 50);
}
if (__get___stateFinished()) {
__set___state("Idle");
}
}
function Walk() {
var _local2 = false;
if (Key.isDown(37)) {
nMoveDir = -1;
_local2 = true;
if (__get___state() != "WalkLeft") {
__set___state("WalkLeft");
}
} else if (Key.isDown(39)) {
nMoveDir = 1;
_local2 = true;
if (__get___state() != "WalkRight") {
__set___state("WalkRight");
}
}
if (!_local2) {
__set___state("Idle");
}
move();
}
function Punch() {
if (__get___currentFrame() == 1) {
var _local3 = MoreMath.RoundedRandom(1, 4);
MainGameHub.__get__S().playSound("SFX_Swish" + _local3, 30);
}
if (__get___currentFrame() == nPUNCH_FRAME) {
var _local2 = mcRef._x + nPUNCH_DISTANCE;
if (nMoveDir < 0) {
_local2 = mcRef._x - nPUNCH_DISTANCE;
}
Superman.MainGame.attackRobot(_local2);
}
if (__get___stateFinished()) {
__set___state("Idle");
}
}
function Die() {
if (__get___currentFrame() == 1) {
MainGameHub.__get__S().playSound("SFX_Die", 30);
}
if (__get___stateFinished()) {
Superman.MainGame.endGame();
}
}
static var nPLAYER_SPEED = 10;
static var nMAX_X_SCREEN = 945;
static var nMIN_X_SCREEN = 35;
static var nPLAYER_WIDTH = 175;
static var nPUNCH_FRAME = 4;
static var nPUNCH_DISTANCE = 140;
}
Symbol 555 MovieClip [__Packages.Superman.Background] Frame 0
class Superman.Background
{
var mcRef, mcTarget, nShakeIndex;
function Background (_mcRef, _mcTarget) {
mcRef = _mcRef;
mcTarget = _mcTarget;
nShakeIndex = 0;
Superman.MainGame.__get__Broadcaster().addListener(this);
}
function update() {
checkTargetPos();
checkShake();
}
function checkTargetPos() {
var _local3 = 0;
var _local2 = 0;
var _local7 = nSTAGE_WIDTH / 2;
var _local6 = nSTAGE_HEIGTH / 2;
var _local5 = getMainGameCoord(mcTarget).x;
var _local4 = getMainGameCoord(mcTarget).y;
if ((_local5 < _local7) && (mcRef._x < nMAX_X_POS)) {
_local3 = (_local7 - _local5) / nSLOW_DOWN_RATIO;
} else if ((_local5 > _local7) && (mcRef._x > nMIN_X_POS)) {
_local3 = (-(_local5 - _local7)) / nSLOW_DOWN_RATIO;
}
if ((_local3 > 0) && (_local3 <= nSPEED_MIN)) {
_local3 = 0;
} else if ((_local3 < 0) && (_local3 >= (-nSPEED_MIN))) {
_local3 = 0;
}
if ((_local4 < _local6) && (mcRef._y < nMAX_Y_POS)) {
_local2 = (_local6 - _local4) / nSLOW_DOWN_RATIO;
} else if ((_local4 > _local6) && (mcRef._y > nMIN_Y_POS)) {
_local2 = (-(_local4 - _local6)) / nSLOW_DOWN_RATIO;
}
if ((_local2 > 0) && (_local2 <= nSPEED_MIN)) {
_local2 = 0;
} else if ((_local2 < 0) && (_local2 >= (-nSPEED_MIN))) {
_local2 = 0;
}
if ((_local3 != 0) || (_local2 != 0)) {
move(_local3, _local2);
}
}
function getMainGameCoord(_mcTarget) {
var _local2 = new Object();
_local2.x = 0;
_local2.y = 0;
_local2.x = _mcTarget._x;
_local2.y = _mcTarget._y - 170;
mcRef.localToGlobal(_local2);
return(_local2);
}
function move(_nXSpeed, _nYSpeed) {
mcRef._x = mcRef._x + _nXSpeed;
mcRef._y = mcRef._y + _nYSpeed;
if (mcRef._x < nMIN_X_POS) {
mcRef._x = nMIN_X_POS;
} else if (mcRef._x > nMAX_X_POS) {
mcRef._x = nMAX_X_POS;
}
if (mcRef._y < nMIN_Y_POS) {
mcRef._y = nMIN_Y_POS;
} else if (mcRef._y > nMAX_Y_POS) {
mcRef._y = nMAX_Y_POS;
}
var _local3 = getMainGameCoord(mcRef.mcFront).x;
if ((_local3 < 0) && ((_local3 + mcRef.mcFront._width) > nSTAGE_WIDTH)) {
mcRef.mcFront._x = mcRef.mcFront._x + (_nXSpeed / nRATIO_FRONT);
}
var _local4 = getMainGameCoord(mcRef.mcCity).x;
if (((_local4 + (_nXSpeed / nRATIO_CITY)) < 0) && (((_local4 + mcRef.mcCity._width) - (_nXSpeed / nRATIO_CITY)) > nSTAGE_WIDTH)) {
mcRef.mcCity._x = mcRef.mcCity._x + (_nXSpeed / nRATIO_CITY);
}
}
function checkShake() {
if (nShakeIndex > 1) {
var _local3 = MoreMath.RoundedRandom(7, 20) * MoreMath.RoundedRandom(-1, 1);
trace("_nX : " + _local3);
var _local2 = MoreMath.RoundedRandom(7, 20) * MoreMath.RoundedRandom(-1, 1);
trace("_nY : " + _local2);
move(_local3, _local2);
nShakeIndex--;
} else if (nShakeIndex == 1) {
nShakeIndex = 0;
}
}
function shake() {
nShakeIndex = 10;
}
var nSLOW_DOWN_RATIO = 10;
var nSPEED_MIN = 0.5;
var nMAX_X_POS = 0;
var nMIN_X_POS = -500;
var nMAX_Y_POS = 28;
var nMIN_Y_POS = -20;
var nSTAGE_WIDTH = 500;
var nSTAGE_HEIGTH = 375;
var nRATIO_FRONT = 4;
var nRATIO_CITY = 8;
}
Symbol 556 MovieClip [__Packages.Superman.Timer] Frame 0
class Superman.Timer
{
var nAddFrame, nFrame, aLevel1, aLevel2, aLevel3, aLevel4, aLevel5, aLevel6;
function Timer () {
Superman.MainGame.oBroadcaster.addListener(this);
generateLevelArray();
nAddFrame = nSTART_FRAME;
nFrame = nAddFrame;
}
function update() {
nFrame++;
if (nFrame >= nAddFrame) {
if (this["aLevel" + Superman.MainGame.nLevel].length > 0) {
nFrame = 0;
if (Superman.MainGame.aRobot.length > 10) {
nAddFrame = nAddFrame - nSPEED_INCREASE_SLOW;
} else {
nAddFrame = nAddFrame - nSPEED_INCREASE;
}
if (nAddFrame < nMINIMAL_FRAME) {
nAddFrame = nMINIMAL_FRAME;
}
Superman.MainGame.addRobot(this["aLevel" + Superman.MainGame.nLevel].pop());
} else {
Superman.MainGame.oBroadcaster.removeListener(this);
}
}
}
function generateLevelArray() {
aLevel1 = new Array();
aLevel2 = new Array();
aLevel3 = new Array();
aLevel4 = new Array();
aLevel5 = new Array();
aLevel6 = new Array();
aLevel3.push(3);
aLevel3.push(3);
aLevel3.push(3);
aLevel1.push(3);
aLevel1.push(3);
aLevel1.push(3);
var _local4 = 0;
while (_local4 < 5) {
aLevel2.push(1);
aLevel4.push(3);
aLevel5.push(2);
aLevel2.push(3);
aLevel3.push(3);
aLevel4.push(3);
aLevel5.push(3);
aLevel6.push(3);
_local4++;
}
_local4 = 0;
while (_local4 < 8) {
aLevel5.push(3);
_local4++;
}
_local4 = 0;
while (_local4 < 10) {
aLevel1.push(0);
aLevel3.push(1);
aLevel6.push(2);
_local4++;
}
_local4 = 0;
while (_local4 < 12) {
aLevel6.push(3);
_local4++;
}
_local4 = 0;
while (_local4 < 15) {
aLevel2.push(0);
aLevel4.push(1);
_local4++;
}
_local4 = 0;
while (_local4 < 20) {
aLevel3.push(0);
aLevel5.push(1);
_local4++;
}
_local4 = 0;
while (_local4 < 23) {
aLevel6.push(1);
_local4++;
}
_local4 = 0;
while (_local4 < 25) {
aLevel5.push(0);
aLevel4.push(0);
_local4++;
}
_local4 = 0;
while (_local4 < 32) {
aLevel6.push(0);
_local4++;
}
Array.prototype.shuffle = function () {
var _local5 = this.length;
var _local2 = 0;
while (_local2 < _local5) {
var _local3 = Math.floor(Math.random() * _local5);
var _local4 = this[_local2];
this[_local2] = this[_local3];
this[_local3] = _local4;
_local2++;
}
};
aLevel1.shuffle();
aLevel2.shuffle();
aLevel3.shuffle();
aLevel4.shuffle();
aLevel5.shuffle();
aLevel6.shuffle();
trace("aLevel1 : " + aLevel1.length);
trace("aLevel2 : " + aLevel2.length);
trace("aLevel3 : " + aLevel3.length);
trace("aLevel4 : " + aLevel4.length);
trace("aLevel5 : " + aLevel5.length);
trace("aLevel6 : " + aLevel6.length);
}
static var nSTART_FRAME = 100;
static var nSPEED_INCREASE = 3;
static var nSPEED_INCREASE_SLOW = 1;
static var nMINIMAL_FRAME = 30;
}
Symbol 557 MovieClip [__Packages.Superman.GameTransition] Frame 0
class Superman.GameTransition
{
var mcRef;
function GameTransition (_mcRef) {
mcRef = _mcRef;
mcRef.onEnterFrame = Delegate.create(this, update);
mcRef.gotoAndStop(1);
}
function transit() {
mcRef.play();
}
function update() {
if (mcRef._currentframe == mcRef._totalframes) {
mcRef.gotoAndStop(1);
}
}
}
Symbol 558 MovieClip [__Packages.Superman.Robot] Frame 0
class Superman.Robot extends Superman.State
{
var __set___state, nDir, mcRef, Die1, Die2, __get___state, updateState, __get___stateFinished;
function Robot (_mcRef, _nDir) {
super(_mcRef);
Superman.MainGame.__get__Broadcaster().addListener(this);
__set___state("Walk");
nDir = _nDir;
mcRef._xscale = nDir * 100;
Die1 = Delegate.create(this, Die);
Die2 = Delegate.create(this, Die);
}
function hitRobot(_xPos) {
var _local2 = false;
if (((nDir < 0) && (_xPos > (mcRef._x - (mcRef._width / 2)))) && (__get___state() == "Walk")) {
_local2 = true;
} else if (((nDir > 0) && (_xPos < (mcRef._x + (mcRef._width / 2)))) && (__get___state() == "Walk")) {
_local2 = true;
}
if (_local2) {
var _local3 = MoreMath.RoundedRandom(1, 3);
MainGameHub.__get__S().playSound("SFX_Punch" + _local3, 50);
var _local4 = MoreMath.RoundedRandom(1, 2);
__set___state("Die" + _local4);
Superman.MainGame.addScore(500);
}
return(_local2);
}
function update() {
updateState();
}
function Walk() {
mcRef._x = mcRef._x + (nDir * nROBOT_WALK_SPEED);
if (mcRef.hitTest(Superman.MainGame.oSuperman.__get__mc().mcHitZone)) {
__set___state("Explode");
Superman.MainGame.hurtSuperMan();
}
}
function Explode() {
if (__get___stateFinished()) {
mcRef.removeMovieClip();
Superman.MainGame.__get__Broadcaster().removeListener(this);
Superman.MainGame.killRobot();
}
}
function Die() {
if (__get___stateFinished()) {
mcRef.removeMovieClip();
Superman.MainGame.__get__Broadcaster().removeListener(this);
Superman.MainGame.killRobot();
}
}
static var nROBOT_WALK_SPEED = 5;
}
Symbol 559 MovieClip [__Packages.Superman.BigRobot] Frame 0
class Superman.BigRobot extends Superman.Robot
{
var sScrap, WalkScrap, ExplodeScrap, Explode, __set___state, nDir, mcRef, __get___state, __get___stateFinished;
function BigRobot (_mcRef, _nDir) {
super(_mcRef, _nDir);
sScrap = "";
WalkScrap = Delegate.create(this, Walk);
ExplodeScrap = Delegate.create(this, Explode);
__set___state("Walk" + sScrap);
}
function hitRobot(_xPos) {
var _local2 = false;
if (((nDir < 0) && (_xPos > (mcRef._x - (mcRef._width / 2)))) && ((__get___state() == "Walk") || (__get___state() == "WalkScrap"))) {
_local2 = true;
} else if (((nDir > 0) && (_xPos < (mcRef._x + (mcRef._width / 2)))) && ((__get___state() == "Walk") || (__get___state() == "WalkScrap"))) {
_local2 = true;
}
if (_local2 && (sScrap == "Scrap")) {
var _local3 = MoreMath.RoundedRandom(1, 3);
MainGameHub.__get__S().playSound("SFX_Punch" + _local3, 50);
var _local4 = MoreMath.RoundedRandom(1, 2);
__set___state("Die" + _local4);
Superman.MainGame.__get__BG().shake();
Superman.MainGame.addScore(1000);
} else if (_local2) {
_local2 = false;
var _local3 = MoreMath.RoundedRandom(1, 3);
MainGameHub.__get__S().playSound("SFX_Punch" + _local3, 50);
sScrap = "Scrap";
__set___state("HyperHurt");
}
return(_local2);
}
function Walk() {
mcRef._x = mcRef._x + (nDir * Superman.Robot.nROBOT_WALK_SPEED);
if (mcRef.hitTest(Superman.MainGame.oSuperman.__get__mc().mcHitZone)) {
__set___state("Explode" + sScrap);
Superman.MainGame.hurtSuperMan();
}
}
function HyperHurt() {
if (__get___stateFinished()) {
if (nDir < 0) {
mcRef._x = mcRef._x + 150;
} else {
mcRef._x = mcRef._x - 150;
}
__set___state("Walk" + sScrap);
}
}
}
Symbol 560 MovieClip [__Packages.Superman.BiggerRobot] Frame 0
class Superman.BiggerRobot extends Superman.Robot
{
var sScrap, WalkScrap, ExplodeScrap, Explode, WalkScrapMore, ExplodeScrapMore, __set___state, nDir, mcRef, __get___state, __get___stateFinished;
function BiggerRobot (_mcRef, _nDir) {
super(_mcRef, _nDir);
sScrap = "";
WalkScrap = Delegate.create(this, Walk);
ExplodeScrap = Delegate.create(this, Explode);
WalkScrapMore = Delegate.create(this, Walk);
ExplodeScrapMore = Delegate.create(this, Explode);
__set___state("Walk" + sScrap);
}
function hitRobot(_xPos) {
var _local2 = false;
if (((nDir < 0) && (_xPos > (mcRef._x - (mcRef._width / 2)))) && (((__get___state() == "Walk") || (__get___state() == "WalkScrap")) || (__get___state() == "WalkScrapMore"))) {
_local2 = true;
} else if (((nDir > 0) && (_xPos < (mcRef._x + (mcRef._width / 2)))) && (((__get___state() == "Walk") || (__get___state() == "WalkScrap")) || (__get___state() == "WalkScrapMore"))) {
_local2 = true;
}
if (_local2 && (sScrap == "ScrapMore")) {
var _local3 = MoreMath.RoundedRandom(1, 3);
MainGameHub.__get__S().playSound("SFX_Punch" + _local3, 50);
var _local4 = MoreMath.RoundedRandom(1, 2);
__set___state("Die" + _local4);
Superman.MainGame.__get__BG().shake();
Superman.MainGame.addScore(1500);
} else if (_local2 && (sScrap == "Scrap")) {
_local2 = false;
var _local3 = MoreMath.RoundedRandom(1, 3);
MainGameHub.__get__S().playSound("SFX_Punch" + _local3, 50);
sScrap = "ScrapMore";
__set___state("HyperHurtMore");
} else if (_local2) {
_local2 = false;
var _local3 = MoreMath.RoundedRandom(1, 3);
MainGameHub.__get__S().playSound("SFX_Punch" + _local3, 50);
sScrap = "Scrap";
__set___state("HyperHurt");
}
return(_local2);
}
function Walk() {
mcRef._x = mcRef._x + (nDir * Superman.Robot.nROBOT_WALK_SPEED);
if (mcRef.hitTest(Superman.MainGame.oSuperman.__get__mc().mcHitZone)) {
__set___state("Explode" + sScrap);
Superman.MainGame.hurtSuperMan();
}
}
function HyperHurt() {
if (__get___stateFinished()) {
if (nDir < 0) {
mcRef._x = mcRef._x + 150;
} else {
mcRef._x = mcRef._x - 150;
}
__set___state("Walk" + sScrap);
}
}
function HyperHurtMore() {
if (__get___stateFinished()) {
if (nDir < 0) {
mcRef._x = mcRef._x + 150;
} else {
mcRef._x = mcRef._x - 150;
}
__set___state("Walk" + sScrap);
}
}
}
Symbol 561 MovieClip [__Packages.Superman.Bomb] Frame 0
class Superman.Bomb extends State
{
var __set___state, updateState, mcRef, __get___currentFrame, __get___stateFinished;
function Bomb (_mcRef) {
super(_mcRef);
Superman.MainGame.__get__Broadcaster().addListener(this);
__set___state("Fall");
}
function update() {
updateState();
}
function Fall() {
mcRef._y = mcRef._y + nFALL_SPEED;
if (mcRef.hitTest(Superman.MainGame.oSuperman.__get__mc().mcHitZone)) {
__set___state("Hit");
Superman.MainGame.hurtSuperMan();
}
if (mcRef._y >= 360) {
__set___state("Hit");
}
}
function Hit() {
if (__get___currentFrame() == 1) {
var _local2 = MoreMath.RoundedRandom(1, 4);
MainGameHub.__get__S().playSound("Explosion" + _local2, 70, 0);
}
if (__get___stateFinished()) {
mcRef.removeMovieClip();
Superman.MainGame.__get__Broadcaster().removeListener(this);
}
}
static var nFALL_SPEED = 7;
}
Symbol 562 MovieClip [__Packages.Hawkgirl.MainGame] Frame 0
class Hawkgirl.MainGame
{
static var mcRef, nScore, nLevel, oBroadcaster, mcNewRobot, oTransition, bRunning, oHud, oHawkgirl, oBG, oPointingArrow;
function MainGame () {
}
static function init(_mcRef) {
mcRef = _mcRef;
nScore = 0;
nLevel = 1;
oBroadcaster = new Object();
mcNewRobot = new MovieClip();
AsBroadcaster.initialize(oBroadcaster);
oTransition = new Hawkgirl.GameTransition(mcRef._parent.transitionMc);
mcRef._parent.gotoAndStop("Game");
bRunning = false;
}
static function initLevel() {
mcRef.onEnterFrame = Delegate.create(Hawkgirl.MainGame, update);
mcRef.btnMenu.onRelease = Delegate.create(Hawkgirl.MainGame, openMenu);
mcRef.btnHelp.onRelease = Delegate.create(Hawkgirl.MainGame, openHelp);
mcRef.btnMenu.onRollOver = Delegate.create(MainGameHub.__get__S(), MainGameHub.__get__S().btnRoll);
mcRef.btnHelp.onRollOver = Delegate.create(MainGameHub.__get__S(), MainGameHub.__get__S().btnRoll);
oHud = new Hawkgirl.Hud(mcRef.mcHud);
oHawkgirl = new Hawkgirl.HawkgirlPlayer(mcRef.mcWorld.mcHawkgirl);
oBG = new Hawkgirl.Background(mcRef.mcWorld, oHawkgirl.__get__mc());
if (nLevel > 1) {
oPointingArrow = new Hawkgirl.PointingArrow(mcRef.mcWorld.arrowMc, mcRef.mcWorld.mcHawkgirl);
} else {
mcRef.mcWorld.arrowMc._visible = false;
}
bRunning = false;
MainGameHub.__get__PP().openPopUp("HGLevel" + nLevel);
oHud.mcRef.txtScore.text = nScore;
}
static function addRobot(_xPos, _yPos) {
var _local2 = mcRef.mcWorld.getNextHighestDepth();
var _local1 = mcRef.mcWorld.attachMovie("mcRobot", "mcRobot" + _local2, _local2);
_local1._x = _xPos;
_local1._y = _yPos;
var _local3 = new Hawkgirl.Robot(_local1);
mcNewRobot = _local1;
}
static function resume() {
oBroadcaster.broadcastMessage("resume");
bRunning = true;
}
static function pause() {
oBroadcaster.broadcastMessage("pause");
bRunning = false;
}
static function destroyAndQuit() {
for (var _local1 in Hawkgirl.MainGame) {
if (typeof(Hawkgirl.MainGame[_local1]) != "function") {
delete Hawkgirl.MainGame[_local1];
trace(Hawkgirl.MainGame[_local1]);
}
}
MainGameHub.__get__S().stopMusic("BGM_2");
MainGameHub.__get__S().fadeInAMusic("BGM_Pack");
MainGameHub.__get__T().transitTo("Splash");
}
static function endGame(_sState) {
Broadcaster.removeListener(oHawkgirl);
Broadcaster.removeListener(oBG);
delete oHawkgirl;
delete oBG;
if ((nLevel >= 6) || (_sState == "Lose")) {
MainGameHub.__set__ScoreHG(nScore);
MainGameHub.__set__StarHG(nLevel - 1);
trace("nLevel : " + nLevel);
for (var _local1 in Hawkgirl.MainGame) {
if (typeof(Hawkgirl.MainGame[_local1]) != "function") {
delete Hawkgirl.MainGame[_local1];
trace(Hawkgirl.MainGame[_local1]);
}
}
MainGameHub.__get__S().stopMusic("BGM_2");
MainGameHub.__get__S().fadeInAMusic("BGM_Pack");
MainGameHub.__get__T().transitTo("WinScreen");
} else {
nLevel++;
oTransition.transit();
}
}
static function getTarget() {
var _local1 = new MovieClip();
_local1 = mcNewRobot;
return(_local1);
}
static function get H() {
return(oHud);
}
static function get BG() {
return(oBG);
}
static function get Broadcaster() {
return(oBroadcaster);
}
static function update() {
if (bRunning) {
oBroadcaster.broadcastMessage("update");
}
}
static function openMenu() {
MainGameHub.__get__S().btnClick();
pause();
MainGameHub.__get__PP().openPopUp("Menu");
}
static function openHelp() {
MainGameHub.__get__S().btnClick();
pause();
MainGameHub.__get__PP().openPopUp("HelpHawk");
}
}
Symbol 563 MovieClip [__Packages.Hawkgirl.State] Frame 0
class Hawkgirl.State
{
var mcRef, sState;
function State (_mcRef) {
mcRef = _mcRef;
}
function get _state() {
return(sState);
}
function set _state(_sState) {
if (_sState != "") {
sState = _sState;
mcRef.gotoAndStop(sState);
updateState();
}
//return(_state);
}
function get _stateFinished() {
return(_currentFrame == _totalFrames);
}
function get _totalFrames() {
return(mcRef.state._totalframes);
}
function get _currentFrame() {
return(mcRef.state._currentframe);
}
function updateState() {
this[sState]();
}
function pause() {
mcRef.state.stop();
}
function resume() {
mcRef.state.play();
}
}
Symbol 564 MovieClip [__Packages.Hawkgirl.HawkgirlPlayer] Frame 0
class Hawkgirl.HawkgirlPlayer extends Hawkgirl.State
{
var nInitialX, mcRef, nInitialY, __set___state, Fly2, RunSlow, nSpeed, updateState, nAngle, nLastX, nRobotRate, __get___state, __get___stateFinished, __get___currentFrame, sState;
function HawkgirlPlayer (_mcRef) {
super(_mcRef);
Key.addListener(this);
nInitialX = mcRef._x;
nInitialY = mcRef._y;
__set___state("Idle");
Hawkgirl.MainGame.__get__Broadcaster().addListener(this);
ResetVar();
Fly2 = Delegate.create(this, Fly1);
RunSlow = Delegate.create(this, Run);
}
function hitRobot() {
nSpeed = nSpeed - (nSpeed / 4);
__set___state("Hurt");
}
function get mc() {
return(mcRef);
}
function update() {
updateState();
}
function startRun() {
nSpeed = 1;
__set___state("Run");
}
function addRun() {
nSpeed = nSpeed + 1.5;
}
function ResetVar() {
mcRef.CamSpot.gotoAndStop(1);
nSpeed = 0;
nAngle = 0;
mcRef._x = nInitialX;
mcRef._y = nInitialY;
nLastX = mcRef._x;
nRobotRate = aROBOT_RATE[Hawkgirl.MainGame.nLevel - 1];
}
function onKeyUp() {
switch (Key.getCode()) {
case 40 :
break;
case 38 :
break;
case 32 :
if ((__get___state() == "Idle") && (Hawkgirl.MainGame.bRunning)) {
startRun();
MainGameHub.__get__S().playSound("SFX_Run_Loop", 65, -1);
} else {
if (!(((__get___state() == "Run") || (__get___state() == "RunSlow")) && (Hawkgirl.MainGame.bRunning))) {
break;
}
addRun();
}
}
}
function startLaunch() {
MainGameHub.__get__S().stopSound("SFX_Run_Loop");
MainGameHub.__get__S().playSound("SFX_Jump", 30);
__set___state("BeginLaunch");
}
function Idle() {
}
function Run() {
if ((nSpeed < 12) && (__get___state() == "Run")) {
__set___state("RunSlow");
} else if ((nSpeed > 12) && (__get___state() == "RunSlow")) {
__set___state("Run");
}
mcRef._x = mcRef._x + (nSpeed / 2);
if (Hawkgirl.MainGame.__get__BG().checkLaunch(mcRef._x)) {
startLaunch();
}
}
function BeginLaunch() {
if (__get___stateFinished()) {
Launch(nSpeed * 2);
MainGameHub.__get__S().playSound("SFX_Wind", 90, -1);
}
}
function Throw() {
}
function Fly1() {
MoveFoward();
MoveUpnDown();
CheckGround();
checkRobotRate();
CheckKeyPress();
}
function Hurt() {
if (__get___currentFrame() == 1) {
var _local2 = MoreMath.RoundedRandom(1, 3);
MainGameHub.__get__S().playSound("SFX_HurtFemale" + _local2, 20);
}
MoveFoward();
MoveUpnDown();
CheckGround();
checkRobotRate();
CheckKeyPress();
if (__get___stateFinished()) {
__set___state("Fly1");
}
}
function Land2() {
if (__get___currentFrame() == 6) {
}
nSpeed--;
if (nSpeed < 0) {
nSpeed = 0;
} else {
MoveFoward();
}
if (__get___stateFinished()) {
if (Hawkgirl.MainGame.oHud.checkDist() == false) {
EndCourse();
} else {
Hawkgirl.MainGame.endGame();
}
mcRef.state.stop();
}
}
function Land1() {
if (__get___currentFrame() == 1) {
MainGameHub.__get__S().playSound("SFX_LandBrake", 50);
}
if (__get___stateFinished()) {
if (Hawkgirl.MainGame.oHud.checkDist() == false) {
EndCourse();
} else {
Hawkgirl.MainGame.endGame();
}
mcRef.state.stop();
}
}
function CheckGround() {
if (mcRef._y > GroundLevel) {
MainGameHub.__get__S().stopSound("SFX_Wind");
mcRef._y = GroundLevel;
mcRef._rotation = 0;
if (nAngle > 45) {
__set___state("Land1");
} else {
__set___state("Land2");
}
}
}
function checkRobotRate() {
if ((mcRef._x - nLastX) >= nRobotRate) {
nRobotRate = nRobotRate - 20;
var _local2 = MoreMath.Random(mcRef._y - 100, mcRef._y + 100);
var _local3 = MoreMath.Random(mcRef._x - 100, mcRef._x + 100) + nRobotRate;
Hawkgirl.MainGame.addRobot(_local3, _local2);
nLastX = mcRef._x;
}
}
function CheckKeyPress() {
if (Key.isDown(38)) {
nAngle = nAngle - nTurnSpeed;
if (__get___state() == "Fly1") {
sState = "Fly2";
mcRef.gotoAndStop("Fly2");
}
} else if (Key.isDown(40)) {
nAngle = nAngle + nTurnSpeed;
if (__get___state() == "Fly2") {
__set___state("Fly1");
}
} else if (!Key.isDown(38)) {
if (__get___state() == "Fly2") {
sState = "Fly1";
mcRef.gotoAndStop("Fly1");
}
}
}
function DetectAnim() {
}
function Launch(_velocity) {
__set___state("Fly1");
mcRef.CamSpot.gotoAndStop(1);
mcRef._visible = true;
mcRef._x = (Hawkgirl.MainGame.__get__BG().__get__launcherMc()._x + nOFFSET_LAUNCH_X) + _velocity;
mcRef._y = Hawkgirl.MainGame.__get__BG().__get__launcherMc()._y;
nSpeed = _velocity;
nAngle = -20;
}
function EndCourse() {
__set___state("Idle");
Hawkgirl.MainGame.endGame("Lose");
}
function MoveFoward() {
mcRef._x = mcRef._x + nSpeed;
nSpeed = nSpeed - ((nSpeed / 160) * nFriction);
nAngle = nAngle + ((80 - nSpeed) / 60);
if (nSpeed < 15) {
nAngle = nAngle + ((15 - nSpeed) / 2);
nSpeed = nSpeed - 0.1;
}
Hawkgirl.MainGame.__get__H().updateDistance(mcRef._x);
}
function MoveUpnDown() {
mcRef._rotation = nAngle;
if (nAngle > 75) {
nAngle = 75;
} else if (nAngle < -25) {
nAngle = -25;
}
if (nAngle < -5) {
mcRef._y = mcRef._y + ((nSpeed * nAngle) / 100);
nSpeed = nSpeed + ((nAngle / 45) * nClimbDeceleration);
} else {
mcRef._y = mcRef._y + (((nSpeed + 50) * nAngle) / 100);
nSpeed = nSpeed + ((nAngle / 45) * nDownhillAcceleration);
}
}
var aROBOT_RATE = [1E19, 3000, 2500, 2300, 1900, 1700];
var GroundLevel = 3245;
var LoopPoint = 8;
var nDownhillAcceleration = 1.4;
var nClimbDeceleration = 0.5;
var nFriction = 0.3;
var nTurnSpeed = 1.5;
var nSpeedRebound = 60;
var nOFFSET_LAUNCH_X = 200;
var nOFFSET_LAUNCH_Y = 3100;
}
Symbol 565 MovieClip [__Packages.Hawkgirl.Background] Frame 0
class Hawkgirl.Background
{
var mcRef, mCible, nMapWidth, nDistanceX, nDistanceY, oNumStage, oNumStageX, oNumStageY;
function Background (_mcRef, _mcCible) {
mcRef = _mcRef;
mCible = _mcCible;
Hawkgirl.MainGame.__get__Broadcaster().addListener(this);
}
function ChangeCible(_NewCible) {
mCible = _NewCible;
}
function update() {
nMapWidth = mcRef._width;
nDistanceX = Bound("x") - (nStageWidth / 2);
nDistanceY = Bound("y") - (nStageHeight / 2);
CheckLimitX(Math.round((nDistanceX * 60) / 100));
CheckLimitY(Math.round((nDistanceY * 60) / 100));
CheckWallRespawn();
}
function Bound(_Kind) {
oNumStage = mCible.getBounds(Hawkgirl.MainGame.mcRef);
oNumStageX = (oNumStage.xMax + oNumStage.xMin) / 2;
oNumStageY = (oNumStage.yMax + oNumStage.yMin) / 2;
if (_Kind == "x") {
return(oNumStageX);
}
return(oNumStageY);
}
function CheckLimitX(_deplaceNum) {
if (_deplaceNum < 0) {
if ((mcRef._x - _deplaceNum) > 0) {
_deplaceNum = 0;
}
} else if (((mcRef._x - _deplaceNum) < ((nMapWidth - nStageWidth) * -1)) || (Hawkgirl.MainGame.oHawkgirl.__get___state() == "Idle")) {
_deplaceNum = 0;
}
mcRef._x = mcRef._x - _deplaceNum;
mcRef.Wall1_1._x = mcRef.Wall1_1._x + (_deplaceNum / 6);
mcRef.Wall2_1._x = mcRef.Wall2_1._x + (_deplaceNum / 6);
mcRef.Wall1_2._x = mcRef.Wall1_2._x + (_deplaceNum / 4);
mcRef.Wall2_2._x = mcRef.Wall2_2._x + (_deplaceNum / 4);
mcRef.Wall1_3._x = mcRef.Wall1_3._x + (_deplaceNum / 1.5);
mcRef.Wall2_3._x = mcRef.Wall2_3._x + (_deplaceNum / 1.5);
mcRef.Wall1_4._x = mcRef.Wall1_4._x + (_deplaceNum / 1.05);
mcRef.Wall2_4._x = mcRef.Wall2_4._x + (_deplaceNum / 1.05);
}
function CheckWallRespawn() {
var _local2 = 1;
while (_local2 <= 4) {
var _local4 = ((mcRef._x + mcRef["Wall1_" + _local2]._x) + mcRef["Wall1_" + _local2]._width) + 50;
var _local3 = ((mcRef._x + mcRef["Wall2_" + _local2]._x) + mcRef["Wall2_" + _local2]._width) + 50;
if (_local4 < 0) {
mcRef["Wall1_" + _local2]._x = (mcRef["Wall2_" + _local2]._x + mcRef["Wall2_" + _local2]._width) - 3;
}
if (_local3 < 0) {
mcRef["Wall2_" + _local2]._x = (mcRef["Wall1_" + _local2]._x + mcRef["Wall1_" + _local2]._width) - 3;
}
_local2++;
}
}
function CheckLimitY(_deplaceNum) {
if ((mcRef._y - _deplaceNum) < (((nMapHeight - nStageHeight) - 1) * -1)) {
_deplaceNum = mcRef._y - (((nMapHeight - nStageHeight) - 1) * -1);
}
mcRef._y = mcRef._y - _deplaceNum;
}
function ViewMode() {
}
function checkLaunch(_nXPos) {
var _local2 = false;
if (_nXPos >= mcRef.LauncherMc._x) {
_local2 = true;
}
return(_local2);
}
function get launcherMc() {
return(mcRef.LauncherMc);
}
var nStageWidth = 250;
var nStageHeight = 300;
var nMapHeight = 3242;
}
Symbol 566 MovieClip [__Packages.Hawkgirl.Hud] Frame 0
class Hawkgirl.Hud
{
var mcRef, nDistance;
function Hud (_mcRef) {
mcRef = _mcRef;
nDistance = 0;
mcRef.mcWon.gotoAndStop(1);
}
function checkDist() {
var _local2 = false;
if (nDistance >= aLEVEL_DISTANCE[Hawkgirl.MainGame.nLevel - 1]) {
_local2 = true;
}
return(_local2);
}
function updateDistance(_nDistance) {
var _local2 = nDistance;
nDistance = _nDistance * nDISTANCE_RATIO;
_local2 = nDistance - _local2;
nDistance = Math.round(nDistance);
mcRef.txtDistance.text = nDistance;
var _local3 = Math.round((nDistance * 400) / aLEVEL_DISTANCE[Hawkgirl.MainGame.nLevel - 1]);
mcRef.mcBar.gotoAndStop(_local3);
Hawkgirl.MainGame.nScore = Math.round(Hawkgirl.MainGame.nScore + (_local2 * (Hawkgirl.MainGame.nLevel * 2)));
mcRef.txtScore.text = Hawkgirl.MainGame.nScore;
if (nDistance >= aLEVEL_DISTANCE[Hawkgirl.MainGame.nLevel - 1]) {
mcRef.mcWon.gotoAndStop(2);
}
}
static var nDISTANCE_RATIO = 0.08;
static var aLEVEL_DISTANCE = [2500, 3000, 3500, 4000, 4250, 4500];
}
Symbol 567 MovieClip [__Packages.Hawkgirl.GameTransition] Frame 0
class Hawkgirl.GameTransition
{
var mcRef;
function GameTransition (_mcRef) {
mcRef = _mcRef;
mcRef.onEnterFrame = Delegate.create(this, update);
mcRef.gotoAndStop(1);
}
function transit() {
mcRef.play();
}
function update() {
if (mcRef._currentframe == 10) {
mcRef._parent.gotoAndStop("ResetGame");
}
if (mcRef._currentframe == mcRef._totalframes) {
mcRef.gotoAndStop(1);
}
}
}
Symbol 568 MovieClip [__Packages.Hawkgirl.PointingArrow] Frame 0
class Hawkgirl.PointingArrow
{
var mcRef, mcFollow, mcTarget;
function PointingArrow (_mcRef, _mcFollow) {
mcRef = _mcRef;
mcFollow = _mcFollow;
mcTarget = Hawkgirl.MainGame.getTarget();
Hawkgirl.MainGame.__get__Broadcaster().addListener(this);
}
function update() {
checkPos();
}
function checkPos() {
mcRef._x = mcFollow._x + nX_OFFSET;
var _local2 = Hawkgirl.MainGame.getTarget();
mcRef._y = _local2._y;
}
static var nX_OFFSET = 250;
static var nSLOW_DOWN = 5;
}
Symbol 569 MovieClip [__Packages.Hawkgirl.Robot] Frame 0
class Hawkgirl.Robot extends Hawkgirl.State
{
var __set___state, updateState, mcRef, __get___stateFinished;
function Robot (_mcRef) {
super(_mcRef);
__set___state("Idle");
Hawkgirl.MainGame.__get__Broadcaster().addListener(this);
}
function update() {
updateState();
}
function Idle() {
var _local2 = new Object();
_local2.x = 0;
_local2.y = 0;
_local2.x = mcRef._x;
_local2.y = mcRef._y;
mcRef._parent.localToGlobal(_local2);
if (_local2.x < -50) {
mcRef.removeMovieClip();
Hawkgirl.MainGame.__get__Broadcaster().removeListener(this);
}
if (mcRef.hitTest(Hawkgirl.MainGame.oHawkgirl.__get__mc().hitZone) && ((Hawkgirl.MainGame.oHawkgirl.__get___state() == "Fly1") || (Hawkgirl.MainGame.oHawkgirl.__get___state() == "Fly2"))) {
__set___state("Explode");
Hawkgirl.MainGame.oHawkgirl.hitRobot();
}
}
function Explode() {
if (__get___stateFinished()) {
mcRef.removeMovieClip();
Hawkgirl.MainGame.__get__Broadcaster().removeListener(this);
}
}
}
Symbol 492 MovieClip Frame 39
stop();