Frame 1
_global.ipbSend = function (ipb_score) {
_root._visible = false;
_root.enabled = false;
if (ipb_score == eval("undefined")) {
ipb_score = eval (_global.ipb_scoreVar);
}
stopAllSounds();
xx = new LoadVars();
xx.gname = _global.ipb_get_gname();
xx.gscore = ipb_score;
xx.send("index.php?act=Arcade&do=newscore", "_self", "POST");
stop();
};
_global.ipb_get_gname = function () {
var u = _root._url;
var ipb_gname = "";
var ch = "";
var startPos = (u.lastIndexOf("\\") + 1);
if ((startPos == -1) || (startPos == 0)) {
startPos = u.lastIndexOf("/") + 1;
}
var x = startPos;
var len = String(u).length;
while (x < String(u).length) {
ch = u.charAt(x);
if (ch == ".") {
break;
}
ipb_gname = ipb_gname + ch;
x++;
}
return(ipb_gname);
};
fscommand("showmenu", false);
fscommand("trapallkeys", true);
ipb_gname = _global.ipb_get_gname();
xx = new LoadVars();
xx.onLoad = function (success) {
if (!success) {
stop();
} else {
_global.ipb_scoreVar = this.scoreVar;
}
};
fname = ((("arcade/gamedata/" + ipb_gname) + "/") + ipb_gname) + ".txt";
xx.load(fname);
Stage.showMenu = false;
_focusrect = false;
_global.theStage = this;
stop();
Instance of Symbol 5 MovieClip in Frame 1
onClipEvent (enterFrame) {
var l_pc = Math.ceil((_parent.getBytesLoaded() / _parent.getBytesTotal()) * 100);
if (l_pc == 100) {
_parent.gotoAndStop("TitleCard");
} else {
_parent.Loading_txt.text = l_pc + "%";
_parent.Loading_txtO.text = l_pc + "%";
}
}
Instance of Symbol 117 MovieClip in Frame 2
onClipEvent (load) {
function mute() {
SoundActive = false;
_global.Hud.Son.gotoAndStop(2);
}
function unmute() {
SoundActive = true;
_global.Hud.Son.gotoAndStop(1);
}
function initGame(bPlayAgain) {
Score = 0;
Life = 10;
Level = 1;
Time = 0;
gear = 0;
AmountLife = 1;
TotalScore = 0;
endStageScore = 0;
goToScreen("level" + Level, true);
resetTimer();
GameActive = true;
}
function endGame(endType) {
GameActive = false;
_global.Game.G_Pause = true;
Score = _global.Game.Pers.Point;
if (endType == "lose") {
TotalScore = Score;
goToScreen("Lose", true);
} else {
goToScreen("Win", true);
}
}
function reInitGame() {
Score = 0;
Life = 10;
gear = 0;
TotalScore = 0;
endStageScore = 0;
goToScreen("level" + Level, true);
}
function levelUp() {
Time = 0;
Level++;
_global.Transition.gotoAndStop("NextLevel");
NextScreen = "level" + Level;
Reset = true;
}
function resumeGame() {
_global.Game.G_Resume = true;
}
function resetTimer() {
Time = 0;
}
function increaseTime() {
if (!_global.Game.G_Pause) {
Time++;
}
TimeRemain = TotalTime - Time;
if (TimeRemain == 0) {
endGame("lose");
}
refreshTime();
}
function TimeFlash() {
if (TimeRemain <= 10) {
if (_global.Hud.Minute._visible) {
_global.Hud.Minute._visible = false;
_global.Hud.Seconde._visible = false;
_global.Hud.Seconde2._visible = false;
} else {
_global.Hud.Minute._visible = true;
_global.Hud.Seconde._visible = true;
_global.Hud.Seconde2._visible = true;
}
}
}
function refreshTime() {
var _local4 = Math.floor(TimeRemain / 60);
var _local3 = TimeRemain % 60;
if (_local3 < 10) {
var _local2 = "0" + String(_local3);
} else {
var _local2 = String(_local3);
}
_global.Hud.Minute.text = _local4;
_global.Hud.Seconde.text = _local2.slice(0, 1);
_global.Hud.Seconde2.text = _local2.slice(1, 2);
}
function calculateBonus(bLoose) {
TimeBonus = 0;
if (bLoose) {
TimeBonus = 0;
} else {
TimeBonus = TimeRemain * 5;
TotalScore = TimeBonus + Score;
}
}
function refreshScore() {
_global.theStage.xBonus.text = Score;
_global.theStage.timeBonus.text = TimeBonus;
_global.theStage.totalPoints.text = Score + TimeBonus;
}
function showHelp(inGame) {
if (inGame) {
GameActive = true;
_global.Game.G_Pause = true;
_global.Popup.gotoAndStop("Instructions");
} else {
GameActive = false;
_global.Popup.gotoAndStop("Instructions");
_global.theStage.gotoAndStop("Reset");
}
}
function helpBack() {
_global.Popup.prevFrame();
}
function helpNext() {
_global.Popup.nextFrame();
}
function goToScreen(Screen, ResetLevel) {
_global.Transition.gotoAndStop("Transition");
NextScreen = Screen;
Reset = ResetLevel;
}
function resetScreen() {
if (Reset) {
_root.gotoAndStop("Reset");
}
_global.Popup.gotoAndStop(1);
}
function showScreen() {
_global.theStage.gotoAndStop(NextScreen);
refreshTime();
if ((NextScreen == "Lose") || (NextScreen == "Win")) {
refreshScore();
} else if (NextScreen.indexOf("level") != -1) {
_global.Popup.gotoAndStop(Level + "Start");
}
}
function beginLevel() {
_global.Popup.gotoAndStop(1);
_global.C.ActivateHud();
_global.Game.G_Resume = true;
}
function endLevel(CurrentPoint, CurrentLife) {
Score = CurrentPoint;
_global.Popup.gotoAndStop(Level + "End");
SetResult();
}
function SetResult() {
_global.Hud.Minute._visible = true;
_global.Hud.Seconde._visible = true;
_global.Hud.Seconde2._visible = true;
_global.Popup.collected_txt.text = gear;
calculateBonus(false);
var _local4 = Math.floor(TimeRemain / 60);
var _local3 = TimeRemain % 60;
if (_local3 < 10) {
var _local2 = "0" + String(_local3);
} else {
var _local2 = String(_local3);
}
_global.Popup.Minute.text = _local4;
_global.Popup.Seconde.text = _local2.slice(0, 1);
_global.Popup.Seconde2.text = _local2.slice(1, 2);
_global.Popup.Score_txt.text = TotalScore;
_global.Game.G_Pause = true;
gear = 0;
Life = 10;
endStageScore = TotalScore;
}
function endTransition() {
_global.Transition.gotoAndStop(1);
}
function ActivateHud() {
_global.Hud.btnHelp.enabled = true;
_global.Hud.Son.btnMute.enabled = true;
}
function DesactivateHud() {
_global.Hud.btnHelp.enabled = false;
_global.Hud.Son.btnMute.enabled = false;
}
function getAgentID() {
}
_global.C = this;
var Reset = false;
var Time = 0;
var gear = 0;
var AmountLife = 1;
var TotalTime = 420;
var TimeRemain = TotalTime;
var NextScreen = "";
var GameActive = false;
var SoundActive = true;
var TotalScore = 0;
var endStageScore = 0;
}
Frame 6
_global.SoundCTRL.playSound("MusicLoop2", 30, 100000);
Frame 7
_global.Sounds.SwitchToPack();
stop();
Instance of Symbol 304 MovieClip "Popup" in Frame 7
onClipEvent (load) {
_global.Popup = this;
}
Instance of Symbol 314 MovieClip "Transition" in Frame 7
onClipEvent (load) {
_global.Transition = this;
}
Instance of Symbol 316 MovieClip in Frame 7
onClipEvent (load) {
function mute() {
SoundActive = false;
_global.Hud.Son.gotoAndStop(2);
}
function unmute() {
SoundActive = true;
_global.Hud.Son.gotoAndStop(1);
}
function initGame(bPlayAgain) {
Score = 0;
Life = 10;
Level = 1;
Time = 0;
gear = 0;
AmountLife = 1;
TotalScore = 0;
endStageScore = 0;
goToScreen("level" + Level, true);
resetTimer();
GameActive = true;
}
function endGame(endType) {
GameActive = false;
_global.Game.G_Pause = true;
Score = _global.Game.Pers.Point;
if (endType == "lose") {
TotalScore = Score;
goToScreen("Lose", true);
} else {
goToScreen("Win", true);
}
}
function reInitGame() {
Score = 0;
Life = 10;
gear = 0;
TotalScore = 0;
endStageScore = 0;
goToScreen("level" + Level, true);
}
function levelUp() {
Time = 0;
Level++;
_global.Transition.gotoAndStop("NextLevel");
NextScreen = "level" + Level;
Reset = true;
}
function resumeGame() {
_global.Game.G_Resume = true;
}
function resetTimer() {
Time = 0;
}
function increaseTime() {
if (!_global.Game.G_Pause) {
Time++;
}
TimeRemain = TotalTime - Time;
if (TimeRemain == 0) {
endGame("lose");
}
refreshTime();
}
function TimeFlash() {
if (TimeRemain <= 10) {
if (_global.Hud.Minute._visible) {
_global.Hud.Minute._visible = false;
_global.Hud.Seconde._visible = false;
_global.Hud.Seconde2._visible = false;
} else {
_global.Hud.Minute._visible = true;
_global.Hud.Seconde._visible = true;
_global.Hud.Seconde2._visible = true;
}
}
}
function refreshTime() {
var _local4 = Math.floor(TimeRemain / 60);
var _local3 = TimeRemain % 60;
if (_local3 < 10) {
var _local2 = "0" + String(_local3);
} else {
var _local2 = String(_local3);
}
_global.Hud.Minute.text = _local4;
_global.Hud.Seconde.text = _local2.slice(0, 1);
_global.Hud.Seconde2.text = _local2.slice(1, 2);
}
function calculateBonus(bLoose) {
TimeBonus = 0;
if (bLoose) {
TimeBonus = 0;
} else {
TimeBonus = TimeRemain * 5;
TotalScore = TimeBonus + Score;
}
}
function refreshScore() {
_global.theStage.xBonus.text = Score;
_global.theStage.timeBonus.text = TimeBonus;
_global.theStage.totalPoints.text = Score + TimeBonus;
}
function showHelp(inGame) {
if (inGame) {
GameActive = true;
_global.Game.G_Pause = true;
_global.Popup.gotoAndStop("Instructions");
} else {
GameActive = false;
_global.Popup.gotoAndStop("Instructions");
_global.theStage.gotoAndStop("Reset");
}
}
function helpBack() {
_global.Popup.prevFrame();
}
function helpNext() {
_global.Popup.nextFrame();
}
function goToScreen(Screen, ResetLevel) {
_global.Transition.gotoAndStop("Transition");
NextScreen = Screen;
Reset = ResetLevel;
}
function resetScreen() {
if (Reset) {
_root.gotoAndStop("Reset");
}
_global.Popup.gotoAndStop(1);
}
function showScreen() {
_global.theStage.gotoAndStop(NextScreen);
refreshTime();
if ((NextScreen == "Lose") || (NextScreen == "Win")) {
refreshScore();
} else if (NextScreen.indexOf("level") != -1) {
_global.Popup.gotoAndStop(Level + "Start");
}
}
function beginLevel() {
_global.Popup.gotoAndStop(1);
_global.C.ActivateHud();
_global.Game.G_Resume = true;
}
function endLevel(CurrentPoint, CurrentLife) {
Score = CurrentPoint;
_global.Popup.gotoAndStop(Level + "End");
SetResult();
}
function SetResult() {
_global.Hud.Minute._visible = true;
_global.Hud.Seconde._visible = true;
_global.Hud.Seconde2._visible = true;
_global.Popup.collected_txt.text = gear;
calculateBonus(false);
var _local4 = Math.floor(TimeRemain / 60);
var _local3 = TimeRemain % 60;
if (_local3 < 10) {
var _local2 = "0" + String(_local3);
} else {
var _local2 = String(_local3);
}
_global.Popup.Minute.text = _local4;
_global.Popup.Seconde.text = _local2.slice(0, 1);
_global.Popup.Seconde2.text = _local2.slice(1, 2);
_global.Popup.Score_txt.text = TotalScore;
_global.Game.G_Pause = true;
gear = 0;
Life = 10;
endStageScore = TotalScore;
}
function endTransition() {
_global.Transition.gotoAndStop(1);
}
function ActivateHud() {
_global.Hud.btnHelp.enabled = true;
_global.Hud.Son.btnMute.enabled = true;
}
function DesactivateHud() {
_global.Hud.btnHelp.enabled = false;
_global.Hud.Son.btnMute.enabled = false;
}
function getAgentID() {
}
_global.C = this;
var Reset = false;
var Time = 0;
var gear = 0;
var AmountLife = 1;
var TotalTime = 420;
var TimeRemain = TotalTime;
var NextScreen = "";
var GameActive = false;
var SoundActive = true;
var TotalScore = 0;
var endStageScore = 0;
}
Instance of Symbol 318 MovieClip in Frame 7
onClipEvent (load) {
function ToMute() {
_global.Muted = true;
this.onEnterFrame = function () {
if (SetVolumePack > 0) {
SetVolumePack = SetVolumePack - 5;
packMusic.setVolume(SetVolumePack);
}
if (SetVolumeInG > 0) {
SetVolumeInG = SetVolumeInG - 5;
gameMusic.setVolume(SetVolumeInG);
}
if ((SetVolumePack == 0) && (SetVolumeInG == 0)) {
delete onEnterFrame;
}
};
}
function UnMute() {
_global.Muted = false;
this.onEnterFrame = function () {
if ((SetVolumePack < 80) && (musicIn == "Packaging")) {
SetVolumePack = SetVolumePack + 5;
packMusic.setVolume(SetVolumePack);
}
if ((SetVolumeInG < 80) && (musicIn == "InGame")) {
SetVolumeInG = SetVolumeInG + 5;
gameMusic.setVolume(SetVolumeInG);
}
if ((SetVolumePack == 80) || (SetVolumeInG == 80)) {
delete onEnterFrame;
}
};
}
function SwitchToPack() {
musicIn = "Packaging";
this.onEnterFrame = function () {
if (_global.Muted) {
delete onEnterFrame;
} else {
if (SetVolumePack < 80) {
SetVolumePack = SetVolumePack + 5;
packMusic.setVolume(SetVolumePack);
}
if (SetVolumeInG > 0) {
SetVolumeInG = SetVolumeInG - 5;
gameMusic.setVolume(SetVolumeInG);
}
if ((SetVolumePack == 80) && (SetVolumeInG == 0)) {
delete onEnterFrame;
}
}
};
}
function SwitchToInGame() {
musicIn = "InGame";
this.onEnterFrame = function () {
if (_global.Muted) {
delete onEnterFrame;
} else {
if (SetVolumeInG < 80) {
SetVolumeInG = SetVolumeInG + 5;
gameMusic.setVolume(SetVolumeInG);
}
if (SetVolumePack > 0) {
SetVolumePack = SetVolumePack - 5;
packMusic.setVolume(SetVolumePack);
}
if ((SetVolumeInG == 80) && (SetVolumePack == 0)) {
delete onEnterFrame;
}
}
};
}
function PlayASound(WitchSound, nloop, nVolume) {
trace("WitchSound = " + WitchSound);
if (nloop == undefined) {
nloop = 1;
}
if (nVolume == undefined) {
nVolume = 100;
}
if (!_global.Muted) {
eval (WitchSound).start(0, nloop);
eval (WitchSound).setVolume(nVolume);
}
}
_global.Sounds = this;
_global.Muted = false;
var SetVolumeInG;
var SetVolumePack;
var musicIn;
this.createEmptyMovieClip("packMusic", 1);
packMusic = new Sound("packMusic");
packMusic.attachSound("packMusic");
this.createEmptyMovieClip("gameMusic", 2);
gameMusic = new Sound("gameMusic");
gameMusic.attachSound("gameMusic");
packMusic.start(0, 1000000);
gameMusic.start(0, 1000000);
SetVolumePack = 80;
SetVolumeInG = 0;
musicIn = "Packaging";
packMusic.setVolume(SetVolumePack);
gameMusic.setVolume(SetVolumeInG);
this.createEmptyMovieClip("Jump", 3);
Jump = new Sound("Jump");
Jump.attachSound("Jump");
this.createEmptyMovieClip("Kick", 4);
Kick = new Sound("Kick");
Kick.attachSound("Kick");
this.createEmptyMovieClip("Pot", 5);
Pot = new Sound("Pot");
Pot.attachSound("Pot");
this.createEmptyMovieClip("Tirroir", 7);
Tirroir = new Sound("Tirroir");
Tirroir.attachSound("Tirroir");
this.createEmptyMovieClip("Objet", 10);
Objet = new Sound("Objet");
Objet.attachSound("Objet");
this.createEmptyMovieClip("Ball", 12);
Ball = new Sound("Ball");
Ball.attachSound("Ball");
this.createEmptyMovieClip("Lazer", 13);
Lazer = new Sound("Lazer");
Lazer.attachSound("Lazer");
this.createEmptyMovieClip("Crache", 14);
Crache = new Sound("Crache");
Crache.attachSound("Crache");
this.createEmptyMovieClip("Explos", 15);
Explos = new Sound("Explos");
Explos.attachSound("Explos");
this.createEmptyMovieClip("Bump", 16);
Bump = new Sound("Bump");
Bump.attachSound("Bump");
this.createEmptyMovieClip("electroc", 17);
electroc = new Sound("electroc");
electroc.attachSound("electroc");
this.createEmptyMovieClip("Coussin", 18);
Coussin = new Sound("Coussin");
Coussin.attachSound("Coussin");
this.createEmptyMovieClip("rBump", 19);
rBump = new Sound("rBump");
rBump.attachSound("rBump");
this.createEmptyMovieClip("rHead", 20);
rHead = new Sound("rHead");
rHead.attachSound("rHead");
this.createEmptyMovieClip("Missile", 22);
Missile = new Sound("Missile");
Missile.attachSound("Missile");
this.createEmptyMovieClip("Dead", 23);
Dead = new Sound("Dead");
Dead.attachSound("Dead");
}
Instance of Symbol 320 MovieClip in Frame 7
onClipEvent (load) {
function getScores() {
if (G_TestHighScore == true) {
trace("getScores");
}
if (gProxyObj == undefined) {
if (G_TestHighScore == true) {
trace("dans getscore, listescore");
}
listScores();
} else {
if (G_TestHighScore == true) {
trace("dans getscore, getScores");
}
gProxyObj.getScores(cbFunc2);
}
}
function submitScore(theScore) {
if (G_TestHighScore == true) {
trace("Envoie le score = " + theScore);
}
gProxyObj.submitScore(theScore, cbFunc);
}
function initHiScores() {
if (G_TestHighScore == true) {
trace("Tu init le highscore!");
}
gProxyObj.setGame_Id("cs_destructo");
}
function getScoreString() {
var _local5 = "Oops! The high score list isn't available right now!";
var _local8 = 30;
if (gProxyObj != undefined) {
var _local7 = gProxyObj.getScoreCount();
if (_local7 > 0) {
var _local1;
var _local6;
var _local3;
var _local4;
_local5 = "";
_local1 = 0;
while (_local1 < _local7) {
_local6 = gProxyObj.getScoreItem(_local1);
_local3 = _local6[0];
_local4 = fStyleNumber(_local6[1]);
spaceNb = ((_local8 - _local3.length) - _local4.length) - 4;
spaceTXT = "";
var _local2 = 0;
while (_local2 < spaceNb) {
spaceTXT = spaceTXT + " ";
_local2++;
}
if (_local1 < 9) {
_local5 = _local5 + ((((((_local1 + 1) + " ") + _local3) + spaceTXT) + _local4) + newline);
} else if (_local1 < 99) {
_local5 = _local5 + ((((((_local1 + 1) + " ") + _local3) + spaceTXT) + _local4) + newline);
} else {
_local5 = _local5 + ((((((_local1 + 1) + " ") + _local3) + spaceTXT) + _local4) + newline);
}
_local1++;
}
} else {
_local5 = "Whoops, the high scores seem to have escaped!";
}
}
if (G_TestHighScore == true) {
trace("Tu retournes \u00E7a = " + _local5);
}
return(_local5);
}
function listScores() {
if (G_TestHighScore == true) {
trace("Liste les scores..");
}
_parent.txt_highScore.text = getScoreString();
}
function cbFunc(thisBool) {
if (thisBool) {
listScores();
} else {
if (G_TestHighScore == true) {
trace("CBfunc y\u00E9 false...");
}
_parent.txt_highScore.text = "Oops! The high score list isn\u2019t available right now!";
}
}
function cbFunc2(thisBool) {
if (thisBool) {
listScores();
} else {
_parent.txt_highScore.text = "Oops! The high score list isn\u2019t available right now!";
}
}
function fStyleNumber(_nNumber, _nMinimumChar) {
_sNumber = String(_nNumber);
_sNewString = "";
_nlength = _sNumber.length;
_nlength = _nlength / 3;
if (_nlength <= 1) {
_sNewNumber = _sNumber;
if (_sNewNumber.length < _nMinimumChar) {
_sNewNumber = "0" + _sNewNumber;
}
return(_sNewNumber);
}
_nLoop = _nlength;
while (_nLoop > 1) {
_sNewString = (" " + _sNumber.substr(-3)) + _sNewString;
_sNumber = _sNumber.substr(0, -3);
_nLoop--;
}
_sNewNumber = _sNumber + _sNewString;
if (_sNewNumber.length < _nMinimumChar) {
_sNewNumber = "0" + _sNewNumber;
}
return(_sNewNumber);
}
_global.HS = this;
var G_ShowHighScore = true;
var G_TestHighScore = false;
if (G_TestHighScore == true) {
gProxyObj.setServer("www.nick-q.mtvi.com");
gProxyObj.setScreenName("DanQuiTest");
gProxyObj.setIsLoggedIn(true);
}
}
Frame 14
_global.Sounds.SwitchToInGame();
stop();
Instance of Symbol 699 MovieClip "Game" in Frame 14
onClipEvent (load) {
this._xscale = 100;
this._yscale = 100;
this._x = -220;
this._y = -380;
}
Instance of Symbol 730 MovieClip "Hud" in Frame 14
onClipEvent (load) {
_global.Hud = this;
_global.C.DesactivateHud();
}
Instance of Symbol 742 MovieClip "ShowLeft" in Frame 14
onClipEvent (load) {
_global.ShowLeft = this;
}
Frame 19
_global.Sounds.SwitchToInGame();
stop();
Instance of Symbol 782 MovieClip "Game" in Frame 19
onClipEvent (load) {
this._xscale = 100;
this._yscale = 100;
this._x = -220;
this._y = -380;
}
Frame 24
_global.Sounds.SwitchToInGame();
stop();
Instance of Symbol 836 MovieClip "Game" in Frame 24
onClipEvent (load) {
this._xscale = 100;
this._yscale = 100;
this._x = -220;
this._y = -380;
}
Frame 31
stop();
_global.Sounds.SwitchToPack();
_global.HS.initHiScores();
if (gProxyObj.getIsLoggedIn()) {
btn_submit_score._visible = true;
} else {
btn_submit_score._visible = false;
}
if (_global.HS.G_ShowHighScore == false) {
btn_submit_score._visible = false;
btn_view_score._visible = false;
}
Frame 36
_global.Sounds.SwitchToPack();
stop();
_global.HS.initHiScores();
if (gProxyObj.getIsLoggedIn()) {
btn_submit_score._visible = true;
} else {
btn_submit_score._visible = false;
}
if (_global.HS.G_ShowHighScore == false) {
btn_submit_score._visible = false;
btn_view_score._visible = false;
}
Frame 42
if (gProxyObj.getIsLoggedIn()) {
btn_submit_score._visible = true;
} else {
btn_submit_score._visible = false;
}
_global.HS.getScores();
Instance of Symbol 967 MovieClip "ControlScroll" in Frame 42
onClipEvent (load) {
scrollUp = false;
scrollDown = false;
}
onClipEvent (enterFrame) {
if (scrollUp == true) {
_parent.txt_highScore.scroll--;
} else if (scrollDown == true) {
_parent.txt_highScore.scroll++;
}
}
Symbol 97 Button
on (keyPress "<Left>") {
return(undefined);
}
on (keyPress "<Right>") {
return(undefined);
}
on (keyPress "<Up>") {
return(undefined);
}
on (keyPress "<Down>") {
return(undefined);
}
on (keyPress "<Space>") {
return(undefined);
}
Symbol 117 MovieClip Frame 1
stop();
Symbol 127 Button
on (release) {
_global.C.initGame();
}
Symbol 131 Button
on (release) {
_global.C.showHelp(false);
}
Symbol 140 Button
on (release) {
_global.Game.G_Resume = true;
}
Symbol 159 Button
on (release) {
_global.Sounds.SwitchToInGame();
_global.C.resumeGame();
}
Symbol 160 MovieClip Frame 1
trace(_global.C.GameActive);
if (_global.C.GameActive) {
gotoAndStop (2);
}
stop();
Symbol 163 Button
on (release) {
_global.C.helpNext();
}
Symbol 177 MovieClip Frame 10
stop();
Symbol 178 MovieClip Frame 1
stop();
Symbol 198 Button
on (release) {
_global.C.helpBack();
}
Symbol 292 Button
on (release) {
_global.C.levelUp();
}
Symbol 303 Button
on (release) {
_global.C.endGame("win");
}
Symbol 304 MovieClip Frame 1
stop();
Symbol 304 MovieClip Frame 2
backBtn.useHandCursor = false;
Instance of Symbol 135 MovieClip "backBtn" in Symbol 304 MovieClip Frame 2
on (release) {
}
Symbol 304 MovieClip Frame 7
_global.Sounds.SwitchToPack();
BackBtn.useHandCursor = false;
Symbol 304 MovieClip Frame 18
_global.C.beginLevel();
Symbol 304 MovieClip Frame 31
_global.C.beginLevel();
Symbol 304 MovieClip Frame 45
_global.C.beginLevel();
Symbol 312 MovieClip Frame 23
_global.C.resetScreen();
Symbol 312 MovieClip Frame 36
_global.C.showScreen();
Symbol 312 MovieClip Frame 48
_global.C.endTransition();
Symbol 313 MovieClip Frame 21
_global.C.resetScreen();
Symbol 313 MovieClip Frame 58
_global.C.showScreen();
Symbol 313 MovieClip Frame 70
_global.C.endTransition();
Symbol 314 MovieClip Frame 1
stop();
Symbol 324 MovieClip Frame 5
_global.C.TimeFlash();
Symbol 324 MovieClip Frame 10
_global.C.TimeFlash();
Symbol 324 MovieClip Frame 15
_global.C.TimeFlash();
Symbol 324 MovieClip Frame 20
_global.C.TimeFlash();
Symbol 324 MovieClip Frame 25
_global.C.TimeFlash();
Symbol 324 MovieClip Frame 30
_global.C.TimeFlash();
Symbol 324 MovieClip Frame 35
_global.C.increaseTime();
Symbol 326 MovieClip Frame 1
stop();
Symbol 326 MovieClip Frame 4
if (_parent.Control.Pers.GunUsed == "GlueGun") {
_parent.Control.CreerPersBall();
}
Symbol 373 MovieClip Frame 37
stop();
Symbol 374 MovieClip [minXBonus] Frame 1
stop();
Symbol 379 MovieClip Frame 1
this._visible = false;
Symbol 383 MovieClip Frame 44
stop();
Symbol 383 MovieClip Frame 53
stop();
Symbol 390 MovieClip Frame 5
stop();
Symbol 390 MovieClip Frame 16
stop();
Symbol 401 MovieClip Frame 1
stop();
Symbol 401 MovieClip Frame 10
stop();
Instance of Symbol 250 MovieClip "missile" in Symbol 401 MovieClip Frame 10
onClipEvent (load) {
_global.Sounds.PlayASound("Explos", 1, 80);
}
Symbol 402 MovieClip Frame 3
_global.Sounds.PlayASound("Missile", 1, 80);
Symbol 405 MovieClip Frame 14
_parent._parent.removeMovieClip();
Symbol 406 MovieClip Frame 30
stop();
Symbol 407 MovieClip Frame 1
stop();
Symbol 407 MovieClip Frame 9
stop();
Symbol 407 MovieClip Frame 13
stop();
Symbol 407 MovieClip Frame 17
stop();
Symbol 407 MovieClip Frame 25
stop();
Symbol 407 MovieClip Frame 33
stop();
Symbol 407 MovieClip Frame 41
stop();
Symbol 407 MovieClip Frame 49
stop();
Symbol 407 MovieClip Frame 57
stop();
Symbol 407 MovieClip Frame 66
stop();
Symbol 414 MovieClip Frame 41
stop();
Symbol 420 MovieClip Frame 30
stop();
Symbol 421 MovieClip Frame 1
stop();
Symbol 421 MovieClip Frame 65
stop();
Symbol 446 MovieClip Frame 30
stop();
Symbol 464 MovieClip Frame 6
stop();
Symbol 465 MovieClip Frame 12
stop();
Symbol 466 MovieClip Frame 1
stop();
Instance of Symbol 468 MovieClip "spark" in Symbol 469 MovieClip Frame 9
onClipEvent (enterFrame) {
this._x = _parent.missile._x;
}
Symbol 469 MovieClip Frame 45
stop();
Symbol 476 MovieClip Frame 30
stop();
Symbol 477 MovieClip Frame 1
stop();
Symbol 477 MovieClip Frame 16
stop();
Symbol 477 MovieClip Frame 65
stop();
Symbol 478 MovieClip Frame 1
stop();
Instance of Symbol 407 MovieClip "Obj" in Symbol 478 MovieClip Frame 1
/* no clip actions */
Symbol 478 MovieClip Frame 2
stop();
Symbol 478 MovieClip Frame 3
stop();
Symbol 478 MovieClip Frame 4
stop();
Symbol 478 MovieClip Frame 5
stop();
Symbol 478 MovieClip Frame 6
stop();
Symbol 522 MovieClip Frame 1
stop();
Symbol 522 MovieClip Frame 2
play();
Symbol 522 MovieClip Frame 22
stop();
Symbol 522 MovieClip Frame 23
stop();
Symbol 528 MovieClip Frame 1
stop();
Symbol 528 MovieClip Frame 2
play();
Symbol 528 MovieClip Frame 22
stop();
Symbol 528 MovieClip Frame 23
stop();
Symbol 533 MovieClip Frame 1
stop();
Symbol 533 MovieClip Frame 2
play();
Symbol 533 MovieClip Frame 22
stop();
Symbol 533 MovieClip Frame 23
stop();
Symbol 537 MovieClip Frame 1
stop();
Symbol 537 MovieClip Frame 2
play();
Symbol 537 MovieClip Frame 21
stop();
Symbol 537 MovieClip Frame 22
stop();
Symbol 541 MovieClip Frame 1
stop();
Symbol 541 MovieClip Frame 2
play();
Symbol 541 MovieClip Frame 22
stop();
Symbol 541 MovieClip Frame 23
stop();
Symbol 548 MovieClip Frame 10
stop();
Symbol 549 MovieClip Frame 1
stop();
Symbol 560 MovieClip Frame 1
stop();
Symbol 560 MovieClip Frame 2
play();
Symbol 560 MovieClip Frame 13
stop();
Symbol 584 MovieClip Frame 1
stop();
Symbol 594 MovieClip Frame 1
_visible = false;
Symbol 603 MovieClip Frame 8
stop();
_global.oPerso.persoIsAttacking = false;
Symbol 611 MovieClip Frame 5
stop();
Symbol 613 MovieClip Frame 7
stop();
_global.oPerso.persoIsAttacking = false;
Symbol 616 MovieClip Frame 17
stop();
Symbol 623 MovieClip Frame 12
_global.oPerso.persoIsInPain = false;
Symbol 647 MovieClip Frame 18
stop();
Symbol 673 MovieClip Frame 1
stop();
Symbol 673 MovieClip Frame 7
stop();
Symbol 673 MovieClip Frame 15
stop();
Symbol 673 MovieClip Frame 21
stop();
Symbol 673 MovieClip Frame 27
stop();
Symbol 673 MovieClip Frame 34
stop();
Symbol 673 MovieClip Frame 39
stop();
Symbol 673 MovieClip Frame 47
stop();
Symbol 673 MovieClip Frame 54
stop();
Symbol 673 MovieClip Frame 61
stop();
Symbol 673 MovieClip Frame 68
stop();
Symbol 673 MovieClip Frame 76
stop();
Symbol 673 MovieClip Frame 84
stop();
Symbol 673 MovieClip Frame 99
stop();
Symbol 673 MovieClip Frame 105
stop();
Symbol 674 MovieClip Frame 1
Obj.gotoAndStop(_parent.Control.Pers.Etat);
stop();
Symbol 674 MovieClip Frame 2
Obj.gotoAndStop(_parent.Control.Pers.Etat);
stop();
Symbol 692 MovieClip Frame 8
stop();
Symbol 693 MovieClip Frame 1
stop();
Instance of Symbol 681 MovieClip in Symbol 693 MovieClip Frame 1
onClipEvent (load) {
this._visible = false;
}
Symbol 693 MovieClip Frame 8
stop();
Symbol 693 MovieClip Frame 15
stop();
Symbol 693 MovieClip Frame 23
stop();
Symbol 694 MovieClip Frame 1
stop();
Symbol 694 MovieClip Frame 2
stop();
Symbol 695 MovieClip Frame 121
stop();
Symbol 696 MovieClip Frame 1
stop();
Symbol 696 MovieClip Frame 8
stop();
Symbol 696 MovieClip Frame 15
stop();
Symbol 696 MovieClip Frame 23
stop();
Instance of Symbol 405 MovieClip "Etat" in Symbol 696 MovieClip Frame 23
onClipEvent (load) {
_global.Sounds.PlayASound("Explos", 1, 80);
}
Symbol 696 MovieClip Frame 27
stop();
Symbol 696 MovieClip Frame 31
stop();
Symbol 697 MovieClip Frame 1
stop();
Symbol 697 MovieClip Frame 2
stop();
Instance of Symbol 322 MovieClip "Control" in Symbol 699 MovieClip Frame 1
onClipEvent (load) {
function ObjPers(PosX, PosY, Perso) {
this.Nom = "Pers";
this.Etat = "Idle";
this.EtatOld = "Idle";
this.Dir = "D";
this.DirOld = "D";
this.Point = _global.C.TotalScore;
this.Life = _global.C.Life;
this.SpdXMinion = 3;
this.SpdXNormal = 9;
this.SpdXBase = 0;
this.SpdXNow = 0;
this.MoveX = 0;
this.MoveY = 0;
this.PosX = PosX;
this.PosY = PosY;
this.TrueX = PosX;
this.TrueY = PosY;
this.FrontX = 0;
this.FrontY = 0;
this.BottomFrontX = 0;
this.BottomBackX = 0;
this.BackX = 0;
this.HitGrdPoint = 0;
this.WallHitBloc = 2;
this.SpdYNow = 0;
this.SpdYUp = 1;
this.SpdYMax = 20;
this.SpdYFall = 0.1;
this.SpdXHitBase = 25;
this.SpdYHitBase = -6;
this.SpdStartJump = -16;
this.SolOut = 2;
this.SolHitMin = 5;
this.MaxSol = 3;
this.HitGrd = false;
this.SolForJump = 6;
this.DistYFall = 0;
this.DistYLand = 30;
this.CanHit = false;
this.CanBeHit = true;
this.FrWalkNow = 1;
this.InPause = false;
this.FrJump = 1;
this.FrFall = 14;
this.FrLand = 10;
this.FrGetHit = 10;
this.FrGetHitCount = 0;
this.FrBoomTir = 9;
this.FrFinBoom = 6;
this.FrDead = 140;
this.FrDeadCount = 0;
this.Perso = Perso;
this.updatePerso();
this.LgGetShootX = 20;
this.LgGetShootUp = 72;
this.LgGetShootUpBas = 44;
this.FrInvincibleCount = 0;
this.FrInvincible = 60;
this.Invincible = false;
this.frKick1 = 2;
this.frFinKick1 = 7;
this.frKick2 = 2;
this.frFinKick2 = 7;
this.frFinKick3 = 7;
this.HitPointX = 0;
this.HitPointY = 0;
this.KickInAir = 3;
this.frEasterEgg = 337;
}
function ModifSpeed(initSpeed, way, inAir, Dir) {
if (way == "acc") {
if (Dir == "D") {
if (inAir) {
initSpeed = initSpeed + 0.4;
} else {
initSpeed = initSpeed + 1.2;
}
if (initSpeed > 9) {
initSpeed = 9;
}
} else {
if (inAir) {
initSpeed = initSpeed - 0.4;
} else {
initSpeed = initSpeed - 1.2;
}
if (initSpeed < -9) {
initSpeed = -9;
}
}
} else if (way == "dec") {
if (initSpeed < 0) {
if (inAir) {
initSpeed = initSpeed + 0.4;
} else {
initSpeed = initSpeed + 1.2;
}
if (initSpeed > 0) {
initSpeed = 0;
}
} else {
if (inAir) {
initSpeed = initSpeed - 0.4;
} else {
initSpeed = initSpeed - 1.2;
}
if (initSpeed < 0) {
initSpeed = 0;
}
}
}
return(initSpeed);
}
function ObjPersBall(Nom, PosX, PosY, Dir, HitBullet, Speed, Tab, HitSound) {
this.Nom = Nom;
this.HitSound = HitSound;
this.Tab = Tab;
this.HurtMyself = false;
this.Dangerous = true;
this.Etat = "Move";
this.EtatOld = "Idle";
this.Dir = Dir;
this.OldDir = "D";
this.PosX = PosX;
this.PosY = PosY;
this.TrueX = PosX;
this.TrueY = PosY;
this.LgOutG = 500;
this.LgOutD = 750;
this.LgOutUp = 1000;
this.LgOutDw = 380;
this.passTime = 0;
this.Stopped = false;
this.CanBeKill = false;
if (Dir eq "D") {
this.SpdX = ForceX;
} else {
this.SpdX = -1 * ForceX;
}
this.Bouncing = Bouncing;
if (Bouncing == "vertic") {
this.Dangerous = false;
}
this.detectNow = false;
this.SpdY = ForceY;
this.InPause = false;
this.FrHit = HitBullet;
this.FrHide = 1;
}
function ObjBg(PosX, PosY) {
this.Nom = "Bg";
this.PosX = PosX;
this.PosY = PosY;
this.MoveX = 0;
this.MoveY = 0;
this.MaxDw = 0;
this.MaxUp = 0;
this.MaxG = 0;
this.MaxD = 0;
this.InvPosX = PosX * -1;
this.InvPosY = PosY * -1;
this.DeadX = PosX;
this.DeadY = PosY;
this.CurrentScreen = 1;
this.OldScreen = 0;
this.MaxYDie = 5000;
this.CenterX = 250;
this.CenterY = 185;
this.SpdXD = 15;
this.SpdXG = -15;
this.SpdYDw = 20;
this.SpdYUp = -20;
this.InPause = false;
}
function ObjShred(Nom, PosX, PosY, Dir, Perso) {
this.Nom = Nom;
this.PosX = PosX;
this.PosY = PosY;
this.TrueX = PosX;
this.TrueY = PosY;
this.Etat = "Sleep";
this.EtatOld = "Idle";
this.Dir = Dir;
this.OldDir = Dir;
this.BaseDir = Dir;
this.LgOutG = 200;
this.LgOutD = 800;
this.LgOutUp = 10;
this.LgOutDw = 475;
this.GetHitG = 50;
this.GetHitD = 50;
this.GetHitUp = 115;
this.GetHitDw = 0;
this.GetFireG = 26;
this.GetFireD = 26;
this.GetFireUp = 100;
this.GetFireDw = 0;
this.LgAttackX = 165;
this.LgAttackUp = 60;
this.LgAttackDw = 440;
this.LgCheckPersX = 200;
this.LgCheckFightX = 180;
this.LgHitX = 60;
this.LgHitUp = 35;
this.LgHitDw = 60;
this.LgFront = 35;
this.LgHitBox = 42;
this.LgCharge = 65;
this.LgBack = 35;
this.AssPointX = 12;
this.AssPointY = 35;
this.FrGetHit = 15;
this.FrGetHitCount = 0;
this.FrSeeingMaxTime = 35;
this.FrSeeingCount = 35;
this.FrIdleCheckMin = 36;
this.FrIdleCheckMax = 60;
this.FrIdleCheckLast = 35;
this.FrSurpris = 21;
this.FrLand = 8;
this.FrDie = 25;
this.FrIdle = 131;
this.FrReady = 20;
this.FrPopOut = 29;
this.FrAttack1 = 15;
this.FrAttack2 = 15;
this.FrAttack3 = 23;
this.FrAttack4 = 8;
this.FrFinAttack1 = 33;
this.FrFinAttack2 = 34;
this.FrFinAttack3 = 57;
this.FrFinAttack4 = 36;
this.FrMoonWalk = 30;
this.BombPlace = false;
this.frGetGlue = 21;
this.frIdleGlue = 131;
this.frDeGlue = 21;
this.frGetFart = 57;
this.frIdleFart = 131;
this.frDeFart = 59;
this.FartCycle = 0;
this.FartCycleMax = 4;
this.FrShoot = 12;
this.FrShootFin = 55;
this.ShootMax = 1;
this.ShootCount = 0;
this.FrStartPush = 4;
this.FrFinPush = 4;
this.PushedBox = 0;
this.FrSeparateWallCount = 0;
this.FrSeparateWallCheck = 15;
this.FrBetweenAttack = this.FrMoonWalk;
this.waitTimeMissile = 0;
this.Life = 3;
this.SpdXBase = 3;
this.SpdXWalkFight = 6;
this.SpdXCharge = 10;
this.SpdXGetHit = 12;
this.SpdYGetHit = -15;
this.SpdXStepBack = 15;
this.SpdYStepBack = -10;
this.WallSeparate = false;
this.SpdXFall = 0;
this.MoveX = 0;
this.MoveY = 0;
this.WallHitBloc = 2;
this.SolOut = 2;
this.SolHitMin = 3;
this.MaxSol = 2;
this.HitGrd = false;
this.SpdYMax = 20;
this.SpdYNow = 0;
this.SpdYUp = 2;
this.CanBeHit = true;
this.InPause = false;
this.Perso = Perso;
this.TooNearWall = false;
this.DistMinWall = 100;
}
function ObjDestruct(Nom, PosX, PosY, Kind, nbr) {
this.Nom = Nom;
if (nbr == undefined) {
nbr = random(3) + 1;
}
if (random(10) < 5) {
this.BombInside = true;
} else {
this.BombInside = false;
}
this.nbr = nbr;
this.PosX = PosX;
this.PosY = PosY;
this.Etat = "Sleep";
this.EtatOld = "Idle";
this.LgOutG = 200;
this.LgOutD = 800;
this.LgOutUp = 10;
this.LgOutDw = 475;
this.GetHitG = 50;
this.GetHitD = 50;
this.GetHitUp = 50;
this.GetHitDw = 50;
this.GetHitGTirroir = 40;
this.GetHitDTirroir = 40;
this.GetHitUpTirroir = 50;
this.GetHitDwTirroir = 100;
this.GetStepY = 12;
this.GetStepX = 60;
this.Stepped = 0;
this.FrDead = 21;
this.FrJump = 12;
this.Life = 1;
this.Kind = Kind;
}
function ObjLifeBonus(Nom, PosX, PosY, Value, imove) {
this.Nom = Nom;
this.imove = imove;
this.passTime = 0;
this.detectNow = false;
this.Stopped = false;
this.bondi = false;
ForceX = random(4) + 4;
ForceY = random(3) - 19;
if (random(100) < 50) {
this.SpdX = ForceX;
} else {
this.SpdX = -1 * ForceX;
}
this.SpdY = ForceY;
this.PosX = PosX;
this.PosY = PosY;
_parent[Nom]._x = PosX;
_parent[Nom]._y = PosY;
this.Etat = "Sleep";
this.EtatOld = "Idle";
this.LgOutG = 75;
this.LgOutD = 600;
this.LgOutUp = 300;
this.LgOutDw = 800;
this.LgHitX = 26;
this.LgHitUp = 45;
this.LgHitDw = 70;
this.InPause = false;
this.FrGetElse = 10;
this.FrGetScore = 35;
this.Value = Value;
this.Xdetect = 15;
}
_global.Game = this;
this.KeyListener = new Object();
this.KeyListener.Up = false;
this.KeyListener.UpRelease = true;
this.KeyListener.Dw = false;
this.KeyListener.L = false;
this.KeyListener.R = false;
this.KeyListener.S = false;
this.KeyListener.Z = false;
this.KeyListener.Sp = false;
this.KeyListener.P = false;
this.KeyListener.Sprelease = true;
this.KeyListener.Srelease = true;
this.KeyListener.onKeyUp = function () {
switch (Key.getCode()) {
case 38 :
this.UpRelease = true;
this.Up = false;
break;
case 40 :
this.Dw = false;
break;
case 37 :
this.L = false;
break;
case 39 :
this.R = false;
break;
case 32 :
this.Sprelease = true;
this.Sp = false;
break;
case 83 :
this.Srelease = true;
this.S = false;
}
};
this.KeyListener.onKeyDown = function () {
switch (Key.getCode()) {
case 38 :
this.Up = true;
break;
case 40 :
this.Dw = true;
break;
case 37 :
this.L = true;
break;
case 39 :
this.R = true;
break;
case 32 :
if (this.Sprelease) {
this.Sp = true;
this.Sprelease = false;
}
break;
case 83 :
if (!this.Srelease) {
break;
}
this.S = true;
this.Srelease = false;
}
};
Key.addListener(this.KeyListener);
Selection.setFocus(_parent._parent.FocusBtn);
G_CurrentFocus = Selection.getFocus();
G_CheckPause = function () {
if ((Pers.Etat != "Die") and (Pers.Etat != "Dead")) {
if (G_PauseOut && (!G_Pause)) {
G_Pause = true;
_parent.ControlBall.stop();
_parent._parent.Popup.gotoAndStop("Pause");
if (_global.C.SoundActive) {
_global.SoundCTRL.muteAllSounds();
}
_global.C.DesactivateHud();
} else if ((G_Resume == true) and (G_Pause == true)) {
G_PauseOut = false;
Selection.setFocus(_parent._parent.FocusBtn);
G_CurrentFocus = Selection.getFocus();
KeyListener.Up = false;
KeyListener.UpRelease = true;
KeyListener.Dw = false;
KeyListener.L = false;
KeyListener.R = false;
KeyListener.X = false;
KeyListener.Z = false;
KeyListener.Sp = false;
Music.VolDest = 70;
Music.Etat = "FadeIn";
G_Pause = false;
G_Resume = false;
_parent._parent.Popup.gotoAndStop(1);
if (_global.C.SoundActive) {
_global.SoundCTRL.unmuteAllSounds();
}
_global.C.ActivateHud();
if (_parent.ControlBall._currentframe != 1) {
_parent.ControlBall.play();
}
}
}
};
CreerPers = function (PosX, PosY, Perso) {
this.Pers = new ObjPers(PosX, PosY, Perso);
_parent._parent.Hud.LifeBar.gotoAndStop(Pers.Life + 1);
_parent._parent.Hud.LifeBar.gotoAndStop(Pers.Life + 1);
_parent._parent.Hud.BonusPoints.text = Pers.Point;
_parent._parent.Hud.BonusPointsShadow.text = Pers.Point;
};
ObjPers.prototype.Idle = function () {
with (this) {
KeepDeadPos = true;
if (Life > 0) {
SetSpdX();
SetMoveX();
CheckWall(FrontX, FrontY);
CheckHitGrd();
CheckPenche();
CheckSol();
CheckFall();
MovePers();
CheckJump();
this["CheckAction" + Perso]();
CheckGetFire();
CheckDie();
checkEaster();
} else {
SetSpdX();
SetMoveX();
CheckWall(FrontX, FrontY);
CheckHitGrd();
CheckSol();
CheckFall();
MovePers();
CheckDie();
}
}
};
ObjPers.prototype.EasterEgg = function () {
with (this) {
if (_parent.Pers.Obj.Etat._currentframe >= frEasterEgg) {
Etat = "Idle";
}
}
};
ObjPers.prototype.GetLifeBonus = function (AddPoints) {
with (this) {
newTotalPoint = Point + AddPoints;
Point = newTotalPoint;
_parent._parent.Hud.BonusPoints.text = Point;
_parent._parent.Hud.BonusPointsShadow.text = Point;
if (AddPoints == 0) {
trace("Life = " + Life);
Life = Life + 3;
if (Life > 10) {
Life = 10;
}
trace("Life = " + Life);
_parent._parent.Hud.LifeBar.gotoAndStop(Life + 1);
} else if (AddPoints == 500) {
_global.C.endLevel(Point, Life);
} else {
_global.C.gear++;
}
}
};
ObjPers.prototype.Walk = function () {
with (this) {
SetSpdX();
SetMoveX();
CheckWall(FrontX, FrontY);
CheckHitGrd();
CheckAttack();
if (Perso == "TuesdayDisguised") {
CheckActionTuesdayDisguised();
}
CheckPenche();
CheckJump();
CheckSol();
CheckFall();
MovePers();
CheckGetFire();
CheckDie();
}
};
ObjPers.prototype.Jump = function () {
with (this) {
SetSpdXJump();
SetMoveX();
CheckWall(FrontX, FrontY);
CheckWall(BottomFrontX, TrueY);
CheckWall(FrontX, TopY);
CheckHitGrd();
CheckSol();
CheckCeil();
CheckGetFire();
this["CheckAction" + Perso]();
MovePers();
if (_parent.Pers.Obj.Etat._currentframe >= FrJump) {
Etat = "FinJump";
}
}
};
ObjPers.prototype.FinJump = function () {
with (this) {
SetSpdXJump();
SetMoveX();
if (UseSuit == true) {
CheckTir();
}
CheckGetFire();
CheckWall(FrontX, FrontY);
CheckWall(BottomFrontX, TrueY);
CheckWall(FrontX, TopY);
CheckHitGrd();
CheckSol();
CheckCeil();
this["CheckAction" + Perso]();
MovePers();
if (HitGrd == true) {
Etat = "Land";
} else if (SpdYNow >= 0) {
Etat = "Fall";
DistYFall = 0;
}
}
};
ObjPers.prototype.Fall = function () {
with (this) {
SetSpdXJump();
SetMoveX();
CheckGetFire();
if (UseSuit == true) {
CheckTir();
}
this["CheckAction" + Perso]();
CheckWall(FrontX, FrontY);
CheckWall(BottomFrontX, TrueY);
CheckWall(FrontX, TopY);
CheckHitGrd();
CheckSol();
MovePers();
if ((_parent.Pers.Obj.Etat._currentframe >= FrFall) or (HitGrd == true)) {
SpdXNow = 0;
MoveX = 0;
if (HitGrd == true) {
if (DistYFall >= DistYLand) {
Etat = "Land";
} else {
Etat = "Idle";
}
} else {
Etat = "FinFall";
}
}
CheckHole();
}
};
ObjPers.prototype.FinFall = function () {
with (this) {
SetSpdXJump();
SetMoveX();
CheckGetFire();
CheckWall(FrontX, FrontY);
CheckWall(FrontX, TrueY);
CheckWall(FrontX, TopY);
CheckHitGrd();
CheckSol();
MovePers();
if (HitGrd == true) {
if (DistYFall >= DistYLand) {
Etat = "Land";
} else {
Etat = "Idle";
}
}
CheckHole();
}
};
ObjPers.prototype.Land = function () {
with (this) {
SetSpdX();
SetMoveX();
CheckGetFire();
CheckWall(FrontX, FrontY);
CheckHitGrd();
CheckSol();
CheckFall();
MovePers();
CheckJump();
this["CheckAction" + Perso]();
CheckDie();
if (_parent.Pers.Obj.Etat._currentframe >= FrLand) {
if (Life <= 0) {
Etat = "Die";
} else {
Etat = "Idle";
}
}
}
};
ObjPers.prototype.GetHit1 = function () {
with (this) {
if (FrGetHitCount >= FrGetHit) {
CheckHitGrd();
Etat = "Fall";
FrGetHitCount = 0;
InvincibleInit();
} else {
FrGetHitCount++;
}
GetHitGeneral();
}
};
ObjPers.prototype.GetHit2 = function () {
with (this) {
GetHitGeneral();
if (FrGetHitCount >= FrGetHit) {
CheckHitGrd();
Etat = "Fall";
FrGetHitCount = 0;
InvincibleInit();
} else {
FrGetHitCount++;
}
}
};
ObjPers.prototype.GetHitLand = function () {
with (this) {
GetHitGeneral();
if (FrGetHitCount == FrGetHit) {
_parent.Pers.Obj.Etat.play();
FrGetHitCount++;
} else if (FrGetHitCount > FrGetHit) {
if (_parent.Pers.Obj.Etat._currentframe >= FrGetHitLand) {
Etat = "PushVide";
FrGetHitCount = 0;
InvincibleInit();
}
} else {
FrGetHitCount++;
}
}
};
ObjPers.prototype.GetHitGeneral = function () {
with (this) {
SetSpdXHit();
CheckWall(BackX, TrueY);
CheckHitGrd();
CheckSol();
MovePers();
CheckDie();
}
};
ObjPers.prototype.GetHit = function () {
with (this) {
var RandomHit = 0;
Life = Life - 1;
_parent._parent.Hud.LifeBar.gotoAndStop(Life + 1);
CanHit = false;
SpdXNow = SpdXHitBase;
SpdYNow = SpdYHitBase;
RandomHit = Math.ceil(Math.random() * 2);
Etat = "GetHit" + RandomHit;
}
};
ObjPers.prototype.GetFire = function () {
with (this) {
var RandomHit = 0;
Life = Life - 1;
_parent._parent.Hud.LifeBar.gotoAndStop(Life + 1);
CanHit = false;
SpdXNow = SpdXHitBase;
SpdYNow = 0;
RandomHit = Math.ceil(Math.random() * 2);
Etat = "GetHit" + RandomHit;
}
};
ObjPers.prototype.CheckGetFire = function () {
with (this) {
var NbMinionBall = G_TabMinionBall.length;
if (NbMinionBall > 0) {
var i = 0;
while (i < NbMinionBall) {
var BallX = _parent.Control[G_TabMinionBall[i]].PosX;
var BallY = _parent.Control[G_TabMinionBall[i]].PosY;
if (((((BallX >= (PosX - GetFireG)) and (BallX <= (PosX + GetFireD))) and (BallY >= (PosY - GetFireUp))) and (BallY <= (PosY + GetFireDw))) && (!Invincible)) {
if (_parent.Control[G_TabMinionBall[i]].Dangerous == true) {
Etat = "GetFire";
if (_parent.Control[G_TabMinionBall[i]].Dir == "D") {
Dir = "G";
} else if (_parent.Control[G_TabMinionBall[i]].Dir == "G") {
Dir = "D";
}
_parent.Control[G_TabMinionBall[i]].Etat = "Hit";
}
}
i++;
}
}
}
};
ObjPers.prototype.InvincibleInit = function () {
with (this) {
Invincible = true;
}
};
ObjPers.prototype.InvincibleEnd = function () {
with (this) {
Invincible = false;
FrInvincibleCount = 0;
_parent.Pers._visible = true;
}
};
ObjPers.prototype.InvincibleCheck = function () {
with (this) {
if (Invincible) {
if (FrInvincibleCount >= FrInvincible) {
InvincibleEnd();
CanBeHit = true;
} else {
FrInvincibleCount++;
if ((FrInvincibleCount % 3) == 0) {
_parent.Pers._visible = !_parent.Pers._visible;
}
}
}
}
};
ObjPers.prototype.Die = function () {
with (this) {
CanBeHit = false;
FrDeadCount++;
if (FrDeadCount >= FrDead) {
FrDeadCount = 0;
_global.C.endGame("lose");
}
}
};
ObjPers.prototype.SetSpdXHit = function () {
with (this) {
MoveX = SpdXNow;
if (SpdXNow > 0) {
SpdXNow = SpdXNow * 0.7;
}
if (Dir eq "D") {
MoveX = MoveX * -1;
}
}
};
ObjPers.prototype.SetSpdX = function () {
with (this) {
if (KeyListener.R == true) {
Dir = "D";
if (_parent.Collider.Wall.hitTest(FrontX + WallHitBloc, TrueY, true)) {
Etat = "Idle";
SpdXBase = 0;
SpdXNow = 0;
} else {
Etat = "Walk";
SpdXBase = ModifSpeed(SpdXBase, "acc", false, Dir);
SpdXNow = SpdXBase;
}
} else if (KeyListener.L == true) {
Dir = "G";
if (_parent.Collider.Wall.hitTest(FrontX - WallHitBloc, TrueY, true)) {
Etat = "Idle";
SpdXBase = 0;
SpdXNow = 0;
} else {
Etat = "Walk";
SpdXBase = ModifSpeed(SpdXBase, "acc", false, Dir);
SpdXNow = SpdXBase;
}
} else {
if (Etat != "Land") {
Etat = "Idle";
}
SpdXBase = ModifSpeed(SpdXBase, "dec", false, Dir);
SpdXNow = SpdXBase;
}
if (Dir ne DirOld) {
SpdXBase = ModifSpeed(SpdXBase, "dec", false, Dir);
SpdXNow = SpdXBase;
}
}
};
ObjPers.prototype.SetSpdXJump = function () {
with (this) {
if (KeyListener.R == true) {
Dir = "D";
if (_parent.Collider.Wall.hitTest(TrueX + WallHitBloc, TrueY, true)) {
SpdXBase = 0;
SpdXNow = 0;
} else {
SpdXBase = ModifSpeed(SpdXBase, "acc", true, Dir);
SpdXNow = SpdXBase;
}
} else if (KeyListener.L == true) {
Dir = "G";
if (_parent.Collider.Wall.hitTest(TrueX - WallHitBloc, TrueY, true)) {
SpdXBase = 0;
SpdXNow = 0;
} else {
SpdXBase = ModifSpeed(SpdXBase, "acc", true, Dir);
SpdXNow = SpdXBase;
}
} else {
SpdXBase = ModifSpeed(SpdXBase, "dec", true, Dir);
SpdXNow = SpdXBase;
}
if (Dir ne DirOld) {
SpdXBase = ModifSpeed(SpdXBase, "dec", true, Dir);
SpdXNow = SpdXBase;
}
}
};
ObjPers.prototype.SetMoveX = function () {
with (this) {
MoveX = SpdXNow;
}
};
ObjPers.prototype.checkEaster = function () {
with (this) {
if (KeyListener.S == true) {
Etat = "EasterEgg";
}
}
};
ObjPers.prototype.CheckWall = function (CoordX, CoordY) {
with (this) {
if (MoveX != 0) {
if (MoveX > 0) {
var WallStop = WallHitBloc;
} else {
var WallStop = (-1 * WallHitBloc);
}
var WallHit1 = (MoveX / 3);
var WallHit2 = (WallHit1 * 2);
if (_parent.Collider.Wall.hitTest(CoordX + WallStop, CoordY, true)) {
SpdXBase = 0;
MoveX = 0;
} else if (_parent.Collider.Wall.hitTest(CoordX + WallHit1, CoordY, true)) {
SpdXBase = 0;
MoveX = WallHitBloc;
} else if (_parent.Collider.Wall.hitTest(CoordX + WallHit2, CoordY, true)) {
SpdXBase = 0;
MoveX = WallHit1;
} else if (_parent.Collider.Wall.hitTest(CoordX + MoveX, CoordY, true)) {
SpdXBase = 0;
MoveX = WallHit2;
}
}
}
};
ObjPers.prototype.CheckCeil = function () {
with (this) {
if (MoveY != 0) {
if (_parent.Collider.Ceil.hitTest(TopX, TopY + MoveY, true)) {
MoveY = 0;
SpdYNow = 0;
Etat = "Fall";
DistYFall = 0;
}
}
}
};
ObjPers.prototype.Kick1 = function () {
with (this) {
if (_parent.Pers.Obj.Etat._currentframe >= frKick1) {
CanHit = true;
HitPointX = _parent.Pers.Obj.HitPoint._x;
if (Dir == "G") {
HitPointX = PosX - HitPointX;
} else if (Dir == "D") {
HitPointX = PosX + HitPointX;
}
HitPointY = PosY + _parent.Pers.Obj.HitPoint._y;
Etat = "FinKick1";
CheckGetFire();
}
}
};
ObjPers.prototype.FinKick1 = function () {
with (this) {
if (_parent.Pers.Obj.Etat._currentframe >= frFinKick1) {
CanHit = false;
if (!HitGrd) {
Etat = "Fall";
} else {
Etat = "Idle";
}
CheckGetFire();
if (KeyListener.Sp) {
ComboKick++;
}
}
}
};
ObjPers.prototype.Kick2 = function () {
with (this) {
SetSpdXJump();
SetMoveX();
CheckGetFire();
CheckWall(FrontX, FrontY);
CheckWall(BottomFrontX, TrueY);
CheckWall(FrontX, TopY);
CheckHitGrd();
CheckSol();
MovePers();
if (_parent.Pers.Obj.Etat._currentframe >= frKick2) {
CanHit = true;
HitPointX = _parent.Pers.Obj.HitPoint._x;
if (Dir == "G") {
HitPointX = PosX - HitPointX;
} else if (Dir == "D") {
HitPointX = PosX + HitPointX;
}
HitPointY = PosY + _parent.Pers.Obj.HitPoint._y;
Etat = "FinKick2";
CheckGetFire();
}
}
};
ObjPers.prototype.FinKick2 = function () {
with (this) {
SetSpdXJump();
SetMoveX();
CheckGetFire();
CheckWall(FrontX, FrontY);
CheckWall(BottomFrontX, TrueY);
CheckWall(FrontX, TopY);
CheckHitGrd();
CheckSol();
MovePers();
if (_parent.Pers.Obj.Etat._currentframe >= frFinKick2) {
CanHit = false;
if (!HitGrd) {
Etat = "Fall";
} else {
Etat = "Idle";
}
CheckGetFire();
if (KeyListener.Sp) {
ComboKick++;
}
}
}
};
ObjPers.prototype.CheckJump = function () {
with (this) {
if (((KeyListener.Up == true) and (HitGrd == true)) and (KeyListener.UpRelease == true)) {
_global.Sounds.PlayASound("Jump", 1, 60);
KeyListener.UpRelease = false;
KeepDeadPos = false;
Etat = "Jump";
SpdYNow = SpdStartJump;
}
}
};
ObjPers.prototype.CheckActionWaffle = function () {
with (this) {
if (KeyListener.Sp == true) {
KeyListener.Sp = false;
if (KickTime < KickInAir) {
if (((Etat == "Jump") || (Etat == "FinJump")) || (Etat == "Fall")) {
KickTime++;
ComboKick = 0;
RandomKick = 2;
} else {
RandomKick = 1;
}
_global.Sounds.PlayASound("Kick", 1, 50);
Etat = "Kick" + RandomKick;
}
} else if (((((Etat != "Jump") && (Etat != "FinJump")) && (Etat != "Fall")) && (Etat != "Kick2")) && (Etat != "FinKick1")) {
KickTime = 0;
ComboKick = 0;
}
}
};
ObjPers.prototype.ResetMove = function () {
with (this) {
MoveX = 0;
MoveY = 0;
SpdXNow = 0;
SpdYNow = 0;
}
};
ObjPers.prototype.CheckFall = function () {
with (this) {
if (SpdYNow >= SpdYFall) {
KeepDeadPos = false;
Etat = "Fall";
DistYFall = 0;
}
}
};
ObjPers.prototype.CheckDie = function () {
with (this) {
if ((Life <= 0) and (HitGrd == true)) {
CanBeHit = false;
InvincibleEnd();
_global.C.DesactivateHud();
Etat = "Die";
}
}
};
ObjPers.prototype.MovePers = function () {
with (this) {
if ((Pers.TrueX + MoveX) < 0) {
MoveX = TrueX * -1;
} else if ((Pers.TrueX + MoveX) > 500) {
MoveX = 500 - Pers.TrueX;
}
PosX = _parent.Pers._x + MoveX;
_parent.Pers._x = PosX;
MoveX = 0;
PosY = _parent.Pers._y + MoveY;
_parent.Pers._y = PosY;
MoveY = 0;
}
};
ObjPers.prototype.SetTruePos = function () {
with (this) {
TrueX = PosX + _parent._x;
TrueY = PosY + _parent._y;
TopX = TrueX;
TopY = TrueY + _parent.Pers.Obj.HitTop._y;
FrontX = _parent.Pers.Obj.HitFront._x;
FrontY = TrueY + _parent.Pers.Obj.HitFront._y;
BottomFrontX = _parent.Pers.Obj.HitBottomFront._x;
BottomBackX = _parent.Pers.Obj.HitBottomBack._x;
BackX = _parent.Pers.Obj.HitBack._x;
if (Dir == "G") {
FrontX = TrueX - FrontX;
BottomFrontX = TrueX - BottomFrontX;
BottomBackX = TrueX - BottomBackX;
BackX = TrueX - BackX;
} else if (Dir == "D") {
FrontX = TrueX + FrontX;
BottomFrontX = TrueX + BottomFrontX;
BottomBackX = TrueX + BottomBackX;
BackX = TrueX + BackX;
}
}
};
ObjPers.prototype.CheckHitGrd = function (CheckX, CheckY) {
with (this) {
if ((CheckX == undefined) && (CheckY == undefined)) {
CheckX = TrueX;
CheckY = TrueY;
aCheckPoints = [CheckX, BottomFrontX, BottomBackX];
} else {
aCheckPoints = [CheckX];
}
for (var i in aCheckPoints) {
if (_parent.Collider.Sol.hitTest(aCheckPoints[i], CheckY + MaxSol, true) and (SpdYNow >= 0)) {
HitGrd = true;
HitGrdPoint = aCheckPoints[i];
break;
}
HitGrd = false;
HitGrdPoint = TrueX;
}
}
};
ObjPers.prototype.CheckSol = function (CheckX, CheckY) {
with (this) {
if ((CheckX == undefined) && (CheckY == undefined)) {
CheckX = HitGrdPoint;
CheckY = TrueY;
}
if (_parent.Collider.Sol.hitTest(CheckX, CheckY, true) and (SpdYNow >= 0)) {
SpdYNow = 0;
var InSol = true;
while (InSol == true) {
MoveY = MoveY - SolOut;
InSol = _parent.Collider.Sol.hitTest(CheckX, CheckY + MoveY, true);
}
} else if (SpdYNow >= 0) {
if (HitGrd == true) {
SpdYNow = 0;
MoveY = SpdYNow;
} else {
if ((KeyListener.Up == true) && (SpdYNow > 0)) {
var MoveUp = (Math.round((SpdYUp * 10) / 1200) / 10);
if (MoveUp < 0.1) {
MoveUp = 0.1;
}
SpdYNow = SpdYNow + MoveUp;
if (SpdYNow > (SpdYMax / 3)) {
SpdYNow = SpdYMax / 3;
}
} else {
SpdYNow = SpdYNow + SpdYUp;
if (SpdYNow > SpdYMax) {
SpdYNow = SpdYMax;
}
}
var SolHit1 = (SpdYNow / 3);
var SolHit2 = (SolHit1 * 2);
if (_parent.Collider.Sol.hitTest(CheckX, CheckY + SolHit1, true)) {
MoveY = SolHitMin;
} else if (_parent.Collider.Sol.hitTest(CheckX, CheckY + SolHit2, true)) {
MoveY = SolHit1;
} else if (_parent.Collider.Sol.hitTest(CheckX, CheckY + SpdYNow, true)) {
MoveY = SolHit2;
} else {
MoveY = SpdYNow;
}
}
} else {
SpdYNow = SpdYNow + SpdYUp;
MoveY = SpdYNow;
}
if (MoveY > 0) {
DistYFall = DistYFall + MoveY;
}
}
};
ObjPers.prototype.ChangeEtat = function (NewAction) {
with (this) {
if (((EtatOld eq "Walk") and (Etat eq "WalkTir")) or ((EtatOld eq "WalkTir") and (Etat eq "Walk"))) {
var SetFrWalk = true;
}
EtatOld = Etat;
Etat = NewAction;
_parent.Pers.Obj.gotoAndStop(NewAction);
if (SetFrWalk == true) {
if (FrWalkNow >= 20) {
FrWalkNow = 1;
}
_parent.Pers.Obj.Etat.gotoAndPlay(FrWalkNow);
}
}
};
ObjPers.prototype.updatePerso = function () {
with (this) {
_parent.Pers.gotoAndStop((Perso + "_") + Dir);
Etat = "Idle";
GetFireG = -1 * _parent.Pers.Obj.HitBack._x;
GetFireD = _parent.Pers.Obj.HitFront._x;
GetFireDw = 20;
GetFireUp = -1 * _parent.Pers.Obj.HitTop._y;
ComboKick = 0;
InvincibleEnd();
CanBeHit = true;
}
};
ObjPers.prototype.ChangeDir = function (NewDir) {
with (this) {
DirOld = Dir;
Dir = NewDir;
_parent.Pers.gotoAndStop((Perso + "_") + Dir);
}
};
ObjPers.prototype.Actions = function () {
with (this) {
if (G_Pause == true) {
if (InPause == false) {
InPause = true;
_parent.Pers.Obj.Etat.stop();
}
} else {
if (InPause == true) {
InPause = false;
_parent.Pers.Obj.Etat.play();
}
SetTruePos();
InvincibleCheck();
this[Etat]();
}
}
};
CreerPersBall = function () {
var _local3 = "Ball" + G_NextPersBall;
G_NextPersBall = G_NextPersBall + 1;
if (G_NextPersBall > 50) {
G_NextPersBall = 1;
}
if (this[_local3] == null) {
var _local7 = G_NextPersBallDepth;
G_NextPersBallDepth++;
duplicateMovieClip (_parent.Ball.PersBallClone, _local3, _local7);
var _local6 = Pers.Dir;
_parent.Ball[_local3].gotoAndStop(_local6);
var _local5 = Pers.PosX;
var _local4 = Pers.PosY + Pers.DistBallY;
_parent.Ball[_local3]._x = _local5;
_parent.Ball[_local3]._y = _local4;
this[_local3] = new ObjPersBall(_local3, _local5, _local4, _local6, 14, 20, G_TabPersBall, "SlimeSplat");
G_TabPersBall.push(_local3);
}
};
CreerMinionBall = function (PosX, PosY, Dir, PowerX, PowerY) {
MinShootX = 10;
MinShootY = 41;
if (PowerX == undefined) {
ForceX = random(4) + 15;
Bouncing = "horiz";
} else {
ForceX = PowerX;
Bouncing = "vertic";
}
if (PowerY == undefined) {
ForceY = random(3) - 7;
} else {
ForceY = PowerY;
}
if (Dir == "none") {
if (random(50) < 25) {
Dir = "D";
} else {
Dir = "G";
}
}
FrDetonate = 90;
var _local3 = "MinionBall" + G_NextMinionBall;
G_NextMinionBall = G_NextMinionBall + 1;
if (G_NextMinionBall > 50) {
G_NextMinionBall = 1;
}
if (this[_local3] == null) {
var _local5 = G_NextMinionBallDepth;
G_NextMinionBallDepth++;
duplicateMovieClip (_parent.Ball.MinionBallClone, _local3, _local5);
_parent.Ball[_local3].gotoAndStop(Dir);
if (Dir == "G") {
_parent.Ball[_local3]._x = PosX - MinShootX;
} else if (Dir == "D") {
_parent.Ball[_local3]._x = PosX + MinShootX;
}
_parent.Ball[_local3]._y = PosY - MinShootY;
this[_local3] = new ObjPersBall(_local3, _parent.Ball[_local3]._x, _parent.Ball[_local3]._y, Dir, 14, 10, G_TabMinionBall, "LaserSplat");
G_TabMinionBall.push(_local3);
}
};
ObjPersBall.prototype.Hide = function () {
with (this) {
_parent.Ball[Nom]._x = PosX + SpdX;
PosX = PosX + SpdX;
SetTruePos();
if (_parent.PersBall[Nom].Obj.Etat._currentframe >= FrHide) {
Etat = "Move";
}
CheckWall();
CheckOut();
}
};
ObjPersBall.prototype.Move = function () {
with (this) {
if (Bouncing == "horiz") {
_parent.Ball[Nom]._x = PosX + SpdX;
_parent.Ball[Nom]._y = PosY + SpdY;
PosX = PosX + SpdX;
PosY = PosY + SpdY;
passTime++;
CheckGround();
SetTruePos();
CheckWall();
CheckOut();
if (passTime == 2) {
passTime = 0;
if (SpdX > 0) {
SpdX--;
} else if (SpdX < 0) {
SpdX++;
} else if (Stopped == true) {
Dangerous = false;
Etat = "detonate";
}
}
} else if (Bouncing == "vertic") {
_parent.Ball[Nom]._x = PosX + SpdX;
_parent.Ball[Nom]._y = PosY + SpdY;
PosX = PosX + SpdX;
PosY = PosY + SpdY;
if (Stopped == false) {
SpdY++;
if (SpdY == 0) {
detectNow = true;
}
} else {
Etat = "detonate";
}
SetTruePos();
if (detectNow == true) {
CheckGround();
}
CheckWall();
CheckOut();
}
}
};
ObjPersBall.prototype.detonate = function () {
with (this) {
if (_parent.Ball[Nom].Obj.Etat._currentframe == FrDetonate) {
Etat = "explode";
}
checkIfKick();
CheckOut();
}
};
ObjPersBall.prototype.checkIfKick = function () {
with (this) {
if (Pers.CanHit == true) {
if (_parent.Ball[Nom].hitTest(_parent.Pers)) {
_global.Sounds.PlayASound("Ball", 1, 100);
Dir = Pers.Dir;
if (Dir eq "D") {
SpdX = random(6) + 18;
} else {
SpdX = -1 * (random(6) + 18);
}
SpdY = random(3) - 11;
Stopped = false;
Etat = "Move";
}
}
}
};
ObjPersBall.prototype.Hit = function () {
with (this) {
if (((_parent.Ball[Nom].Obj.Etat._currentframe == 1) && (TrueX > 0)) && (TrueX < 500)) {
} else if (_parent.Ball[Nom].Obj.Etat._currentframe >= FrHit) {
_parent.Ball[Nom].Obj.Etat = "Sleep";
_parent.Ball[Nom].Obj.gotoAndStop("Sleep");
KillBall();
}
}
};
ObjPersBall.prototype.explode = function () {
with (this) {
if (_parent.Ball[Nom].hitTest(_parent.Pers)) {
if (Pers.CanBeHit) {
Pers.Etat = "GetHit";
Pers.CanBeHit = false;
if (_parent.Ball[Nom]._x > _parent.Pers._x) {
Pers.Dir = "D";
} else {
Pers.Dir = "G";
}
}
}
if (_parent.Ball[Nom].Obj.Etat._currentframe >= FrHit) {
_parent.Ball[Nom].Obj.Etat = "Sleep";
_parent.Ball[Nom].Obj.gotoAndStop("Sleep");
KillBall();
}
}
};
ObjPersBall.prototype.KillBall = function () {
with (this) {
if (Tab == G_TabPersBall) {
G_TabPersBall.splice(PersBallI, 1);
PersBallI = PersBallI - 1;
} else if (Tab == G_TabMinionBall) {
G_TabMinionBall.splice(MinionBallI, 1);
MinionBallI = MinionBallI - 1;
}
delete _parent.Control[Nom];
}
};
ObjPersBall.prototype.SetTruePos = function () {
with (this) {
TrueX = PosX + _parent._x;
TrueY = (PosY + _parent._y) + 10;
}
};
ObjPersBall.prototype.Sleep = function () {
};
ObjPersBall.prototype.CheckWall = function () {
with (this) {
if (_parent.Collider.Wall.hitTest(TrueX, TrueY, true) and (!_parent.Collider.Wall.Pass.hitTest(TrueX, TrueY, true))) {
_global.Sounds.PlayASound("Ball", 1, 100);
if (Dir eq "D") {
Dir = "G";
} else {
Dir = "D";
}
Dangerous = true;
SpdX = SpdX * -1;
if (SpdX > 0) {
SpdX = SpdX + 2;
} else {
SpdX = SpdX + -2;
}
if (Math.abs(SpdX) < 5) {
if (SpdX < 5) {
SpdX = 5;
} else if (Spd > -5) {
SpdX = -5;
}
}
}
}
};
ObjPersBall.prototype.CheckGround = function () {
with (this) {
if (_parent.Collider.Sol.hitTest(TrueX, TrueY, true)) {
if (SpdY >= 0) {
if (SpdY >= 5) {
_global.Sounds.PlayASound("Ball", 1, 100);
}
var i = 0;
while (_parent.Collider.Sol.hitTest(TrueX, TrueY - (i + 1), true)) {
i++;
}
PosY = PosY + (i * -1);
_parent.Ball[Nom]._y = PosY;
HurtMyself = true;
if (SpdY > 2) {
Stopped = false;
SpdY = Math.round(SpdY * -0.5);
} else {
Stopped = true;
SpdY = 0;
}
} else {
Stopped = false;
SpdY++;
}
} else {
Stopped = false;
SpdY++;
}
}
};
ObjPersBall.prototype.CheckOut = function () {
with (this) {
if ((((PosX < (Bg.InvPosX - LgOutG)) or (PosX > (Bg.InvPosX + LgOutD))) or (PosY < (Bg.InvPosY - LgOutUp))) or (PosY > (Bg.InvPosY + LgOutDw))) {
_parent.Ball[Nom].Obj.Etat = "Sleep";
_parent.Ball[Nom].Obj.gotoAndStop("Sleep");
KillBall();
}
}
};
ObjPersBall.prototype.ChangeEtat = function (NewAction) {
with (this) {
EtatOld = Etat;
Etat = NewAction;
_parent.Ball[Nom].Obj.gotoAndStop(NewAction);
}
};
ObjPersBall.prototype.Actions = function () {
with (this) {
if (G_Pause == true) {
if (InPause == false) {
InPause = true;
_parent.Ball[Nom].Obj.Etat.stop();
}
} else {
if (InPause == true) {
InPause = false;
_parent.Ball[Nom].Obj.Etat.play();
}
this[Etat]();
}
}
};
CreerBg = function (PosX, PosY) {
this.Bg = new ObjBg(PosX, PosY);
};
ObjBg.prototype.Actions = function () {
with (this) {
if (G_Pause == true) {
if (InPause == false) {
InPause = true;
}
} else {
if (InPause == true) {
InPause = false;
}
ScrollBg();
}
}
};
ObjBg.prototype.ScrollBg = function () {
with (this) {
CheckScreen();
if ((PosY <= MaxDw) and (PosY >= MaxUp)) {
if (Pers.TrueX > (CenterX + 1)) {
if ((Pers.HitGrd == false) and (Pers.TrueY >= 300)) {
SpdXG = -30;
SpdXD = 30;
} else if (Pers.SpdXNow > 0) {
SpdXG = (Pers.SpdXNow * -1) - 5;
} else if (Pers.SpdXNow < 0) {
SpdXD = (Pers.SpdXNow * -1) + 5;
} else {
SpdXG = -8;
SpdXD = 8;
}
if (PosX < MaxG) {
if ((PosX + SpdXD) > MaxG) {
MoveX = MaxG - PosX;
} else {
MoveX = SpdXD;
}
} else {
if ((CenterX - Pers.TrueX) > SpdXG) {
MoveX = CenterX - Pers.TrueX;
} else {
MoveX = SpdXG;
}
if ((PosX + MoveX) < MaxG) {
MoveX = MaxG - PosX;
}
}
} else if (Pers.TrueX < (CenterX - 1)) {
if ((Pers.HitGrd == false) and (Pers.TrueY >= 300)) {
SpdXG = -30;
SpdXD = 30;
} else if (Pers.SpdXNow > 0) {
SpdXG = (Pers.SpdXNow * -1) - 5;
} else if (Pers.SpdXNow < 0) {
SpdXD = (Pers.SpdXNow * -1) + 5;
} else {
SpdXG = -8;
SpdXD = 8;
}
if (PosX > MaxD) {
if ((PosX + SpdXG) < MaxD) {
MoveX = MaxD - PosX;
} else {
MoveX = SpdXG;
}
} else {
if ((CenterX - Pers.TrueX) < SpdXD) {
MoveX = CenterX - Pers.TrueX;
} else {
MoveX = SpdXD;
}
if ((PosX + MoveX) > MaxD) {
MoveX = MaxD - PosX;
}
}
} else {
if ((Pers.HitGrd == false) and (Pers.TrueY >= 300)) {
SpdXG = -30;
SpdXD = 30;
} else if (Pers.SpdXNow > 0) {
SpdXG = (Pers.SpdXNow * -1) - 5;
} else if (Pers.SpdXNow < 0) {
SpdXD = (Pers.SpdXNow * -1) + 5;
} else {
SpdXG = -8;
SpdXD = 8;
}
if (PosX < MaxG) {
if ((PosX + SpdXD) > MaxG) {
MoveX = MaxG - PosX;
} else {
MoveX = SpdXD;
}
} else if (PosX > MaxD) {
if ((PosX + SpdXG) < MaxD) {
MoveX = MaxD - PosX;
} else {
MoveX = SpdXG;
}
}
}
}
if ((PosX <= MaxD) and (PosX >= MaxG)) {
if (Pers.TrueY > (CenterY + 1)) {
if (Pers.SpdYNow > 0) {
SpdYUp = (Pers.SpdYNow * -1) - 5;
} else if (Pers.SpdYNow < 0) {
SpdYDw = (Pers.SpdYNow * -1) + 5;
} else {
SpdYUp = -5;
SpdYDw = 5;
}
if (PosY < MaxUp) {
if ((PosY + SpdYDw) > MaxUp) {
MoveY = MaxUp - PosY;
} else {
MoveY = SpdYDw;
}
} else {
if ((CenterY - Pers.TrueY) > SpdYUp) {
MoveY = CenterY - Pers.TrueY;
} else {
MoveY = SpdYUp;
}
if ((PosY + MoveY) < MaxUp) {
MoveY = MaxUp - PosY;
}
}
} else if (Pers.TrueY < (CenterY - 1)) {
if (Pers.SpdYNow > 0) {
SpdYUp = (Pers.SpdYNow * -1) - 5;
} else if (Pers.SpdYNow < 0) {
SpdYDw = (Pers.SpdYNow * -1) + 5;
} else {
SpdYUp = -5;
SpdYDw = 5;
}
if (PosY > MaxDw) {
if ((PosY + SpdYUp) < MaxDw) {
MoveY = MaxDw - PosY;
} else {
MoveY = SpdYUp;
}
} else {
if ((CenterY - Pers.TrueY) < SpdYDw) {
MoveY = CenterY - Pers.TrueY;
} else {
MoveY = SpdYDw;
}
if ((PosY + MoveY) > MaxDw) {
MoveY = MaxDw - PosY;
}
}
} else {
if (Pers.SpdYNow > 0) {
SpdYUp = (Pers.SpdYNow * -1) - 5;
} else if (Pers.SpdYNow < 0) {
SpdYDw = (Pers.SpdYNow * -1) + 5;
} else {
SpdYUp = -5;
SpdYDw = 5;
}
if (PosY < MaxUp) {
if ((PosY + SpdYDw) > MaxUp) {
MoveY = MaxDw - PosY;
} else {
MoveY = SpdYDw;
}
} else if (PosY > MaxDw) {
if ((PosY + SpdYUp) < MaxDw) {
MoveY = MaxDw - PosY;
} else {
MoveY = SpdYUp;
}
}
}
}
_parent._x = Math.floor(_parent._x + MoveX);
PosX = _parent._x;
InvPosX = PosX * -1;
MoveX = 0;
_parent._y = Math.floor(_parent._y + MoveY);
PosY = _parent._y;
InvPosY = PosY * -1;
MoveY = 0;
}
};
CreerShred = function (Nom, PosX, PosY, Dir, Perso) {
if (this[Nom] == null) {
if ((Perso == undefined) || (!Perso)) {
Perso = "Gordon";
}
this[Nom] = new ObjShred(Nom, PosX, PosY, Dir, Perso);
G_TabShred.push(Nom);
}
};
ObjShred.prototype.Sleep = function () {
with (this) {
CheckActif();
}
};
ObjShred.prototype.Idle = function () {
with (this) {
MoveX = 0;
MoveY = 0;
CanBeHit = true;
FrBetweenAttack++;
FrSeparateWallCount++;
if (FrSeparateWallCount == FrSeparateWallCheck) {
FrSeparateWallCount = 0;
WallSeparate = false;
}
if (((Etat == "Idle") && ((_parent[Nom].Obj.Etat._currentframe >= FrIdleCheckMin) && (_parent[Nom].Obj.Etat._currentframe <= FrIdleCheckMax))) || (_parent[Nom].Obj.Etat._currentframe == FrIdleCheckLast)) {
if (Dir == "G") {
CheckPers("D");
} else if (Dir == "D") {
CheckPers("G");
}
} else {
CheckPers();
}
if ((Perso == "Gordon") || (Perso == "Blik")) {
CheckAttack();
if ((Etat == "Idle") && (_parent[Nom].Obj.Etat._currentframe == FrIdleCheckLast)) {
CheckDistWall();
if (TooNearWall) {
if (Dir == "G") {
Dir = "D";
} else if (Dir == "D") {
Dir = "G";
}
CheckDistWall();
if (!TooNearWall) {
Etat = "Walk";
}
} else {
Etat = "Walk";
}
}
} else {
CheckAttack();
}
CheckBoxOver();
CheckBoxSide();
CheckHeadAttack();
if (Perso != "Waffle") {
CheckGetHit();
}
CheckGetFire();
CheckGetFart();
CheckHitGrd();
if (Perso != "Blik") {
CheckSol();
}
CheckSleep();
}
};
ObjShred.prototype.Walk = function () {
with (this) {
CanBeHit = true;
CheckHeadAttack();
CheckTurn();
CheckWall();
CheckPers();
CheckHitGrd();
if (Perso != "Blik") {
CheckSol();
}
CheckAttack();
CheckBoxOver();
CheckBoxSide();
CheckGetHit();
CheckGetFire();
CheckGetFart();
SetMoveX();
MoveShred();
CheckSleep();
}
};
ObjShred.prototype.MoonWalk = function () {
with (this) {
CanBeHit = true;
FrBetweenAttack++;
CheckHeadAttack();
CheckTurn();
CheckWall();
if (FrBetweenAttack >= FrMoonWalk) {
CheckPers();
}
CheckHitGrd();
CheckAttack();
CheckBoxOver();
CheckBoxSide();
CheckGetHit();
CheckGetFire();
CheckGetFart();
InverseSetMoveX();
MoveShred();
CheckSleep();
}
};
ObjShred.prototype.WalkFight = function () {
with (this) {
CanBeHit = true;
CheckHeadAttack();
SetMoveXWalkFight();
CheckTurn();
CheckWall();
CheckHitGrd();
if (Perso != "Blik") {
CheckSol();
}
CheckAttack();
CheckBoxOver();
CheckBoxSide();
CheckGetFire();
CheckGetFart();
MoveShred();
CheckSleep();
CheckFight();
CheckGetHit();
}
};
ObjShred.prototype.Surpris = function () {
with (this) {
if (_parent[Nom].Obj.Etat._currentframe >= FrSurpris) {
MoveX = 0;
MoveY = 0;
if (Perso == "Gordon") {
if (((Pers.Etat == "Die") && (Pers.Obj.Etat._currentframe >= 40)) || (Pers.Etat == "Dead")) {
Etat = "Charge";
} else if ((Math.ceil(Math.random() * 3) == 1) || ((TrueX < 0) || (TrueX > 500))) {
Etat = "WalkFight";
} else {
Etat = "Charge";
}
} else if (Perso == "Blik") {
if (FrBetweenAttack >= FrMoonWalk) {
FrBetweenAttack = 0;
Etat = "Attack3";
ShootMax = Math.ceil((Math.random() * 3) + 1);
ShootCount = 1;
} else {
Etat = "MoonWalk";
}
}
}
CanBeHit = true;
CheckHeadAttack();
CheckBoxOver();
CheckBoxSide();
CheckGetHit();
CheckGetFire();
CheckGetFart();
}
};
ObjShred.prototype.Attack3 = function () {
with (this) {
if (_parent[Nom].Obj.Etat._currentframe == FrShoot) {
_global.Sounds.PlayASound("Crache", 1, 100);
_global.Game.CreerMinionBall(PosX, PosY, Dir);
} else if (_parent[Nom].Obj.Etat._currentframe >= FrShootFin) {
Etat = "Idle";
}
CanBeHit = true;
CheckHeadAttack();
CheckGetHit();
CheckGetFire();
CheckGetFart();
}
};
ObjShred.prototype.Ready = function () {
with (this) {
CanBeHit = true;
if (_parent[Nom].Obj.Etat._currentframe >= 5) {
CheckHeadAttack();
CheckGetHit();
}
CheckGetFire();
if (_parent[Nom].Obj.Etat._currentframe >= FrReady) {
Etat = "Attack4";
}
}
};
ObjShred.prototype.PopOut = function () {
with (this) {
CanBeHit = true;
CheckHeadAttack();
CheckGetHit();
CheckGetFire();
if (_parent[Nom].Obj.Etat._currentframe >= FrPopOut) {
Etat = "Idle";
}
}
};
ObjShred.prototype.Attack4 = function () {
with (this) {
if (_parent[Nom].Obj.Etat._currentframe == FrAttack4) {
_global.Sounds.PlayASound("Lazer", 1, 80);
}
if (_parent[Nom].Obj.Etat._currentframe >= FrAttack4) {
if (_parent[Nom].Obj.Etat.missile.hitTest(_parent.Pers) && (Pers.CanBeHit == true)) {
_global.Sounds.PlayASound("electroc", 1, 80);
if (Dir == "G") {
Pers.Dir = "D";
} else if (Dir == "D") {
Pers.Dir = "G";
}
Pers.Etat = "GetHit";
Pers.CanBeHit = false;
waitTimeMissile = 0;
_parent[Nom].Obj.Etat.spark._visible = true;
}
var BounceMiss = _parent[Nom].Obj.Etat.spark.getBounds(_parent._parent);
BounceMissX = (BounceMiss.xMax + BounceMiss.xMin) / 2;
BounceMissY = (BounceMiss.yMax + BounceMiss.yMin) / 2;
if (_parent.Collider.Wall.hitTest(BounceMissX, BounceMissY, true)) {
_parent[Nom].Obj.Etat.missile.gotoAndStop("explode");
_parent[Nom].Obj.Etat.stop();
waitTimeMissile = 0;
Etat = "FinAttack4";
}
if (_parent[Nom].Obj.Etat._currentframe >= FrFinAttack4) {
_parent[Nom].Obj.Etat.missile.gotoAndStop("explode");
_parent[Nom].Obj.Etat.stop();
waitTimeMissile = 0;
Etat = "FinAttack4";
}
}
CanBeHit = true;
CheckHeadAttack();
CheckGetHit();
CheckGetFire();
}
};
ObjShred.prototype.Charge = function () {
with (this) {
CanBeHit = true;
SetMoveXCharge();
CheckTurn();
CheckWall("Charge");
CheckHitGrd();
CheckSol();
CheckGetFire();
CheckGetFart();
MoveShred();
CheckSleep();
CheckBoxOver();
CheckBoxSide();
CheckTouchCharge();
CheckHeadAttack();
CheckGetHit();
}
};
ObjShred.prototype.Fight = function () {
with (this) {
Etat = "Attack1";
}
};
ObjShred.prototype.StartJump = function () {
with (this) {
CanBeHit = true;
Etat = "Jump";
SpdYNow = SpdYStepBack;
SpdXFall = SpdXStepBack;
}
};
ObjShred.prototype.Jump = function () {
with (this) {
CanBeHit = true;
CheckHeadAttack();
SetMoveXFall();
CheckWall("Back");
CheckHitGrd();
CheckSol();
CheckGetFire();
CheckGetFart();
MoveShred();
Etat = "Fall";
}
};
ObjShred.prototype.Land = function () {
with (this) {
if (_parent[Nom].Obj.Etat._currentframe >= FrLand) {
Etat = "Walk";
}
}
};
ObjShred.prototype.GetHit = function () {
with (this) {
if (Perso != "Waffle") {
SetMoveXFall();
CheckWall("Back");
CheckHitGrd();
CheckSol();
MoveShred();
}
CheckGetFire();
CheckGetFart();
FrGetHitCount++;
if (FrGetHitCount == 1) {
if (Perso != "Waffle") {
CreerLifeBonus("LifeBonus", PosX, PosY, 50);
} else if (Dir == "D") {
CreerLifeBonus("LifeBonus", PosX + 30, PosY, 50);
} else {
CreerLifeBonus("LifeBonus", PosX - 30, PosY, 50);
}
}
if (FrGetHitCount >= FrGetHit) {
CanBeHit = true;
if (HitGrd == true) {
if (Life > 0) {
if (Perso != "Waffle") {
FrGetHitCount = 0;
Etat = "Idle";
WallSeparate = false;
} else {
FrGetHitCount = 0;
Etat = "PopOut";
WallSeparate = false;
}
} else {
Etat = "Die";
}
} else {
Etat = "Fall";
}
}
}
};
ObjShred.prototype.Fall = function () {
with (this) {
CanBeHit = true;
SetMoveXFall();
CheckWall("Back");
CheckHitGrd();
CheckSol();
CheckGetFire();
CheckHeadAttack();
MoveShred();
if (HitGrd == true) {
if (Life > 0) {
Etat = "Sleep";
CanBeHit = true;
WallSeparate = false;
} else {
Etat = "Die";
}
}
}
};
ObjShred.prototype.CheckHeadAttack = function () {
with (this) {
if (_parent[Nom].Obj.headZone.hitTest(_parent.Pers.Obj.HitBottom)) {
if (random(100) < 50) {
Pers.SpdXBase = random(4) + 3;
} else {
Pers.SpdXBase = random(4) - 7;
}
Pers.SpdYNow = Pers.SpdStartJump / 1.5;
if (CanBeHit) {
_global.Sounds.PlayASound("rHead", 1, 50);
Life--;
CanBeHit = false;
Etat = "GetHit";
}
} else if ((_parent[Nom].Obj.KikZone.hitTest(_parent.Pers.Obj.HitTop) || (_parent[Nom].Obj.KikZone.hitTest(_parent.Pers.Obj.HitFront))) || (_parent[Nom].Obj.KikZone.hitTest(_parent.Pers.Obj.HitBack))) {
if (Pers.CanBeHit == true) {
_global.Sounds.PlayASound("rBump", 1, 80);
Pers.Etat = "GetHit";
Pers.CanBeHit = false;
}
}
}
};
ObjShred.prototype.Attack1 = function () {
with (this) {
if (_parent[Nom].Obj.Etat._currentframe >= FrAttack1) {
if (_parent[Nom].Obj.Etat.missile.hitTest(_parent.Pers) && (Pers.CanBeHit == true)) {
_parent[Nom].Obj.Etat.missile.gotoAndStop("explode");
_parent[Nom].Obj.Etat.stop();
if (Dir == "G") {
Pers.Dir = "D";
} else if (Dir == "D") {
Pers.Dir = "G";
}
Pers.Etat = "GetHit";
Pers.CanBeHit = false;
waitTimeMissile = 0;
Etat = "FinAttack1";
}
var BounceMiss = _parent[Nom].Obj.Etat.missile.getBounds(_parent._parent);
BounceMissX = (BounceMiss.xMax + BounceMiss.xMin) / 2;
BounceMissY = (BounceMiss.yMax + BounceMiss.yMin) / 2;
if (_parent.Collider.Wall.hitTest(BounceMissX, BounceMissY, true)) {
_parent[Nom].Obj.Etat.missile.gotoAndStop("explode");
_parent[Nom].Obj.Etat.stop();
waitTimeMissile = 0;
Etat = "FinAttack1";
}
if (_parent[Nom].Obj.Etat._currentframe >= FrFinAttack1) {
waitTimeMissile = 0;
_parent[Nom].Obj.Etat.missile.gotoAndStop("explode");
_parent[Nom].Obj.Etat.stop();
Etat = "FinAttack1";
}
}
CanBeHit = true;
CheckHeadAttack();
CheckGetHit();
CheckGetFire();
}
};
ObjShred.prototype.FinAttack1 = function () {
with (this) {
waitTimeMissile++;
if (waitTimeMissile >= 10) {
Etat = "Idle";
}
CanBeHit = true;
CheckHeadAttack();
CheckGetHit();
CheckGetFire();
}
};
ObjShred.prototype.FinAttack4 = function () {
with (this) {
waitTimeMissile++;
if (waitTimeMissile == 12) {
_parent[Nom].Obj.Etat.gotoAndPlay(37);
} else if (waitTimeMissile == 21) {
Etat = "PopOut";
}
CanBeHit = true;
CheckHeadAttack();
CheckGetHit();
CheckGetFire();
}
};
ObjShred.prototype.FinAttack3 = function () {
with (this) {
if (_parent[Nom].Obj.Etat._currentframe >= FrFinAttack3) {
Etat = "Idle";
}
CanBeHit = true;
CheckHeadAttack();
CheckGetHit();
CheckGetFire();
}
};
ObjShred.prototype.Die = function () {
with (this) {
Dir = "D";
if (_parent[Nom].Obj.Etat._currentframe == 1) {
_global.Sounds.PlayASound("Dead", 1, 80);
}
if (_parent[Nom].Obj.Etat._currentframe >= FrDie) {
Etat = "Dead";
}
}
};
ObjShred.prototype.Dead = function () {
with (this) {
G_TabShred.splice(ShredI, 1);
ShredI = ShredI - 1;
}
};
ObjShred.prototype.CheckPers = function (CheckDir) {
with (this) {
if (Pers.CanBeHit) {
if (CheckDir == undefined) {
CheckDir = Dir;
}
if ((Pers.PosY >= (PosY - LgAttackUp)) and (Pers.PosY <= (PosY + LgAttackDw))) {
if (((Pers.PosX >= (PosX - LgCheckPersX)) and (Pers.PosX <= PosX)) && (CheckDir == "G")) {
var CheckX = (TrueX - (PosX - Pers.PosX));
while ((CheckX < TrueX) && (!WallSeparate)) {
if (_parent.Collider.Wall.hitTest(CheckX, TrueY, true)) {
WallSeparate = true;
}
CheckX = CheckX + 10;
}
if (!WallSeparate) {
if ((Perso == "Gordon") || ((TrueX > 0) && (TrueX < 500))) {
Etat = "Surpris";
Dir = CheckDir;
}
}
} else if (((Pers.PosX <= (PosX + LgCheckPersX)) and (Pers.PosX >= PosX)) && (CheckDir == "D")) {
var CheckX = (TrueX + (Pers.PosX - PosX));
while ((CheckX > TrueX) && (!WallSeparate)) {
if (_parent.Collider.Wall.hitTest(CheckX, TrueY, true)) {
WallSeparate = true;
}
CheckX = CheckX - 10;
}
if (!WallSeparate) {
if ((Perso == "Gordon") || ((TrueX > 0) && (TrueX < 500))) {
Etat = "Surpris";
Dir = CheckDir;
}
}
}
}
}
}
};
ObjShred.prototype.CheckDistWall = function (CheckDir, CheckXPoint) {
with (this) {
if (CheckDir == undefined) {
CheckDir = Dir;
}
if (CheckXPoint == undefined) {
CheckXPoint = TrueX;
}
TooNearWall = false;
if (CheckDir == "G") {
var CheckX = (CheckXPoint - DistMinWall);
while ((CheckX < CheckXPoint) && (!TooNearWall)) {
if (_parent.Collider.Wall.hitTest(CheckX, TrueY - 5, true)) {
TooNearWall = true;
} else if (_parent.Collider.Turn.hitTest(CheckX, TrueY - 5, true)) {
TooNearWall = true;
}
CheckX = CheckX + 10;
}
} else if (CheckDir == "D") {
var CheckX = (TrueX + DistMinWall);
while ((CheckX > CheckXPoint) && (!TooNearWall)) {
if (_parent.Collider.Wall.hitTest(CheckX, TrueY - 5, true)) {
TooNearWall = true;
} else if (_parent.Collider.Turn.hitTest(CheckX, TrueY - 5, true)) {
TooNearWall = true;
}
CheckX = CheckX - 10;
}
}
}
};
ObjShred.prototype.CheckPersDist = function () {
with (this) {
if (Pers.CanBeHit == true) {
if ((Dir == "G") && (Pers.PosX > PosX)) {
if (Perso != "Waffle") {
Dir = "D";
}
} else if ((Dir == "D") && (Pers.PosX <= PosX)) {
if (Perso != "Waffle") {
Dir = "G";
}
}
if ((Pers.PosY >= (PosY - LgAttackUp)) and (Pers.PosY <= (PosY + LgAttackDw))) {
if ((Pers.PosX >= (PosX - LgCheckPersX)) and (Pers.PosX <= PosX)) {
if ((Pers.PosX >= (PosX - LgCheckFightX)) and (Pers.PosX <= PosX)) {
} else {
Etat = "WalkFight";
}
} else if ((Pers.PosX <= (PosX + LgCheckPersX)) and (Pers.PosX >= PosX)) {
if ((Pers.PosX <= (PosX + LgCheckFightX)) and (Pers.PosX >= PosX)) {
} else {
Etat = "WalkFight";
}
}
}
} else {
Etat = "WalkFight";
}
}
};
ObjShred.prototype.CheckFight = function () {
with (this) {
if (Pers.CanBeHit == true) {
if ((Pers.PosY >= (PosY - LgAttackUp)) and (Pers.PosY <= (PosY + LgAttackDw))) {
if (((Pers.PosX >= (PosX - LgCheckFightX)) and (Pers.PosX <= PosX)) && (Dir == "G")) {
FrSeeingCount = 0;
Etat = "Attack1";
} else if (((Pers.PosX <= (PosX + LgCheckFightX)) and (Pers.PosX >= PosX)) && (Dir == "D")) {
FrSeeingCount = 0;
Etat = "Attack1";
}
}
}
}
};
ObjShred.prototype.CheckJump = function () {
with (this) {
if (Pers.Perso == "MrsX") {
if (Math.ceil(Math.random() * 100) == 1) {
Etat = "StartJump";
}
}
}
};
ObjShred.prototype.CheckGetHit = function () {
with (this) {
if (Pers.CanHit == true) {
if (CanBeHit) {
if ((Pers.HitPointY >= (PosY - GetHitUp)) and (Pers.HitPointY <= (PosY + GetHitDw))) {
if (((Pers.HitPointX <= (PosX + GetHitD)) and (Pers.HitPointX >= (PosX - GetHitG))) and (Pers.Dir eq "D")) {
if (Perso != "Waffle") {
Dir = "G";
}
_global.Sounds.PlayASound("rHead", 1, 50);
Life--;
SpdYNow = SpdYGetHit;
SpdXFall = random(SpdXGetHit) + 5;
Etat = "GetHit";
CanBeHit = false;
} else if (((Pers.HitPointX >= (PosX - GetHitG)) and (Pers.HitPointX <= (PosX + GetHitD))) and (Pers.Dir eq "G")) {
if (Perso != "Waffle") {
Dir = "D";
}
_global.Sounds.PlayASound("rHead", 1, 50);
Life--;
SpdYNow = SpdYGetHit;
SpdXFall = random(SpdXGetHit) + 5;
Etat = "GetHit";
CanBeHit = false;
}
}
}
}
}
};
ObjShred.prototype.CheckGetFire = function () {
with (this) {
var NbMinionBall = G_TabMinionBall.length;
if (NbMinionBall > 0) {
var i = 0;
while (i < NbMinionBall) {
var BallX = _parent.Control[G_TabMinionBall[i]].PosX;
var BallY = _parent.Control[G_TabMinionBall[i]].PosY;
if (((((BallX >= (PosX - GetFireG)) and (BallX <= (PosX + GetFireD))) and (BallY >= (PosY - GetFireUp))) and (BallY <= (PosY + GetFireDw))) && (!Invincible)) {
if (_parent.Control[G_TabMinionBall[i]].HurtMyself == true) {
t = 1;
while (t < 6) {
if (Perso != "Waffle") {
CreerLifeBonus("LifeBonus", PosX, PosY, 50);
} else if (Dir == "D") {
CreerLifeBonus("LifeBonus", PosX + 30, PosY, 50);
} else {
CreerLifeBonus("LifeBonus", PosX - 30, PosY, 50);
}
t++;
}
Etat = "Die";
if (_parent.Control[G_TabMinionBall[i]].Dir == "D") {
Dir = "G";
} else if (_parent.Control[G_TabMinionBall[i]].Dir == "G") {
Dir = "D";
}
_parent.Control[G_TabMinionBall[i]].Etat = "Hit";
}
}
i++;
}
}
}
};
ObjShred.prototype.CheckAttack = function () {
with (this) {
if (Pers.CanBeHit == true) {
if ((Pers.PosY >= (PosY - LgAttackUp)) and (Pers.PosY <= (PosY + LgAttackDw))) {
if (Perso == "Gordon") {
if ((Pers.PosX >= (PosX - LgAttackX)) and (Pers.PosX <= (PosX + LgAttackX))) {
if ((Dir eq "G") and (Pers.PosX > PosX)) {
if (Perso != "Waffle") {
Dir = "D";
}
} else if ((Dir eq "D") and (Pers.PosX <= PosX)) {
if (Perso != "Waffle") {
Dir = "G";
}
}
Etat = "Attack1";
}
} else if (Perso == "Blik") {
if ((Pers.PosX >= (PosX - LgCheckPersX)) and (Pers.PosX <= (PosX + LgCheckPersX))) {
if ((Dir eq "G") and (Pers.PosX > PosX)) {
if (Perso != "Waffle") {
Dir = "D";
}
} else if ((Dir eq "D") and (Pers.PosX <= PosX)) {
if (Perso != "Waffle") {
Dir = "G";
}
}
if (FrBetweenAttack >= FrMoonWalk) {
FrBetweenAttack = 0;
Etat = "Attack3";
} else {
Etat = "MoonWalk";
}
}
} else if ((Dir eq "D") and (Pers.PosX > PosX)) {
if (Math.abs(Pers.PosX - PosX) < 250) {
Etat = "Ready";
}
} else if ((Dir eq "G") and (Pers.PosX < PosX)) {
if (Math.abs(Pers.PosX - PosX) < 250) {
Etat = "Ready";
}
}
}
}
}
};
ObjShred.prototype.CheckTouchCharge = function () {
with (this) {
var CheckX = Pers.FrontX;
if (((Dir == "G") && (Pers.Dir == "G")) || ((Dir == "D") && (Pers.Dir == "D"))) {
CheckX = Pers.BackX;
}
if (_parent[Nom].hitTest(CheckX, Pers.FrontY, true)) {
if (Pers.CanBeHit == true) {
_global.Sounds.PlayASound("rBump", 1, 80);
if (Dir == "G") {
Pers.Dir = "D";
} else if (Dir == "D") {
Pers.Dir = "G";
}
Pers.Etat = "GetHit";
Pers.CanBeHit = false;
Etat = "Idle";
}
}
}
};
ObjShred.prototype.SetMoveX = function () {
with (this) {
MoveX = SpdXBase;
if (Dir eq "G") {
MoveX = MoveX * -1;
}
}
};
ObjShred.prototype.InverseSetMoveX = function () {
with (this) {
MoveX = SpdXBase;
if (Dir eq "D") {
MoveX = MoveX * -1;
}
}
};
ObjShred.prototype.SetMoveXWalkFight = function () {
with (this) {
MoveX = SpdXWalkFight;
if (Dir eq "G") {
MoveX = MoveX * -1;
}
}
};
ObjShred.prototype.SetMoveXCharge = function () {
with (this) {
MoveX = SpdXCharge;
if (Dir eq "G") {
MoveX = MoveX * -1;
}
}
};
ObjShred.prototype.SetMoveXFall = function () {
with (this) {
MoveX = SpdXFall;
if (SpdXFall > 0) {
SpdXFall = SpdXFall * 0.9;
}
if (Dir eq "D") {
MoveX = MoveX * -1;
}
}
};
ObjShred.prototype.CheckWall = function (CheckDir) {
with (this) {
if (MoveX != 0) {
if (CheckDir == "Back") {
var AddPoint = LgBack;
} else if (CheckDir == "Charge") {
var AddPoint = LgCharge;
} else {
var AddPoint = LgFront;
}
if (MoveX > 0) {
var WallStop = WallHitBloc;
var CheckX = (TrueX + AddPoint);
} else {
var WallStop = (-1 * WallHitBloc);
var CheckX = (TrueX - AddPoint);
}
var WallHit1 = (MoveX / 3);
var WallHit2 = (WallHit1 * 2);
if (_parent.Collider.Wall.hitTest(CheckX + WallStop, TrueY, true)) {
if (Etat == "Charge") {
Etat = "StartJump";
} else if (((Etat == "GetHit") || (Etat == "StartJump")) || (Etat == "Fall")) {
MoveX = 0;
WallSeparate = false;
} else if (Etat == "MoonWalk") {
WallSeparate = false;
FrBetweenAttack = FrMoonWalk;
SetMoveX();
MoveShred();
Etat = "Walk";
} else {
MoveX = 0;
WallSeparate = false;
if (Dir eq "G") {
Dir = "D";
} else {
Dir = "G";
}
CheckDistWall();
if ((Math.ceil(Math.random() * 4) == 4) || (TooNearWall)) {
Etat = "Idle";
} else {
Etat = "Walk";
}
}
} else if (_parent.Collider.Wall.hitTest(CheckX + WallHit1, TrueY, true)) {
MoveX = WallHitBloc;
} else if (_parent.Collider.Wall.hitTest(CheckX + WallHit2, TrueY, true)) {
MoveX = WallHit1;
} else if (_parent.Collider.Wall.hitTest(CheckX + MoveX, TrueY, true)) {
MoveX = WallHit2;
}
}
}
};
ObjShred.prototype.CheckTurn = function () {
with (this) {
if (_parent.Collider.Turn.hitTest(TrueX + MoveX, TrueY, true) || (_parent.Collider.Wall.hitTest(TrueX + MoveX, TrueY, true))) {
if (Etat == "MoonWalk") {
FrBetweenAttack = FrMoonWalk;
SetMoveX();
MoveShred();
Etat = "Walk";
} else {
MoveX = 0;
if (Dir eq "G") {
Dir = "D";
} else {
Dir = "G";
}
CheckDistWall();
if ((Math.ceil(Math.random() * 4) == 4) || (TooNearWall)) {
Etat = "Idle";
} else {
Etat = "Walk";
}
}
}
}
};
ObjShred.prototype.CheckSol = function () {
with (this) {
if (_parent.Collider.Sol.hitTest(TrueX, TrueY, true) and (SpdYNow >= 0)) {
SpdYNow = 0;
var InSol = true;
while (InSol == true) {
MoveY = MoveY - SolOut;
InSol = _parent.Collider.Sol.hitTest(TrueX, TrueY + MoveY, true);
}
} else if (SpdYNow >= 0) {
if (HitGrd == true) {
SpdYNow = 0;
MoveY = SpdYNow;
} else {
SpdYNow = SpdYNow + SpdYUp;
if (SpdYNow > SpdYMax) {
SpdYNow = SpdYMax;
}
var SolHit1 = (SpdYNow / 3);
var SolHit2 = (SolHit1 * 2);
if (_parent.Collider.Sol.hitTest(TrueX, TrueY + SolHit1, true)) {
MoveY = SolHitMin;
} else if (_parent.Collider.Sol.hitTest(TrueX, TrueY + SolHit2, true)) {
MoveY = SolHit1;
} else if (_parent.Collider.Sol.hitTest(TrueX, TrueY + SpdYNow, true)) {
MoveY = SolHit2;
} else {
MoveY = SpdYNow;
}
}
} else {
SpdYNow = SpdYNow + SpdYUp;
MoveY = SpdYNow;
}
}
};
ObjShred.prototype.CheckHitGrd = function () {
with (this) {
if (_parent.Collider.Sol.hitTest(TrueX, TrueY + MaxSol, true)) {
HitGrd = true;
} else {
HitGrd = false;
}
}
};
ObjShred.prototype.SetTruePos = function () {
with (this) {
TrueX = PosX + _parent._x;
TrueY = PosY + _parent._y;
}
};
ObjShred.prototype.MoveShred = function () {
with (this) {
_parent[Nom]._x = _parent[Nom]._x + MoveX;
_parent[Nom]._y = _parent[Nom]._y + MoveY;
PosX = _parent[Nom]._x;
PosY = _parent[Nom]._y;
}
};
ObjShred.prototype.CheckActif = function () {
with (this) {
if (((((PosX >= (Bg.InvPosX - LgOutG)) and (PosX <= (Bg.InvPosX + LgOutD))) and (PosY >= (Bg.InvPosY - LgOutUp))) and (PosY <= (Bg.InvPosY + LgOutDw))) and (Etat eq "Sleep")) {
if (Life > 0) {
Etat = "Idle";
CanBeHit = true;
Dir = BaseDir;
} else {
Etat = "Dead";
}
}
}
};
ObjShred.prototype.CheckSleep = function () {
with (this) {
if ((((PosX < (Bg.InvPosX - LgOutG)) or (PosX > (Bg.InvPosX + LgOutD))) or (PosY < (Bg.InvPosY - LgOutUp))) or (PosY > (Bg.InvPosY + LgOutDw))) {
if (Pers.PosX < PosX) {
if (Perso != "Waffle") {
Dir = "G";
}
} else if (Perso != "Waffle") {
Dir = "D";
}
Etat = "Sleep";
}
}
};
ObjShred.prototype.KillShred = function () {
with (this) {
Etat = "Dead";
}
};
ObjShred.prototype.ChangeDir = function (NewDir) {
with (this) {
DirOld = Dir;
Dir = NewDir;
_parent[Nom].gotoAndStop(Perso + NewDir);
_parent[Nom].Obj.gotoAndStop(Etat);
}
};
ObjShred.prototype.ChangeEtat = function (NewAction) {
with (this) {
EtatOld = Etat;
Etat = NewAction;
_parent[Nom].Obj.gotoAndStop(NewAction);
}
};
ObjShred.prototype.Actions = function () {
with (this) {
if (G_Pause == true) {
if (InPause == false) {
InPause = true;
_parent[Nom].Obj.Etat.stop();
}
} else {
if (InPause == true) {
InPause = false;
_parent[Nom].Obj.Etat.play();
}
SetTruePos();
this[Etat]();
}
}
};
CreerDestructObject = function (Nom, PosX, PosY, Kind, nbr) {
if (this[Nom] == null) {
this[Nom] = new ObjDestruct(Nom, PosX, PosY, Kind, nbr);
G_TabDestruct.push(Nom);
}
};
ObjDestruct.prototype.Actions = function () {
with (this) {
if (G_Pause == true) {
if (InPause == false) {
InPause = true;
}
} else {
if (InPause == true) {
InPause = false;
}
this[Etat]();
}
}
};
ObjDestruct.prototype.Idle = function () {
with (this) {
CheckSleep();
CheckHit();
}
};
ObjDestruct.prototype.Normal = function () {
with (this) {
CheckSleep();
CheckWalkOn();
}
};
ObjDestruct.prototype.CheckHit = function () {
with (this) {
if (Pers.CanHit == true) {
if (Kind != "tirroir") {
if ((Pers.HitPointY >= (PosY - GetHitUp)) and (Pers.HitPointY <= (PosY + GetHitDw))) {
if ((Pers.HitPointX <= (PosX + GetHitD)) and (Pers.HitPointX >= (PosX - GetHitG))) {
_global.Sounds.PlayASound("Pot", 1, 80);
Pers.CanHit = false;
Life--;
Etat = "animplaying";
trace((("PosX = " + PosX) + " / ") + PosY);
i = 1;
while (i <= nbr) {
CreerLifeBonus("LifeBonus", PosX, PosY, 50);
i++;
}
if (BombInside) {
_global.Game.CreerMinionBall(PosX, PosY, "none", random(4) + 4, random(3) - 20);
}
}
}
} else if ((Pers.HitPointY >= (PosY - GetHitUpTirroir)) and (Pers.HitPointY <= (PosY + GetHitDwTirroir))) {
if ((Pers.HitPointX <= ((PosX + GetHitDTirroir) + (_parent[Nom]._width / 2))) and (Pers.HitPointX >= ((PosX - GetHitGTirroir) - (_parent[Nom]._width / 2)))) {
_global.Sounds.PlayASound("Tirroir", 1, 100);
Pers.CanHit = false;
Life--;
Etat = "animplaying";
trace((("PosX = " + PosX) + " / ") + PosY);
i = 1;
while (i <= nbr) {
CreerLifeBonus("LifeBonus", PosX, PosY, 50);
i++;
}
if (BombInside) {
_global.Game.CreerMinionBall(PosX, PosY, "none", random(4) + 4, random(3) - 20);
}
}
}
}
}
};
ObjDestruct.prototype.CheckWalkOn = function () {
with (this) {
if ((Pers.PosY >= (PosY - GetStepY)) and (Pers.PosY <= (PosY + GetStepY))) {
if ((Pers.PosX <= (PosX + GetStepX)) and (Pers.PosX >= (PosX - GetStepX))) {
_global.Sounds.PlayASound("Coussin", 1, 80);
Etat = "Jump";
Pers.SpdYNow = Pers.SpdStartJump;
if (Stepped < nbr) {
Stepped++;
if (Stepped <= nbr) {
CreerLifeBonus("LifeBonus", PosX, PosY, 50);
}
if (BombInside) {
BombInside = false;
_global.Game.CreerMinionBall(PosX, PosY, "none", random(4) + 4, random(3) - 10);
}
}
}
}
}
};
ObjDestruct.prototype.Jump = function () {
with (this) {
if (_parent[Nom]._currentframe == FrJump) {
Etat = "Normal";
}
}
};
ObjDestruct.prototype.animplaying = function () {
with (this) {
if (_parent[Nom]._currentframe == FrDead) {
Etat = "Dead";
}
}
};
ObjDestruct.prototype.Dead = function () {
};
ObjDestruct.prototype.ChangeEtat = function (NewAction) {
with (this) {
EtatOld = Etat;
Etat = NewAction;
_parent[Nom].gotoAndStop(NewAction);
}
};
ObjDestruct.prototype.Sleep = function () {
with (this) {
CheckActif();
}
};
ObjDestruct.prototype.CheckActif = function () {
with (this) {
if (((((PosX >= (Bg.InvPosX - LgOutG)) and (PosX <= (Bg.InvPosX + LgOutD))) and (PosY >= (Bg.InvPosY - LgOutUp))) and (PosY <= (Bg.InvPosY + LgOutDw))) and (Etat eq "Sleep")) {
if (Kind == "Coussin") {
Etat = "Normal";
} else if (Life > 0) {
Etat = "Idle";
} else {
Etat = "Dead";
}
}
}
};
ObjDestruct.prototype.CheckSleep = function () {
with (this) {
if ((((PosX < (Bg.InvPosX - LgOutG)) or (PosX > (Bg.InvPosX + LgOutD))) or (PosY < (Bg.InvPosY - LgOutUp))) or (PosY > (Bg.InvPosY + LgOutDw))) {
Etat = "Sleep";
}
}
};
CreerLifeBonus = function (Nom, PosX, PosY, Value, imove) {
if (Nom == "LifeBonus") {
var _local3 = 1;
while (this[Nom + _local3] != null) {
_local3++;
}
Nom = Nom + _local3;
_parent.attachMovie("minXBonus", Nom, _parent.getNextHighestDepth());
}
if (imove == undefined) {
imove = true;
}
if (this[Nom] == null) {
this[Nom] = new ObjLifeBonus(Nom, PosX, PosY, Value, imove);
G_TabLifeBonus.push(Nom);
}
};
ObjLifeBonus.prototype.Sleep = function () {
with (this) {
CheckActif();
}
};
ObjLifeBonus.prototype.Idle = function () {
with (this) {
CheckGet();
CheckSleep();
}
};
ObjLifeBonus.prototype.IdleClose = function () {
with (this) {
CheckSleep();
}
};
ObjLifeBonus.prototype.Move = function () {
with (this) {
_parent[Nom]._x = PosX + SpdX;
_parent[Nom]._y = PosY + SpdY;
PosX = PosX + SpdX;
PosY = PosY + SpdY;
if (Stopped == false) {
SpdY++;
if (SpdY == 0) {
detectNow = true;
}
} else {
Etat = "Idle";
}
SetTruePos();
if (detectNow == true) {
CheckGet();
CheckGround();
}
CheckWall();
CheckOut();
}
};
ObjLifeBonus.prototype.Get = function () {
with (this) {
if (Value == 50) {
FrGet = FrGetScore;
} else {
FrGet = FrGetElse;
}
if (_parent[Nom].Etat._currentframe >= FrGet) {
ChangeEtat("Kill");
Pers.GetLifeBonus(Value);
}
}
};
ObjLifeBonus.prototype.Kill = function () {
with (this) {
for (LifeBonusI in G_TabLifeBonus) {
var LifeBonusActif = G_TabLifeBonus[LifeBonusI];
_parent[Nom].removeMovieClip();
if (LifeBonusActif == Nom) {
delete G_TabLifeBonus[LifeBonusI];
}
}
delete this;
}
};
ObjLifeBonus.prototype.CheckGet = function () {
with (this) {
if ((((Pers.PosY >= (PosY - LgHitUp)) and (Pers.PosY <= (PosY + LgHitDw))) and (Pers.PosX >= (PosX - LgHitX))) and (Pers.PosX <= (PosX + LgHitX))) {
_global.Sounds.PlayASound("Objet", 1, 100);
Etat = "Get";
}
}
};
ObjLifeBonus.prototype.CheckActif = function () {
with (this) {
if ((((PosX >= (Bg.InvPosX - LgOutG)) and (PosX <= (Bg.InvPosX + LgOutD))) and (PosY >= (Bg.InvPosY - LgOutUp))) and (PosY <= (Bg.InvPosY + LgOutDw))) {
if (imove == false) {
if ((Value != 500) || (_global.Game.G_TabShred.length == 0)) {
Etat = "Idle";
} else {
Etat = "IdleClose";
if (_global.ShowLeft._currentframe == 1) {
_global.ShowLeft.gotoAndPlay("opening");
}
}
} else {
Etat = "Move";
}
}
}
};
ObjLifeBonus.prototype.CheckSleep = function () {
with (this) {
if ((((PosX < (Bg.InvPosX - LgOutG)) or (PosX > (Bg.InvPosX + LgOutD))) or (PosY < (Bg.InvPosY - LgOutUp))) or (PosY > (Bg.InvPosY + LgOutDw))) {
Etat = "Sleep";
}
}
};
ObjLifeBonus.prototype.ChangeEtat = function (NewAction) {
with (this) {
EtatOld = Etat;
Etat = NewAction;
_parent[Nom].gotoAndStop(NewAction);
}
};
ObjLifeBonus.prototype.Actions = function () {
with (this) {
if (G_Pause == true) {
if (InPause == false) {
InPause = true;
_parent[Nom].Etat.stop();
}
} else {
if (InPause == true) {
InPause = false;
_parent[Nom].Etat.play();
}
this[Etat]();
}
}
};
ObjLifeBonus.prototype.SetTruePos = function () {
with (this) {
if (SpdX > 0) {
TrueX = (PosX + _parent._x) + Xdetect;
} else {
TrueX = (PosX + _parent._x) - Xdetect;
}
TrueY = PosY + _parent._y;
}
};
ObjLifeBonus.prototype.CheckWall = function () {
with (this) {
if (_parent.Collider.Wall.hitTest(TrueX, TrueY, true) and (!_parent.Collider.Wall.Pass.hitTest(TrueX, TrueY, true))) {
_global.Sounds.PlayASound("Bump", 1, 60);
SpdX = SpdX * -1;
if (Math.abs(SpdX) < 5) {
if (SpdX < 5) {
SpdX = 5;
} else if (Spd > -5) {
SpdX = -5;
}
}
}
}
};
ObjLifeBonus.prototype.CheckGround = function () {
with (this) {
if (_parent.Collider.Sol.hitTest(TrueX, TrueY, true)) {
if (SpdY > 2) {
if (SpdY >= 5) {
_global.Sounds.PlayASound("Bump", 1, 60);
}
bondi = true;
SpdY = Math.round(SpdY * -0.5);
} else if ((SpdY < 2) && (SpdY > 0)) {
if (bondi == true) {
Stopped = true;
SpdY = 0;
} else {
SpdY = random(3) - 15;
}
}
}
}
};
this.G_Pause = true;
this.G_PauseOut = false;
this.G_PRealese = true;
this.G_Resume = false;
this.G_TabShred = new Array();
this.G_TabBox = new Array();
this.G_TabGun = new Array();
this.G_TabSwitch = new Array();
this.G_TabDoor = new Array();
this.G_TabHeroChanger = new Array();
this.G_TabElevator = new Array();
this.G_TabPersBall = new Array();
this.G_TabMinionBall = new Array();
this.G_TabLifeBonus = new Array();
this.G_TabCam = new Array();
this.G_TabLevier = new Array();
this.G_TabTV = new Array();
this.G_TabDestruct = new Array();
this.G_NextPersBall = 1;
this.G_NextPersBallDepth = 10;
this.G_NextMinionBall = 1;
this.G_NextMinionBallDepth = 20;
}
onClipEvent (enterFrame) {
ShredI = 0;
for (ShredI in G_TabShred) {
var ShredActif = G_TabShred[ShredI];
if (this[ShredActif].Dir != this[ShredActif].DirOld) {
this[ShredActif].ChangeDir(this[ShredActif].Dir);
}
if (this[ShredActif].Etat != this[ShredActif].EtatOld) {
this[ShredActif].ChangeEtat(this[ShredActif].Etat);
}
this[ShredActif].Actions();
}
MinionBallI = 0;
for (MinionBallI in G_TabMinionBall) {
var MinionBallActif = G_TabMinionBall[MinionBallI];
if (this[MinionBallActif].Etat != this[MinionBallActif].EtatOld) {
this[MinionBallActif].ChangeEtat(this[MinionBallActif].Etat);
}
this[MinionBallActif].Actions();
}
LifeBonusI = 0;
for (LifeBonusI in G_TabLifeBonus) {
var LifeBonusActif = G_TabLifeBonus[LifeBonusI];
if (this[LifeBonusActif].Etat != this[LifeBonusActif].EtatOld) {
this[LifeBonusActif].ChangeEtat(this[LifeBonusActif].Etat);
}
this[LifeBonusActif].Actions();
}
ObjDstr = 0;
for (ObjDstr in G_TabDestruct) {
var DstrActif = G_TabDestruct[ObjDstr];
if (this[DstrActif].Etat != this[DstrActif].EtatOld) {
this[DstrActif].ChangeEtat(this[DstrActif].Etat);
}
this[DstrActif].Actions();
}
if (Pers.Dir != Pers.DirOld) {
Pers.ChangeDir(Pers.Dir);
}
if (Pers.Etat != Pers.EtatOld) {
Pers.ChangeEtat(Pers.Etat);
}
this.Pers.Actions();
this.Bg.Actions();
if (G_Pause == false) {
G_CurrentFocus = Selection.getFocus();
if (G_CurrentFocus == null) {
G_PauseOut = true;
}
}
G_CheckPause();
}
Symbol 699 MovieClip Frame 2
stop();
Instance of Symbol 366 MovieClip in Symbol 699 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerBg(_parent._x, _parent._y);
BG = _parent.Control.Bg;
BG.MaxDw1 = -280;
BG.MaxUp1 = -380;
BG.MaxG1 = -11400;
BG.MaxD1 = -220;
BG.MaxDw2 = 13000;
BG.MaxUp2 = -125000;
BG.MaxG2 = -162000;
BG.MaxD2 = 112500 /* 0x01B774 */;
BG.CheckScreen = function () {
with (this) {
if (CurrentScreen == 1) {
if (_global.Game.Pers.PosX > 1300000) {
MaxDw = MaxDw2;
MaxUp = MaxUp2;
MaxG = MaxG2;
MaxD = MaxD2;
CurrentScreen = 2;
} else {
MaxDw = MaxDw1;
MaxUp = MaxUp1;
MaxG = MaxG1;
MaxD = MaxD1;
}
} else if (CurrentScreen == 2) {
if (((_global.Game.Pers.PosX < 1250) && (_global.Game.Pers.PosY < 1050)) && (_global.Game.Pers.PosY > 900)) {
MaxDw = MaxDw1;
MaxUp = MaxUp1;
MaxG = MaxG1;
MaxD = MaxD1;
CurrentScreen = 1;
} else {
MaxDw = MaxDw2;
MaxUp = MaxUp2;
MaxG = MaxG2;
MaxD = MaxD2;
}
}
}
};
}
Instance of Symbol 374 MovieClip [minXBonus] "LifeBonus7" in Symbol 699 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerLifeBonus(this._name, this._x, this._y, 50, false);
}
Instance of Symbol 374 MovieClip [minXBonus] "LifeBonus8" in Symbol 699 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerLifeBonus(this._name, this._x, this._y, 50, false);
}
Instance of Symbol 374 MovieClip [minXBonus] "LifeBonus9" in Symbol 699 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerLifeBonus(this._name, this._x, this._y, 50, false);
}
Instance of Symbol 374 MovieClip [minXBonus] "LifeBonus18" in Symbol 699 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerLifeBonus(this._name, this._x, this._y, 50, false);
}
Instance of Symbol 374 MovieClip [minXBonus] "LifeBonus19" in Symbol 699 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerLifeBonus(this._name, this._x, this._y, 50, false);
}
Instance of Symbol 374 MovieClip [minXBonus] "LifeBonus20" in Symbol 699 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerLifeBonus(this._name, this._x, this._y, 50, false);
}
Instance of Symbol 478 MovieClip "Minion13" in Symbol 699 MovieClip Frame 2
onClipEvent (load) {
var Dir = "D";
var Type = "Waffle";
_parent.Control.CreerShred(this._name, this._x, this._y, Dir, Type);
this.gotoAndStop(Dir);
this.Obj.gotoAndStop("Sleep");
}
Instance of Symbol 478 MovieClip "Minion14" in Symbol 699 MovieClip Frame 2
onClipEvent (load) {
var Dir = "G";
var Type = "Waffle";
_parent.Control.CreerShred(this._name, this._x, this._y, Dir, Type);
this.gotoAndStop(Dir);
this.Obj.gotoAndStop("Sleep");
}
Instance of Symbol 487 MovieClip "Collider" in Symbol 699 MovieClip Frame 2
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 478 MovieClip "Minion18" in Symbol 699 MovieClip Frame 2
onClipEvent (load) {
var Dir = "D";
var Type = "Waffle";
_parent.Control.CreerShred(this._name, this._x, this._y, Dir, Type);
this.gotoAndStop(Dir);
this.Obj.gotoAndStop("Sleep");
}
Instance of Symbol 522 MovieClip "destruct14" in Symbol 699 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerDestructObject(this._name, this._x, this._y, "tirroir", 2);
this.gotoAndStop("Sleep");
}
Instance of Symbol 522 MovieClip "destruct13" in Symbol 699 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerDestructObject(this._name, this._x, this._y, "tirroir");
this.gotoAndStop("Sleep");
}
Instance of Symbol 522 MovieClip "destruct12" in Symbol 699 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerDestructObject(this._name, this._x, this._y, "tirroir");
this.gotoAndStop("Sleep");
}
Instance of Symbol 528 MovieClip "destruct34" in Symbol 699 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerDestructObject(this._name, this._x, this._y, "pot");
this.gotoAndStop("Sleep");
}
Instance of Symbol 533 MovieClip "destruct1" in Symbol 699 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerDestructObject(this._name, this._x, this._y, "pot");
this.gotoAndStop("Sleep");
}
Instance of Symbol 528 MovieClip "destruct2" in Symbol 699 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerDestructObject(this._name, this._x, this._y, "pot", 2);
this.gotoAndStop("Sleep");
}
Instance of Symbol 537 MovieClip "destruct3" in Symbol 699 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerDestructObject(this._name, this._x, this._y, "tirroir", 2);
this.gotoAndStop("Sleep");
}
Instance of Symbol 541 MovieClip "destruct5" in Symbol 699 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerDestructObject(this._name, this._x, this._y, "tirroir");
this.gotoAndStop("Sleep");
}
Instance of Symbol 541 MovieClip "destruct4" in Symbol 699 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerDestructObject(this._name, this._x, this._y, "tirroir");
this.gotoAndStop("Sleep");
}
Instance of Symbol 549 MovieClip "LifeBonus101" in Symbol 699 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerLifeBonus(this._name, this._x, this._y, 0, false);
}
Instance of Symbol 533 MovieClip "destruct6" in Symbol 699 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerDestructObject(this._name, this._x, this._y, "pot");
this.gotoAndStop("Sleep");
}
Instance of Symbol 533 MovieClip "destruct8" in Symbol 699 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerDestructObject(this._name, this._x, this._y, "pot");
this.gotoAndStop("Sleep");
}
Instance of Symbol 528 MovieClip "destruct7" in Symbol 699 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerDestructObject(this._name, this._x, this._y, "pot");
this.gotoAndStop("Sleep");
}
Instance of Symbol 537 MovieClip "destruct9" in Symbol 699 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerDestructObject(this._name, this._x, this._y, "tirroir", 2);
this.gotoAndStop("Sleep");
}
Instance of Symbol 541 MovieClip "destruct10" in Symbol 699 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerDestructObject(this._name, this._x, this._y, "tirroir", 3);
this.gotoAndStop("Sleep");
}
Instance of Symbol 560 MovieClip "destruct21" in Symbol 699 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerDestructObject(this._name, this._x, this._y, "Coussin");
this.gotoAndStop("Sleep");
}
Instance of Symbol 560 MovieClip "destruct22" in Symbol 699 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerDestructObject(this._name, this._x, this._y, "Coussin");
this.gotoAndStop("Sleep");
}
Instance of Symbol 560 MovieClip "destruct23" in Symbol 699 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerDestructObject(this._name, this._x, this._y, "Coussin");
this.gotoAndStop("Sleep");
}
Instance of Symbol 528 MovieClip "destruct11" in Symbol 699 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerDestructObject(this._name, this._x, this._y, "pot");
this.gotoAndStop("Sleep");
}
Instance of Symbol 537 MovieClip "destruct15" in Symbol 699 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerDestructObject(this._name, this._x, this._y, "tirroir");
this.gotoAndStop("Sleep");
}
Instance of Symbol 541 MovieClip "destruct17" in Symbol 699 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerDestructObject(this._name, this._x, this._y, "tirroir");
this.gotoAndStop("Sleep");
}
Instance of Symbol 541 MovieClip "destruct16" in Symbol 699 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerDestructObject(this._name, this._x, this._y, "tirroir");
this.gotoAndStop("Sleep");
}
Instance of Symbol 541 MovieClip "destruct19" in Symbol 699 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerDestructObject(this._name, this._x, this._y, "tirroir");
this.gotoAndStop("Sleep");
}
Instance of Symbol 541 MovieClip "destruct18" in Symbol 699 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerDestructObject(this._name, this._x, this._y, "tirroir");
this.gotoAndStop("Sleep");
}
Instance of Symbol 541 MovieClip "destruct20" in Symbol 699 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerDestructObject(this._name, this._x, this._y, "tirroir");
this.gotoAndStop("Sleep");
}
Instance of Symbol 584 MovieClip "LifeBonus21" in Symbol 699 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerLifeBonus(this._name, this._x, this._y, 500, false);
}
Instance of Symbol 541 MovieClip "destruc32" in Symbol 699 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerDestructObject(this._name, this._x, this._y, "tirroir", 3);
this.gotoAndStop("Sleep");
}
Instance of Symbol 560 MovieClip "destruct33" in Symbol 699 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerDestructObject(this._name, this._x, this._y, "Coussin");
this.gotoAndStop("Sleep");
}
Instance of Symbol 560 MovieClip "destruct24" in Symbol 699 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerDestructObject(this._name, this._x, this._y, "Coussin");
this.gotoAndStop("Sleep");
}
Instance of Symbol 528 MovieClip "destruct25" in Symbol 699 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerDestructObject(this._name, this._x, this._y, "pot", 3);
this.gotoAndStop("Sleep");
}
Instance of Symbol 533 MovieClip "destruct27" in Symbol 699 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerDestructObject(this._name, this._x, this._y, "pot");
this.gotoAndStop("Sleep");
}
Instance of Symbol 528 MovieClip "destruct28" in Symbol 699 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerDestructObject(this._name, this._x, this._y, "pot");
this.gotoAndStop("Sleep");
}
Instance of Symbol 537 MovieClip "destruct26" in Symbol 699 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerDestructObject(this._name, this._x, this._y, "tirroir");
this.gotoAndStop("Sleep");
}
Instance of Symbol 478 MovieClip "Minion22" in Symbol 699 MovieClip Frame 2
onClipEvent (load) {
var Dir = "G";
var Type = "Waffle";
_parent.Control.CreerShred(this._name, this._x, this._y, Dir, Type);
this.gotoAndStop(Dir);
this.Obj.gotoAndStop("Sleep");
}
Instance of Symbol 522 MovieClip "destruct29" in Symbol 699 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerDestructObject(this._name, this._x, this._y, "tirroir");
this.gotoAndStop("Sleep");
}
Instance of Symbol 522 MovieClip "destruct30" in Symbol 699 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerDestructObject(this._name, this._x, this._y, "tirroir");
this.gotoAndStop("Sleep");
}
Instance of Symbol 522 MovieClip "destruct31" in Symbol 699 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerDestructObject(this._name, this._x, this._y, "tirroir");
this.gotoAndStop("Sleep");
}
Instance of Symbol 374 MovieClip [minXBonus] "LifeBonus1" in Symbol 699 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerLifeBonus(this._name, this._x, this._y, 50, false);
}
Instance of Symbol 374 MovieClip [minXBonus] "LifeBonus2" in Symbol 699 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerLifeBonus(this._name, this._x, this._y, 50, false);
}
Instance of Symbol 374 MovieClip [minXBonus] "LifeBonus3" in Symbol 699 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerLifeBonus(this._name, this._x, this._y, 50, false);
}
Instance of Symbol 478 MovieClip "Minion15" in Symbol 699 MovieClip Frame 2
onClipEvent (load) {
var Dir = "D";
var Type = "Gordon";
_parent.Control.CreerShred(this._name, this._x, this._y, Dir, Type);
this.gotoAndStop(Dir);
this.Obj.gotoAndStop("Sleep");
}
Instance of Symbol 374 MovieClip [minXBonus] "LifeBonus4" in Symbol 699 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerLifeBonus(this._name, this._x, this._y, 50, false);
}
Instance of Symbol 374 MovieClip [minXBonus] "LifeBonus5" in Symbol 699 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerLifeBonus(this._name, this._x, this._y, 50, false);
}
Instance of Symbol 374 MovieClip [minXBonus] "LifeBonus6" in Symbol 699 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerLifeBonus(this._name, this._x, this._y, 50, false);
}
Instance of Symbol 374 MovieClip [minXBonus] "LifeBonus10" in Symbol 699 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerLifeBonus(this._name, this._x, this._y, 50, false);
}
Instance of Symbol 374 MovieClip [minXBonus] "LifeBonus11" in Symbol 699 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerLifeBonus(this._name, this._x, this._y, 50, false);
}
Instance of Symbol 374 MovieClip [minXBonus] "LifeBonus12" in Symbol 699 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerLifeBonus(this._name, this._x, this._y, 50, false);
}
Instance of Symbol 374 MovieClip [minXBonus] "LifeBonus13" in Symbol 699 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerLifeBonus(this._name, this._x, this._y, 50, false);
}
Instance of Symbol 374 MovieClip [minXBonus] "LifeBonus14" in Symbol 699 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerLifeBonus(this._name, this._x, this._y, 50, false);
}
Instance of Symbol 374 MovieClip [minXBonus] "LifeBonus15" in Symbol 699 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerLifeBonus(this._name, this._x, this._y, 50, false);
}
Instance of Symbol 549 MovieClip "LifeBonus102" in Symbol 699 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerLifeBonus(this._name, this._x, this._y, 0, false);
}
Instance of Symbol 374 MovieClip [minXBonus] "LifeBonus16" in Symbol 699 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerLifeBonus(this._name, this._x, this._y, 50, false);
}
Instance of Symbol 374 MovieClip [minXBonus] "LifeBonus17" in Symbol 699 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerLifeBonus(this._name, this._x, this._y, 50, false);
}
Instance of Symbol 478 MovieClip "Minion16" in Symbol 699 MovieClip Frame 2
onClipEvent (load) {
var Dir = "G";
var Type = "Blik";
_parent.Control.CreerShred(this._name, this._x, this._y, Dir, Type);
this.gotoAndStop(Dir);
this.Obj.gotoAndStop("Sleep");
}
Instance of Symbol 478 MovieClip "Minion17" in Symbol 699 MovieClip Frame 2
onClipEvent (load) {
var Dir = "G";
var Type = "Gordon";
_parent.Control.CreerShred(this._name, this._x, this._y, Dir, Type);
this.gotoAndStop(Dir);
this.Obj.gotoAndStop("Sleep");
}
Instance of Symbol 478 MovieClip "Minion19" in Symbol 699 MovieClip Frame 2
onClipEvent (load) {
var Dir = "G";
var Type = "Gordon";
_parent.Control.CreerShred(this._name, this._x, this._y, Dir, Type);
this.gotoAndStop(Dir);
this.Obj.gotoAndStop("Sleep");
}
Instance of Symbol 478 MovieClip "Minion20" in Symbol 699 MovieClip Frame 2
onClipEvent (load) {
var Dir = "G";
var Type = "Gordon";
_parent.Control.CreerShred(this._name, this._x, this._y, Dir, Type);
this.gotoAndStop(Dir);
this.Obj.gotoAndStop("Sleep");
}
Instance of Symbol 478 MovieClip "Minion21" in Symbol 699 MovieClip Frame 2
onClipEvent (load) {
var Dir = "D";
var Type = "Blik";
_parent.Control.CreerShred(this._name, this._x, this._y, Dir, Type);
this.gotoAndStop(Dir);
this.Obj.gotoAndStop("Sleep");
}
Instance of Symbol 478 MovieClip "Minion11" in Symbol 699 MovieClip Frame 2
onClipEvent (load) {
var Dir = "G";
var Type = "Gordon";
_parent.Control.CreerShred(this._name, this._x, this._y, Dir, Type);
this.gotoAndStop(Dir);
this.Obj.gotoAndStop("Sleep");
}
Instance of Symbol 478 MovieClip "Minion12" in Symbol 699 MovieClip Frame 2
onClipEvent (load) {
var Dir = "G";
var Type = "Blik";
_parent.Control.CreerShred(this._name, this._x, this._y, Dir, Type);
this.gotoAndStop(Dir);
this.Obj.gotoAndStop("Sleep");
}
Instance of Symbol 674 MovieClip "Pers" in Symbol 699 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerPers(this._x, this._y, "Waffle");
this.gotoAndStop("D");
Etat = "Die";
}
Symbol 710 Button
on (release) {
if (_parent.Popup._currentframe == 1) {
_global.C.endGame("lose");
}
}
Symbol 714 Button
on (release) {
if (_parent.Popup._currentframe == 1) {
_global.C.showHelp(true);
}
}
Symbol 716 Button
on (release) {
_global.Sounds.ToMute();
gotoAndStop (2);
}
Symbol 719 Button
on (release) {
_global.Sounds.UnMute();
gotoAndStop (1);
}
Symbol 729 Button
on (release) {
if (_parent.Popup._currentframe == 1) {
_global.Game.G_Pause = true;
_global.Popup.gotoAndStop("Pause");
}
}
Instance of Symbol 720 MovieClip "MuteSymbol" in Symbol 730 MovieClip Frame 1
onClipEvent (load) {
if (_global.Muted) {
gotoAndStop (2);
} else {
stop();
}
}
Symbol 742 MovieClip Frame 1
stop();
Symbol 767 MovieClip Frame 10
stop();
Symbol 768 MovieClip Frame 1
stop();
Symbol 775 MovieClip Frame 1
stop();
Symbol 775 MovieClip Frame 2
play();
Symbol 775 MovieClip Frame 21
stop();
Symbol 775 MovieClip Frame 22
stop();
Instance of Symbol 322 MovieClip "Control" in Symbol 782 MovieClip Frame 1
onClipEvent (load) {
function ObjPers(PosX, PosY, Perso) {
this.Nom = "Pers";
this.Etat = "Idle";
this.EtatOld = "Idle";
this.Dir = "D";
this.DirOld = "D";
this.Point = _global.C.TotalScore;
this.Life = _global.C.Life;
this.SpdXMinion = 3;
this.SpdXNormal = 9;
this.SpdXBase = 0;
this.SpdXNow = 0;
this.MoveX = 0;
this.MoveY = 0;
this.PosX = PosX;
this.PosY = PosY;
this.TrueX = PosX;
this.TrueY = PosY;
this.FrontX = 0;
this.FrontY = 0;
this.BottomFrontX = 0;
this.BottomBackX = 0;
this.BackX = 0;
this.HitGrdPoint = 0;
this.WallHitBloc = 2;
this.SpdYNow = 0;
this.SpdYUp = 1;
this.SpdYMax = 20;
this.SpdYFall = 0.1;
this.SpdXHitBase = 25;
this.SpdYHitBase = -6;
this.SpdStartJump = -16;
this.SolOut = 2;
this.SolHitMin = 5;
this.MaxSol = 3;
this.HitGrd = false;
this.SolForJump = 6;
this.DistYFall = 0;
this.DistYLand = 30;
this.CanHit = false;
this.CanBeHit = true;
this.FrWalkNow = 1;
this.InPause = false;
this.FrJump = 1;
this.FrFall = 14;
this.FrLand = 10;
this.FrGetHit = 10;
this.FrGetHitCount = 0;
this.FrBoomTir = 9;
this.FrFinBoom = 6;
this.FrDead = 140;
this.FrDeadCount = 0;
this.Perso = Perso;
this.updatePerso();
this.LgGetShootX = 20;
this.LgGetShootUp = 72;
this.LgGetShootUpBas = 44;
this.FrInvincibleCount = 0;
this.FrInvincible = 60;
this.Invincible = false;
this.frKick1 = 2;
this.frFinKick1 = 7;
this.frKick2 = 2;
this.frFinKick2 = 7;
this.frFinKick3 = 7;
this.HitPointX = 0;
this.HitPointY = 0;
this.KickInAir = 3;
this.frEasterEgg = 337;
}
function ModifSpeed(initSpeed, way, inAir, Dir) {
if (way == "acc") {
if (Dir == "D") {
if (inAir) {
initSpeed = initSpeed + 0.4;
} else {
initSpeed = initSpeed + 1.2;
}
if (initSpeed > 9) {
initSpeed = 9;
}
} else {
if (inAir) {
initSpeed = initSpeed - 0.4;
} else {
initSpeed = initSpeed - 1.2;
}
if (initSpeed < -9) {
initSpeed = -9;
}
}
} else if (way == "dec") {
if (initSpeed < 0) {
if (inAir) {
initSpeed = initSpeed + 0.4;
} else {
initSpeed = initSpeed + 1.2;
}
if (initSpeed > 0) {
initSpeed = 0;
}
} else {
if (inAir) {
initSpeed = initSpeed - 0.4;
} else {
initSpeed = initSpeed - 1.2;
}
if (initSpeed < 0) {
initSpeed = 0;
}
}
}
return(initSpeed);
}
function ObjPersBall(Nom, PosX, PosY, Dir, HitBullet, Speed, Tab, HitSound) {
this.Nom = Nom;
this.HitSound = HitSound;
this.Tab = Tab;
this.HurtMyself = false;
this.Dangerous = true;
this.Etat = "Move";
this.EtatOld = "Idle";
this.Dir = Dir;
this.OldDir = "D";
this.PosX = PosX;
this.PosY = PosY;
this.TrueX = PosX;
this.TrueY = PosY;
this.LgOutG = 500;
this.LgOutD = 750;
this.LgOutUp = 1000;
this.LgOutDw = 380;
this.passTime = 0;
this.Stopped = false;
this.CanBeKill = false;
if (Dir eq "D") {
this.SpdX = ForceX;
} else {
this.SpdX = -1 * ForceX;
}
this.Bouncing = Bouncing;
if (Bouncing == "vertic") {
this.Dangerous = false;
}
this.detectNow = false;
this.SpdY = ForceY;
this.InPause = false;
this.FrHit = HitBullet;
this.FrHide = 1;
}
function ObjBg(PosX, PosY) {
this.Nom = "Bg";
this.PosX = PosX;
this.PosY = PosY;
this.MoveX = 0;
this.MoveY = 0;
this.MaxDw = 0;
this.MaxUp = 0;
this.MaxG = 0;
this.MaxD = 0;
this.InvPosX = PosX * -1;
this.InvPosY = PosY * -1;
this.DeadX = PosX;
this.DeadY = PosY;
this.CurrentScreen = 1;
this.OldScreen = 0;
this.MaxYDie = 5000;
this.CenterX = 250;
this.CenterY = 185;
this.SpdXD = 15;
this.SpdXG = -15;
this.SpdYDw = 20;
this.SpdYUp = -20;
this.InPause = false;
}
function ObjShred(Nom, PosX, PosY, Dir, Perso) {
this.Nom = Nom;
this.PosX = PosX;
this.PosY = PosY;
this.TrueX = PosX;
this.TrueY = PosY;
this.Etat = "Sleep";
this.EtatOld = "Idle";
this.Dir = Dir;
this.OldDir = Dir;
this.BaseDir = Dir;
this.LgOutG = 200;
this.LgOutD = 800;
this.LgOutUp = 10;
this.LgOutDw = 475;
this.GetHitG = 50;
this.GetHitD = 50;
this.GetHitUp = 115;
this.GetHitDw = 0;
this.GetFireG = 26;
this.GetFireD = 26;
this.GetFireUp = 100;
this.GetFireDw = 0;
this.LgAttackX = 165;
this.LgAttackUp = 60;
this.LgAttackDw = 440;
this.LgCheckPersX = 200;
this.LgCheckFightX = 180;
this.LgHitX = 60;
this.LgHitUp = 35;
this.LgHitDw = 60;
this.LgFront = 35;
this.LgHitBox = 42;
this.LgCharge = 65;
this.LgBack = 35;
this.AssPointX = 12;
this.AssPointY = 35;
this.FrGetHit = 15;
this.FrGetHitCount = 0;
this.FrSeeingMaxTime = 35;
this.FrSeeingCount = 35;
this.FrIdleCheckMin = 36;
this.FrIdleCheckMax = 60;
this.FrIdleCheckLast = 35;
this.FrSurpris = 21;
this.FrLand = 8;
this.FrDie = 25;
this.FrIdle = 131;
this.FrReady = 20;
this.FrPopOut = 29;
this.FrAttack1 = 15;
this.FrAttack2 = 15;
this.FrAttack3 = 23;
this.FrAttack4 = 8;
this.FrFinAttack1 = 33;
this.FrFinAttack2 = 34;
this.FrFinAttack3 = 57;
this.FrFinAttack4 = 36;
this.FrMoonWalk = 30;
this.BombPlace = false;
this.frGetGlue = 21;
this.frIdleGlue = 131;
this.frDeGlue = 21;
this.frGetFart = 57;
this.frIdleFart = 131;
this.frDeFart = 59;
this.FartCycle = 0;
this.FartCycleMax = 4;
this.FrShoot = 12;
this.FrShootFin = 55;
this.ShootMax = 1;
this.ShootCount = 0;
this.FrStartPush = 4;
this.FrFinPush = 4;
this.PushedBox = 0;
this.FrSeparateWallCount = 0;
this.FrSeparateWallCheck = 15;
this.FrBetweenAttack = this.FrMoonWalk;
this.waitTimeMissile = 0;
this.Life = 3;
this.SpdXBase = 3;
this.SpdXWalkFight = 6;
this.SpdXCharge = 10;
this.SpdXGetHit = 12;
this.SpdYGetHit = -15;
this.SpdXStepBack = 15;
this.SpdYStepBack = -10;
this.WallSeparate = false;
this.SpdXFall = 0;
this.MoveX = 0;
this.MoveY = 0;
this.WallHitBloc = 2;
this.SolOut = 2;
this.SolHitMin = 3;
this.MaxSol = 2;
this.HitGrd = false;
this.SpdYMax = 20;
this.SpdYNow = 0;
this.SpdYUp = 2;
this.CanBeHit = true;
this.InPause = false;
this.Perso = Perso;
this.TooNearWall = false;
this.DistMinWall = 100;
}
function ObjDestruct(Nom, PosX, PosY, Kind, nbr) {
this.Nom = Nom;
if (nbr == undefined) {
nbr = random(3) + 1;
}
if (random(10) < 5) {
this.BombInside = true;
} else {
this.BombInside = false;
}
this.nbr = nbr;
this.PosX = PosX;
this.PosY = PosY;
this.Etat = "Sleep";
this.EtatOld = "Idle";
this.LgOutG = 200;
this.LgOutD = 800;
this.LgOutUp = 10;
this.LgOutDw = 475;
this.GetHitG = 50;
this.GetHitD = 50;
this.GetHitUp = 50;
this.GetHitDw = 50;
this.GetHitGTirroir = 40;
this.GetHitDTirroir = 40;
this.GetHitUpTirroir = 50;
this.GetHitDwTirroir = 100;
this.GetStepY = 12;
this.GetStepX = 60;
this.Stepped = 0;
this.FrDead = 21;
this.FrJump = 12;
this.Life = 1;
this.Kind = Kind;
}
function ObjLifeBonus(Nom, PosX, PosY, Value, imove) {
this.Nom = Nom;
this.imove = imove;
this.passTime = 0;
this.detectNow = false;
this.Stopped = false;
this.bondi = false;
ForceX = random(4) + 4;
ForceY = random(3) - 19;
if (random(100) < 50) {
this.SpdX = ForceX;
} else {
this.SpdX = -1 * ForceX;
}
this.SpdY = ForceY;
this.PosX = PosX;
this.PosY = PosY;
_parent[Nom]._x = PosX;
_parent[Nom]._y = PosY;
this.Etat = "Sleep";
this.EtatOld = "Idle";
this.LgOutG = 75;
this.LgOutD = 600;
this.LgOutUp = 300;
this.LgOutDw = 800;
this.LgHitX = 26;
this.LgHitUp = 45;
this.LgHitDw = 70;
this.InPause = false;
this.FrGetElse = 10;
this.FrGetScore = 35;
this.Value = Value;
this.Xdetect = 15;
}
_global.Game = this;
this.KeyListener = new Object();
this.KeyListener.Up = false;
this.KeyListener.UpRelease = true;
this.KeyListener.Dw = false;
this.KeyListener.L = false;
this.KeyListener.R = false;
this.KeyListener.S = false;
this.KeyListener.Z = false;
this.KeyListener.Sp = false;
this.KeyListener.P = false;
this.KeyListener.Sprelease = true;
this.KeyListener.Srelease = true;
this.KeyListener.onKeyUp = function () {
switch (Key.getCode()) {
case 38 :
this.UpRelease = true;
this.Up = false;
break;
case 40 :
this.Dw = false;
break;
case 37 :
this.L = false;
break;
case 39 :
this.R = false;
break;
case 32 :
this.Sprelease = true;
this.Sp = false;
break;
case 83 :
this.Srelease = true;
this.S = false;
}
};
this.KeyListener.onKeyDown = function () {
switch (Key.getCode()) {
case 38 :
this.Up = true;
break;
case 40 :
this.Dw = true;
break;
case 37 :
this.L = true;
break;
case 39 :
this.R = true;
break;
case 32 :
if (this.Sprelease) {
this.Sp = true;
this.Sprelease = false;
}
break;
case 83 :
if (!this.Srelease) {
break;
}
this.S = true;
this.Srelease = false;
}
};
Key.addListener(this.KeyListener);
Selection.setFocus(_parent._parent.FocusBtn);
G_CurrentFocus = Selection.getFocus();
G_CheckPause = function () {
if ((Pers.Etat != "Die") and (Pers.Etat != "Dead")) {
if (G_PauseOut && (!G_Pause)) {
G_Pause = true;
_parent.ControlBall.stop();
_parent._parent.Popup.gotoAndStop("Pause");
if (_global.C.SoundActive) {
_global.SoundCTRL.muteAllSounds();
}
_global.C.DesactivateHud();
} else if ((G_Resume == true) and (G_Pause == true)) {
G_PauseOut = false;
Selection.setFocus(_parent._parent.FocusBtn);
G_CurrentFocus = Selection.getFocus();
KeyListener.Up = false;
KeyListener.UpRelease = true;
KeyListener.Dw = false;
KeyListener.L = false;
KeyListener.R = false;
KeyListener.X = false;
KeyListener.Z = false;
KeyListener.Sp = false;
Music.VolDest = 70;
Music.Etat = "FadeIn";
G_Pause = false;
G_Resume = false;
_parent._parent.Popup.gotoAndStop(1);
if (_global.C.SoundActive) {
_global.SoundCTRL.unmuteAllSounds();
}
_global.C.ActivateHud();
if (_parent.ControlBall._currentframe != 1) {
_parent.ControlBall.play();
}
}
}
};
CreerPers = function (PosX, PosY, Perso) {
this.Pers = new ObjPers(PosX, PosY, Perso);
_parent._parent.Hud.LifeBar.gotoAndStop(Pers.Life + 1);
_parent._parent.Hud.LifeBar.gotoAndStop(Pers.Life + 1);
_parent._parent.Hud.BonusPoints.text = Pers.Point;
_parent._parent.Hud.BonusPointsShadow.text = Pers.Point;
};
ObjPers.prototype.Idle = function () {
with (this) {
KeepDeadPos = true;
if (Life > 0) {
SetSpdX();
SetMoveX();
CheckWall(FrontX, FrontY);
CheckHitGrd();
CheckPenche();
CheckSol();
CheckFall();
MovePers();
CheckJump();
this["CheckAction" + Perso]();
CheckGetFire();
CheckDie();
checkEaster();
} else {
SetSpdX();
SetMoveX();
CheckWall(FrontX, FrontY);
CheckHitGrd();
CheckSol();
CheckFall();
MovePers();
CheckDie();
}
}
};
ObjPers.prototype.EasterEgg = function () {
with (this) {
if (_parent.Pers.Obj.Etat._currentframe >= frEasterEgg) {
Etat = "Idle";
}
}
};
ObjPers.prototype.GetLifeBonus = function (AddPoints) {
with (this) {
newTotalPoint = Point + AddPoints;
Point = newTotalPoint;
_parent._parent.Hud.BonusPoints.text = Point;
_parent._parent.Hud.BonusPointsShadow.text = Point;
if (AddPoints == 0) {
trace("Life = " + Life);
Life = Life + 3;
if (Life > 10) {
Life = 10;
}
trace("Life = " + Life);
_parent._parent.Hud.LifeBar.gotoAndStop(Life + 1);
} else if (AddPoints == 500) {
_global.C.endLevel(Point, Life);
} else {
_global.C.gear++;
}
}
};
ObjPers.prototype.Walk = function () {
with (this) {
SetSpdX();
SetMoveX();
CheckWall(FrontX, FrontY);
CheckHitGrd();
CheckAttack();
if (Perso == "TuesdayDisguised") {
CheckActionTuesdayDisguised();
}
CheckPenche();
CheckJump();
CheckSol();
CheckFall();
MovePers();
CheckGetFire();
CheckDie();
}
};
ObjPers.prototype.Jump = function () {
with (this) {
SetSpdXJump();
SetMoveX();
CheckWall(FrontX, FrontY);
CheckWall(BottomFrontX, TrueY);
CheckWall(FrontX, TopY);
CheckHitGrd();
CheckSol();
CheckCeil();
CheckGetFire();
this["CheckAction" + Perso]();
MovePers();
if (_parent.Pers.Obj.Etat._currentframe >= FrJump) {
Etat = "FinJump";
}
}
};
ObjPers.prototype.FinJump = function () {
with (this) {
SetSpdXJump();
SetMoveX();
if (UseSuit == true) {
CheckTir();
}
CheckGetFire();
CheckWall(FrontX, FrontY);
CheckWall(BottomFrontX, TrueY);
CheckWall(FrontX, TopY);
CheckHitGrd();
CheckSol();
CheckCeil();
this["CheckAction" + Perso]();
MovePers();
if (HitGrd == true) {
Etat = "Land";
} else if (SpdYNow >= 0) {
Etat = "Fall";
DistYFall = 0;
}
}
};
ObjPers.prototype.Fall = function () {
with (this) {
SetSpdXJump();
SetMoveX();
CheckGetFire();
if (UseSuit == true) {
CheckTir();
}
this["CheckAction" + Perso]();
CheckWall(FrontX, FrontY);
CheckWall(BottomFrontX, TrueY);
CheckWall(FrontX, TopY);
CheckHitGrd();
CheckSol();
MovePers();
if ((_parent.Pers.Obj.Etat._currentframe >= FrFall) or (HitGrd == true)) {
SpdXNow = 0;
MoveX = 0;
if (HitGrd == true) {
if (DistYFall >= DistYLand) {
Etat = "Land";
} else {
Etat = "Idle";
}
} else {
Etat = "FinFall";
}
}
CheckHole();
}
};
ObjPers.prototype.FinFall = function () {
with (this) {
SetSpdXJump();
SetMoveX();
CheckGetFire();
CheckWall(FrontX, FrontY);
CheckWall(FrontX, TrueY);
CheckWall(FrontX, TopY);
CheckHitGrd();
CheckSol();
MovePers();
if (HitGrd == true) {
if (DistYFall >= DistYLand) {
Etat = "Land";
} else {
Etat = "Idle";
}
}
CheckHole();
}
};
ObjPers.prototype.Land = function () {
with (this) {
SetSpdX();
SetMoveX();
CheckGetFire();
CheckWall(FrontX, FrontY);
CheckHitGrd();
CheckSol();
CheckFall();
MovePers();
CheckJump();
this["CheckAction" + Perso]();
CheckDie();
if (_parent.Pers.Obj.Etat._currentframe >= FrLand) {
if (Life <= 0) {
Etat = "Die";
} else {
Etat = "Idle";
}
}
}
};
ObjPers.prototype.GetHit1 = function () {
with (this) {
if (FrGetHitCount >= FrGetHit) {
CheckHitGrd();
Etat = "Fall";
FrGetHitCount = 0;
InvincibleInit();
} else {
FrGetHitCount++;
}
GetHitGeneral();
}
};
ObjPers.prototype.GetHit2 = function () {
with (this) {
GetHitGeneral();
if (FrGetHitCount >= FrGetHit) {
CheckHitGrd();
Etat = "Fall";
FrGetHitCount = 0;
InvincibleInit();
} else {
FrGetHitCount++;
}
}
};
ObjPers.prototype.GetHitLand = function () {
with (this) {
GetHitGeneral();
if (FrGetHitCount == FrGetHit) {
_parent.Pers.Obj.Etat.play();
FrGetHitCount++;
} else if (FrGetHitCount > FrGetHit) {
if (_parent.Pers.Obj.Etat._currentframe >= FrGetHitLand) {
Etat = "PushVide";
FrGetHitCount = 0;
InvincibleInit();
}
} else {
FrGetHitCount++;
}
}
};
ObjPers.prototype.GetHitGeneral = function () {
with (this) {
SetSpdXHit();
CheckWall(BackX, TrueY);
CheckHitGrd();
CheckSol();
MovePers();
CheckDie();
}
};
ObjPers.prototype.GetHit = function () {
with (this) {
var RandomHit = 0;
Life = Life - 1;
_parent._parent.Hud.LifeBar.gotoAndStop(Life + 1);
CanHit = false;
SpdXNow = SpdXHitBase;
SpdYNow = SpdYHitBase;
RandomHit = Math.ceil(Math.random() * 2);
Etat = "GetHit" + RandomHit;
}
};
ObjPers.prototype.GetFire = function () {
with (this) {
var RandomHit = 0;
Life = Life - 1;
_parent._parent.Hud.LifeBar.gotoAndStop(Life + 1);
CanHit = false;
SpdXNow = SpdXHitBase;
SpdYNow = 0;
RandomHit = Math.ceil(Math.random() * 2);
Etat = "GetHit" + RandomHit;
}
};
ObjPers.prototype.CheckGetFire = function () {
with (this) {
var NbMinionBall = G_TabMinionBall.length;
if (NbMinionBall > 0) {
var i = 0;
while (i < NbMinionBall) {
var BallX = _parent.Control[G_TabMinionBall[i]].PosX;
var BallY = _parent.Control[G_TabMinionBall[i]].PosY;
if (((((BallX >= (PosX - GetFireG)) and (BallX <= (PosX + GetFireD))) and (BallY >= (PosY - GetFireUp))) and (BallY <= (PosY + GetFireDw))) && (!Invincible)) {
if (_parent.Control[G_TabMinionBall[i]].Dangerous == true) {
Etat = "GetFire";
if (_parent.Control[G_TabMinionBall[i]].Dir == "D") {
Dir = "G";
} else if (_parent.Control[G_TabMinionBall[i]].Dir == "G") {
Dir = "D";
}
_parent.Control[G_TabMinionBall[i]].Etat = "Hit";
}
}
i++;
}
}
}
};
ObjPers.prototype.InvincibleInit = function () {
with (this) {
Invincible = true;
}
};
ObjPers.prototype.InvincibleEnd = function () {
with (this) {
Invincible = false;
FrInvincibleCount = 0;
_parent.Pers._visible = true;
}
};
ObjPers.prototype.InvincibleCheck = function () {
with (this) {
if (Invincible) {
if (FrInvincibleCount >= FrInvincible) {
InvincibleEnd();
CanBeHit = true;
} else {
FrInvincibleCount++;
if ((FrInvincibleCount % 3) == 0) {
_parent.Pers._visible = !_parent.Pers._visible;
}
}
}
}
};
ObjPers.prototype.Die = function () {
with (this) {
CanBeHit = false;
FrDeadCount++;
if (FrDeadCount >= FrDead) {
FrDeadCount = 0;
_global.C.endGame("lose");
}
}
};
ObjPers.prototype.SetSpdXHit = function () {
with (this) {
MoveX = SpdXNow;
if (SpdXNow > 0) {
SpdXNow = SpdXNow * 0.7;
}
if (Dir eq "D") {
MoveX = MoveX * -1;
}
}
};
ObjPers.prototype.SetSpdX = function () {
with (this) {
if (KeyListener.R == true) {
Dir = "D";
if (_parent.Collider.Wall.hitTest(FrontX + WallHitBloc, TrueY, true)) {
Etat = "Idle";
SpdXBase = 0;
SpdXNow = 0;
} else {
Etat = "Walk";
SpdXBase = ModifSpeed(SpdXBase, "acc", false, Dir);
SpdXNow = SpdXBase;
}
} else if (KeyListener.L == true) {
Dir = "G";
if (_parent.Collider.Wall.hitTest(FrontX - WallHitBloc, TrueY, true)) {
Etat = "Idle";
SpdXBase = 0;
SpdXNow = 0;
} else {
Etat = "Walk";
SpdXBase = ModifSpeed(SpdXBase, "acc", false, Dir);
SpdXNow = SpdXBase;
}
} else {
if (Etat != "Land") {
Etat = "Idle";
}
SpdXBase = ModifSpeed(SpdXBase, "dec", false, Dir);
SpdXNow = SpdXBase;
}
if (Dir ne DirOld) {
SpdXBase = ModifSpeed(SpdXBase, "dec", false, Dir);
SpdXNow = SpdXBase;
}
}
};
ObjPers.prototype.SetSpdXJump = function () {
with (this) {
if (KeyListener.R == true) {
Dir = "D";
if (_parent.Collider.Wall.hitTest(TrueX + WallHitBloc, TrueY, true)) {
SpdXBase = 0;
SpdXNow = 0;
} else {
SpdXBase = ModifSpeed(SpdXBase, "acc", true, Dir);
SpdXNow = SpdXBase;
}
} else if (KeyListener.L == true) {
Dir = "G";
if (_parent.Collider.Wall.hitTest(TrueX - WallHitBloc, TrueY, true)) {
SpdXBase = 0;
SpdXNow = 0;
} else {
SpdXBase = ModifSpeed(SpdXBase, "acc", true, Dir);
SpdXNow = SpdXBase;
}
} else {
SpdXBase = ModifSpeed(SpdXBase, "dec", true, Dir);
SpdXNow = SpdXBase;
}
if (Dir ne DirOld) {
SpdXBase = ModifSpeed(SpdXBase, "dec", true, Dir);
SpdXNow = SpdXBase;
}
}
};
ObjPers.prototype.SetMoveX = function () {
with (this) {
MoveX = SpdXNow;
}
};
ObjPers.prototype.checkEaster = function () {
with (this) {
if (KeyListener.S == true) {
Etat = "EasterEgg";
}
}
};
ObjPers.prototype.CheckWall = function (CoordX, CoordY) {
with (this) {
if (MoveX != 0) {
if (MoveX > 0) {
var WallStop = WallHitBloc;
} else {
var WallStop = (-1 * WallHitBloc);
}
var WallHit1 = (MoveX / 3);
var WallHit2 = (WallHit1 * 2);
if (_parent.Collider.Wall.hitTest(CoordX + WallStop, CoordY, true)) {
SpdXBase = 0;
MoveX = 0;
} else if (_parent.Collider.Wall.hitTest(CoordX + WallHit1, CoordY, true)) {
SpdXBase = 0;
MoveX = WallHitBloc;
} else if (_parent.Collider.Wall.hitTest(CoordX + WallHit2, CoordY, true)) {
SpdXBase = 0;
MoveX = WallHit1;
} else if (_parent.Collider.Wall.hitTest(CoordX + MoveX, CoordY, true)) {
SpdXBase = 0;
MoveX = WallHit2;
}
}
}
};
ObjPers.prototype.CheckCeil = function () {
with (this) {
if (MoveY != 0) {
if (_parent.Collider.Ceil.hitTest(TopX, TopY + MoveY, true)) {
MoveY = 0;
SpdYNow = 0;
Etat = "Fall";
DistYFall = 0;
}
}
}
};
ObjPers.prototype.Kick1 = function () {
with (this) {
if (_parent.Pers.Obj.Etat._currentframe >= frKick1) {
CanHit = true;
HitPointX = _parent.Pers.Obj.HitPoint._x;
if (Dir == "G") {
HitPointX = PosX - HitPointX;
} else if (Dir == "D") {
HitPointX = PosX + HitPointX;
}
HitPointY = PosY + _parent.Pers.Obj.HitPoint._y;
Etat = "FinKick1";
CheckGetFire();
}
}
};
ObjPers.prototype.FinKick1 = function () {
with (this) {
if (_parent.Pers.Obj.Etat._currentframe >= frFinKick1) {
CanHit = false;
if (!HitGrd) {
Etat = "Fall";
} else {
Etat = "Idle";
}
CheckGetFire();
if (KeyListener.Sp) {
ComboKick++;
}
}
}
};
ObjPers.prototype.Kick2 = function () {
with (this) {
SetSpdXJump();
SetMoveX();
CheckGetFire();
CheckWall(FrontX, FrontY);
CheckWall(BottomFrontX, TrueY);
CheckWall(FrontX, TopY);
CheckHitGrd();
CheckSol();
MovePers();
if (_parent.Pers.Obj.Etat._currentframe >= frKick2) {
CanHit = true;
HitPointX = _parent.Pers.Obj.HitPoint._x;
if (Dir == "G") {
HitPointX = PosX - HitPointX;
} else if (Dir == "D") {
HitPointX = PosX + HitPointX;
}
HitPointY = PosY + _parent.Pers.Obj.HitPoint._y;
Etat = "FinKick2";
CheckGetFire();
}
}
};
ObjPers.prototype.FinKick2 = function () {
with (this) {
SetSpdXJump();
SetMoveX();
CheckGetFire();
CheckWall(FrontX, FrontY);
CheckWall(BottomFrontX, TrueY);
CheckWall(FrontX, TopY);
CheckHitGrd();
CheckSol();
MovePers();
if (_parent.Pers.Obj.Etat._currentframe >= frFinKick2) {
CanHit = false;
if (!HitGrd) {
Etat = "Fall";
} else {
Etat = "Idle";
}
CheckGetFire();
if (KeyListener.Sp) {
ComboKick++;
}
}
}
};
ObjPers.prototype.CheckJump = function () {
with (this) {
if (((KeyListener.Up == true) and (HitGrd == true)) and (KeyListener.UpRelease == true)) {
_global.Sounds.PlayASound("Jump", 1, 60);
KeyListener.UpRelease = false;
KeepDeadPos = false;
Etat = "Jump";
SpdYNow = SpdStartJump;
}
}
};
ObjPers.prototype.CheckActionWaffle = function () {
with (this) {
if (KeyListener.Sp == true) {
KeyListener.Sp = false;
if (KickTime < KickInAir) {
if (((Etat == "Jump") || (Etat == "FinJump")) || (Etat == "Fall")) {
KickTime++;
ComboKick = 0;
RandomKick = 2;
} else {
RandomKick = 1;
}
_global.Sounds.PlayASound("Kick", 1, 50);
Etat = "Kick" + RandomKick;
}
} else if (((((Etat != "Jump") && (Etat != "FinJump")) && (Etat != "Fall")) && (Etat != "Kick2")) && (Etat != "FinKick1")) {
KickTime = 0;
ComboKick = 0;
}
}
};
ObjPers.prototype.ResetMove = function () {
with (this) {
MoveX = 0;
MoveY = 0;
SpdXNow = 0;
SpdYNow = 0;
}
};
ObjPers.prototype.CheckFall = function () {
with (this) {
if (SpdYNow >= SpdYFall) {
KeepDeadPos = false;
Etat = "Fall";
DistYFall = 0;
}
}
};
ObjPers.prototype.CheckDie = function () {
with (this) {
if ((Life <= 0) and (HitGrd == true)) {
CanBeHit = false;
InvincibleEnd();
_global.C.DesactivateHud();
Etat = "Die";
}
}
};
ObjPers.prototype.MovePers = function () {
with (this) {
if ((Pers.TrueX + MoveX) < 0) {
MoveX = TrueX * -1;
} else if ((Pers.TrueX + MoveX) > 500) {
MoveX = 500 - Pers.TrueX;
}
PosX = _parent.Pers._x + MoveX;
_parent.Pers._x = PosX;
MoveX = 0;
PosY = _parent.Pers._y + MoveY;
_parent.Pers._y = PosY;
MoveY = 0;
}
};
ObjPers.prototype.SetTruePos = function () {
with (this) {
TrueX = PosX + _parent._x;
TrueY = PosY + _parent._y;
TopX = TrueX;
TopY = TrueY + _parent.Pers.Obj.HitTop._y;
FrontX = _parent.Pers.Obj.HitFront._x;
FrontY = TrueY + _parent.Pers.Obj.HitFront._y;
BottomFrontX = _parent.Pers.Obj.HitBottomFront._x;
BottomBackX = _parent.Pers.Obj.HitBottomBack._x;
BackX = _parent.Pers.Obj.HitBack._x;
if (Dir == "G") {
FrontX = TrueX - FrontX;
BottomFrontX = TrueX - BottomFrontX;
BottomBackX = TrueX - BottomBackX;
BackX = TrueX - BackX;
} else if (Dir == "D") {
FrontX = TrueX + FrontX;
BottomFrontX = TrueX + BottomFrontX;
BottomBackX = TrueX + BottomBackX;
BackX = TrueX + BackX;
}
}
};
ObjPers.prototype.CheckHitGrd = function (CheckX, CheckY) {
with (this) {
if ((CheckX == undefined) && (CheckY == undefined)) {
CheckX = TrueX;
CheckY = TrueY;
aCheckPoints = [CheckX, BottomFrontX, BottomBackX];
} else {
aCheckPoints = [CheckX];
}
for (var i in aCheckPoints) {
if (_parent.Collider.Sol.hitTest(aCheckPoints[i], CheckY + MaxSol, true) and (SpdYNow >= 0)) {
HitGrd = true;
HitGrdPoint = aCheckPoints[i];
break;
}
HitGrd = false;
HitGrdPoint = TrueX;
}
}
};
ObjPers.prototype.CheckSol = function (CheckX, CheckY) {
with (this) {
if ((CheckX == undefined) && (CheckY == undefined)) {
CheckX = HitGrdPoint;
CheckY = TrueY;
}
if (_parent.Collider.Sol.hitTest(CheckX, CheckY, true) and (SpdYNow >= 0)) {
SpdYNow = 0;
var InSol = true;
while (InSol == true) {
MoveY = MoveY - SolOut;
InSol = _parent.Collider.Sol.hitTest(CheckX, CheckY + MoveY, true);
}
} else if (SpdYNow >= 0) {
if (HitGrd == true) {
SpdYNow = 0;
MoveY = SpdYNow;
} else {
if ((KeyListener.Up == true) && (SpdYNow > 0)) {
var MoveUp = (Math.round((SpdYUp * 10) / 1200) / 10);
if (MoveUp < 0.1) {
MoveUp = 0.1;
}
SpdYNow = SpdYNow + MoveUp;
if (SpdYNow > (SpdYMax / 3)) {
SpdYNow = SpdYMax / 3;
}
} else {
SpdYNow = SpdYNow + SpdYUp;
if (SpdYNow > SpdYMax) {
SpdYNow = SpdYMax;
}
}
var SolHit1 = (SpdYNow / 3);
var SolHit2 = (SolHit1 * 2);
if (_parent.Collider.Sol.hitTest(CheckX, CheckY + SolHit1, true)) {
MoveY = SolHitMin;
} else if (_parent.Collider.Sol.hitTest(CheckX, CheckY + SolHit2, true)) {
MoveY = SolHit1;
} else if (_parent.Collider.Sol.hitTest(CheckX, CheckY + SpdYNow, true)) {
MoveY = SolHit2;
} else {
MoveY = SpdYNow;
}
}
} else {
SpdYNow = SpdYNow + SpdYUp;
MoveY = SpdYNow;
}
if (MoveY > 0) {
DistYFall = DistYFall + MoveY;
}
}
};
ObjPers.prototype.ChangeEtat = function (NewAction) {
with (this) {
if (((EtatOld eq "Walk") and (Etat eq "WalkTir")) or ((EtatOld eq "WalkTir") and (Etat eq "Walk"))) {
var SetFrWalk = true;
}
EtatOld = Etat;
Etat = NewAction;
_parent.Pers.Obj.gotoAndStop(NewAction);
if (SetFrWalk == true) {
if (FrWalkNow >= 20) {
FrWalkNow = 1;
}
_parent.Pers.Obj.Etat.gotoAndPlay(FrWalkNow);
}
}
};
ObjPers.prototype.updatePerso = function () {
with (this) {
_parent.Pers.gotoAndStop((Perso + "_") + Dir);
Etat = "Idle";
GetFireG = -1 * _parent.Pers.Obj.HitBack._x;
GetFireD = _parent.Pers.Obj.HitFront._x;
GetFireDw = 20;
GetFireUp = -1 * _parent.Pers.Obj.HitTop._y;
ComboKick = 0;
InvincibleEnd();
CanBeHit = true;
}
};
ObjPers.prototype.ChangeDir = function (NewDir) {
with (this) {
DirOld = Dir;
Dir = NewDir;
_parent.Pers.gotoAndStop((Perso + "_") + Dir);
}
};
ObjPers.prototype.Actions = function () {
with (this) {
if (G_Pause == true) {
if (InPause == false) {
InPause = true;
_parent.Pers.Obj.Etat.stop();
}
} else {
if (InPause == true) {
InPause = false;
_parent.Pers.Obj.Etat.play();
}
SetTruePos();
InvincibleCheck();
this[Etat]();
}
}
};
CreerPersBall = function () {
var _local3 = "Ball" + G_NextPersBall;
G_NextPersBall = G_NextPersBall + 1;
if (G_NextPersBall > 50) {
G_NextPersBall = 1;
}
if (this[_local3] == null) {
var _local7 = G_NextPersBallDepth;
G_NextPersBallDepth++;
duplicateMovieClip (_parent.Ball.PersBallClone, _local3, _local7);
var _local6 = Pers.Dir;
_parent.Ball[_local3].gotoAndStop(_local6);
var _local5 = Pers.PosX;
var _local4 = Pers.PosY + Pers.DistBallY;
_parent.Ball[_local3]._x = _local5;
_parent.Ball[_local3]._y = _local4;
this[_local3] = new ObjPersBall(_local3, _local5, _local4, _local6, 14, 20, G_TabPersBall, "SlimeSplat");
G_TabPersBall.push(_local3);
}
};
CreerMinionBall = function (PosX, PosY, Dir, PowerX, PowerY) {
MinShootX = 10;
MinShootY = 41;
if (PowerX == undefined) {
ForceX = random(4) + 15;
Bouncing = "horiz";
} else {
ForceX = PowerX;
Bouncing = "vertic";
}
if (PowerY == undefined) {
ForceY = random(3) - 7;
} else {
ForceY = PowerY;
}
if (Dir == "none") {
if (random(50) < 25) {
Dir = "D";
} else {
Dir = "G";
}
}
FrDetonate = 90;
var _local3 = "MinionBall" + G_NextMinionBall;
G_NextMinionBall = G_NextMinionBall + 1;
if (G_NextMinionBall > 50) {
G_NextMinionBall = 1;
}
if (this[_local3] == null) {
var _local5 = G_NextMinionBallDepth;
G_NextMinionBallDepth++;
duplicateMovieClip (_parent.Ball.MinionBallClone, _local3, _local5);
_parent.Ball[_local3].gotoAndStop(Dir);
if (Dir == "G") {
_parent.Ball[_local3]._x = PosX - MinShootX;
} else if (Dir == "D") {
_parent.Ball[_local3]._x = PosX + MinShootX;
}
_parent.Ball[_local3]._y = PosY - MinShootY;
this[_local3] = new ObjPersBall(_local3, _parent.Ball[_local3]._x, _parent.Ball[_local3]._y, Dir, 14, 10, G_TabMinionBall, "LaserSplat");
G_TabMinionBall.push(_local3);
}
};
ObjPersBall.prototype.Hide = function () {
with (this) {
_parent.Ball[Nom]._x = PosX + SpdX;
PosX = PosX + SpdX;
SetTruePos();
if (_parent.PersBall[Nom].Obj.Etat._currentframe >= FrHide) {
Etat = "Move";
}
CheckWall();
CheckOut();
}
};
ObjPersBall.prototype.Move = function () {
with (this) {
if (Bouncing == "horiz") {
_parent.Ball[Nom]._x = PosX + SpdX;
_parent.Ball[Nom]._y = PosY + SpdY;
PosX = PosX + SpdX;
PosY = PosY + SpdY;
passTime++;
CheckGround();
SetTruePos();
CheckWall();
CheckOut();
if (passTime == 2) {
passTime = 0;
if (SpdX > 0) {
SpdX--;
} else if (SpdX < 0) {
SpdX++;
} else if (Stopped == true) {
Dangerous = false;
Etat = "detonate";
}
}
} else if (Bouncing == "vertic") {
_parent.Ball[Nom]._x = PosX + SpdX;
_parent.Ball[Nom]._y = PosY + SpdY;
PosX = PosX + SpdX;
PosY = PosY + SpdY;
if (Stopped == false) {
SpdY++;
if (SpdY == 0) {
detectNow = true;
}
} else {
Etat = "detonate";
}
SetTruePos();
if (detectNow == true) {
CheckGround();
}
CheckWall();
CheckOut();
}
}
};
ObjPersBall.prototype.detonate = function () {
with (this) {
if (_parent.Ball[Nom].Obj.Etat._currentframe == FrDetonate) {
Etat = "explode";
}
checkIfKick();
CheckOut();
}
};
ObjPersBall.prototype.checkIfKick = function () {
with (this) {
if (Pers.CanHit == true) {
if (_parent.Ball[Nom].hitTest(_parent.Pers)) {
_global.Sounds.PlayASound("Ball", 1, 100);
Dir = Pers.Dir;
if (Dir eq "D") {
SpdX = random(6) + 18;
} else {
SpdX = -1 * (random(6) + 18);
}
SpdY = random(3) - 11;
Stopped = false;
Etat = "Move";
}
}
}
};
ObjPersBall.prototype.Hit = function () {
with (this) {
if (((_parent.Ball[Nom].Obj.Etat._currentframe == 1) && (TrueX > 0)) && (TrueX < 500)) {
} else if (_parent.Ball[Nom].Obj.Etat._currentframe >= FrHit) {
_parent.Ball[Nom].Obj.Etat = "Sleep";
_parent.Ball[Nom].Obj.gotoAndStop("Sleep");
KillBall();
}
}
};
ObjPersBall.prototype.explode = function () {
with (this) {
if (_parent.Ball[Nom].hitTest(_parent.Pers)) {
if (Pers.CanBeHit) {
Pers.Etat = "GetHit";
Pers.CanBeHit = false;
if (_parent.Ball[Nom]._x > _parent.Pers._x) {
Pers.Dir = "D";
} else {
Pers.Dir = "G";
}
}
}
if (_parent.Ball[Nom].Obj.Etat._currentframe >= FrHit) {
_parent.Ball[Nom].Obj.Etat = "Sleep";
_parent.Ball[Nom].Obj.gotoAndStop("Sleep");
KillBall();
}
}
};
ObjPersBall.prototype.KillBall = function () {
with (this) {
if (Tab == G_TabPersBall) {
G_TabPersBall.splice(PersBallI, 1);
PersBallI = PersBallI - 1;
} else if (Tab == G_TabMinionBall) {
G_TabMinionBall.splice(MinionBallI, 1);
MinionBallI = MinionBallI - 1;
}
delete _parent.Control[Nom];
}
};
ObjPersBall.prototype.SetTruePos = function () {
with (this) {
TrueX = PosX + _parent._x;
TrueY = (PosY + _parent._y) + 10;
}
};
ObjPersBall.prototype.Sleep = function () {
};
ObjPersBall.prototype.CheckWall = function () {
with (this) {
if (_parent.Collider.Wall.hitTest(TrueX, TrueY, true) and (!_parent.Collider.Wall.Pass.hitTest(TrueX, TrueY, true))) {
_global.Sounds.PlayASound("Ball", 1, 100);
if (Dir eq "D") {
Dir = "G";
} else {
Dir = "D";
}
Dangerous = true;
SpdX = SpdX * -1;
if (SpdX > 0) {
SpdX = SpdX + 2;
} else {
SpdX = SpdX + -2;
}
if (Math.abs(SpdX) < 5) {
if (SpdX < 5) {
SpdX = 5;
} else if (Spd > -5) {
SpdX = -5;
}
}
}
}
};
ObjPersBall.prototype.CheckGround = function () {
with (this) {
if (_parent.Collider.Sol.hitTest(TrueX, TrueY, true)) {
if (SpdY >= 0) {
if (SpdY >= 5) {
_global.Sounds.PlayASound("Ball", 1, 100);
}
var i = 0;
while (_parent.Collider.Sol.hitTest(TrueX, TrueY - (i + 1), true)) {
i++;
}
PosY = PosY + (i * -1);
_parent.Ball[Nom]._y = PosY;
HurtMyself = true;
if (SpdY > 2) {
Stopped = false;
SpdY = Math.round(SpdY * -0.5);
} else {
Stopped = true;
SpdY = 0;
}
} else {
Stopped = false;
SpdY++;
}
} else {
Stopped = false;
SpdY++;
}
}
};
ObjPersBall.prototype.CheckOut = function () {
with (this) {
if ((((PosX < (Bg.InvPosX - LgOutG)) or (PosX > (Bg.InvPosX + LgOutD))) or (PosY < (Bg.InvPosY - LgOutUp))) or (PosY > (Bg.InvPosY + LgOutDw))) {
_parent.Ball[Nom].Obj.Etat = "Sleep";
_parent.Ball[Nom].Obj.gotoAndStop("Sleep");
KillBall();
}
}
};
ObjPersBall.prototype.ChangeEtat = function (NewAction) {
with (this) {
EtatOld = Etat;
Etat = NewAction;
_parent.Ball[Nom].Obj.gotoAndStop(NewAction);
}
};
ObjPersBall.prototype.Actions = function () {
with (this) {
if (G_Pause == true) {
if (InPause == false) {
InPause = true;
_parent.Ball[Nom].Obj.Etat.stop();
}
} else {
if (InPause == true) {
InPause = false;
_parent.Ball[Nom].Obj.Etat.play();
}
this[Etat]();
}
}
};
CreerBg = function (PosX, PosY) {
this.Bg = new ObjBg(PosX, PosY);
};
ObjBg.prototype.Actions = function () {
with (this) {
if (G_Pause == true) {
if (InPause == false) {
InPause = true;
}
} else {
if (InPause == true) {
InPause = false;
}
ScrollBg();
}
}
};
ObjBg.prototype.ScrollBg = function () {
with (this) {
CheckScreen();
if ((PosY <= MaxDw) and (PosY >= MaxUp)) {
if (Pers.TrueX > (CenterX + 1)) {
if ((Pers.HitGrd == false) and (Pers.TrueY >= 300)) {
SpdXG = -30;
SpdXD = 30;
} else if (Pers.SpdXNow > 0) {
SpdXG = (Pers.SpdXNow * -1) - 5;
} else if (Pers.SpdXNow < 0) {
SpdXD = (Pers.SpdXNow * -1) + 5;
} else {
SpdXG = -8;
SpdXD = 8;
}
if (PosX < MaxG) {
if ((PosX + SpdXD) > MaxG) {
MoveX = MaxG - PosX;
} else {
MoveX = SpdXD;
}
} else {
if ((CenterX - Pers.TrueX) > SpdXG) {
MoveX = CenterX - Pers.TrueX;
} else {
MoveX = SpdXG;
}
if ((PosX + MoveX) < MaxG) {
MoveX = MaxG - PosX;
}
}
} else if (Pers.TrueX < (CenterX - 1)) {
if ((Pers.HitGrd == false) and (Pers.TrueY >= 300)) {
SpdXG = -30;
SpdXD = 30;
} else if (Pers.SpdXNow > 0) {
SpdXG = (Pers.SpdXNow * -1) - 5;
} else if (Pers.SpdXNow < 0) {
SpdXD = (Pers.SpdXNow * -1) + 5;
} else {
SpdXG = -8;
SpdXD = 8;
}
if (PosX > MaxD) {
if ((PosX + SpdXG) < MaxD) {
MoveX = MaxD - PosX;
} else {
MoveX = SpdXG;
}
} else {
if ((CenterX - Pers.TrueX) < SpdXD) {
MoveX = CenterX - Pers.TrueX;
} else {
MoveX = SpdXD;
}
if ((PosX + MoveX) > MaxD) {
MoveX = MaxD - PosX;
}
}
} else {
if ((Pers.HitGrd == false) and (Pers.TrueY >= 300)) {
SpdXG = -30;
SpdXD = 30;
} else if (Pers.SpdXNow > 0) {
SpdXG = (Pers.SpdXNow * -1) - 5;
} else if (Pers.SpdXNow < 0) {
SpdXD = (Pers.SpdXNow * -1) + 5;
} else {
SpdXG = -8;
SpdXD = 8;
}
if (PosX < MaxG) {
if ((PosX + SpdXD) > MaxG) {
MoveX = MaxG - PosX;
} else {
MoveX = SpdXD;
}
} else if (PosX > MaxD) {
if ((PosX + SpdXG) < MaxD) {
MoveX = MaxD - PosX;
} else {
MoveX = SpdXG;
}
}
}
}
if ((PosX <= MaxD) and (PosX >= MaxG)) {
if (Pers.TrueY > (CenterY + 1)) {
if (Pers.SpdYNow > 0) {
SpdYUp = (Pers.SpdYNow * -1) - 5;
} else if (Pers.SpdYNow < 0) {
SpdYDw = (Pers.SpdYNow * -1) + 5;
} else {
SpdYUp = -5;
SpdYDw = 5;
}
if (PosY < MaxUp) {
if ((PosY + SpdYDw) > MaxUp) {
MoveY = MaxUp - PosY;
} else {
MoveY = SpdYDw;
}
} else {
if ((CenterY - Pers.TrueY) > SpdYUp) {
MoveY = CenterY - Pers.TrueY;
} else {
MoveY = SpdYUp;
}
if ((PosY + MoveY) < MaxUp) {
MoveY = MaxUp - PosY;
}
}
} else if (Pers.TrueY < (CenterY - 1)) {
if (Pers.SpdYNow > 0) {
SpdYUp = (Pers.SpdYNow * -1) - 5;
} else if (Pers.SpdYNow < 0) {
SpdYDw = (Pers.SpdYNow * -1) + 5;
} else {
SpdYUp = -5;
SpdYDw = 5;
}
if (PosY > MaxDw) {
if ((PosY + SpdYUp) < MaxDw) {
MoveY = MaxDw - PosY;
} else {
MoveY = SpdYUp;
}
} else {
if ((CenterY - Pers.TrueY) < SpdYDw) {
MoveY = CenterY - Pers.TrueY;
} else {
MoveY = SpdYDw;
}
if ((PosY + MoveY) > MaxDw) {
MoveY = MaxDw - PosY;
}
}
} else {
if (Pers.SpdYNow > 0) {
SpdYUp = (Pers.SpdYNow * -1) - 5;
} else if (Pers.SpdYNow < 0) {
SpdYDw = (Pers.SpdYNow * -1) + 5;
} else {
SpdYUp = -5;
SpdYDw = 5;
}
if (PosY < MaxUp) {
if ((PosY + SpdYDw) > MaxUp) {
MoveY = MaxDw - PosY;
} else {
MoveY = SpdYDw;
}
} else if (PosY > MaxDw) {
if ((PosY + SpdYUp) < MaxDw) {
MoveY = MaxDw - PosY;
} else {
MoveY = SpdYUp;
}
}
}
}
_parent._x = Math.floor(_parent._x + MoveX);
PosX = _parent._x;
InvPosX = PosX * -1;
MoveX = 0;
_parent._y = Math.floor(_parent._y + MoveY);
PosY = _parent._y;
InvPosY = PosY * -1;
MoveY = 0;
}
};
CreerShred = function (Nom, PosX, PosY, Dir, Perso) {
if (this[Nom] == null) {
if ((Perso == undefined) || (!Perso)) {
Perso = "Gordon";
}
this[Nom] = new ObjShred(Nom, PosX, PosY, Dir, Perso);
G_TabShred.push(Nom);
}
};
ObjShred.prototype.Sleep = function () {
with (this) {
CheckActif();
}
};
ObjShred.prototype.Idle = function () {
with (this) {
MoveX = 0;
MoveY = 0;
CanBeHit = true;
FrBetweenAttack++;
FrSeparateWallCount++;
if (FrSeparateWallCount == FrSeparateWallCheck) {
FrSeparateWallCount = 0;
WallSeparate = false;
}
if (((Etat == "Idle") && ((_parent[Nom].Obj.Etat._currentframe >= FrIdleCheckMin) && (_parent[Nom].Obj.Etat._currentframe <= FrIdleCheckMax))) || (_parent[Nom].Obj.Etat._currentframe == FrIdleCheckLast)) {
if (Dir == "G") {
CheckPers("D");
} else if (Dir == "D") {
CheckPers("G");
}
} else {
CheckPers();
}
if ((Perso == "Gordon") || (Perso == "Blik")) {
CheckAttack();
if ((Etat == "Idle") && (_parent[Nom].Obj.Etat._currentframe == FrIdleCheckLast)) {
CheckDistWall();
if (TooNearWall) {
if (Dir == "G") {
Dir = "D";
} else if (Dir == "D") {
Dir = "G";
}
CheckDistWall();
if (!TooNearWall) {
Etat = "Walk";
}
} else {
Etat = "Walk";
}
}
} else {
CheckAttack();
}
CheckBoxOver();
CheckBoxSide();
CheckHeadAttack();
if (Perso != "Waffle") {
CheckGetHit();
}
CheckGetFire();
CheckGetFart();
CheckHitGrd();
if (Perso != "Blik") {
CheckSol();
}
CheckSleep();
}
};
ObjShred.prototype.Walk = function () {
with (this) {
CanBeHit = true;
CheckHeadAttack();
CheckTurn();
CheckWall();
CheckPers();
CheckHitGrd();
if (Perso != "Blik") {
CheckSol();
}
CheckAttack();
CheckBoxOver();
CheckBoxSide();
CheckGetHit();
CheckGetFire();
CheckGetFart();
SetMoveX();
MoveShred();
CheckSleep();
}
};
ObjShred.prototype.MoonWalk = function () {
with (this) {
CanBeHit = true;
FrBetweenAttack++;
CheckHeadAttack();
CheckTurn();
CheckWall();
if (FrBetweenAttack >= FrMoonWalk) {
CheckPers();
}
CheckHitGrd();
CheckAttack();
CheckBoxOver();
CheckBoxSide();
CheckGetHit();
CheckGetFire();
CheckGetFart();
InverseSetMoveX();
MoveShred();
CheckSleep();
}
};
ObjShred.prototype.WalkFight = function () {
with (this) {
CanBeHit = true;
CheckHeadAttack();
SetMoveXWalkFight();
CheckTurn();
CheckWall();
CheckHitGrd();
if (Perso != "Blik") {
CheckSol();
}
CheckAttack();
CheckBoxOver();
CheckBoxSide();
CheckGetFire();
CheckGetFart();
MoveShred();
CheckSleep();
CheckFight();
CheckGetHit();
}
};
ObjShred.prototype.Surpris = function () {
with (this) {
if (_parent[Nom].Obj.Etat._currentframe >= FrSurpris) {
MoveX = 0;
MoveY = 0;
if (Perso == "Gordon") {
if (((Pers.Etat == "Die") && (Pers.Obj.Etat._currentframe >= 40)) || (Pers.Etat == "Dead")) {
Etat = "Charge";
} else if ((Math.ceil(Math.random() * 3) == 1) || ((TrueX < 0) || (TrueX > 500))) {
Etat = "WalkFight";
} else {
Etat = "Charge";
}
} else if (Perso == "Blik") {
if (FrBetweenAttack >= FrMoonWalk) {
FrBetweenAttack = 0;
Etat = "Attack3";
ShootMax = Math.ceil((Math.random() * 3) + 1);
ShootCount = 1;
} else {
Etat = "MoonWalk";
}
}
}
CanBeHit = true;
CheckHeadAttack();
CheckBoxOver();
CheckBoxSide();
CheckGetHit();
CheckGetFire();
CheckGetFart();
}
};
ObjShred.prototype.Attack3 = function () {
with (this) {
if (_parent[Nom].Obj.Etat._currentframe == FrShoot) {
_global.Sounds.PlayASound("Crache", 1, 100);
_global.Game.CreerMinionBall(PosX, PosY, Dir);
} else if (_parent[Nom].Obj.Etat._currentframe >= FrShootFin) {
Etat = "Idle";
}
CanBeHit = true;
CheckHeadAttack();
CheckGetHit();
CheckGetFire();
CheckGetFart();
}
};
ObjShred.prototype.Ready = function () {
with (this) {
CanBeHit = true;
if (_parent[Nom].Obj.Etat._currentframe >= 5) {
CheckHeadAttack();
CheckGetHit();
}
CheckGetFire();
if (_parent[Nom].Obj.Etat._currentframe >= FrReady) {
Etat = "Attack4";
}
}
};
ObjShred.prototype.PopOut = function () {
with (this) {
CanBeHit = true;
CheckHeadAttack();
CheckGetHit();
CheckGetFire();
if (_parent[Nom].Obj.Etat._currentframe >= FrPopOut) {
Etat = "Idle";
}
}
};
ObjShred.prototype.Attack4 = function () {
with (this) {
if (_parent[Nom].Obj.Etat._currentframe == FrAttack4) {
_global.Sounds.PlayASound("Lazer", 1, 80);
}
if (_parent[Nom].Obj.Etat._currentframe >= FrAttack4) {
if (_parent[Nom].Obj.Etat.missile.hitTest(_parent.Pers) && (Pers.CanBeHit == true)) {
_global.Sounds.PlayASound("electroc", 1, 80);
if (Dir == "G") {
Pers.Dir = "D";
} else if (Dir == "D") {
Pers.Dir = "G";
}
Pers.Etat = "GetHit";
Pers.CanBeHit = false;
waitTimeMissile = 0;
_parent[Nom].Obj.Etat.spark._visible = true;
}
var BounceMiss = _parent[Nom].Obj.Etat.spark.getBounds(_parent._parent);
BounceMissX = (BounceMiss.xMax + BounceMiss.xMin) / 2;
BounceMissY = (BounceMiss.yMax + BounceMiss.yMin) / 2;
if (_parent.Collider.Wall.hitTest(BounceMissX, BounceMissY, true)) {
_parent[Nom].Obj.Etat.missile.gotoAndStop("explode");
_parent[Nom].Obj.Etat.stop();
waitTimeMissile = 0;
Etat = "FinAttack4";
}
if (_parent[Nom].Obj.Etat._currentframe >= FrFinAttack4) {
_parent[Nom].Obj.Etat.missile.gotoAndStop("explode");
_parent[Nom].Obj.Etat.stop();
waitTimeMissile = 0;
Etat = "FinAttack4";
}
}
CanBeHit = true;
CheckHeadAttack();
CheckGetHit();
CheckGetFire();
}
};
ObjShred.prototype.Charge = function () {
with (this) {
CanBeHit = true;
SetMoveXCharge();
CheckTurn();
CheckWall("Charge");
CheckHitGrd();
CheckSol();
CheckGetFire();
CheckGetFart();
MoveShred();
CheckSleep();
CheckBoxOver();
CheckBoxSide();
CheckTouchCharge();
CheckHeadAttack();
CheckGetHit();
}
};
ObjShred.prototype.Fight = function () {
with (this) {
Etat = "Attack1";
}
};
ObjShred.prototype.StartJump = function () {
with (this) {
CanBeHit = true;
Etat = "Jump";
SpdYNow = SpdYStepBack;
SpdXFall = SpdXStepBack;
}
};
ObjShred.prototype.Jump = function () {
with (this) {
CanBeHit = true;
CheckHeadAttack();
SetMoveXFall();
CheckWall("Back");
CheckHitGrd();
CheckSol();
CheckGetFire();
CheckGetFart();
MoveShred();
Etat = "Fall";
}
};
ObjShred.prototype.Land = function () {
with (this) {
if (_parent[Nom].Obj.Etat._currentframe >= FrLand) {
Etat = "Walk";
}
}
};
ObjShred.prototype.GetHit = function () {
with (this) {
if (Perso != "Waffle") {
SetMoveXFall();
CheckWall("Back");
CheckHitGrd();
CheckSol();
MoveShred();
}
CheckGetFire();
CheckGetFart();
FrGetHitCount++;
if (FrGetHitCount == 1) {
if (Perso != "Waffle") {
CreerLifeBonus("LifeBonus", PosX, PosY, 50);
} else if (Dir == "D") {
CreerLifeBonus("LifeBonus", PosX + 30, PosY, 50);
} else {
CreerLifeBonus("LifeBonus", PosX - 30, PosY, 50);
}
}
if (FrGetHitCount >= FrGetHit) {
CanBeHit = true;
if (HitGrd == true) {
if (Life > 0) {
if (Perso != "Waffle") {
FrGetHitCount = 0;
Etat = "Idle";
WallSeparate = false;
} else {
FrGetHitCount = 0;
Etat = "PopOut";
WallSeparate = false;
}
} else {
Etat = "Die";
}
} else {
Etat = "Fall";
}
}
}
};
ObjShred.prototype.Fall = function () {
with (this) {
CanBeHit = true;
SetMoveXFall();
CheckWall("Back");
CheckHitGrd();
CheckSol();
CheckGetFire();
CheckHeadAttack();
MoveShred();
if (HitGrd == true) {
if (Life > 0) {
Etat = "Sleep";
CanBeHit = true;
WallSeparate = false;
} else {
Etat = "Die";
}
}
}
};
ObjShred.prototype.CheckHeadAttack = function () {
with (this) {
if (_parent[Nom].Obj.headZone.hitTest(_parent.Pers.Obj.HitBottom)) {
if (random(100) < 50) {
Pers.SpdXBase = random(4) + 3;
} else {
Pers.SpdXBase = random(4) - 7;
}
Pers.SpdYNow = Pers.SpdStartJump / 1.5;
if (CanBeHit) {
_global.Sounds.PlayASound("rHead", 1, 50);
Life--;
CanBeHit = false;
Etat = "GetHit";
}
} else if ((_parent[Nom].Obj.KikZone.hitTest(_parent.Pers.Obj.HitTop) || (_parent[Nom].Obj.KikZone.hitTest(_parent.Pers.Obj.HitFront))) || (_parent[Nom].Obj.KikZone.hitTest(_parent.Pers.Obj.HitBack))) {
if (Pers.CanBeHit == true) {
_global.Sounds.PlayASound("rBump", 1, 80);
Pers.Etat = "GetHit";
Pers.CanBeHit = false;
}
}
}
};
ObjShred.prototype.Attack1 = function () {
with (this) {
if (_parent[Nom].Obj.Etat._currentframe >= FrAttack1) {
if (_parent[Nom].Obj.Etat.missile.hitTest(_parent.Pers) && (Pers.CanBeHit == true)) {
_parent[Nom].Obj.Etat.missile.gotoAndStop("explode");
_parent[Nom].Obj.Etat.stop();
if (Dir == "G") {
Pers.Dir = "D";
} else if (Dir == "D") {
Pers.Dir = "G";
}
Pers.Etat = "GetHit";
Pers.CanBeHit = false;
waitTimeMissile = 0;
Etat = "FinAttack1";
}
var BounceMiss = _parent[Nom].Obj.Etat.missile.getBounds(_parent._parent);
BounceMissX = (BounceMiss.xMax + BounceMiss.xMin) / 2;
BounceMissY = (BounceMiss.yMax + BounceMiss.yMin) / 2;
if (_parent.Collider.Wall.hitTest(BounceMissX, BounceMissY, true)) {
_parent[Nom].Obj.Etat.missile.gotoAndStop("explode");
_parent[Nom].Obj.Etat.stop();
waitTimeMissile = 0;
Etat = "FinAttack1";
}
if (_parent[Nom].Obj.Etat._currentframe >= FrFinAttack1) {
waitTimeMissile = 0;
_parent[Nom].Obj.Etat.missile.gotoAndStop("explode");
_parent[Nom].Obj.Etat.stop();
Etat = "FinAttack1";
}
}
CanBeHit = true;
CheckHeadAttack();
CheckGetHit();
CheckGetFire();
}
};
ObjShred.prototype.FinAttack1 = function () {
with (this) {
waitTimeMissile++;
if (waitTimeMissile >= 10) {
Etat = "Idle";
}
CanBeHit = true;
CheckHeadAttack();
CheckGetHit();
CheckGetFire();
}
};
ObjShred.prototype.FinAttack4 = function () {
with (this) {
waitTimeMissile++;
if (waitTimeMissile == 12) {
_parent[Nom].Obj.Etat.gotoAndPlay(37);
} else if (waitTimeMissile == 21) {
Etat = "PopOut";
}
CanBeHit = true;
CheckHeadAttack();
CheckGetHit();
CheckGetFire();
}
};
ObjShred.prototype.FinAttack3 = function () {
with (this) {
if (_parent[Nom].Obj.Etat._currentframe >= FrFinAttack3) {
Etat = "Idle";
}
CanBeHit = true;
CheckHeadAttack();
CheckGetHit();
CheckGetFire();
}
};
ObjShred.prototype.Die = function () {
with (this) {
Dir = "D";
if (_parent[Nom].Obj.Etat._currentframe == 1) {
_global.Sounds.PlayASound("Dead", 1, 80);
}
if (_parent[Nom].Obj.Etat._currentframe >= FrDie) {
Etat = "Dead";
}
}
};
ObjShred.prototype.Dead = function () {
with (this) {
G_TabShred.splice(ShredI, 1);
ShredI = ShredI - 1;
}
};
ObjShred.prototype.CheckPers = function (CheckDir) {
with (this) {
if (Pers.CanBeHit) {
if (CheckDir == undefined) {
CheckDir = Dir;
}
if ((Pers.PosY >= (PosY - LgAttackUp)) and (Pers.PosY <= (PosY + LgAttackDw))) {
if (((Pers.PosX >= (PosX - LgCheckPersX)) and (Pers.PosX <= PosX)) && (CheckDir == "G")) {
var CheckX = (TrueX - (PosX - Pers.PosX));
while ((CheckX < TrueX) && (!WallSeparate)) {
if (_parent.Collider.Wall.hitTest(CheckX, TrueY, true)) {
WallSeparate = true;
}
CheckX = CheckX + 10;
}
if (!WallSeparate) {
if ((Perso == "Gordon") || ((TrueX > 0) && (TrueX < 500))) {
Etat = "Surpris";
Dir = CheckDir;
}
}
} else if (((Pers.PosX <= (PosX + LgCheckPersX)) and (Pers.PosX >= PosX)) && (CheckDir == "D")) {
var CheckX = (TrueX + (Pers.PosX - PosX));
while ((CheckX > TrueX) && (!WallSeparate)) {
if (_parent.Collider.Wall.hitTest(CheckX, TrueY, true)) {
WallSeparate = true;
}
CheckX = CheckX - 10;
}
if (!WallSeparate) {
if ((Perso == "Gordon") || ((TrueX > 0) && (TrueX < 500))) {
Etat = "Surpris";
Dir = CheckDir;
}
}
}
}
}
}
};
ObjShred.prototype.CheckDistWall = function (CheckDir, CheckXPoint) {
with (this) {
if (CheckDir == undefined) {
CheckDir = Dir;
}
if (CheckXPoint == undefined) {
CheckXPoint = TrueX;
}
TooNearWall = false;
if (CheckDir == "G") {
var CheckX = (CheckXPoint - DistMinWall);
while ((CheckX < CheckXPoint) && (!TooNearWall)) {
if (_parent.Collider.Wall.hitTest(CheckX, TrueY - 5, true)) {
TooNearWall = true;
} else if (_parent.Collider.Turn.hitTest(CheckX, TrueY - 5, true)) {
TooNearWall = true;
}
CheckX = CheckX + 10;
}
} else if (CheckDir == "D") {
var CheckX = (TrueX + DistMinWall);
while ((CheckX > CheckXPoint) && (!TooNearWall)) {
if (_parent.Collider.Wall.hitTest(CheckX, TrueY - 5, true)) {
TooNearWall = true;
} else if (_parent.Collider.Turn.hitTest(CheckX, TrueY - 5, true)) {
TooNearWall = true;
}
CheckX = CheckX - 10;
}
}
}
};
ObjShred.prototype.CheckPersDist = function () {
with (this) {
if (Pers.CanBeHit == true) {
if ((Dir == "G") && (Pers.PosX > PosX)) {
if (Perso != "Waffle") {
Dir = "D";
}
} else if ((Dir == "D") && (Pers.PosX <= PosX)) {
if (Perso != "Waffle") {
Dir = "G";
}
}
if ((Pers.PosY >= (PosY - LgAttackUp)) and (Pers.PosY <= (PosY + LgAttackDw))) {
if ((Pers.PosX >= (PosX - LgCheckPersX)) and (Pers.PosX <= PosX)) {
if ((Pers.PosX >= (PosX - LgCheckFightX)) and (Pers.PosX <= PosX)) {
} else {
Etat = "WalkFight";
}
} else if ((Pers.PosX <= (PosX + LgCheckPersX)) and (Pers.PosX >= PosX)) {
if ((Pers.PosX <= (PosX + LgCheckFightX)) and (Pers.PosX >= PosX)) {
} else {
Etat = "WalkFight";
}
}
}
} else {
Etat = "WalkFight";
}
}
};
ObjShred.prototype.CheckFight = function () {
with (this) {
if (Pers.CanBeHit == true) {
if ((Pers.PosY >= (PosY - LgAttackUp)) and (Pers.PosY <= (PosY + LgAttackDw))) {
if (((Pers.PosX >= (PosX - LgCheckFightX)) and (Pers.PosX <= PosX)) && (Dir == "G")) {
FrSeeingCount = 0;
Etat = "Attack1";
} else if (((Pers.PosX <= (PosX + LgCheckFightX)) and (Pers.PosX >= PosX)) && (Dir == "D")) {
FrSeeingCount = 0;
Etat = "Attack1";
}
}
}
}
};
ObjShred.prototype.CheckJump = function () {
with (this) {
if (Pers.Perso == "MrsX") {
if (Math.ceil(Math.random() * 100) == 1) {
Etat = "StartJump";
}
}
}
};
ObjShred.prototype.CheckGetHit = function () {
with (this) {
if (Pers.CanHit == true) {
if (CanBeHit) {
if ((Pers.HitPointY >= (PosY - GetHitUp)) and (Pers.HitPointY <= (PosY + GetHitDw))) {
if (((Pers.HitPointX <= (PosX + GetHitD)) and (Pers.HitPointX >= (PosX - GetHitG))) and (Pers.Dir eq "D")) {
if (Perso != "Waffle") {
Dir = "G";
}
_global.Sounds.PlayASound("rHead", 1, 50);
Life--;
SpdYNow = SpdYGetHit;
SpdXFall = random(SpdXGetHit) + 5;
Etat = "GetHit";
CanBeHit = false;
} else if (((Pers.HitPointX >= (PosX - GetHitG)) and (Pers.HitPointX <= (PosX + GetHitD))) and (Pers.Dir eq "G")) {
if (Perso != "Waffle") {
Dir = "D";
}
_global.Sounds.PlayASound("rHead", 1, 50);
Life--;
SpdYNow = SpdYGetHit;
SpdXFall = random(SpdXGetHit) + 5;
Etat = "GetHit";
CanBeHit = false;
}
}
}
}
}
};
ObjShred.prototype.CheckGetFire = function () {
with (this) {
var NbMinionBall = G_TabMinionBall.length;
if (NbMinionBall > 0) {
var i = 0;
while (i < NbMinionBall) {
var BallX = _parent.Control[G_TabMinionBall[i]].PosX;
var BallY = _parent.Control[G_TabMinionBall[i]].PosY;
if (((((BallX >= (PosX - GetFireG)) and (BallX <= (PosX + GetFireD))) and (BallY >= (PosY - GetFireUp))) and (BallY <= (PosY + GetFireDw))) && (!Invincible)) {
if (_parent.Control[G_TabMinionBall[i]].HurtMyself == true) {
t = 1;
while (t < 6) {
if (Perso != "Waffle") {
CreerLifeBonus("LifeBonus", PosX, PosY, 50);
} else if (Dir == "D") {
CreerLifeBonus("LifeBonus", PosX + 30, PosY, 50);
} else {
CreerLifeBonus("LifeBonus", PosX - 30, PosY, 50);
}
t++;
}
Etat = "Die";
if (_parent.Control[G_TabMinionBall[i]].Dir == "D") {
Dir = "G";
} else if (_parent.Control[G_TabMinionBall[i]].Dir == "G") {
Dir = "D";
}
_parent.Control[G_TabMinionBall[i]].Etat = "Hit";
}
}
i++;
}
}
}
};
ObjShred.prototype.CheckAttack = function () {
with (this) {
if (Pers.CanBeHit == true) {
if ((Pers.PosY >= (PosY - LgAttackUp)) and (Pers.PosY <= (PosY + LgAttackDw))) {
if (Perso == "Gordon") {
if ((Pers.PosX >= (PosX - LgAttackX)) and (Pers.PosX <= (PosX + LgAttackX))) {
if ((Dir eq "G") and (Pers.PosX > PosX)) {
if (Perso != "Waffle") {
Dir = "D";
}
} else if ((Dir eq "D") and (Pers.PosX <= PosX)) {
if (Perso != "Waffle") {
Dir = "G";
}
}
Etat = "Attack1";
}
} else if (Perso == "Blik") {
if ((Pers.PosX >= (PosX - LgCheckPersX)) and (Pers.PosX <= (PosX + LgCheckPersX))) {
if ((Dir eq "G") and (Pers.PosX > PosX)) {
if (Perso != "Waffle") {
Dir = "D";
}
} else if ((Dir eq "D") and (Pers.PosX <= PosX)) {
if (Perso != "Waffle") {
Dir = "G";
}
}
if (FrBetweenAttack >= FrMoonWalk) {
FrBetweenAttack = 0;
Etat = "Attack3";
} else {
Etat = "MoonWalk";
}
}
} else if ((Dir eq "D") and (Pers.PosX > PosX)) {
if (Math.abs(Pers.PosX - PosX) < 250) {
Etat = "Ready";
}
} else if ((Dir eq "G") and (Pers.PosX < PosX)) {
if (Math.abs(Pers.PosX - PosX) < 250) {
Etat = "Ready";
}
}
}
}
}
};
ObjShred.prototype.CheckTouchCharge = function () {
with (this) {
var CheckX = Pers.FrontX;
if (((Dir == "G") && (Pers.Dir == "G")) || ((Dir == "D") && (Pers.Dir == "D"))) {
CheckX = Pers.BackX;
}
if (_parent[Nom].hitTest(CheckX, Pers.FrontY, true)) {
if (Pers.CanBeHit == true) {
_global.Sounds.PlayASound("rBump", 1, 80);
if (Dir == "G") {
Pers.Dir = "D";
} else if (Dir == "D") {
Pers.Dir = "G";
}
Pers.Etat = "GetHit";
Pers.CanBeHit = false;
Etat = "Idle";
}
}
}
};
ObjShred.prototype.SetMoveX = function () {
with (this) {
MoveX = SpdXBase;
if (Dir eq "G") {
MoveX = MoveX * -1;
}
}
};
ObjShred.prototype.InverseSetMoveX = function () {
with (this) {
MoveX = SpdXBase;
if (Dir eq "D") {
MoveX = MoveX * -1;
}
}
};
ObjShred.prototype.SetMoveXWalkFight = function () {
with (this) {
MoveX = SpdXWalkFight;
if (Dir eq "G") {
MoveX = MoveX * -1;
}
}
};
ObjShred.prototype.SetMoveXCharge = function () {
with (this) {
MoveX = SpdXCharge;
if (Dir eq "G") {
MoveX = MoveX * -1;
}
}
};
ObjShred.prototype.SetMoveXFall = function () {
with (this) {
MoveX = SpdXFall;
if (SpdXFall > 0) {
SpdXFall = SpdXFall * 0.9;
}
if (Dir eq "D") {
MoveX = MoveX * -1;
}
}
};
ObjShred.prototype.CheckWall = function (CheckDir) {
with (this) {
if (MoveX != 0) {
if (CheckDir == "Back") {
var AddPoint = LgBack;
} else if (CheckDir == "Charge") {
var AddPoint = LgCharge;
} else {
var AddPoint = LgFront;
}
if (MoveX > 0) {
var WallStop = WallHitBloc;
var CheckX = (TrueX + AddPoint);
} else {
var WallStop = (-1 * WallHitBloc);
var CheckX = (TrueX - AddPoint);
}
var WallHit1 = (MoveX / 3);
var WallHit2 = (WallHit1 * 2);
if (_parent.Collider.Wall.hitTest(CheckX + WallStop, TrueY, true)) {
if (Etat == "Charge") {
Etat = "StartJump";
} else if (((Etat == "GetHit") || (Etat == "StartJump")) || (Etat == "Fall")) {
MoveX = 0;
WallSeparate = false;
} else if (Etat == "MoonWalk") {
WallSeparate = false;
FrBetweenAttack = FrMoonWalk;
SetMoveX();
MoveShred();
Etat = "Walk";
} else {
MoveX = 0;
WallSeparate = false;
if (Dir eq "G") {
Dir = "D";
} else {
Dir = "G";
}
CheckDistWall();
if ((Math.ceil(Math.random() * 4) == 4) || (TooNearWall)) {
Etat = "Idle";
} else {
Etat = "Walk";
}
}
} else if (_parent.Collider.Wall.hitTest(CheckX + WallHit1, TrueY, true)) {
MoveX = WallHitBloc;
} else if (_parent.Collider.Wall.hitTest(CheckX + WallHit2, TrueY, true)) {
MoveX = WallHit1;
} else if (_parent.Collider.Wall.hitTest(CheckX + MoveX, TrueY, true)) {
MoveX = WallHit2;
}
}
}
};
ObjShred.prototype.CheckTurn = function () {
with (this) {
if (_parent.Collider.Turn.hitTest(TrueX + MoveX, TrueY, true) || (_parent.Collider.Wall.hitTest(TrueX + MoveX, TrueY, true))) {
if (Etat == "MoonWalk") {
FrBetweenAttack = FrMoonWalk;
SetMoveX();
MoveShred();
Etat = "Walk";
} else {
MoveX = 0;
if (Dir eq "G") {
Dir = "D";
} else {
Dir = "G";
}
CheckDistWall();
if ((Math.ceil(Math.random() * 4) == 4) || (TooNearWall)) {
Etat = "Idle";
} else {
Etat = "Walk";
}
}
}
}
};
ObjShred.prototype.CheckSol = function () {
with (this) {
if (_parent.Collider.Sol.hitTest(TrueX, TrueY, true) and (SpdYNow >= 0)) {
SpdYNow = 0;
var InSol = true;
while (InSol == true) {
MoveY = MoveY - SolOut;
InSol = _parent.Collider.Sol.hitTest(TrueX, TrueY + MoveY, true);
}
} else if (SpdYNow >= 0) {
if (HitGrd == true) {
SpdYNow = 0;
MoveY = SpdYNow;
} else {
SpdYNow = SpdYNow + SpdYUp;
if (SpdYNow > SpdYMax) {
SpdYNow = SpdYMax;
}
var SolHit1 = (SpdYNow / 3);
var SolHit2 = (SolHit1 * 2);
if (_parent.Collider.Sol.hitTest(TrueX, TrueY + SolHit1, true)) {
MoveY = SolHitMin;
} else if (_parent.Collider.Sol.hitTest(TrueX, TrueY + SolHit2, true)) {
MoveY = SolHit1;
} else if (_parent.Collider.Sol.hitTest(TrueX, TrueY + SpdYNow, true)) {
MoveY = SolHit2;
} else {
MoveY = SpdYNow;
}
}
} else {
SpdYNow = SpdYNow + SpdYUp;
MoveY = SpdYNow;
}
}
};
ObjShred.prototype.CheckHitGrd = function () {
with (this) {
if (_parent.Collider.Sol.hitTest(TrueX, TrueY + MaxSol, true)) {
HitGrd = true;
} else {
HitGrd = false;
}
}
};
ObjShred.prototype.SetTruePos = function () {
with (this) {
TrueX = PosX + _parent._x;
TrueY = PosY + _parent._y;
}
};
ObjShred.prototype.MoveShred = function () {
with (this) {
_parent[Nom]._x = _parent[Nom]._x + MoveX;
_parent[Nom]._y = _parent[Nom]._y + MoveY;
PosX = _parent[Nom]._x;
PosY = _parent[Nom]._y;
}
};
ObjShred.prototype.CheckActif = function () {
with (this) {
if (((((PosX >= (Bg.InvPosX - LgOutG)) and (PosX <= (Bg.InvPosX + LgOutD))) and (PosY >= (Bg.InvPosY - LgOutUp))) and (PosY <= (Bg.InvPosY + LgOutDw))) and (Etat eq "Sleep")) {
if (Life > 0) {
Etat = "Idle";
CanBeHit = true;
Dir = BaseDir;
} else {
Etat = "Dead";
}
}
}
};
ObjShred.prototype.CheckSleep = function () {
with (this) {
if ((((PosX < (Bg.InvPosX - LgOutG)) or (PosX > (Bg.InvPosX + LgOutD))) or (PosY < (Bg.InvPosY - LgOutUp))) or (PosY > (Bg.InvPosY + LgOutDw))) {
if (Pers.PosX < PosX) {
if (Perso != "Waffle") {
Dir = "G";
}
} else if (Perso != "Waffle") {
Dir = "D";
}
Etat = "Sleep";
}
}
};
ObjShred.prototype.KillShred = function () {
with (this) {
Etat = "Dead";
}
};
ObjShred.prototype.ChangeDir = function (NewDir) {
with (this) {
DirOld = Dir;
Dir = NewDir;
_parent[Nom].gotoAndStop(Perso + NewDir);
_parent[Nom].Obj.gotoAndStop(Etat);
}
};
ObjShred.prototype.ChangeEtat = function (NewAction) {
with (this) {
EtatOld = Etat;
Etat = NewAction;
_parent[Nom].Obj.gotoAndStop(NewAction);
}
};
ObjShred.prototype.Actions = function () {
with (this) {
if (G_Pause == true) {
if (InPause == false) {
InPause = true;
_parent[Nom].Obj.Etat.stop();
}
} else {
if (InPause == true) {
InPause = false;
_parent[Nom].Obj.Etat.play();
}
SetTruePos();
this[Etat]();
}
}
};
CreerDestructObject = function (Nom, PosX, PosY, Kind, nbr) {
if (this[Nom] == null) {
this[Nom] = new ObjDestruct(Nom, PosX, PosY, Kind, nbr);
G_TabDestruct.push(Nom);
}
};
ObjDestruct.prototype.Actions = function () {
with (this) {
if (G_Pause == true) {
if (InPause == false) {
InPause = true;
}
} else {
if (InPause == true) {
InPause = false;
}
this[Etat]();
}
}
};
ObjDestruct.prototype.Idle = function () {
with (this) {
CheckSleep();
CheckHit();
}
};
ObjDestruct.prototype.Normal = function () {
with (this) {
CheckSleep();
CheckWalkOn();
}
};
ObjDestruct.prototype.CheckHit = function () {
with (this) {
if (Pers.CanHit == true) {
if (Kind != "tirroir") {
if ((Pers.HitPointY >= (PosY - GetHitUp)) and (Pers.HitPointY <= (PosY + GetHitDw))) {
if ((Pers.HitPointX <= (PosX + GetHitD)) and (Pers.HitPointX >= (PosX - GetHitG))) {
_global.Sounds.PlayASound("Pot", 1, 80);
Pers.CanHit = false;
Life--;
Etat = "animplaying";
trace((("PosX = " + PosX) + " / ") + PosY);
i = 1;
while (i <= nbr) {
CreerLifeBonus("LifeBonus", PosX, PosY, 50);
i++;
}
if (BombInside) {
_global.Game.CreerMinionBall(PosX, PosY, "none", random(4) + 4, random(3) - 20);
}
}
}
} else if ((Pers.HitPointY >= (PosY - GetHitUpTirroir)) and (Pers.HitPointY <= (PosY + GetHitDwTirroir))) {
if ((Pers.HitPointX <= ((PosX + GetHitDTirroir) + (_parent[Nom]._width / 2))) and (Pers.HitPointX >= ((PosX - GetHitGTirroir) - (_parent[Nom]._width / 2)))) {
_global.Sounds.PlayASound("Tirroir", 1, 100);
Pers.CanHit = false;
Life--;
Etat = "animplaying";
trace((("PosX = " + PosX) + " / ") + PosY);
i = 1;
while (i <= nbr) {
CreerLifeBonus("LifeBonus", PosX, PosY, 50);
i++;
}
if (BombInside) {
_global.Game.CreerMinionBall(PosX, PosY, "none", random(4) + 4, random(3) - 20);
}
}
}
}
}
};
ObjDestruct.prototype.CheckWalkOn = function () {
with (this) {
if ((Pers.PosY >= (PosY - GetStepY)) and (Pers.PosY <= (PosY + GetStepY))) {
if ((Pers.PosX <= (PosX + GetStepX)) and (Pers.PosX >= (PosX - GetStepX))) {
_global.Sounds.PlayASound("Coussin", 1, 80);
Etat = "Jump";
Pers.SpdYNow = Pers.SpdStartJump;
if (Stepped < nbr) {
Stepped++;
if (Stepped <= nbr) {
CreerLifeBonus("LifeBonus", PosX, PosY, 50);
}
if (BombInside) {
BombInside = false;
_global.Game.CreerMinionBall(PosX, PosY, "none", random(4) + 4, random(3) - 10);
}
}
}
}
}
};
ObjDestruct.prototype.Jump = function () {
with (this) {
if (_parent[Nom]._currentframe == FrJump) {
Etat = "Normal";
}
}
};
ObjDestruct.prototype.animplaying = function () {
with (this) {
if (_parent[Nom]._currentframe == FrDead) {
Etat = "Dead";
}
}
};
ObjDestruct.prototype.Dead = function () {
};
ObjDestruct.prototype.ChangeEtat = function (NewAction) {
with (this) {
EtatOld = Etat;
Etat = NewAction;
_parent[Nom].gotoAndStop(NewAction);
}
};
ObjDestruct.prototype.Sleep = function () {
with (this) {
CheckActif();
}
};
ObjDestruct.prototype.CheckActif = function () {
with (this) {
if (((((PosX >= (Bg.InvPosX - LgOutG)) and (PosX <= (Bg.InvPosX + LgOutD))) and (PosY >= (Bg.InvPosY - LgOutUp))) and (PosY <= (Bg.InvPosY + LgOutDw))) and (Etat eq "Sleep")) {
if (Kind == "Coussin") {
Etat = "Normal";
} else if (Life > 0) {
Etat = "Idle";
} else {
Etat = "Dead";
}
}
}
};
ObjDestruct.prototype.CheckSleep = function () {
with (this) {
if ((((PosX < (Bg.InvPosX - LgOutG)) or (PosX > (Bg.InvPosX + LgOutD))) or (PosY < (Bg.InvPosY - LgOutUp))) or (PosY > (Bg.InvPosY + LgOutDw))) {
Etat = "Sleep";
}
}
};
CreerLifeBonus = function (Nom, PosX, PosY, Value, imove) {
if (Nom == "LifeBonus") {
var _local3 = 1;
while (this[Nom + _local3] != null) {
_local3++;
}
Nom = Nom + _local3;
_parent.attachMovie("minXBonus", Nom, _parent.getNextHighestDepth());
}
if (imove == undefined) {
imove = true;
}
if (this[Nom] == null) {
this[Nom] = new ObjLifeBonus(Nom, PosX, PosY, Value, imove);
G_TabLifeBonus.push(Nom);
}
};
ObjLifeBonus.prototype.Sleep = function () {
with (this) {
CheckActif();
}
};
ObjLifeBonus.prototype.Idle = function () {
with (this) {
CheckGet();
CheckSleep();
}
};
ObjLifeBonus.prototype.IdleClose = function () {
with (this) {
CheckSleep();
}
};
ObjLifeBonus.prototype.Move = function () {
with (this) {
_parent[Nom]._x = PosX + SpdX;
_parent[Nom]._y = PosY + SpdY;
PosX = PosX + SpdX;
PosY = PosY + SpdY;
if (Stopped == false) {
SpdY++;
if (SpdY == 0) {
detectNow = true;
}
} else {
Etat = "Idle";
}
SetTruePos();
if (detectNow == true) {
CheckGet();
CheckGround();
}
CheckWall();
CheckOut();
}
};
ObjLifeBonus.prototype.Get = function () {
with (this) {
if (Value == 50) {
FrGet = FrGetScore;
} else {
FrGet = FrGetElse;
}
if (_parent[Nom].Etat._currentframe >= FrGet) {
ChangeEtat("Kill");
Pers.GetLifeBonus(Value);
}
}
};
ObjLifeBonus.prototype.Kill = function () {
with (this) {
for (LifeBonusI in G_TabLifeBonus) {
var LifeBonusActif = G_TabLifeBonus[LifeBonusI];
_parent[Nom].removeMovieClip();
if (LifeBonusActif == Nom) {
delete G_TabLifeBonus[LifeBonusI];
}
}
delete this;
}
};
ObjLifeBonus.prototype.CheckGet = function () {
with (this) {
if ((((Pers.PosY >= (PosY - LgHitUp)) and (Pers.PosY <= (PosY + LgHitDw))) and (Pers.PosX >= (PosX - LgHitX))) and (Pers.PosX <= (PosX + LgHitX))) {
_global.Sounds.PlayASound("Objet", 1, 100);
Etat = "Get";
}
}
};
ObjLifeBonus.prototype.CheckActif = function () {
with (this) {
if ((((PosX >= (Bg.InvPosX - LgOutG)) and (PosX <= (Bg.InvPosX + LgOutD))) and (PosY >= (Bg.InvPosY - LgOutUp))) and (PosY <= (Bg.InvPosY + LgOutDw))) {
if (imove == false) {
if ((Value != 500) || (_global.Game.G_TabShred.length == 0)) {
Etat = "Idle";
} else {
Etat = "IdleClose";
if (_global.ShowLeft._currentframe == 1) {
_global.ShowLeft.gotoAndPlay("opening");
}
}
} else {
Etat = "Move";
}
}
}
};
ObjLifeBonus.prototype.CheckSleep = function () {
with (this) {
if ((((PosX < (Bg.InvPosX - LgOutG)) or (PosX > (Bg.InvPosX + LgOutD))) or (PosY < (Bg.InvPosY - LgOutUp))) or (PosY > (Bg.InvPosY + LgOutDw))) {
Etat = "Sleep";
}
}
};
ObjLifeBonus.prototype.ChangeEtat = function (NewAction) {
with (this) {
EtatOld = Etat;
Etat = NewAction;
_parent[Nom].gotoAndStop(NewAction);
}
};
ObjLifeBonus.prototype.Actions = function () {
with (this) {
if (G_Pause == true) {
if (InPause == false) {
InPause = true;
_parent[Nom].Etat.stop();
}
} else {
if (InPause == true) {
InPause = false;
_parent[Nom].Etat.play();
}
this[Etat]();
}
}
};
ObjLifeBonus.prototype.SetTruePos = function () {
with (this) {
if (SpdX > 0) {
TrueX = (PosX + _parent._x) + Xdetect;
} else {
TrueX = (PosX + _parent._x) - Xdetect;
}
TrueY = PosY + _parent._y;
}
};
ObjLifeBonus.prototype.CheckWall = function () {
with (this) {
if (_parent.Collider.Wall.hitTest(TrueX, TrueY, true) and (!_parent.Collider.Wall.Pass.hitTest(TrueX, TrueY, true))) {
_global.Sounds.PlayASound("Bump", 1, 60);
SpdX = SpdX * -1;
if (Math.abs(SpdX) < 5) {
if (SpdX < 5) {
SpdX = 5;
} else if (Spd > -5) {
SpdX = -5;
}
}
}
}
};
ObjLifeBonus.prototype.CheckGround = function () {
with (this) {
if (_parent.Collider.Sol.hitTest(TrueX, TrueY, true)) {
if (SpdY > 2) {
if (SpdY >= 5) {
_global.Sounds.PlayASound("Bump", 1, 60);
}
bondi = true;
SpdY = Math.round(SpdY * -0.5);
} else if ((SpdY < 2) && (SpdY > 0)) {
if (bondi == true) {
Stopped = true;
SpdY = 0;
} else {
SpdY = random(3) - 15;
}
}
}
}
};
this.G_Pause = true;
this.G_PauseOut = false;
this.G_PRealese = true;
this.G_Resume = false;
this.G_TabShred = new Array();
this.G_TabBox = new Array();
this.G_TabGun = new Array();
this.G_TabSwitch = new Array();
this.G_TabDoor = new Array();
this.G_TabHeroChanger = new Array();
this.G_TabElevator = new Array();
this.G_TabPersBall = new Array();
this.G_TabMinionBall = new Array();
this.G_TabLifeBonus = new Array();
this.G_TabCam = new Array();
this.G_TabLevier = new Array();
this.G_TabTV = new Array();
this.G_TabDestruct = new Array();
this.G_NextPersBall = 1;
this.G_NextPersBallDepth = 10;
this.G_NextMinionBall = 1;
this.G_NextMinionBallDepth = 20;
}
onClipEvent (enterFrame) {
ShredI = 0;
for (ShredI in G_TabShred) {
var ShredActif = G_TabShred[ShredI];
if (this[ShredActif].Dir != this[ShredActif].DirOld) {
this[ShredActif].ChangeDir(this[ShredActif].Dir);
}
if (this[ShredActif].Etat != this[ShredActif].EtatOld) {
this[ShredActif].ChangeEtat(this[ShredActif].Etat);
}
this[ShredActif].Actions();
}
MinionBallI = 0;
for (MinionBallI in G_TabMinionBall) {
var MinionBallActif = G_TabMinionBall[MinionBallI];
if (this[MinionBallActif].Etat != this[MinionBallActif].EtatOld) {
this[MinionBallActif].ChangeEtat(this[MinionBallActif].Etat);
}
this[MinionBallActif].Actions();
}
LifeBonusI = 0;
for (LifeBonusI in G_TabLifeBonus) {
var LifeBonusActif = G_TabLifeBonus[LifeBonusI];
if (this[LifeBonusActif].Etat != this[LifeBonusActif].EtatOld) {
this[LifeBonusActif].ChangeEtat(this[LifeBonusActif].Etat);
}
this[LifeBonusActif].Actions();
}
ObjDstr = 0;
for (ObjDstr in G_TabDestruct) {
var DstrActif = G_TabDestruct[ObjDstr];
if (this[DstrActif].Etat != this[DstrActif].EtatOld) {
this[DstrActif].ChangeEtat(this[DstrActif].Etat);
}
this[DstrActif].Actions();
}
if (Pers.Dir != Pers.DirOld) {
Pers.ChangeDir(Pers.Dir);
}
if (Pers.Etat != Pers.EtatOld) {
Pers.ChangeEtat(Pers.Etat);
}
this.Pers.Actions();
this.Bg.Actions();
if (G_Pause == false) {
G_CurrentFocus = Selection.getFocus();
if (G_CurrentFocus == null) {
G_PauseOut = true;
}
}
G_CheckPause();
}
Symbol 782 MovieClip Frame 2
stop();
Instance of Symbol 746 MovieClip in Symbol 782 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerBg(_parent._x, _parent._y);
BG = _parent.Control.Bg;
BG.MaxDw1 = -280;
BG.MaxUp1 = -380;
BG.MaxG1 = -11400;
BG.MaxD1 = -220;
BG.MaxDw2 = 13000;
BG.MaxUp2 = -125000;
BG.MaxG2 = -162000;
BG.MaxD2 = 112500 /* 0x01B774 */;
BG.CheckScreen = function () {
with (this) {
if (CurrentScreen == 1) {
if (_global.Game.Pers.PosX > 1300000) {
MaxDw = MaxDw2;
MaxUp = MaxUp2;
MaxG = MaxG2;
MaxD = MaxD2;
CurrentScreen = 2;
} else {
MaxDw = MaxDw1;
MaxUp = MaxUp1;
MaxG = MaxG1;
MaxD = MaxD1;
}
} else if (CurrentScreen == 2) {
if (((_global.Game.Pers.PosX < 1250) && (_global.Game.Pers.PosY < 1050)) && (_global.Game.Pers.PosY > 900)) {
MaxDw = MaxDw1;
MaxUp = MaxUp1;
MaxG = MaxG1;
MaxD = MaxD1;
CurrentScreen = 1;
} else {
MaxDw = MaxDw2;
MaxUp = MaxUp2;
MaxG = MaxG2;
MaxD = MaxD2;
}
}
}
};
}
Instance of Symbol 374 MovieClip [minXBonus] "LifeBonus19" in Symbol 782 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerLifeBonus(this._name, this._x, this._y, 50, false);
}
Instance of Symbol 374 MovieClip [minXBonus] "LifeBonus20" in Symbol 782 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerLifeBonus(this._name, this._x, this._y, 50, false);
}
Instance of Symbol 374 MovieClip [minXBonus] "LifeBonus10" in Symbol 782 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerLifeBonus(this._name, this._x, this._y, 50, false);
}
Instance of Symbol 374 MovieClip [minXBonus] "LifeBonus11" in Symbol 782 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerLifeBonus(this._name, this._x, this._y, 50, false);
}
Instance of Symbol 374 MovieClip [minXBonus] "LifeBonus12" in Symbol 782 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerLifeBonus(this._name, this._x, this._y, 50, false);
}
Instance of Symbol 374 MovieClip [minXBonus] "LifeBonus13" in Symbol 782 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerLifeBonus(this._name, this._x, this._y, 50, false);
}
Instance of Symbol 374 MovieClip [minXBonus] "LifeBonus14" in Symbol 782 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerLifeBonus(this._name, this._x, this._y, 50, false);
}
Instance of Symbol 374 MovieClip [minXBonus] "LifeBonus15" in Symbol 782 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerLifeBonus(this._name, this._x, this._y, 50, false);
}
Instance of Symbol 374 MovieClip [minXBonus] "LifeBonus16" in Symbol 782 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerLifeBonus(this._name, this._x, this._y, 50, false);
}
Instance of Symbol 374 MovieClip [minXBonus] "LifeBonus17" in Symbol 782 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerLifeBonus(this._name, this._x, this._y, 50, false);
}
Instance of Symbol 374 MovieClip [minXBonus] "LifeBonus18" in Symbol 782 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerLifeBonus(this._name, this._x, this._y, 50, false);
}
Instance of Symbol 374 MovieClip [minXBonus] "LifeBonus21" in Symbol 782 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerLifeBonus(this._name, this._x, this._y, 50, false);
}
Instance of Symbol 478 MovieClip "Minion13" in Symbol 782 MovieClip Frame 2
onClipEvent (load) {
var Dir = "G";
var Type = "Waffle";
_parent.Control.CreerShred(this._name, this._x, this._y, Dir, Type);
this.gotoAndStop(Dir);
this.Obj.gotoAndStop("Sleep");
}
Instance of Symbol 754 MovieClip "Collider" in Symbol 782 MovieClip Frame 2
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 478 MovieClip "Minion17" in Symbol 782 MovieClip Frame 2
onClipEvent (load) {
var Dir = "D";
var Type = "Waffle";
_parent.Control.CreerShred(this._name, this._x, this._y, Dir, Type);
this.gotoAndStop(Dir);
this.Obj.gotoAndStop("Sleep");
}
Instance of Symbol 533 MovieClip "destruct2" in Symbol 782 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerDestructObject(this._name, this._x, this._y, "pot");
this.gotoAndStop("Sleep");
}
Instance of Symbol 528 MovieClip "destruct3" in Symbol 782 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerDestructObject(this._name, this._x, this._y, "pot", 2);
this.gotoAndStop("Sleep");
}
Instance of Symbol 560 MovieClip "destruct22" in Symbol 782 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerDestructObject(this._name, this._x, this._y, "Coussin");
this.gotoAndStop("Sleep");
}
Instance of Symbol 560 MovieClip "destruct23" in Symbol 782 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerDestructObject(this._name, this._x, this._y, "Coussin");
this.gotoAndStop("Sleep");
}
Instance of Symbol 541 MovieClip "destruct15" in Symbol 782 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerDestructObject(this._name, this._x, this._y, "tirroir");
this.gotoAndStop("Sleep");
}
Instance of Symbol 768 MovieClip "LifeBonus22" in Symbol 782 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerLifeBonus(this._name, this._x, this._y, 500, false);
}
Instance of Symbol 560 MovieClip "destruct33" in Symbol 782 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerDestructObject(this._name, this._x, this._y, "Coussin");
this.gotoAndStop("Sleep");
}
Instance of Symbol 560 MovieClip "destruct24" in Symbol 782 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerDestructObject(this._name, this._x, this._y, "Coussin");
this.gotoAndStop("Sleep");
}
Instance of Symbol 528 MovieClip "destruct25" in Symbol 782 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerDestructObject(this._name, this._x, this._y, "pot", 2);
this.gotoAndStop("Sleep");
}
Instance of Symbol 533 MovieClip "destruct20" in Symbol 782 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerDestructObject(this._name, this._x, this._y, "pot");
this.gotoAndStop("Sleep");
}
Instance of Symbol 528 MovieClip "destruct21" in Symbol 782 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerDestructObject(this._name, this._x, this._y, "pot");
this.gotoAndStop("Sleep");
}
Instance of Symbol 537 MovieClip "destruct19" in Symbol 782 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerDestructObject(this._name, this._x, this._y, "tirroir");
this.gotoAndStop("Sleep");
}
Instance of Symbol 522 MovieClip "destruct16" in Symbol 782 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerDestructObject(this._name, this._x, this._y, "tirroir");
this.gotoAndStop("Sleep");
}
Instance of Symbol 522 MovieClip "destruct17" in Symbol 782 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerDestructObject(this._name, this._x, this._y, "tirroir");
this.gotoAndStop("Sleep");
}
Instance of Symbol 522 MovieClip "destruct18" in Symbol 782 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerDestructObject(this._name, this._x, this._y, "tirroir");
this.gotoAndStop("Sleep");
}
Instance of Symbol 374 MovieClip [minXBonus] "LifeBonus1" in Symbol 782 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerLifeBonus(this._name, this._x, this._y, 50, false);
}
Instance of Symbol 374 MovieClip [minXBonus] "LifeBonus2" in Symbol 782 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerLifeBonus(this._name, this._x, this._y, 50, false);
}
Instance of Symbol 374 MovieClip [minXBonus] "LifeBonus3" in Symbol 782 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerLifeBonus(this._name, this._x, this._y, 50, false);
}
Instance of Symbol 374 MovieClip [minXBonus] "LifeBonus5" in Symbol 782 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerLifeBonus(this._name, this._x, this._y, 50, false);
}
Instance of Symbol 374 MovieClip [minXBonus] "LifeBonus6" in Symbol 782 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerLifeBonus(this._name, this._x, this._y, 50, false);
}
Instance of Symbol 374 MovieClip [minXBonus] "LifeBonus4" in Symbol 782 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerLifeBonus(this._name, this._x, this._y, 50, false);
}
Instance of Symbol 549 MovieClip "LifeBonus112" in Symbol 782 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerLifeBonus(this._name, this._x, this._y, 0, false);
}
Instance of Symbol 775 MovieClip "destruct1" in Symbol 782 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerDestructObject(this._name, this._x, this._y, "tirroir", 2);
this.gotoAndStop("Sleep");
}
Instance of Symbol 478 MovieClip "Minion11" in Symbol 782 MovieClip Frame 2
onClipEvent (load) {
var Dir = "D";
var Type = "Waffle";
_parent.Control.CreerShred(this._name, this._x, this._y, Dir, Type);
this.gotoAndStop(Dir);
this.Obj.gotoAndStop("Sleep");
}
Instance of Symbol 533 MovieClip "destruct4" in Symbol 782 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerDestructObject(this._name, this._x, this._y, "pot");
this.gotoAndStop("Sleep");
}
Instance of Symbol 522 MovieClip "destruct5" in Symbol 782 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerDestructObject(this._name, this._x, this._y, "tirroir");
this.gotoAndStop("Sleep");
}
Instance of Symbol 522 MovieClip "destruct6" in Symbol 782 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerDestructObject(this._name, this._x, this._y, "tirroir", 2);
this.gotoAndStop("Sleep");
}
Instance of Symbol 522 MovieClip "destruct7" in Symbol 782 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerDestructObject(this._name, this._x, this._y, "tirroir");
this.gotoAndStop("Sleep");
}
Instance of Symbol 775 MovieClip "destruct8" in Symbol 782 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerDestructObject(this._name, this._x, this._y, "tirroir");
this.gotoAndStop("Sleep");
}
Instance of Symbol 533 MovieClip "destruct9" in Symbol 782 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerDestructObject(this._name, this._x, this._y, "pot");
this.gotoAndStop("Sleep");
}
Instance of Symbol 522 MovieClip "destruct10" in Symbol 782 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerDestructObject(this._name, this._x, this._y, "tirroir");
this.gotoAndStop("Sleep");
}
Instance of Symbol 522 MovieClip "destruct11" in Symbol 782 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerDestructObject(this._name, this._x, this._y, "tirroir");
this.gotoAndStop("Sleep");
}
Instance of Symbol 522 MovieClip "destruct12" in Symbol 782 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerDestructObject(this._name, this._x, this._y, "tirroir", 2);
this.gotoAndStop("Sleep");
}
Instance of Symbol 533 MovieClip "destruct13" in Symbol 782 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerDestructObject(this._name, this._x, this._y, "pot");
this.gotoAndStop("Sleep");
}
Instance of Symbol 528 MovieClip "destruct14" in Symbol 782 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerDestructObject(this._name, this._x, this._y, "pot");
this.gotoAndStop("Sleep");
}
Instance of Symbol 528 MovieClip "destruct22" in Symbol 782 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerDestructObject(this._name, this._x, this._y, "pot");
this.gotoAndStop("Sleep");
}
Instance of Symbol 528 MovieClip "destruct24" in Symbol 782 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerDestructObject(this._name, this._x, this._y, "pot");
this.gotoAndStop("Sleep");
}
Instance of Symbol 533 MovieClip "destruct23" in Symbol 782 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerDestructObject(this._name, this._x, this._y, "pot", 3);
this.gotoAndStop("Sleep");
}
Instance of Symbol 374 MovieClip [minXBonus] "LifeBonus7" in Symbol 782 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerLifeBonus(this._name, this._x, this._y, 50, false);
}
Instance of Symbol 374 MovieClip [minXBonus] "LifeBonus8" in Symbol 782 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerLifeBonus(this._name, this._x, this._y, 50, false);
}
Instance of Symbol 374 MovieClip [minXBonus] "LifeBonus9" in Symbol 782 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerLifeBonus(this._name, this._x, this._y, 50, false);
}
Instance of Symbol 549 MovieClip "LifeBonus111" in Symbol 782 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerLifeBonus(this._name, this._x, this._y, 0, false);
}
Instance of Symbol 478 MovieClip "Minion21" in Symbol 782 MovieClip Frame 2
onClipEvent (load) {
var Dir = "G";
var Type = "Gordon";
_parent.Control.CreerShred(this._name, this._x, this._y, Dir, Type);
this.gotoAndStop(Dir);
this.Obj.gotoAndStop("Sleep");
}
Instance of Symbol 478 MovieClip "Minion14" in Symbol 782 MovieClip Frame 2
onClipEvent (load) {
var Dir = "G";
var Type = "Blik";
_parent.Control.CreerShred(this._name, this._x, this._y, Dir, Type);
this.gotoAndStop(Dir);
this.Obj.gotoAndStop("Sleep");
}
Instance of Symbol 478 MovieClip "Minion15" in Symbol 782 MovieClip Frame 2
onClipEvent (load) {
var Dir = "G";
var Type = "Gordon";
_parent.Control.CreerShred(this._name, this._x, this._y, Dir, Type);
this.gotoAndStop(Dir);
this.Obj.gotoAndStop("Sleep");
}
Instance of Symbol 478 MovieClip "Minion16" in Symbol 782 MovieClip Frame 2
onClipEvent (load) {
var Dir = "G";
var Type = "Blik";
_parent.Control.CreerShred(this._name, this._x, this._y, Dir, Type);
this.gotoAndStop(Dir);
this.Obj.gotoAndStop("Sleep");
}
Instance of Symbol 478 MovieClip "Minion18" in Symbol 782 MovieClip Frame 2
onClipEvent (load) {
var Dir = "G";
var Type = "Gordon";
_parent.Control.CreerShred(this._name, this._x, this._y, Dir, Type);
this.gotoAndStop(Dir);
this.Obj.gotoAndStop("Sleep");
}
Instance of Symbol 478 MovieClip "Minion20" in Symbol 782 MovieClip Frame 2
onClipEvent (load) {
var Dir = "G";
var Type = "Gordon";
_parent.Control.CreerShred(this._name, this._x, this._y, Dir, Type);
this.gotoAndStop(Dir);
this.Obj.gotoAndStop("Sleep");
}
Instance of Symbol 478 MovieClip "Minion19" in Symbol 782 MovieClip Frame 2
onClipEvent (load) {
var Dir = "G";
var Type = "Blik";
_parent.Control.CreerShred(this._name, this._x, this._y, Dir, Type);
this.gotoAndStop(Dir);
this.Obj.gotoAndStop("Sleep");
}
Instance of Symbol 478 MovieClip "Minion22" in Symbol 782 MovieClip Frame 2
onClipEvent (load) {
var Dir = "G";
var Type = "Blik";
_parent.Control.CreerShred(this._name, this._x, this._y, Dir, Type);
this.gotoAndStop(Dir);
this.Obj.gotoAndStop("Sleep");
}
Instance of Symbol 478 MovieClip "Minion12" in Symbol 782 MovieClip Frame 2
onClipEvent (load) {
var Dir = "G";
var Type = "Gordon";
_parent.Control.CreerShred(this._name, this._x, this._y, Dir, Type);
this.gotoAndStop(Dir);
this.Obj.gotoAndStop("Sleep");
}
Instance of Symbol 674 MovieClip "Pers" in Symbol 782 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerPers(this._x, this._y, "Waffle");
this.gotoAndStop("D");
Etat = "Die";
}
Symbol 808 MovieClip Frame 11
stop();
Symbol 809 MovieClip Frame 1
stop();
Symbol 818 MovieClip Frame 1
stop();
Symbol 818 MovieClip Frame 2
play();
Symbol 818 MovieClip Frame 21
stop();
Symbol 818 MovieClip Frame 22
stop();
Symbol 827 MovieClip Frame 1
stop();
Symbol 827 MovieClip Frame 2
play();
Symbol 827 MovieClip Frame 22
stop();
Symbol 827 MovieClip Frame 23
stop();
Symbol 832 MovieClip Frame 1
stop();
Symbol 832 MovieClip Frame 2
play();
Symbol 832 MovieClip Frame 22
stop();
Symbol 832 MovieClip Frame 23
stop();
Instance of Symbol 322 MovieClip "Control" in Symbol 836 MovieClip Frame 1
onClipEvent (load) {
function ObjPers(PosX, PosY, Perso) {
this.Nom = "Pers";
this.Etat = "Idle";
this.EtatOld = "Idle";
this.Dir = "D";
this.DirOld = "D";
this.Point = _global.C.TotalScore;
this.Life = _global.C.Life;
this.SpdXMinion = 3;
this.SpdXNormal = 9;
this.SpdXBase = 0;
this.SpdXNow = 0;
this.MoveX = 0;
this.MoveY = 0;
this.PosX = PosX;
this.PosY = PosY;
this.TrueX = PosX;
this.TrueY = PosY;
this.FrontX = 0;
this.FrontY = 0;
this.BottomFrontX = 0;
this.BottomBackX = 0;
this.BackX = 0;
this.HitGrdPoint = 0;
this.WallHitBloc = 2;
this.SpdYNow = 0;
this.SpdYUp = 1;
this.SpdYMax = 20;
this.SpdYFall = 0.1;
this.SpdXHitBase = 25;
this.SpdYHitBase = -6;
this.SpdStartJump = -16;
this.SolOut = 2;
this.SolHitMin = 5;
this.MaxSol = 3;
this.HitGrd = false;
this.SolForJump = 6;
this.DistYFall = 0;
this.DistYLand = 30;
this.CanHit = false;
this.CanBeHit = true;
this.FrWalkNow = 1;
this.InPause = false;
this.FrJump = 1;
this.FrFall = 14;
this.FrLand = 10;
this.FrGetHit = 10;
this.FrGetHitCount = 0;
this.FrBoomTir = 9;
this.FrFinBoom = 6;
this.FrDead = 140;
this.FrDeadCount = 0;
this.Perso = Perso;
this.updatePerso();
this.LgGetShootX = 20;
this.LgGetShootUp = 72;
this.LgGetShootUpBas = 44;
this.FrInvincibleCount = 0;
this.FrInvincible = 60;
this.Invincible = false;
this.frKick1 = 2;
this.frFinKick1 = 7;
this.frKick2 = 2;
this.frFinKick2 = 7;
this.frFinKick3 = 7;
this.HitPointX = 0;
this.HitPointY = 0;
this.KickInAir = 3;
this.frEasterEgg = 337;
}
function ModifSpeed(initSpeed, way, inAir, Dir) {
if (way == "acc") {
if (Dir == "D") {
if (inAir) {
initSpeed = initSpeed + 0.4;
} else {
initSpeed = initSpeed + 1.2;
}
if (initSpeed > 9) {
initSpeed = 9;
}
} else {
if (inAir) {
initSpeed = initSpeed - 0.4;
} else {
initSpeed = initSpeed - 1.2;
}
if (initSpeed < -9) {
initSpeed = -9;
}
}
} else if (way == "dec") {
if (initSpeed < 0) {
if (inAir) {
initSpeed = initSpeed + 0.4;
} else {
initSpeed = initSpeed + 1.2;
}
if (initSpeed > 0) {
initSpeed = 0;
}
} else {
if (inAir) {
initSpeed = initSpeed - 0.4;
} else {
initSpeed = initSpeed - 1.2;
}
if (initSpeed < 0) {
initSpeed = 0;
}
}
}
return(initSpeed);
}
function ObjPersBall(Nom, PosX, PosY, Dir, HitBullet, Speed, Tab, HitSound) {
this.Nom = Nom;
this.HitSound = HitSound;
this.Tab = Tab;
this.HurtMyself = false;
this.Dangerous = true;
this.Etat = "Move";
this.EtatOld = "Idle";
this.Dir = Dir;
this.OldDir = "D";
this.PosX = PosX;
this.PosY = PosY;
this.TrueX = PosX;
this.TrueY = PosY;
this.LgOutG = 500;
this.LgOutD = 750;
this.LgOutUp = 1000;
this.LgOutDw = 380;
this.passTime = 0;
this.Stopped = false;
this.CanBeKill = false;
if (Dir eq "D") {
this.SpdX = ForceX;
} else {
this.SpdX = -1 * ForceX;
}
this.Bouncing = Bouncing;
if (Bouncing == "vertic") {
this.Dangerous = false;
}
this.detectNow = false;
this.SpdY = ForceY;
this.InPause = false;
this.FrHit = HitBullet;
this.FrHide = 1;
}
function ObjBg(PosX, PosY) {
this.Nom = "Bg";
this.PosX = PosX;
this.PosY = PosY;
this.MoveX = 0;
this.MoveY = 0;
this.MaxDw = 0;
this.MaxUp = 0;
this.MaxG = 0;
this.MaxD = 0;
this.InvPosX = PosX * -1;
this.InvPosY = PosY * -1;
this.DeadX = PosX;
this.DeadY = PosY;
this.CurrentScreen = 1;
this.OldScreen = 0;
this.MaxYDie = 5000;
this.CenterX = 250;
this.CenterY = 185;
this.SpdXD = 15;
this.SpdXG = -15;
this.SpdYDw = 20;
this.SpdYUp = -20;
this.InPause = false;
}
function ObjShred(Nom, PosX, PosY, Dir, Perso) {
this.Nom = Nom;
this.PosX = PosX;
this.PosY = PosY;
this.TrueX = PosX;
this.TrueY = PosY;
this.Etat = "Sleep";
this.EtatOld = "Idle";
this.Dir = Dir;
this.OldDir = Dir;
this.BaseDir = Dir;
this.LgOutG = 200;
this.LgOutD = 800;
this.LgOutUp = 10;
this.LgOutDw = 475;
this.GetHitG = 50;
this.GetHitD = 50;
this.GetHitUp = 115;
this.GetHitDw = 0;
this.GetFireG = 26;
this.GetFireD = 26;
this.GetFireUp = 100;
this.GetFireDw = 0;
this.LgAttackX = 165;
this.LgAttackUp = 60;
this.LgAttackDw = 440;
this.LgCheckPersX = 200;
this.LgCheckFightX = 180;
this.LgHitX = 60;
this.LgHitUp = 35;
this.LgHitDw = 60;
this.LgFront = 35;
this.LgHitBox = 42;
this.LgCharge = 65;
this.LgBack = 35;
this.AssPointX = 12;
this.AssPointY = 35;
this.FrGetHit = 15;
this.FrGetHitCount = 0;
this.FrSeeingMaxTime = 35;
this.FrSeeingCount = 35;
this.FrIdleCheckMin = 36;
this.FrIdleCheckMax = 60;
this.FrIdleCheckLast = 35;
this.FrSurpris = 21;
this.FrLand = 8;
this.FrDie = 25;
this.FrIdle = 131;
this.FrReady = 20;
this.FrPopOut = 29;
this.FrAttack1 = 15;
this.FrAttack2 = 15;
this.FrAttack3 = 23;
this.FrAttack4 = 8;
this.FrFinAttack1 = 33;
this.FrFinAttack2 = 34;
this.FrFinAttack3 = 57;
this.FrFinAttack4 = 36;
this.FrMoonWalk = 30;
this.BombPlace = false;
this.frGetGlue = 21;
this.frIdleGlue = 131;
this.frDeGlue = 21;
this.frGetFart = 57;
this.frIdleFart = 131;
this.frDeFart = 59;
this.FartCycle = 0;
this.FartCycleMax = 4;
this.FrShoot = 12;
this.FrShootFin = 55;
this.ShootMax = 1;
this.ShootCount = 0;
this.FrStartPush = 4;
this.FrFinPush = 4;
this.PushedBox = 0;
this.FrSeparateWallCount = 0;
this.FrSeparateWallCheck = 15;
this.FrBetweenAttack = this.FrMoonWalk;
this.waitTimeMissile = 0;
this.Life = 3;
this.SpdXBase = 3;
this.SpdXWalkFight = 6;
this.SpdXCharge = 10;
this.SpdXGetHit = 12;
this.SpdYGetHit = -15;
this.SpdXStepBack = 15;
this.SpdYStepBack = -10;
this.WallSeparate = false;
this.SpdXFall = 0;
this.MoveX = 0;
this.MoveY = 0;
this.WallHitBloc = 2;
this.SolOut = 2;
this.SolHitMin = 3;
this.MaxSol = 2;
this.HitGrd = false;
this.SpdYMax = 20;
this.SpdYNow = 0;
this.SpdYUp = 2;
this.CanBeHit = true;
this.InPause = false;
this.Perso = Perso;
this.TooNearWall = false;
this.DistMinWall = 100;
}
function ObjDestruct(Nom, PosX, PosY, Kind, nbr) {
this.Nom = Nom;
if (nbr == undefined) {
nbr = random(3) + 1;
}
if (random(10) < 5) {
this.BombInside = true;
} else {
this.BombInside = false;
}
this.nbr = nbr;
this.PosX = PosX;
this.PosY = PosY;
this.Etat = "Sleep";
this.EtatOld = "Idle";
this.LgOutG = 200;
this.LgOutD = 800;
this.LgOutUp = 10;
this.LgOutDw = 475;
this.GetHitG = 50;
this.GetHitD = 50;
this.GetHitUp = 50;
this.GetHitDw = 50;
this.GetHitGTirroir = 40;
this.GetHitDTirroir = 40;
this.GetHitUpTirroir = 50;
this.GetHitDwTirroir = 100;
this.GetStepY = 12;
this.GetStepX = 60;
this.Stepped = 0;
this.FrDead = 21;
this.FrJump = 12;
this.Life = 1;
this.Kind = Kind;
}
function ObjLifeBonus(Nom, PosX, PosY, Value, imove) {
this.Nom = Nom;
this.imove = imove;
this.passTime = 0;
this.detectNow = false;
this.Stopped = false;
this.bondi = false;
ForceX = random(4) + 4;
ForceY = random(3) - 19;
if (random(100) < 50) {
this.SpdX = ForceX;
} else {
this.SpdX = -1 * ForceX;
}
this.SpdY = ForceY;
this.PosX = PosX;
this.PosY = PosY;
_parent[Nom]._x = PosX;
_parent[Nom]._y = PosY;
this.Etat = "Sleep";
this.EtatOld = "Idle";
this.LgOutG = 75;
this.LgOutD = 600;
this.LgOutUp = 300;
this.LgOutDw = 800;
this.LgHitX = 26;
this.LgHitUp = 45;
this.LgHitDw = 70;
this.InPause = false;
this.FrGetElse = 10;
this.FrGetScore = 35;
this.Value = Value;
this.Xdetect = 15;
}
_global.Game = this;
this.KeyListener = new Object();
this.KeyListener.Up = false;
this.KeyListener.UpRelease = true;
this.KeyListener.Dw = false;
this.KeyListener.L = false;
this.KeyListener.R = false;
this.KeyListener.S = false;
this.KeyListener.Z = false;
this.KeyListener.Sp = false;
this.KeyListener.P = false;
this.KeyListener.Sprelease = true;
this.KeyListener.Srelease = true;
this.KeyListener.onKeyUp = function () {
switch (Key.getCode()) {
case 38 :
this.UpRelease = true;
this.Up = false;
break;
case 40 :
this.Dw = false;
break;
case 37 :
this.L = false;
break;
case 39 :
this.R = false;
break;
case 32 :
this.Sprelease = true;
this.Sp = false;
break;
case 83 :
this.Srelease = true;
this.S = false;
}
};
this.KeyListener.onKeyDown = function () {
switch (Key.getCode()) {
case 38 :
this.Up = true;
break;
case 40 :
this.Dw = true;
break;
case 37 :
this.L = true;
break;
case 39 :
this.R = true;
break;
case 32 :
if (this.Sprelease) {
this.Sp = true;
this.Sprelease = false;
}
break;
case 83 :
if (!this.Srelease) {
break;
}
this.S = true;
this.Srelease = false;
}
};
Key.addListener(this.KeyListener);
Selection.setFocus(_parent._parent.FocusBtn);
G_CurrentFocus = Selection.getFocus();
G_CheckPause = function () {
if ((Pers.Etat != "Die") and (Pers.Etat != "Dead")) {
if (G_PauseOut && (!G_Pause)) {
G_Pause = true;
_parent.ControlBall.stop();
_parent._parent.Popup.gotoAndStop("Pause");
if (_global.C.SoundActive) {
_global.SoundCTRL.muteAllSounds();
}
_global.C.DesactivateHud();
} else if ((G_Resume == true) and (G_Pause == true)) {
G_PauseOut = false;
Selection.setFocus(_parent._parent.FocusBtn);
G_CurrentFocus = Selection.getFocus();
KeyListener.Up = false;
KeyListener.UpRelease = true;
KeyListener.Dw = false;
KeyListener.L = false;
KeyListener.R = false;
KeyListener.X = false;
KeyListener.Z = false;
KeyListener.Sp = false;
Music.VolDest = 70;
Music.Etat = "FadeIn";
G_Pause = false;
G_Resume = false;
_parent._parent.Popup.gotoAndStop(1);
if (_global.C.SoundActive) {
_global.SoundCTRL.unmuteAllSounds();
}
_global.C.ActivateHud();
if (_parent.ControlBall._currentframe != 1) {
_parent.ControlBall.play();
}
}
}
};
CreerPers = function (PosX, PosY, Perso) {
this.Pers = new ObjPers(PosX, PosY, Perso);
_parent._parent.Hud.LifeBar.gotoAndStop(Pers.Life + 1);
_parent._parent.Hud.LifeBar.gotoAndStop(Pers.Life + 1);
_parent._parent.Hud.BonusPoints.text = Pers.Point;
_parent._parent.Hud.BonusPointsShadow.text = Pers.Point;
};
ObjPers.prototype.Idle = function () {
with (this) {
KeepDeadPos = true;
if (Life > 0) {
SetSpdX();
SetMoveX();
CheckWall(FrontX, FrontY);
CheckHitGrd();
CheckPenche();
CheckSol();
CheckFall();
MovePers();
CheckJump();
this["CheckAction" + Perso]();
CheckGetFire();
CheckDie();
checkEaster();
} else {
SetSpdX();
SetMoveX();
CheckWall(FrontX, FrontY);
CheckHitGrd();
CheckSol();
CheckFall();
MovePers();
CheckDie();
}
}
};
ObjPers.prototype.EasterEgg = function () {
with (this) {
if (_parent.Pers.Obj.Etat._currentframe >= frEasterEgg) {
Etat = "Idle";
}
}
};
ObjPers.prototype.GetLifeBonus = function (AddPoints) {
with (this) {
newTotalPoint = Point + AddPoints;
Point = newTotalPoint;
_parent._parent.Hud.BonusPoints.text = Point;
_parent._parent.Hud.BonusPointsShadow.text = Point;
if (AddPoints == 0) {
trace("Life = " + Life);
Life = Life + 3;
if (Life > 10) {
Life = 10;
}
trace("Life = " + Life);
_parent._parent.Hud.LifeBar.gotoAndStop(Life + 1);
} else if (AddPoints == 500) {
_global.C.endLevel(Point, Life);
} else {
_global.C.gear++;
}
}
};
ObjPers.prototype.Walk = function () {
with (this) {
SetSpdX();
SetMoveX();
CheckWall(FrontX, FrontY);
CheckHitGrd();
CheckAttack();
if (Perso == "TuesdayDisguised") {
CheckActionTuesdayDisguised();
}
CheckPenche();
CheckJump();
CheckSol();
CheckFall();
MovePers();
CheckGetFire();
CheckDie();
}
};
ObjPers.prototype.Jump = function () {
with (this) {
SetSpdXJump();
SetMoveX();
CheckWall(FrontX, FrontY);
CheckWall(BottomFrontX, TrueY);
CheckWall(FrontX, TopY);
CheckHitGrd();
CheckSol();
CheckCeil();
CheckGetFire();
this["CheckAction" + Perso]();
MovePers();
if (_parent.Pers.Obj.Etat._currentframe >= FrJump) {
Etat = "FinJump";
}
}
};
ObjPers.prototype.FinJump = function () {
with (this) {
SetSpdXJump();
SetMoveX();
if (UseSuit == true) {
CheckTir();
}
CheckGetFire();
CheckWall(FrontX, FrontY);
CheckWall(BottomFrontX, TrueY);
CheckWall(FrontX, TopY);
CheckHitGrd();
CheckSol();
CheckCeil();
this["CheckAction" + Perso]();
MovePers();
if (HitGrd == true) {
Etat = "Land";
} else if (SpdYNow >= 0) {
Etat = "Fall";
DistYFall = 0;
}
}
};
ObjPers.prototype.Fall = function () {
with (this) {
SetSpdXJump();
SetMoveX();
CheckGetFire();
if (UseSuit == true) {
CheckTir();
}
this["CheckAction" + Perso]();
CheckWall(FrontX, FrontY);
CheckWall(BottomFrontX, TrueY);
CheckWall(FrontX, TopY);
CheckHitGrd();
CheckSol();
MovePers();
if ((_parent.Pers.Obj.Etat._currentframe >= FrFall) or (HitGrd == true)) {
SpdXNow = 0;
MoveX = 0;
if (HitGrd == true) {
if (DistYFall >= DistYLand) {
Etat = "Land";
} else {
Etat = "Idle";
}
} else {
Etat = "FinFall";
}
}
CheckHole();
}
};
ObjPers.prototype.FinFall = function () {
with (this) {
SetSpdXJump();
SetMoveX();
CheckGetFire();
CheckWall(FrontX, FrontY);
CheckWall(FrontX, TrueY);
CheckWall(FrontX, TopY);
CheckHitGrd();
CheckSol();
MovePers();
if (HitGrd == true) {
if (DistYFall >= DistYLand) {
Etat = "Land";
} else {
Etat = "Idle";
}
}
CheckHole();
}
};
ObjPers.prototype.Land = function () {
with (this) {
SetSpdX();
SetMoveX();
CheckGetFire();
CheckWall(FrontX, FrontY);
CheckHitGrd();
CheckSol();
CheckFall();
MovePers();
CheckJump();
this["CheckAction" + Perso]();
CheckDie();
if (_parent.Pers.Obj.Etat._currentframe >= FrLand) {
if (Life <= 0) {
Etat = "Die";
} else {
Etat = "Idle";
}
}
}
};
ObjPers.prototype.GetHit1 = function () {
with (this) {
if (FrGetHitCount >= FrGetHit) {
CheckHitGrd();
Etat = "Fall";
FrGetHitCount = 0;
InvincibleInit();
} else {
FrGetHitCount++;
}
GetHitGeneral();
}
};
ObjPers.prototype.GetHit2 = function () {
with (this) {
GetHitGeneral();
if (FrGetHitCount >= FrGetHit) {
CheckHitGrd();
Etat = "Fall";
FrGetHitCount = 0;
InvincibleInit();
} else {
FrGetHitCount++;
}
}
};
ObjPers.prototype.GetHitLand = function () {
with (this) {
GetHitGeneral();
if (FrGetHitCount == FrGetHit) {
_parent.Pers.Obj.Etat.play();
FrGetHitCount++;
} else if (FrGetHitCount > FrGetHit) {
if (_parent.Pers.Obj.Etat._currentframe >= FrGetHitLand) {
Etat = "PushVide";
FrGetHitCount = 0;
InvincibleInit();
}
} else {
FrGetHitCount++;
}
}
};
ObjPers.prototype.GetHitGeneral = function () {
with (this) {
SetSpdXHit();
CheckWall(BackX, TrueY);
CheckHitGrd();
CheckSol();
MovePers();
CheckDie();
}
};
ObjPers.prototype.GetHit = function () {
with (this) {
var RandomHit = 0;
Life = Life - 1;
_parent._parent.Hud.LifeBar.gotoAndStop(Life + 1);
CanHit = false;
SpdXNow = SpdXHitBase;
SpdYNow = SpdYHitBase;
RandomHit = Math.ceil(Math.random() * 2);
Etat = "GetHit" + RandomHit;
}
};
ObjPers.prototype.GetFire = function () {
with (this) {
var RandomHit = 0;
Life = Life - 1;
_parent._parent.Hud.LifeBar.gotoAndStop(Life + 1);
CanHit = false;
SpdXNow = SpdXHitBase;
SpdYNow = 0;
RandomHit = Math.ceil(Math.random() * 2);
Etat = "GetHit" + RandomHit;
}
};
ObjPers.prototype.CheckGetFire = function () {
with (this) {
var NbMinionBall = G_TabMinionBall.length;
if (NbMinionBall > 0) {
var i = 0;
while (i < NbMinionBall) {
var BallX = _parent.Control[G_TabMinionBall[i]].PosX;
var BallY = _parent.Control[G_TabMinionBall[i]].PosY;
if (((((BallX >= (PosX - GetFireG)) and (BallX <= (PosX + GetFireD))) and (BallY >= (PosY - GetFireUp))) and (BallY <= (PosY + GetFireDw))) && (!Invincible)) {
if (_parent.Control[G_TabMinionBall[i]].Dangerous == true) {
Etat = "GetFire";
if (_parent.Control[G_TabMinionBall[i]].Dir == "D") {
Dir = "G";
} else if (_parent.Control[G_TabMinionBall[i]].Dir == "G") {
Dir = "D";
}
_parent.Control[G_TabMinionBall[i]].Etat = "Hit";
}
}
i++;
}
}
}
};
ObjPers.prototype.InvincibleInit = function () {
with (this) {
Invincible = true;
}
};
ObjPers.prototype.InvincibleEnd = function () {
with (this) {
Invincible = false;
FrInvincibleCount = 0;
_parent.Pers._visible = true;
}
};
ObjPers.prototype.InvincibleCheck = function () {
with (this) {
if (Invincible) {
if (FrInvincibleCount >= FrInvincible) {
InvincibleEnd();
CanBeHit = true;
} else {
FrInvincibleCount++;
if ((FrInvincibleCount % 3) == 0) {
_parent.Pers._visible = !_parent.Pers._visible;
}
}
}
}
};
ObjPers.prototype.Die = function () {
with (this) {
CanBeHit = false;
FrDeadCount++;
if (FrDeadCount >= FrDead) {
FrDeadCount = 0;
_global.C.endGame("lose");
}
}
};
ObjPers.prototype.SetSpdXHit = function () {
with (this) {
MoveX = SpdXNow;
if (SpdXNow > 0) {
SpdXNow = SpdXNow * 0.7;
}
if (Dir eq "D") {
MoveX = MoveX * -1;
}
}
};
ObjPers.prototype.SetSpdX = function () {
with (this) {
if (KeyListener.R == true) {
Dir = "D";
if (_parent.Collider.Wall.hitTest(FrontX + WallHitBloc, TrueY, true)) {
Etat = "Idle";
SpdXBase = 0;
SpdXNow = 0;
} else {
Etat = "Walk";
SpdXBase = ModifSpeed(SpdXBase, "acc", false, Dir);
SpdXNow = SpdXBase;
}
} else if (KeyListener.L == true) {
Dir = "G";
if (_parent.Collider.Wall.hitTest(FrontX - WallHitBloc, TrueY, true)) {
Etat = "Idle";
SpdXBase = 0;
SpdXNow = 0;
} else {
Etat = "Walk";
SpdXBase = ModifSpeed(SpdXBase, "acc", false, Dir);
SpdXNow = SpdXBase;
}
} else {
if (Etat != "Land") {
Etat = "Idle";
}
SpdXBase = ModifSpeed(SpdXBase, "dec", false, Dir);
SpdXNow = SpdXBase;
}
if (Dir ne DirOld) {
SpdXBase = ModifSpeed(SpdXBase, "dec", false, Dir);
SpdXNow = SpdXBase;
}
}
};
ObjPers.prototype.SetSpdXJump = function () {
with (this) {
if (KeyListener.R == true) {
Dir = "D";
if (_parent.Collider.Wall.hitTest(TrueX + WallHitBloc, TrueY, true)) {
SpdXBase = 0;
SpdXNow = 0;
} else {
SpdXBase = ModifSpeed(SpdXBase, "acc", true, Dir);
SpdXNow = SpdXBase;
}
} else if (KeyListener.L == true) {
Dir = "G";
if (_parent.Collider.Wall.hitTest(TrueX - WallHitBloc, TrueY, true)) {
SpdXBase = 0;
SpdXNow = 0;
} else {
SpdXBase = ModifSpeed(SpdXBase, "acc", true, Dir);
SpdXNow = SpdXBase;
}
} else {
SpdXBase = ModifSpeed(SpdXBase, "dec", true, Dir);
SpdXNow = SpdXBase;
}
if (Dir ne DirOld) {
SpdXBase = ModifSpeed(SpdXBase, "dec", true, Dir);
SpdXNow = SpdXBase;
}
}
};
ObjPers.prototype.SetMoveX = function () {
with (this) {
MoveX = SpdXNow;
}
};
ObjPers.prototype.checkEaster = function () {
with (this) {
if (KeyListener.S == true) {
Etat = "EasterEgg";
}
}
};
ObjPers.prototype.CheckWall = function (CoordX, CoordY) {
with (this) {
if (MoveX != 0) {
if (MoveX > 0) {
var WallStop = WallHitBloc;
} else {
var WallStop = (-1 * WallHitBloc);
}
var WallHit1 = (MoveX / 3);
var WallHit2 = (WallHit1 * 2);
if (_parent.Collider.Wall.hitTest(CoordX + WallStop, CoordY, true)) {
SpdXBase = 0;
MoveX = 0;
} else if (_parent.Collider.Wall.hitTest(CoordX + WallHit1, CoordY, true)) {
SpdXBase = 0;
MoveX = WallHitBloc;
} else if (_parent.Collider.Wall.hitTest(CoordX + WallHit2, CoordY, true)) {
SpdXBase = 0;
MoveX = WallHit1;
} else if (_parent.Collider.Wall.hitTest(CoordX + MoveX, CoordY, true)) {
SpdXBase = 0;
MoveX = WallHit2;
}
}
}
};
ObjPers.prototype.CheckCeil = function () {
with (this) {
if (MoveY != 0) {
if (_parent.Collider.Ceil.hitTest(TopX, TopY + MoveY, true)) {
MoveY = 0;
SpdYNow = 0;
Etat = "Fall";
DistYFall = 0;
}
}
}
};
ObjPers.prototype.Kick1 = function () {
with (this) {
if (_parent.Pers.Obj.Etat._currentframe >= frKick1) {
CanHit = true;
HitPointX = _parent.Pers.Obj.HitPoint._x;
if (Dir == "G") {
HitPointX = PosX - HitPointX;
} else if (Dir == "D") {
HitPointX = PosX + HitPointX;
}
HitPointY = PosY + _parent.Pers.Obj.HitPoint._y;
Etat = "FinKick1";
CheckGetFire();
}
}
};
ObjPers.prototype.FinKick1 = function () {
with (this) {
if (_parent.Pers.Obj.Etat._currentframe >= frFinKick1) {
CanHit = false;
if (!HitGrd) {
Etat = "Fall";
} else {
Etat = "Idle";
}
CheckGetFire();
if (KeyListener.Sp) {
ComboKick++;
}
}
}
};
ObjPers.prototype.Kick2 = function () {
with (this) {
SetSpdXJump();
SetMoveX();
CheckGetFire();
CheckWall(FrontX, FrontY);
CheckWall(BottomFrontX, TrueY);
CheckWall(FrontX, TopY);
CheckHitGrd();
CheckSol();
MovePers();
if (_parent.Pers.Obj.Etat._currentframe >= frKick2) {
CanHit = true;
HitPointX = _parent.Pers.Obj.HitPoint._x;
if (Dir == "G") {
HitPointX = PosX - HitPointX;
} else if (Dir == "D") {
HitPointX = PosX + HitPointX;
}
HitPointY = PosY + _parent.Pers.Obj.HitPoint._y;
Etat = "FinKick2";
CheckGetFire();
}
}
};
ObjPers.prototype.FinKick2 = function () {
with (this) {
SetSpdXJump();
SetMoveX();
CheckGetFire();
CheckWall(FrontX, FrontY);
CheckWall(BottomFrontX, TrueY);
CheckWall(FrontX, TopY);
CheckHitGrd();
CheckSol();
MovePers();
if (_parent.Pers.Obj.Etat._currentframe >= frFinKick2) {
CanHit = false;
if (!HitGrd) {
Etat = "Fall";
} else {
Etat = "Idle";
}
CheckGetFire();
if (KeyListener.Sp) {
ComboKick++;
}
}
}
};
ObjPers.prototype.CheckJump = function () {
with (this) {
if (((KeyListener.Up == true) and (HitGrd == true)) and (KeyListener.UpRelease == true)) {
_global.Sounds.PlayASound("Jump", 1, 60);
KeyListener.UpRelease = false;
KeepDeadPos = false;
Etat = "Jump";
SpdYNow = SpdStartJump;
}
}
};
ObjPers.prototype.CheckActionWaffle = function () {
with (this) {
if (KeyListener.Sp == true) {
KeyListener.Sp = false;
if (KickTime < KickInAir) {
if (((Etat == "Jump") || (Etat == "FinJump")) || (Etat == "Fall")) {
KickTime++;
ComboKick = 0;
RandomKick = 2;
} else {
RandomKick = 1;
}
_global.Sounds.PlayASound("Kick", 1, 50);
Etat = "Kick" + RandomKick;
}
} else if (((((Etat != "Jump") && (Etat != "FinJump")) && (Etat != "Fall")) && (Etat != "Kick2")) && (Etat != "FinKick1")) {
KickTime = 0;
ComboKick = 0;
}
}
};
ObjPers.prototype.ResetMove = function () {
with (this) {
MoveX = 0;
MoveY = 0;
SpdXNow = 0;
SpdYNow = 0;
}
};
ObjPers.prototype.CheckFall = function () {
with (this) {
if (SpdYNow >= SpdYFall) {
KeepDeadPos = false;
Etat = "Fall";
DistYFall = 0;
}
}
};
ObjPers.prototype.CheckDie = function () {
with (this) {
if ((Life <= 0) and (HitGrd == true)) {
CanBeHit = false;
InvincibleEnd();
_global.C.DesactivateHud();
Etat = "Die";
}
}
};
ObjPers.prototype.MovePers = function () {
with (this) {
if ((Pers.TrueX + MoveX) < 0) {
MoveX = TrueX * -1;
} else if ((Pers.TrueX + MoveX) > 500) {
MoveX = 500 - Pers.TrueX;
}
PosX = _parent.Pers._x + MoveX;
_parent.Pers._x = PosX;
MoveX = 0;
PosY = _parent.Pers._y + MoveY;
_parent.Pers._y = PosY;
MoveY = 0;
}
};
ObjPers.prototype.SetTruePos = function () {
with (this) {
TrueX = PosX + _parent._x;
TrueY = PosY + _parent._y;
TopX = TrueX;
TopY = TrueY + _parent.Pers.Obj.HitTop._y;
FrontX = _parent.Pers.Obj.HitFront._x;
FrontY = TrueY + _parent.Pers.Obj.HitFront._y;
BottomFrontX = _parent.Pers.Obj.HitBottomFront._x;
BottomBackX = _parent.Pers.Obj.HitBottomBack._x;
BackX = _parent.Pers.Obj.HitBack._x;
if (Dir == "G") {
FrontX = TrueX - FrontX;
BottomFrontX = TrueX - BottomFrontX;
BottomBackX = TrueX - BottomBackX;
BackX = TrueX - BackX;
} else if (Dir == "D") {
FrontX = TrueX + FrontX;
BottomFrontX = TrueX + BottomFrontX;
BottomBackX = TrueX + BottomBackX;
BackX = TrueX + BackX;
}
}
};
ObjPers.prototype.CheckHitGrd = function (CheckX, CheckY) {
with (this) {
if ((CheckX == undefined) && (CheckY == undefined)) {
CheckX = TrueX;
CheckY = TrueY;
aCheckPoints = [CheckX, BottomFrontX, BottomBackX];
} else {
aCheckPoints = [CheckX];
}
for (var i in aCheckPoints) {
if (_parent.Collider.Sol.hitTest(aCheckPoints[i], CheckY + MaxSol, true) and (SpdYNow >= 0)) {
HitGrd = true;
HitGrdPoint = aCheckPoints[i];
break;
}
HitGrd = false;
HitGrdPoint = TrueX;
}
}
};
ObjPers.prototype.CheckSol = function (CheckX, CheckY) {
with (this) {
if ((CheckX == undefined) && (CheckY == undefined)) {
CheckX = HitGrdPoint;
CheckY = TrueY;
}
if (_parent.Collider.Sol.hitTest(CheckX, CheckY, true) and (SpdYNow >= 0)) {
SpdYNow = 0;
var InSol = true;
while (InSol == true) {
MoveY = MoveY - SolOut;
InSol = _parent.Collider.Sol.hitTest(CheckX, CheckY + MoveY, true);
}
} else if (SpdYNow >= 0) {
if (HitGrd == true) {
SpdYNow = 0;
MoveY = SpdYNow;
} else {
if ((KeyListener.Up == true) && (SpdYNow > 0)) {
var MoveUp = (Math.round((SpdYUp * 10) / 1200) / 10);
if (MoveUp < 0.1) {
MoveUp = 0.1;
}
SpdYNow = SpdYNow + MoveUp;
if (SpdYNow > (SpdYMax / 3)) {
SpdYNow = SpdYMax / 3;
}
} else {
SpdYNow = SpdYNow + SpdYUp;
if (SpdYNow > SpdYMax) {
SpdYNow = SpdYMax;
}
}
var SolHit1 = (SpdYNow / 3);
var SolHit2 = (SolHit1 * 2);
if (_parent.Collider.Sol.hitTest(CheckX, CheckY + SolHit1, true)) {
MoveY = SolHitMin;
} else if (_parent.Collider.Sol.hitTest(CheckX, CheckY + SolHit2, true)) {
MoveY = SolHit1;
} else if (_parent.Collider.Sol.hitTest(CheckX, CheckY + SpdYNow, true)) {
MoveY = SolHit2;
} else {
MoveY = SpdYNow;
}
}
} else {
SpdYNow = SpdYNow + SpdYUp;
MoveY = SpdYNow;
}
if (MoveY > 0) {
DistYFall = DistYFall + MoveY;
}
}
};
ObjPers.prototype.ChangeEtat = function (NewAction) {
with (this) {
if (((EtatOld eq "Walk") and (Etat eq "WalkTir")) or ((EtatOld eq "WalkTir") and (Etat eq "Walk"))) {
var SetFrWalk = true;
}
EtatOld = Etat;
Etat = NewAction;
_parent.Pers.Obj.gotoAndStop(NewAction);
if (SetFrWalk == true) {
if (FrWalkNow >= 20) {
FrWalkNow = 1;
}
_parent.Pers.Obj.Etat.gotoAndPlay(FrWalkNow);
}
}
};
ObjPers.prototype.updatePerso = function () {
with (this) {
_parent.Pers.gotoAndStop((Perso + "_") + Dir);
Etat = "Idle";
GetFireG = -1 * _parent.Pers.Obj.HitBack._x;
GetFireD = _parent.Pers.Obj.HitFront._x;
GetFireDw = 20;
GetFireUp = -1 * _parent.Pers.Obj.HitTop._y;
ComboKick = 0;
InvincibleEnd();
CanBeHit = true;
}
};
ObjPers.prototype.ChangeDir = function (NewDir) {
with (this) {
DirOld = Dir;
Dir = NewDir;
_parent.Pers.gotoAndStop((Perso + "_") + Dir);
}
};
ObjPers.prototype.Actions = function () {
with (this) {
if (G_Pause == true) {
if (InPause == false) {
InPause = true;
_parent.Pers.Obj.Etat.stop();
}
} else {
if (InPause == true) {
InPause = false;
_parent.Pers.Obj.Etat.play();
}
SetTruePos();
InvincibleCheck();
this[Etat]();
}
}
};
CreerPersBall = function () {
var _local3 = "Ball" + G_NextPersBall;
G_NextPersBall = G_NextPersBall + 1;
if (G_NextPersBall > 50) {
G_NextPersBall = 1;
}
if (this[_local3] == null) {
var _local7 = G_NextPersBallDepth;
G_NextPersBallDepth++;
duplicateMovieClip (_parent.Ball.PersBallClone, _local3, _local7);
var _local6 = Pers.Dir;
_parent.Ball[_local3].gotoAndStop(_local6);
var _local5 = Pers.PosX;
var _local4 = Pers.PosY + Pers.DistBallY;
_parent.Ball[_local3]._x = _local5;
_parent.Ball[_local3]._y = _local4;
this[_local3] = new ObjPersBall(_local3, _local5, _local4, _local6, 14, 20, G_TabPersBall, "SlimeSplat");
G_TabPersBall.push(_local3);
}
};
CreerMinionBall = function (PosX, PosY, Dir, PowerX, PowerY) {
MinShootX = 10;
MinShootY = 41;
if (PowerX == undefined) {
ForceX = random(4) + 15;
Bouncing = "horiz";
} else {
ForceX = PowerX;
Bouncing = "vertic";
}
if (PowerY == undefined) {
ForceY = random(3) - 7;
} else {
ForceY = PowerY;
}
if (Dir == "none") {
if (random(50) < 25) {
Dir = "D";
} else {
Dir = "G";
}
}
FrDetonate = 90;
var _local3 = "MinionBall" + G_NextMinionBall;
G_NextMinionBall = G_NextMinionBall + 1;
if (G_NextMinionBall > 50) {
G_NextMinionBall = 1;
}
if (this[_local3] == null) {
var _local5 = G_NextMinionBallDepth;
G_NextMinionBallDepth++;
duplicateMovieClip (_parent.Ball.MinionBallClone, _local3, _local5);
_parent.Ball[_local3].gotoAndStop(Dir);
if (Dir == "G") {
_parent.Ball[_local3]._x = PosX - MinShootX;
} else if (Dir == "D") {
_parent.Ball[_local3]._x = PosX + MinShootX;
}
_parent.Ball[_local3]._y = PosY - MinShootY;
this[_local3] = new ObjPersBall(_local3, _parent.Ball[_local3]._x, _parent.Ball[_local3]._y, Dir, 14, 10, G_TabMinionBall, "LaserSplat");
G_TabMinionBall.push(_local3);
}
};
ObjPersBall.prototype.Hide = function () {
with (this) {
_parent.Ball[Nom]._x = PosX + SpdX;
PosX = PosX + SpdX;
SetTruePos();
if (_parent.PersBall[Nom].Obj.Etat._currentframe >= FrHide) {
Etat = "Move";
}
CheckWall();
CheckOut();
}
};
ObjPersBall.prototype.Move = function () {
with (this) {
if (Bouncing == "horiz") {
_parent.Ball[Nom]._x = PosX + SpdX;
_parent.Ball[Nom]._y = PosY + SpdY;
PosX = PosX + SpdX;
PosY = PosY + SpdY;
passTime++;
CheckGround();
SetTruePos();
CheckWall();
CheckOut();
if (passTime == 2) {
passTime = 0;
if (SpdX > 0) {
SpdX--;
} else if (SpdX < 0) {
SpdX++;
} else if (Stopped == true) {
Dangerous = false;
Etat = "detonate";
}
}
} else if (Bouncing == "vertic") {
_parent.Ball[Nom]._x = PosX + SpdX;
_parent.Ball[Nom]._y = PosY + SpdY;
PosX = PosX + SpdX;
PosY = PosY + SpdY;
if (Stopped == false) {
SpdY++;
if (SpdY == 0) {
detectNow = true;
}
} else {
Etat = "detonate";
}
SetTruePos();
if (detectNow == true) {
CheckGround();
}
CheckWall();
CheckOut();
}
}
};
ObjPersBall.prototype.detonate = function () {
with (this) {
if (_parent.Ball[Nom].Obj.Etat._currentframe == FrDetonate) {
Etat = "explode";
}
checkIfKick();
CheckOut();
}
};
ObjPersBall.prototype.checkIfKick = function () {
with (this) {
if (Pers.CanHit == true) {
if (_parent.Ball[Nom].hitTest(_parent.Pers)) {
_global.Sounds.PlayASound("Ball", 1, 100);
Dir = Pers.Dir;
if (Dir eq "D") {
SpdX = random(6) + 18;
} else {
SpdX = -1 * (random(6) + 18);
}
SpdY = random(3) - 11;
Stopped = false;
Etat = "Move";
}
}
}
};
ObjPersBall.prototype.Hit = function () {
with (this) {
if (((_parent.Ball[Nom].Obj.Etat._currentframe == 1) && (TrueX > 0)) && (TrueX < 500)) {
} else if (_parent.Ball[Nom].Obj.Etat._currentframe >= FrHit) {
_parent.Ball[Nom].Obj.Etat = "Sleep";
_parent.Ball[Nom].Obj.gotoAndStop("Sleep");
KillBall();
}
}
};
ObjPersBall.prototype.explode = function () {
with (this) {
if (_parent.Ball[Nom].hitTest(_parent.Pers)) {
if (Pers.CanBeHit) {
Pers.Etat = "GetHit";
Pers.CanBeHit = false;
if (_parent.Ball[Nom]._x > _parent.Pers._x) {
Pers.Dir = "D";
} else {
Pers.Dir = "G";
}
}
}
if (_parent.Ball[Nom].Obj.Etat._currentframe >= FrHit) {
_parent.Ball[Nom].Obj.Etat = "Sleep";
_parent.Ball[Nom].Obj.gotoAndStop("Sleep");
KillBall();
}
}
};
ObjPersBall.prototype.KillBall = function () {
with (this) {
if (Tab == G_TabPersBall) {
G_TabPersBall.splice(PersBallI, 1);
PersBallI = PersBallI - 1;
} else if (Tab == G_TabMinionBall) {
G_TabMinionBall.splice(MinionBallI, 1);
MinionBallI = MinionBallI - 1;
}
delete _parent.Control[Nom];
}
};
ObjPersBall.prototype.SetTruePos = function () {
with (this) {
TrueX = PosX + _parent._x;
TrueY = (PosY + _parent._y) + 10;
}
};
ObjPersBall.prototype.Sleep = function () {
};
ObjPersBall.prototype.CheckWall = function () {
with (this) {
if (_parent.Collider.Wall.hitTest(TrueX, TrueY, true) and (!_parent.Collider.Wall.Pass.hitTest(TrueX, TrueY, true))) {
_global.Sounds.PlayASound("Ball", 1, 100);
if (Dir eq "D") {
Dir = "G";
} else {
Dir = "D";
}
Dangerous = true;
SpdX = SpdX * -1;
if (SpdX > 0) {
SpdX = SpdX + 2;
} else {
SpdX = SpdX + -2;
}
if (Math.abs(SpdX) < 5) {
if (SpdX < 5) {
SpdX = 5;
} else if (Spd > -5) {
SpdX = -5;
}
}
}
}
};
ObjPersBall.prototype.CheckGround = function () {
with (this) {
if (_parent.Collider.Sol.hitTest(TrueX, TrueY, true)) {
if (SpdY >= 0) {
if (SpdY >= 5) {
_global.Sounds.PlayASound("Ball", 1, 100);
}
var i = 0;
while (_parent.Collider.Sol.hitTest(TrueX, TrueY - (i + 1), true)) {
i++;
}
PosY = PosY + (i * -1);
_parent.Ball[Nom]._y = PosY;
HurtMyself = true;
if (SpdY > 2) {
Stopped = false;
SpdY = Math.round(SpdY * -0.5);
} else {
Stopped = true;
SpdY = 0;
}
} else {
Stopped = false;
SpdY++;
}
} else {
Stopped = false;
SpdY++;
}
}
};
ObjPersBall.prototype.CheckOut = function () {
with (this) {
if ((((PosX < (Bg.InvPosX - LgOutG)) or (PosX > (Bg.InvPosX + LgOutD))) or (PosY < (Bg.InvPosY - LgOutUp))) or (PosY > (Bg.InvPosY + LgOutDw))) {
_parent.Ball[Nom].Obj.Etat = "Sleep";
_parent.Ball[Nom].Obj.gotoAndStop("Sleep");
KillBall();
}
}
};
ObjPersBall.prototype.ChangeEtat = function (NewAction) {
with (this) {
EtatOld = Etat;
Etat = NewAction;
_parent.Ball[Nom].Obj.gotoAndStop(NewAction);
}
};
ObjPersBall.prototype.Actions = function () {
with (this) {
if (G_Pause == true) {
if (InPause == false) {
InPause = true;
_parent.Ball[Nom].Obj.Etat.stop();
}
} else {
if (InPause == true) {
InPause = false;
_parent.Ball[Nom].Obj.Etat.play();
}
this[Etat]();
}
}
};
CreerBg = function (PosX, PosY) {
this.Bg = new ObjBg(PosX, PosY);
};
ObjBg.prototype.Actions = function () {
with (this) {
if (G_Pause == true) {
if (InPause == false) {
InPause = true;
}
} else {
if (InPause == true) {
InPause = false;
}
ScrollBg();
}
}
};
ObjBg.prototype.ScrollBg = function () {
with (this) {
CheckScreen();
if ((PosY <= MaxDw) and (PosY >= MaxUp)) {
if (Pers.TrueX > (CenterX + 1)) {
if ((Pers.HitGrd == false) and (Pers.TrueY >= 300)) {
SpdXG = -30;
SpdXD = 30;
} else if (Pers.SpdXNow > 0) {
SpdXG = (Pers.SpdXNow * -1) - 5;
} else if (Pers.SpdXNow < 0) {
SpdXD = (Pers.SpdXNow * -1) + 5;
} else {
SpdXG = -8;
SpdXD = 8;
}
if (PosX < MaxG) {
if ((PosX + SpdXD) > MaxG) {
MoveX = MaxG - PosX;
} else {
MoveX = SpdXD;
}
} else {
if ((CenterX - Pers.TrueX) > SpdXG) {
MoveX = CenterX - Pers.TrueX;
} else {
MoveX = SpdXG;
}
if ((PosX + MoveX) < MaxG) {
MoveX = MaxG - PosX;
}
}
} else if (Pers.TrueX < (CenterX - 1)) {
if ((Pers.HitGrd == false) and (Pers.TrueY >= 300)) {
SpdXG = -30;
SpdXD = 30;
} else if (Pers.SpdXNow > 0) {
SpdXG = (Pers.SpdXNow * -1) - 5;
} else if (Pers.SpdXNow < 0) {
SpdXD = (Pers.SpdXNow * -1) + 5;
} else {
SpdXG = -8;
SpdXD = 8;
}
if (PosX > MaxD) {
if ((PosX + SpdXG) < MaxD) {
MoveX = MaxD - PosX;
} else {
MoveX = SpdXG;
}
} else {
if ((CenterX - Pers.TrueX) < SpdXD) {
MoveX = CenterX - Pers.TrueX;
} else {
MoveX = SpdXD;
}
if ((PosX + MoveX) > MaxD) {
MoveX = MaxD - PosX;
}
}
} else {
if ((Pers.HitGrd == false) and (Pers.TrueY >= 300)) {
SpdXG = -30;
SpdXD = 30;
} else if (Pers.SpdXNow > 0) {
SpdXG = (Pers.SpdXNow * -1) - 5;
} else if (Pers.SpdXNow < 0) {
SpdXD = (Pers.SpdXNow * -1) + 5;
} else {
SpdXG = -8;
SpdXD = 8;
}
if (PosX < MaxG) {
if ((PosX + SpdXD) > MaxG) {
MoveX = MaxG - PosX;
} else {
MoveX = SpdXD;
}
} else if (PosX > MaxD) {
if ((PosX + SpdXG) < MaxD) {
MoveX = MaxD - PosX;
} else {
MoveX = SpdXG;
}
}
}
}
if ((PosX <= MaxD) and (PosX >= MaxG)) {
if (Pers.TrueY > (CenterY + 1)) {
if (Pers.SpdYNow > 0) {
SpdYUp = (Pers.SpdYNow * -1) - 5;
} else if (Pers.SpdYNow < 0) {
SpdYDw = (Pers.SpdYNow * -1) + 5;
} else {
SpdYUp = -5;
SpdYDw = 5;
}
if (PosY < MaxUp) {
if ((PosY + SpdYDw) > MaxUp) {
MoveY = MaxUp - PosY;
} else {
MoveY = SpdYDw;
}
} else {
if ((CenterY - Pers.TrueY) > SpdYUp) {
MoveY = CenterY - Pers.TrueY;
} else {
MoveY = SpdYUp;
}
if ((PosY + MoveY) < MaxUp) {
MoveY = MaxUp - PosY;
}
}
} else if (Pers.TrueY < (CenterY - 1)) {
if (Pers.SpdYNow > 0) {
SpdYUp = (Pers.SpdYNow * -1) - 5;
} else if (Pers.SpdYNow < 0) {
SpdYDw = (Pers.SpdYNow * -1) + 5;
} else {
SpdYUp = -5;
SpdYDw = 5;
}
if (PosY > MaxDw) {
if ((PosY + SpdYUp) < MaxDw) {
MoveY = MaxDw - PosY;
} else {
MoveY = SpdYUp;
}
} else {
if ((CenterY - Pers.TrueY) < SpdYDw) {
MoveY = CenterY - Pers.TrueY;
} else {
MoveY = SpdYDw;
}
if ((PosY + MoveY) > MaxDw) {
MoveY = MaxDw - PosY;
}
}
} else {
if (Pers.SpdYNow > 0) {
SpdYUp = (Pers.SpdYNow * -1) - 5;
} else if (Pers.SpdYNow < 0) {
SpdYDw = (Pers.SpdYNow * -1) + 5;
} else {
SpdYUp = -5;
SpdYDw = 5;
}
if (PosY < MaxUp) {
if ((PosY + SpdYDw) > MaxUp) {
MoveY = MaxDw - PosY;
} else {
MoveY = SpdYDw;
}
} else if (PosY > MaxDw) {
if ((PosY + SpdYUp) < MaxDw) {
MoveY = MaxDw - PosY;
} else {
MoveY = SpdYUp;
}
}
}
}
_parent._x = Math.floor(_parent._x + MoveX);
PosX = _parent._x;
InvPosX = PosX * -1;
MoveX = 0;
_parent._y = Math.floor(_parent._y + MoveY);
PosY = _parent._y;
InvPosY = PosY * -1;
MoveY = 0;
}
};
CreerShred = function (Nom, PosX, PosY, Dir, Perso) {
if (this[Nom] == null) {
if ((Perso == undefined) || (!Perso)) {
Perso = "Gordon";
}
this[Nom] = new ObjShred(Nom, PosX, PosY, Dir, Perso);
G_TabShred.push(Nom);
}
};
ObjShred.prototype.Sleep = function () {
with (this) {
CheckActif();
}
};
ObjShred.prototype.Idle = function () {
with (this) {
MoveX = 0;
MoveY = 0;
CanBeHit = true;
FrBetweenAttack++;
FrSeparateWallCount++;
if (FrSeparateWallCount == FrSeparateWallCheck) {
FrSeparateWallCount = 0;
WallSeparate = false;
}
if (((Etat == "Idle") && ((_parent[Nom].Obj.Etat._currentframe >= FrIdleCheckMin) && (_parent[Nom].Obj.Etat._currentframe <= FrIdleCheckMax))) || (_parent[Nom].Obj.Etat._currentframe == FrIdleCheckLast)) {
if (Dir == "G") {
CheckPers("D");
} else if (Dir == "D") {
CheckPers("G");
}
} else {
CheckPers();
}
if ((Perso == "Gordon") || (Perso == "Blik")) {
CheckAttack();
if ((Etat == "Idle") && (_parent[Nom].Obj.Etat._currentframe == FrIdleCheckLast)) {
CheckDistWall();
if (TooNearWall) {
if (Dir == "G") {
Dir = "D";
} else if (Dir == "D") {
Dir = "G";
}
CheckDistWall();
if (!TooNearWall) {
Etat = "Walk";
}
} else {
Etat = "Walk";
}
}
} else {
CheckAttack();
}
CheckBoxOver();
CheckBoxSide();
CheckHeadAttack();
if (Perso != "Waffle") {
CheckGetHit();
}
CheckGetFire();
CheckGetFart();
CheckHitGrd();
if (Perso != "Blik") {
CheckSol();
}
CheckSleep();
}
};
ObjShred.prototype.Walk = function () {
with (this) {
CanBeHit = true;
CheckHeadAttack();
CheckTurn();
CheckWall();
CheckPers();
CheckHitGrd();
if (Perso != "Blik") {
CheckSol();
}
CheckAttack();
CheckBoxOver();
CheckBoxSide();
CheckGetHit();
CheckGetFire();
CheckGetFart();
SetMoveX();
MoveShred();
CheckSleep();
}
};
ObjShred.prototype.MoonWalk = function () {
with (this) {
CanBeHit = true;
FrBetweenAttack++;
CheckHeadAttack();
CheckTurn();
CheckWall();
if (FrBetweenAttack >= FrMoonWalk) {
CheckPers();
}
CheckHitGrd();
CheckAttack();
CheckBoxOver();
CheckBoxSide();
CheckGetHit();
CheckGetFire();
CheckGetFart();
InverseSetMoveX();
MoveShred();
CheckSleep();
}
};
ObjShred.prototype.WalkFight = function () {
with (this) {
CanBeHit = true;
CheckHeadAttack();
SetMoveXWalkFight();
CheckTurn();
CheckWall();
CheckHitGrd();
if (Perso != "Blik") {
CheckSol();
}
CheckAttack();
CheckBoxOver();
CheckBoxSide();
CheckGetFire();
CheckGetFart();
MoveShred();
CheckSleep();
CheckFight();
CheckGetHit();
}
};
ObjShred.prototype.Surpris = function () {
with (this) {
if (_parent[Nom].Obj.Etat._currentframe >= FrSurpris) {
MoveX = 0;
MoveY = 0;
if (Perso == "Gordon") {
if (((Pers.Etat == "Die") && (Pers.Obj.Etat._currentframe >= 40)) || (Pers.Etat == "Dead")) {
Etat = "Charge";
} else if ((Math.ceil(Math.random() * 3) == 1) || ((TrueX < 0) || (TrueX > 500))) {
Etat = "WalkFight";
} else {
Etat = "Charge";
}
} else if (Perso == "Blik") {
if (FrBetweenAttack >= FrMoonWalk) {
FrBetweenAttack = 0;
Etat = "Attack3";
ShootMax = Math.ceil((Math.random() * 3) + 1);
ShootCount = 1;
} else {
Etat = "MoonWalk";
}
}
}
CanBeHit = true;
CheckHeadAttack();
CheckBoxOver();
CheckBoxSide();
CheckGetHit();
CheckGetFire();
CheckGetFart();
}
};
ObjShred.prototype.Attack3 = function () {
with (this) {
if (_parent[Nom].Obj.Etat._currentframe == FrShoot) {
_global.Sounds.PlayASound("Crache", 1, 100);
_global.Game.CreerMinionBall(PosX, PosY, Dir);
} else if (_parent[Nom].Obj.Etat._currentframe >= FrShootFin) {
Etat = "Idle";
}
CanBeHit = true;
CheckHeadAttack();
CheckGetHit();
CheckGetFire();
CheckGetFart();
}
};
ObjShred.prototype.Ready = function () {
with (this) {
CanBeHit = true;
if (_parent[Nom].Obj.Etat._currentframe >= 5) {
CheckHeadAttack();
CheckGetHit();
}
CheckGetFire();
if (_parent[Nom].Obj.Etat._currentframe >= FrReady) {
Etat = "Attack4";
}
}
};
ObjShred.prototype.PopOut = function () {
with (this) {
CanBeHit = true;
CheckHeadAttack();
CheckGetHit();
CheckGetFire();
if (_parent[Nom].Obj.Etat._currentframe >= FrPopOut) {
Etat = "Idle";
}
}
};
ObjShred.prototype.Attack4 = function () {
with (this) {
if (_parent[Nom].Obj.Etat._currentframe == FrAttack4) {
_global.Sounds.PlayASound("Lazer", 1, 80);
}
if (_parent[Nom].Obj.Etat._currentframe >= FrAttack4) {
if (_parent[Nom].Obj.Etat.missile.hitTest(_parent.Pers) && (Pers.CanBeHit == true)) {
_global.Sounds.PlayASound("electroc", 1, 80);
if (Dir == "G") {
Pers.Dir = "D";
} else if (Dir == "D") {
Pers.Dir = "G";
}
Pers.Etat = "GetHit";
Pers.CanBeHit = false;
waitTimeMissile = 0;
_parent[Nom].Obj.Etat.spark._visible = true;
}
var BounceMiss = _parent[Nom].Obj.Etat.spark.getBounds(_parent._parent);
BounceMissX = (BounceMiss.xMax + BounceMiss.xMin) / 2;
BounceMissY = (BounceMiss.yMax + BounceMiss.yMin) / 2;
if (_parent.Collider.Wall.hitTest(BounceMissX, BounceMissY, true)) {
_parent[Nom].Obj.Etat.missile.gotoAndStop("explode");
_parent[Nom].Obj.Etat.stop();
waitTimeMissile = 0;
Etat = "FinAttack4";
}
if (_parent[Nom].Obj.Etat._currentframe >= FrFinAttack4) {
_parent[Nom].Obj.Etat.missile.gotoAndStop("explode");
_parent[Nom].Obj.Etat.stop();
waitTimeMissile = 0;
Etat = "FinAttack4";
}
}
CanBeHit = true;
CheckHeadAttack();
CheckGetHit();
CheckGetFire();
}
};
ObjShred.prototype.Charge = function () {
with (this) {
CanBeHit = true;
SetMoveXCharge();
CheckTurn();
CheckWall("Charge");
CheckHitGrd();
CheckSol();
CheckGetFire();
CheckGetFart();
MoveShred();
CheckSleep();
CheckBoxOver();
CheckBoxSide();
CheckTouchCharge();
CheckHeadAttack();
CheckGetHit();
}
};
ObjShred.prototype.Fight = function () {
with (this) {
Etat = "Attack1";
}
};
ObjShred.prototype.StartJump = function () {
with (this) {
CanBeHit = true;
Etat = "Jump";
SpdYNow = SpdYStepBack;
SpdXFall = SpdXStepBack;
}
};
ObjShred.prototype.Jump = function () {
with (this) {
CanBeHit = true;
CheckHeadAttack();
SetMoveXFall();
CheckWall("Back");
CheckHitGrd();
CheckSol();
CheckGetFire();
CheckGetFart();
MoveShred();
Etat = "Fall";
}
};
ObjShred.prototype.Land = function () {
with (this) {
if (_parent[Nom].Obj.Etat._currentframe >= FrLand) {
Etat = "Walk";
}
}
};
ObjShred.prototype.GetHit = function () {
with (this) {
if (Perso != "Waffle") {
SetMoveXFall();
CheckWall("Back");
CheckHitGrd();
CheckSol();
MoveShred();
}
CheckGetFire();
CheckGetFart();
FrGetHitCount++;
if (FrGetHitCount == 1) {
if (Perso != "Waffle") {
CreerLifeBonus("LifeBonus", PosX, PosY, 50);
} else if (Dir == "D") {
CreerLifeBonus("LifeBonus", PosX + 30, PosY, 50);
} else {
CreerLifeBonus("LifeBonus", PosX - 30, PosY, 50);
}
}
if (FrGetHitCount >= FrGetHit) {
CanBeHit = true;
if (HitGrd == true) {
if (Life > 0) {
if (Perso != "Waffle") {
FrGetHitCount = 0;
Etat = "Idle";
WallSeparate = false;
} else {
FrGetHitCount = 0;
Etat = "PopOut";
WallSeparate = false;
}
} else {
Etat = "Die";
}
} else {
Etat = "Fall";
}
}
}
};
ObjShred.prototype.Fall = function () {
with (this) {
CanBeHit = true;
SetMoveXFall();
CheckWall("Back");
CheckHitGrd();
CheckSol();
CheckGetFire();
CheckHeadAttack();
MoveShred();
if (HitGrd == true) {
if (Life > 0) {
Etat = "Sleep";
CanBeHit = true;
WallSeparate = false;
} else {
Etat = "Die";
}
}
}
};
ObjShred.prototype.CheckHeadAttack = function () {
with (this) {
if (_parent[Nom].Obj.headZone.hitTest(_parent.Pers.Obj.HitBottom)) {
if (random(100) < 50) {
Pers.SpdXBase = random(4) + 3;
} else {
Pers.SpdXBase = random(4) - 7;
}
Pers.SpdYNow = Pers.SpdStartJump / 1.5;
if (CanBeHit) {
_global.Sounds.PlayASound("rHead", 1, 50);
Life--;
CanBeHit = false;
Etat = "GetHit";
}
} else if ((_parent[Nom].Obj.KikZone.hitTest(_parent.Pers.Obj.HitTop) || (_parent[Nom].Obj.KikZone.hitTest(_parent.Pers.Obj.HitFront))) || (_parent[Nom].Obj.KikZone.hitTest(_parent.Pers.Obj.HitBack))) {
if (Pers.CanBeHit == true) {
_global.Sounds.PlayASound("rBump", 1, 80);
Pers.Etat = "GetHit";
Pers.CanBeHit = false;
}
}
}
};
ObjShred.prototype.Attack1 = function () {
with (this) {
if (_parent[Nom].Obj.Etat._currentframe >= FrAttack1) {
if (_parent[Nom].Obj.Etat.missile.hitTest(_parent.Pers) && (Pers.CanBeHit == true)) {
_parent[Nom].Obj.Etat.missile.gotoAndStop("explode");
_parent[Nom].Obj.Etat.stop();
if (Dir == "G") {
Pers.Dir = "D";
} else if (Dir == "D") {
Pers.Dir = "G";
}
Pers.Etat = "GetHit";
Pers.CanBeHit = false;
waitTimeMissile = 0;
Etat = "FinAttack1";
}
var BounceMiss = _parent[Nom].Obj.Etat.missile.getBounds(_parent._parent);
BounceMissX = (BounceMiss.xMax + BounceMiss.xMin) / 2;
BounceMissY = (BounceMiss.yMax + BounceMiss.yMin) / 2;
if (_parent.Collider.Wall.hitTest(BounceMissX, BounceMissY, true)) {
_parent[Nom].Obj.Etat.missile.gotoAndStop("explode");
_parent[Nom].Obj.Etat.stop();
waitTimeMissile = 0;
Etat = "FinAttack1";
}
if (_parent[Nom].Obj.Etat._currentframe >= FrFinAttack1) {
waitTimeMissile = 0;
_parent[Nom].Obj.Etat.missile.gotoAndStop("explode");
_parent[Nom].Obj.Etat.stop();
Etat = "FinAttack1";
}
}
CanBeHit = true;
CheckHeadAttack();
CheckGetHit();
CheckGetFire();
}
};
ObjShred.prototype.FinAttack1 = function () {
with (this) {
waitTimeMissile++;
if (waitTimeMissile >= 10) {
Etat = "Idle";
}
CanBeHit = true;
CheckHeadAttack();
CheckGetHit();
CheckGetFire();
}
};
ObjShred.prototype.FinAttack4 = function () {
with (this) {
waitTimeMissile++;
if (waitTimeMissile == 12) {
_parent[Nom].Obj.Etat.gotoAndPlay(37);
} else if (waitTimeMissile == 21) {
Etat = "PopOut";
}
CanBeHit = true;
CheckHeadAttack();
CheckGetHit();
CheckGetFire();
}
};
ObjShred.prototype.FinAttack3 = function () {
with (this) {
if (_parent[Nom].Obj.Etat._currentframe >= FrFinAttack3) {
Etat = "Idle";
}
CanBeHit = true;
CheckHeadAttack();
CheckGetHit();
CheckGetFire();
}
};
ObjShred.prototype.Die = function () {
with (this) {
Dir = "D";
if (_parent[Nom].Obj.Etat._currentframe == 1) {
_global.Sounds.PlayASound("Dead", 1, 80);
}
if (_parent[Nom].Obj.Etat._currentframe >= FrDie) {
Etat = "Dead";
}
}
};
ObjShred.prototype.Dead = function () {
with (this) {
G_TabShred.splice(ShredI, 1);
ShredI = ShredI - 1;
}
};
ObjShred.prototype.CheckPers = function (CheckDir) {
with (this) {
if (Pers.CanBeHit) {
if (CheckDir == undefined) {
CheckDir = Dir;
}
if ((Pers.PosY >= (PosY - LgAttackUp)) and (Pers.PosY <= (PosY + LgAttackDw))) {
if (((Pers.PosX >= (PosX - LgCheckPersX)) and (Pers.PosX <= PosX)) && (CheckDir == "G")) {
var CheckX = (TrueX - (PosX - Pers.PosX));
while ((CheckX < TrueX) && (!WallSeparate)) {
if (_parent.Collider.Wall.hitTest(CheckX, TrueY, true)) {
WallSeparate = true;
}
CheckX = CheckX + 10;
}
if (!WallSeparate) {
if ((Perso == "Gordon") || ((TrueX > 0) && (TrueX < 500))) {
Etat = "Surpris";
Dir = CheckDir;
}
}
} else if (((Pers.PosX <= (PosX + LgCheckPersX)) and (Pers.PosX >= PosX)) && (CheckDir == "D")) {
var CheckX = (TrueX + (Pers.PosX - PosX));
while ((CheckX > TrueX) && (!WallSeparate)) {
if (_parent.Collider.Wall.hitTest(CheckX, TrueY, true)) {
WallSeparate = true;
}
CheckX = CheckX - 10;
}
if (!WallSeparate) {
if ((Perso == "Gordon") || ((TrueX > 0) && (TrueX < 500))) {
Etat = "Surpris";
Dir = CheckDir;
}
}
}
}
}
}
};
ObjShred.prototype.CheckDistWall = function (CheckDir, CheckXPoint) {
with (this) {
if (CheckDir == undefined) {
CheckDir = Dir;
}
if (CheckXPoint == undefined) {
CheckXPoint = TrueX;
}
TooNearWall = false;
if (CheckDir == "G") {
var CheckX = (CheckXPoint - DistMinWall);
while ((CheckX < CheckXPoint) && (!TooNearWall)) {
if (_parent.Collider.Wall.hitTest(CheckX, TrueY - 5, true)) {
TooNearWall = true;
} else if (_parent.Collider.Turn.hitTest(CheckX, TrueY - 5, true)) {
TooNearWall = true;
}
CheckX = CheckX + 10;
}
} else if (CheckDir == "D") {
var CheckX = (TrueX + DistMinWall);
while ((CheckX > CheckXPoint) && (!TooNearWall)) {
if (_parent.Collider.Wall.hitTest(CheckX, TrueY - 5, true)) {
TooNearWall = true;
} else if (_parent.Collider.Turn.hitTest(CheckX, TrueY - 5, true)) {
TooNearWall = true;
}
CheckX = CheckX - 10;
}
}
}
};
ObjShred.prototype.CheckPersDist = function () {
with (this) {
if (Pers.CanBeHit == true) {
if ((Dir == "G") && (Pers.PosX > PosX)) {
if (Perso != "Waffle") {
Dir = "D";
}
} else if ((Dir == "D") && (Pers.PosX <= PosX)) {
if (Perso != "Waffle") {
Dir = "G";
}
}
if ((Pers.PosY >= (PosY - LgAttackUp)) and (Pers.PosY <= (PosY + LgAttackDw))) {
if ((Pers.PosX >= (PosX - LgCheckPersX)) and (Pers.PosX <= PosX)) {
if ((Pers.PosX >= (PosX - LgCheckFightX)) and (Pers.PosX <= PosX)) {
} else {
Etat = "WalkFight";
}
} else if ((Pers.PosX <= (PosX + LgCheckPersX)) and (Pers.PosX >= PosX)) {
if ((Pers.PosX <= (PosX + LgCheckFightX)) and (Pers.PosX >= PosX)) {
} else {
Etat = "WalkFight";
}
}
}
} else {
Etat = "WalkFight";
}
}
};
ObjShred.prototype.CheckFight = function () {
with (this) {
if (Pers.CanBeHit == true) {
if ((Pers.PosY >= (PosY - LgAttackUp)) and (Pers.PosY <= (PosY + LgAttackDw))) {
if (((Pers.PosX >= (PosX - LgCheckFightX)) and (Pers.PosX <= PosX)) && (Dir == "G")) {
FrSeeingCount = 0;
Etat = "Attack1";
} else if (((Pers.PosX <= (PosX + LgCheckFightX)) and (Pers.PosX >= PosX)) && (Dir == "D")) {
FrSeeingCount = 0;
Etat = "Attack1";
}
}
}
}
};
ObjShred.prototype.CheckJump = function () {
with (this) {
if (Pers.Perso == "MrsX") {
if (Math.ceil(Math.random() * 100) == 1) {
Etat = "StartJump";
}
}
}
};
ObjShred.prototype.CheckGetHit = function () {
with (this) {
if (Pers.CanHit == true) {
if (CanBeHit) {
if ((Pers.HitPointY >= (PosY - GetHitUp)) and (Pers.HitPointY <= (PosY + GetHitDw))) {
if (((Pers.HitPointX <= (PosX + GetHitD)) and (Pers.HitPointX >= (PosX - GetHitG))) and (Pers.Dir eq "D")) {
if (Perso != "Waffle") {
Dir = "G";
}
_global.Sounds.PlayASound("rHead", 1, 50);
Life--;
SpdYNow = SpdYGetHit;
SpdXFall = random(SpdXGetHit) + 5;
Etat = "GetHit";
CanBeHit = false;
} else if (((Pers.HitPointX >= (PosX - GetHitG)) and (Pers.HitPointX <= (PosX + GetHitD))) and (Pers.Dir eq "G")) {
if (Perso != "Waffle") {
Dir = "D";
}
_global.Sounds.PlayASound("rHead", 1, 50);
Life--;
SpdYNow = SpdYGetHit;
SpdXFall = random(SpdXGetHit) + 5;
Etat = "GetHit";
CanBeHit = false;
}
}
}
}
}
};
ObjShred.prototype.CheckGetFire = function () {
with (this) {
var NbMinionBall = G_TabMinionBall.length;
if (NbMinionBall > 0) {
var i = 0;
while (i < NbMinionBall) {
var BallX = _parent.Control[G_TabMinionBall[i]].PosX;
var BallY = _parent.Control[G_TabMinionBall[i]].PosY;
if (((((BallX >= (PosX - GetFireG)) and (BallX <= (PosX + GetFireD))) and (BallY >= (PosY - GetFireUp))) and (BallY <= (PosY + GetFireDw))) && (!Invincible)) {
if (_parent.Control[G_TabMinionBall[i]].HurtMyself == true) {
t = 1;
while (t < 6) {
if (Perso != "Waffle") {
CreerLifeBonus("LifeBonus", PosX, PosY, 50);
} else if (Dir == "D") {
CreerLifeBonus("LifeBonus", PosX + 30, PosY, 50);
} else {
CreerLifeBonus("LifeBonus", PosX - 30, PosY, 50);
}
t++;
}
Etat = "Die";
if (_parent.Control[G_TabMinionBall[i]].Dir == "D") {
Dir = "G";
} else if (_parent.Control[G_TabMinionBall[i]].Dir == "G") {
Dir = "D";
}
_parent.Control[G_TabMinionBall[i]].Etat = "Hit";
}
}
i++;
}
}
}
};
ObjShred.prototype.CheckAttack = function () {
with (this) {
if (Pers.CanBeHit == true) {
if ((Pers.PosY >= (PosY - LgAttackUp)) and (Pers.PosY <= (PosY + LgAttackDw))) {
if (Perso == "Gordon") {
if ((Pers.PosX >= (PosX - LgAttackX)) and (Pers.PosX <= (PosX + LgAttackX))) {
if ((Dir eq "G") and (Pers.PosX > PosX)) {
if (Perso != "Waffle") {
Dir = "D";
}
} else if ((Dir eq "D") and (Pers.PosX <= PosX)) {
if (Perso != "Waffle") {
Dir = "G";
}
}
Etat = "Attack1";
}
} else if (Perso == "Blik") {
if ((Pers.PosX >= (PosX - LgCheckPersX)) and (Pers.PosX <= (PosX + LgCheckPersX))) {
if ((Dir eq "G") and (Pers.PosX > PosX)) {
if (Perso != "Waffle") {
Dir = "D";
}
} else if ((Dir eq "D") and (Pers.PosX <= PosX)) {
if (Perso != "Waffle") {
Dir = "G";
}
}
if (FrBetweenAttack >= FrMoonWalk) {
FrBetweenAttack = 0;
Etat = "Attack3";
} else {
Etat = "MoonWalk";
}
}
} else if ((Dir eq "D") and (Pers.PosX > PosX)) {
if (Math.abs(Pers.PosX - PosX) < 250) {
Etat = "Ready";
}
} else if ((Dir eq "G") and (Pers.PosX < PosX)) {
if (Math.abs(Pers.PosX - PosX) < 250) {
Etat = "Ready";
}
}
}
}
}
};
ObjShred.prototype.CheckTouchCharge = function () {
with (this) {
var CheckX = Pers.FrontX;
if (((Dir == "G") && (Pers.Dir == "G")) || ((Dir == "D") && (Pers.Dir == "D"))) {
CheckX = Pers.BackX;
}
if (_parent[Nom].hitTest(CheckX, Pers.FrontY, true)) {
if (Pers.CanBeHit == true) {
_global.Sounds.PlayASound("rBump", 1, 80);
if (Dir == "G") {
Pers.Dir = "D";
} else if (Dir == "D") {
Pers.Dir = "G";
}
Pers.Etat = "GetHit";
Pers.CanBeHit = false;
Etat = "Idle";
}
}
}
};
ObjShred.prototype.SetMoveX = function () {
with (this) {
MoveX = SpdXBase;
if (Dir eq "G") {
MoveX = MoveX * -1;
}
}
};
ObjShred.prototype.InverseSetMoveX = function () {
with (this) {
MoveX = SpdXBase;
if (Dir eq "D") {
MoveX = MoveX * -1;
}
}
};
ObjShred.prototype.SetMoveXWalkFight = function () {
with (this) {
MoveX = SpdXWalkFight;
if (Dir eq "G") {
MoveX = MoveX * -1;
}
}
};
ObjShred.prototype.SetMoveXCharge = function () {
with (this) {
MoveX = SpdXCharge;
if (Dir eq "G") {
MoveX = MoveX * -1;
}
}
};
ObjShred.prototype.SetMoveXFall = function () {
with (this) {
MoveX = SpdXFall;
if (SpdXFall > 0) {
SpdXFall = SpdXFall * 0.9;
}
if (Dir eq "D") {
MoveX = MoveX * -1;
}
}
};
ObjShred.prototype.CheckWall = function (CheckDir) {
with (this) {
if (MoveX != 0) {
if (CheckDir == "Back") {
var AddPoint = LgBack;
} else if (CheckDir == "Charge") {
var AddPoint = LgCharge;
} else {
var AddPoint = LgFront;
}
if (MoveX > 0) {
var WallStop = WallHitBloc;
var CheckX = (TrueX + AddPoint);
} else {
var WallStop = (-1 * WallHitBloc);
var CheckX = (TrueX - AddPoint);
}
var WallHit1 = (MoveX / 3);
var WallHit2 = (WallHit1 * 2);
if (_parent.Collider.Wall.hitTest(CheckX + WallStop, TrueY, true)) {
if (Etat == "Charge") {
Etat = "StartJump";
} else if (((Etat == "GetHit") || (Etat == "StartJump")) || (Etat == "Fall")) {
MoveX = 0;
WallSeparate = false;
} else if (Etat == "MoonWalk") {
WallSeparate = false;
FrBetweenAttack = FrMoonWalk;
SetMoveX();
MoveShred();
Etat = "Walk";
} else {
MoveX = 0;
WallSeparate = false;
if (Dir eq "G") {
Dir = "D";
} else {
Dir = "G";
}
CheckDistWall();
if ((Math.ceil(Math.random() * 4) == 4) || (TooNearWall)) {
Etat = "Idle";
} else {
Etat = "Walk";
}
}
} else if (_parent.Collider.Wall.hitTest(CheckX + WallHit1, TrueY, true)) {
MoveX = WallHitBloc;
} else if (_parent.Collider.Wall.hitTest(CheckX + WallHit2, TrueY, true)) {
MoveX = WallHit1;
} else if (_parent.Collider.Wall.hitTest(CheckX + MoveX, TrueY, true)) {
MoveX = WallHit2;
}
}
}
};
ObjShred.prototype.CheckTurn = function () {
with (this) {
if (_parent.Collider.Turn.hitTest(TrueX + MoveX, TrueY, true) || (_parent.Collider.Wall.hitTest(TrueX + MoveX, TrueY, true))) {
if (Etat == "MoonWalk") {
FrBetweenAttack = FrMoonWalk;
SetMoveX();
MoveShred();
Etat = "Walk";
} else {
MoveX = 0;
if (Dir eq "G") {
Dir = "D";
} else {
Dir = "G";
}
CheckDistWall();
if ((Math.ceil(Math.random() * 4) == 4) || (TooNearWall)) {
Etat = "Idle";
} else {
Etat = "Walk";
}
}
}
}
};
ObjShred.prototype.CheckSol = function () {
with (this) {
if (_parent.Collider.Sol.hitTest(TrueX, TrueY, true) and (SpdYNow >= 0)) {
SpdYNow = 0;
var InSol = true;
while (InSol == true) {
MoveY = MoveY - SolOut;
InSol = _parent.Collider.Sol.hitTest(TrueX, TrueY + MoveY, true);
}
} else if (SpdYNow >= 0) {
if (HitGrd == true) {
SpdYNow = 0;
MoveY = SpdYNow;
} else {
SpdYNow = SpdYNow + SpdYUp;
if (SpdYNow > SpdYMax) {
SpdYNow = SpdYMax;
}
var SolHit1 = (SpdYNow / 3);
var SolHit2 = (SolHit1 * 2);
if (_parent.Collider.Sol.hitTest(TrueX, TrueY + SolHit1, true)) {
MoveY = SolHitMin;
} else if (_parent.Collider.Sol.hitTest(TrueX, TrueY + SolHit2, true)) {
MoveY = SolHit1;
} else if (_parent.Collider.Sol.hitTest(TrueX, TrueY + SpdYNow, true)) {
MoveY = SolHit2;
} else {
MoveY = SpdYNow;
}
}
} else {
SpdYNow = SpdYNow + SpdYUp;
MoveY = SpdYNow;
}
}
};
ObjShred.prototype.CheckHitGrd = function () {
with (this) {
if (_parent.Collider.Sol.hitTest(TrueX, TrueY + MaxSol, true)) {
HitGrd = true;
} else {
HitGrd = false;
}
}
};
ObjShred.prototype.SetTruePos = function () {
with (this) {
TrueX = PosX + _parent._x;
TrueY = PosY + _parent._y;
}
};
ObjShred.prototype.MoveShred = function () {
with (this) {
_parent[Nom]._x = _parent[Nom]._x + MoveX;
_parent[Nom]._y = _parent[Nom]._y + MoveY;
PosX = _parent[Nom]._x;
PosY = _parent[Nom]._y;
}
};
ObjShred.prototype.CheckActif = function () {
with (this) {
if (((((PosX >= (Bg.InvPosX - LgOutG)) and (PosX <= (Bg.InvPosX + LgOutD))) and (PosY >= (Bg.InvPosY - LgOutUp))) and (PosY <= (Bg.InvPosY + LgOutDw))) and (Etat eq "Sleep")) {
if (Life > 0) {
Etat = "Idle";
CanBeHit = true;
Dir = BaseDir;
} else {
Etat = "Dead";
}
}
}
};
ObjShred.prototype.CheckSleep = function () {
with (this) {
if ((((PosX < (Bg.InvPosX - LgOutG)) or (PosX > (Bg.InvPosX + LgOutD))) or (PosY < (Bg.InvPosY - LgOutUp))) or (PosY > (Bg.InvPosY + LgOutDw))) {
if (Pers.PosX < PosX) {
if (Perso != "Waffle") {
Dir = "G";
}
} else if (Perso != "Waffle") {
Dir = "D";
}
Etat = "Sleep";
}
}
};
ObjShred.prototype.KillShred = function () {
with (this) {
Etat = "Dead";
}
};
ObjShred.prototype.ChangeDir = function (NewDir) {
with (this) {
DirOld = Dir;
Dir = NewDir;
_parent[Nom].gotoAndStop(Perso + NewDir);
_parent[Nom].Obj.gotoAndStop(Etat);
}
};
ObjShred.prototype.ChangeEtat = function (NewAction) {
with (this) {
EtatOld = Etat;
Etat = NewAction;
_parent[Nom].Obj.gotoAndStop(NewAction);
}
};
ObjShred.prototype.Actions = function () {
with (this) {
if (G_Pause == true) {
if (InPause == false) {
InPause = true;
_parent[Nom].Obj.Etat.stop();
}
} else {
if (InPause == true) {
InPause = false;
_parent[Nom].Obj.Etat.play();
}
SetTruePos();
this[Etat]();
}
}
};
CreerDestructObject = function (Nom, PosX, PosY, Kind, nbr) {
if (this[Nom] == null) {
this[Nom] = new ObjDestruct(Nom, PosX, PosY, Kind, nbr);
G_TabDestruct.push(Nom);
}
};
ObjDestruct.prototype.Actions = function () {
with (this) {
if (G_Pause == true) {
if (InPause == false) {
InPause = true;
}
} else {
if (InPause == true) {
InPause = false;
}
this[Etat]();
}
}
};
ObjDestruct.prototype.Idle = function () {
with (this) {
CheckSleep();
CheckHit();
}
};
ObjDestruct.prototype.Normal = function () {
with (this) {
CheckSleep();
CheckWalkOn();
}
};
ObjDestruct.prototype.CheckHit = function () {
with (this) {
if (Pers.CanHit == true) {
if (Kind != "tirroir") {
if ((Pers.HitPointY >= (PosY - GetHitUp)) and (Pers.HitPointY <= (PosY + GetHitDw))) {
if ((Pers.HitPointX <= (PosX + GetHitD)) and (Pers.HitPointX >= (PosX - GetHitG))) {
_global.Sounds.PlayASound("Pot", 1, 80);
Pers.CanHit = false;
Life--;
Etat = "animplaying";
trace((("PosX = " + PosX) + " / ") + PosY);
i = 1;
while (i <= nbr) {
CreerLifeBonus("LifeBonus", PosX, PosY, 50);
i++;
}
if (BombInside) {
_global.Game.CreerMinionBall(PosX, PosY, "none", random(4) + 4, random(3) - 20);
}
}
}
} else if ((Pers.HitPointY >= (PosY - GetHitUpTirroir)) and (Pers.HitPointY <= (PosY + GetHitDwTirroir))) {
if ((Pers.HitPointX <= ((PosX + GetHitDTirroir) + (_parent[Nom]._width / 2))) and (Pers.HitPointX >= ((PosX - GetHitGTirroir) - (_parent[Nom]._width / 2)))) {
_global.Sounds.PlayASound("Tirroir", 1, 100);
Pers.CanHit = false;
Life--;
Etat = "animplaying";
trace((("PosX = " + PosX) + " / ") + PosY);
i = 1;
while (i <= nbr) {
CreerLifeBonus("LifeBonus", PosX, PosY, 50);
i++;
}
if (BombInside) {
_global.Game.CreerMinionBall(PosX, PosY, "none", random(4) + 4, random(3) - 20);
}
}
}
}
}
};
ObjDestruct.prototype.CheckWalkOn = function () {
with (this) {
if ((Pers.PosY >= (PosY - GetStepY)) and (Pers.PosY <= (PosY + GetStepY))) {
if ((Pers.PosX <= (PosX + GetStepX)) and (Pers.PosX >= (PosX - GetStepX))) {
_global.Sounds.PlayASound("Coussin", 1, 80);
Etat = "Jump";
Pers.SpdYNow = Pers.SpdStartJump;
if (Stepped < nbr) {
Stepped++;
if (Stepped <= nbr) {
CreerLifeBonus("LifeBonus", PosX, PosY, 50);
}
if (BombInside) {
BombInside = false;
_global.Game.CreerMinionBall(PosX, PosY, "none", random(4) + 4, random(3) - 10);
}
}
}
}
}
};
ObjDestruct.prototype.Jump = function () {
with (this) {
if (_parent[Nom]._currentframe == FrJump) {
Etat = "Normal";
}
}
};
ObjDestruct.prototype.animplaying = function () {
with (this) {
if (_parent[Nom]._currentframe == FrDead) {
Etat = "Dead";
}
}
};
ObjDestruct.prototype.Dead = function () {
};
ObjDestruct.prototype.ChangeEtat = function (NewAction) {
with (this) {
EtatOld = Etat;
Etat = NewAction;
_parent[Nom].gotoAndStop(NewAction);
}
};
ObjDestruct.prototype.Sleep = function () {
with (this) {
CheckActif();
}
};
ObjDestruct.prototype.CheckActif = function () {
with (this) {
if (((((PosX >= (Bg.InvPosX - LgOutG)) and (PosX <= (Bg.InvPosX + LgOutD))) and (PosY >= (Bg.InvPosY - LgOutUp))) and (PosY <= (Bg.InvPosY + LgOutDw))) and (Etat eq "Sleep")) {
if (Kind == "Coussin") {
Etat = "Normal";
} else if (Life > 0) {
Etat = "Idle";
} else {
Etat = "Dead";
}
}
}
};
ObjDestruct.prototype.CheckSleep = function () {
with (this) {
if ((((PosX < (Bg.InvPosX - LgOutG)) or (PosX > (Bg.InvPosX + LgOutD))) or (PosY < (Bg.InvPosY - LgOutUp))) or (PosY > (Bg.InvPosY + LgOutDw))) {
Etat = "Sleep";
}
}
};
CreerLifeBonus = function (Nom, PosX, PosY, Value, imove) {
if (Nom == "LifeBonus") {
var _local3 = 1;
while (this[Nom + _local3] != null) {
_local3++;
}
Nom = Nom + _local3;
_parent.attachMovie("minXBonus", Nom, _parent.getNextHighestDepth());
}
if (imove == undefined) {
imove = true;
}
if (this[Nom] == null) {
this[Nom] = new ObjLifeBonus(Nom, PosX, PosY, Value, imove);
G_TabLifeBonus.push(Nom);
}
};
ObjLifeBonus.prototype.Sleep = function () {
with (this) {
CheckActif();
}
};
ObjLifeBonus.prototype.Idle = function () {
with (this) {
CheckGet();
CheckSleep();
}
};
ObjLifeBonus.prototype.IdleClose = function () {
with (this) {
CheckSleep();
}
};
ObjLifeBonus.prototype.Move = function () {
with (this) {
_parent[Nom]._x = PosX + SpdX;
_parent[Nom]._y = PosY + SpdY;
PosX = PosX + SpdX;
PosY = PosY + SpdY;
if (Stopped == false) {
SpdY++;
if (SpdY == 0) {
detectNow = true;
}
} else {
Etat = "Idle";
}
SetTruePos();
if (detectNow == true) {
CheckGet();
CheckGround();
}
CheckWall();
CheckOut();
}
};
ObjLifeBonus.prototype.Get = function () {
with (this) {
if (Value == 50) {
FrGet = FrGetScore;
} else {
FrGet = FrGetElse;
}
if (_parent[Nom].Etat._currentframe >= FrGet) {
ChangeEtat("Kill");
Pers.GetLifeBonus(Value);
}
}
};
ObjLifeBonus.prototype.Kill = function () {
with (this) {
for (LifeBonusI in G_TabLifeBonus) {
var LifeBonusActif = G_TabLifeBonus[LifeBonusI];
_parent[Nom].removeMovieClip();
if (LifeBonusActif == Nom) {
delete G_TabLifeBonus[LifeBonusI];
}
}
delete this;
}
};
ObjLifeBonus.prototype.CheckGet = function () {
with (this) {
if ((((Pers.PosY >= (PosY - LgHitUp)) and (Pers.PosY <= (PosY + LgHitDw))) and (Pers.PosX >= (PosX - LgHitX))) and (Pers.PosX <= (PosX + LgHitX))) {
_global.Sounds.PlayASound("Objet", 1, 100);
Etat = "Get";
}
}
};
ObjLifeBonus.prototype.CheckActif = function () {
with (this) {
if ((((PosX >= (Bg.InvPosX - LgOutG)) and (PosX <= (Bg.InvPosX + LgOutD))) and (PosY >= (Bg.InvPosY - LgOutUp))) and (PosY <= (Bg.InvPosY + LgOutDw))) {
if (imove == false) {
if ((Value != 500) || (_global.Game.G_TabShred.length == 0)) {
Etat = "Idle";
} else {
Etat = "IdleClose";
if (_global.ShowLeft._currentframe == 1) {
_global.ShowLeft.gotoAndPlay("opening");
}
}
} else {
Etat = "Move";
}
}
}
};
ObjLifeBonus.prototype.CheckSleep = function () {
with (this) {
if ((((PosX < (Bg.InvPosX - LgOutG)) or (PosX > (Bg.InvPosX + LgOutD))) or (PosY < (Bg.InvPosY - LgOutUp))) or (PosY > (Bg.InvPosY + LgOutDw))) {
Etat = "Sleep";
}
}
};
ObjLifeBonus.prototype.ChangeEtat = function (NewAction) {
with (this) {
EtatOld = Etat;
Etat = NewAction;
_parent[Nom].gotoAndStop(NewAction);
}
};
ObjLifeBonus.prototype.Actions = function () {
with (this) {
if (G_Pause == true) {
if (InPause == false) {
InPause = true;
_parent[Nom].Etat.stop();
}
} else {
if (InPause == true) {
InPause = false;
_parent[Nom].Etat.play();
}
this[Etat]();
}
}
};
ObjLifeBonus.prototype.SetTruePos = function () {
with (this) {
if (SpdX > 0) {
TrueX = (PosX + _parent._x) + Xdetect;
} else {
TrueX = (PosX + _parent._x) - Xdetect;
}
TrueY = PosY + _parent._y;
}
};
ObjLifeBonus.prototype.CheckWall = function () {
with (this) {
if (_parent.Collider.Wall.hitTest(TrueX, TrueY, true) and (!_parent.Collider.Wall.Pass.hitTest(TrueX, TrueY, true))) {
_global.Sounds.PlayASound("Bump", 1, 60);
SpdX = SpdX * -1;
if (Math.abs(SpdX) < 5) {
if (SpdX < 5) {
SpdX = 5;
} else if (Spd > -5) {
SpdX = -5;
}
}
}
}
};
ObjLifeBonus.prototype.CheckGround = function () {
with (this) {
if (_parent.Collider.Sol.hitTest(TrueX, TrueY, true)) {
if (SpdY > 2) {
if (SpdY >= 5) {
_global.Sounds.PlayASound("Bump", 1, 60);
}
bondi = true;
SpdY = Math.round(SpdY * -0.5);
} else if ((SpdY < 2) && (SpdY > 0)) {
if (bondi == true) {
Stopped = true;
SpdY = 0;
} else {
SpdY = random(3) - 15;
}
}
}
}
};
this.G_Pause = true;
this.G_PauseOut = false;
this.G_PRealese = true;
this.G_Resume = false;
this.G_TabShred = new Array();
this.G_TabBox = new Array();
this.G_TabGun = new Array();
this.G_TabSwitch = new Array();
this.G_TabDoor = new Array();
this.G_TabHeroChanger = new Array();
this.G_TabElevator = new Array();
this.G_TabPersBall = new Array();
this.G_TabMinionBall = new Array();
this.G_TabLifeBonus = new Array();
this.G_TabCam = new Array();
this.G_TabLevier = new Array();
this.G_TabTV = new Array();
this.G_TabDestruct = new Array();
this.G_NextPersBall = 1;
this.G_NextPersBallDepth = 10;
this.G_NextMinionBall = 1;
this.G_NextMinionBallDepth = 20;
}
onClipEvent (enterFrame) {
ShredI = 0;
for (ShredI in G_TabShred) {
var ShredActif = G_TabShred[ShredI];
if (this[ShredActif].Dir != this[ShredActif].DirOld) {
this[ShredActif].ChangeDir(this[ShredActif].Dir);
}
if (this[ShredActif].Etat != this[ShredActif].EtatOld) {
this[ShredActif].ChangeEtat(this[ShredActif].Etat);
}
this[ShredActif].Actions();
}
MinionBallI = 0;
for (MinionBallI in G_TabMinionBall) {
var MinionBallActif = G_TabMinionBall[MinionBallI];
if (this[MinionBallActif].Etat != this[MinionBallActif].EtatOld) {
this[MinionBallActif].ChangeEtat(this[MinionBallActif].Etat);
}
this[MinionBallActif].Actions();
}
LifeBonusI = 0;
for (LifeBonusI in G_TabLifeBonus) {
var LifeBonusActif = G_TabLifeBonus[LifeBonusI];
if (this[LifeBonusActif].Etat != this[LifeBonusActif].EtatOld) {
this[LifeBonusActif].ChangeEtat(this[LifeBonusActif].Etat);
}
this[LifeBonusActif].Actions();
}
ObjDstr = 0;
for (ObjDstr in G_TabDestruct) {
var DstrActif = G_TabDestruct[ObjDstr];
if (this[DstrActif].Etat != this[DstrActif].EtatOld) {
this[DstrActif].ChangeEtat(this[DstrActif].Etat);
}
this[DstrActif].Actions();
}
if (Pers.Dir != Pers.DirOld) {
Pers.ChangeDir(Pers.Dir);
}
if (Pers.Etat != Pers.EtatOld) {
Pers.ChangeEtat(Pers.Etat);
}
this.Pers.Actions();
this.Bg.Actions();
if (G_Pause == false) {
G_CurrentFocus = Selection.getFocus();
if (G_CurrentFocus == null) {
G_PauseOut = true;
}
}
G_CheckPause();
}
Symbol 836 MovieClip Frame 2
stop();
Instance of Symbol 786 MovieClip in Symbol 836 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerBg(_parent._x, _parent._y);
BG = _parent.Control.Bg;
BG.MaxDw1 = -200;
BG.MaxUp1 = -380;
BG.MaxG1 = -11400;
BG.MaxD1 = -220;
BG.MaxDw2 = 13000;
BG.MaxUp2 = -125000;
BG.MaxG2 = -162000;
BG.MaxD2 = 112500 /* 0x01B774 */;
BG.CheckScreen = function () {
with (this) {
if (CurrentScreen == 1) {
if (_global.Game.Pers.PosX > 1300000) {
MaxDw = MaxDw2;
MaxUp = MaxUp2;
MaxG = MaxG2;
MaxD = MaxD2;
CurrentScreen = 2;
} else {
MaxDw = MaxDw1;
MaxUp = MaxUp1;
MaxG = MaxG1;
MaxD = MaxD1;
}
} else if (CurrentScreen == 2) {
if (((_global.Game.Pers.PosX < 1250) && (_global.Game.Pers.PosY < 1050)) && (_global.Game.Pers.PosY > 900)) {
MaxDw = MaxDw1;
MaxUp = MaxUp1;
MaxG = MaxG1;
MaxD = MaxD1;
CurrentScreen = 1;
} else {
MaxDw = MaxDw2;
MaxUp = MaxUp2;
MaxG = MaxG2;
MaxD = MaxD2;
}
}
}
};
}
Instance of Symbol 478 MovieClip "Minion11" in Symbol 836 MovieClip Frame 2
onClipEvent (load) {
var Dir = "D";
var Type = "Waffle";
_parent.Control.CreerShred(this._name, this._x, this._y, Dir, Type);
this.gotoAndStop(Dir);
this.Obj.gotoAndStop("Sleep");
}
Instance of Symbol 478 MovieClip "Minion14" in Symbol 836 MovieClip Frame 2
onClipEvent (load) {
var Dir = "G";
var Type = "Waffle";
_parent.Control.CreerShred(this._name, this._x, this._y, Dir, Type);
this.gotoAndStop(Dir);
this.Obj.gotoAndStop("Sleep");
}
Instance of Symbol 794 MovieClip "Collider" in Symbol 836 MovieClip Frame 2
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 478 MovieClip "Minion19" in Symbol 836 MovieClip Frame 2
onClipEvent (load) {
var Dir = "G";
var Type = "Waffle";
_parent.Control.CreerShred(this._name, this._x, this._y, Dir, Type);
this.gotoAndStop(Dir);
this.Obj.gotoAndStop("Sleep");
}
Instance of Symbol 522 MovieClip "destruct8" in Symbol 836 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerDestructObject(this._name, this._x, this._y, "tirroir");
this.gotoAndStop("Sleep");
}
Instance of Symbol 522 MovieClip "destruct7" in Symbol 836 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerDestructObject(this._name, this._x, this._y, "tirroir");
this.gotoAndStop("Sleep");
}
Instance of Symbol 522 MovieClip "destruct6" in Symbol 836 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerDestructObject(this._name, this._x, this._y, "tirroir");
this.gotoAndStop("Sleep");
}
Instance of Symbol 533 MovieClip "destruct1" in Symbol 836 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerDestructObject(this._name, this._x, this._y, "pot");
this.gotoAndStop("Sleep");
}
Instance of Symbol 528 MovieClip "destruct2" in Symbol 836 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerDestructObject(this._name, this._x, this._y, "pot");
this.gotoAndStop("Sleep");
}
Instance of Symbol 549 MovieClip "LifeBonus101" in Symbol 836 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerLifeBonus(this._name, this._x, this._y, 0, false);
}
Instance of Symbol 533 MovieClip "destruct29" in Symbol 836 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerDestructObject(this._name, this._x, this._y, "pot");
this.gotoAndStop("Sleep");
}
Instance of Symbol 533 MovieClip "destruct31" in Symbol 836 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerDestructObject(this._name, this._x, this._y, "pot");
this.gotoAndStop("Sleep");
}
Instance of Symbol 528 MovieClip "destruct5" in Symbol 836 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerDestructObject(this._name, this._x, this._y, "pot");
this.gotoAndStop("Sleep");
}
Instance of Symbol 560 MovieClip "destruct28" in Symbol 836 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerDestructObject(this._name, this._x, this._y, "Coussin");
this.gotoAndStop("Sleep");
}
Instance of Symbol 560 MovieClip "destruct17" in Symbol 836 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerDestructObject(this._name, this._x, this._y, "Coussin");
this.gotoAndStop("Sleep");
}
Instance of Symbol 560 MovieClip "destruct18" in Symbol 836 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerDestructObject(this._name, this._x, this._y, "Coussin");
this.gotoAndStop("Sleep");
}
Instance of Symbol 537 MovieClip "destruct33" in Symbol 836 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerDestructObject(this._name, this._x, this._y, "tirroir");
this.gotoAndStop("Sleep");
}
Instance of Symbol 541 MovieClip "destruct30" in Symbol 836 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerDestructObject(this._name, this._x, this._y, "tirroir");
this.gotoAndStop("Sleep");
}
Instance of Symbol 809 MovieClip "LifeBonus20" in Symbol 836 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerLifeBonus(this._name, this._x, this._y, 500, false);
}
Instance of Symbol 541 MovieClip "destruct38" in Symbol 836 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerDestructObject(this._name, this._x, this._y, "tirroir");
this.gotoAndStop("Sleep");
}
Instance of Symbol 533 MovieClip "destruct9" in Symbol 836 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerDestructObject(this._name, this._x, this._y, "pot");
this.gotoAndStop("Sleep");
}
Instance of Symbol 528 MovieClip "destruct10" in Symbol 836 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerDestructObject(this._name, this._x, this._y, "pot");
this.gotoAndStop("Sleep");
}
Instance of Symbol 478 MovieClip "Minion22" in Symbol 836 MovieClip Frame 2
onClipEvent (load) {
var Dir = "G";
var Type = "Waffle";
_parent.Control.CreerShred(this._name, this._x, this._y, Dir, Type);
this.gotoAndStop(Dir);
this.Obj.gotoAndStop("Sleep");
}
Instance of Symbol 522 MovieClip "destruct35" in Symbol 836 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerDestructObject(this._name, this._x, this._y, "tirroir");
this.gotoAndStop("Sleep");
}
Instance of Symbol 522 MovieClip "destruct36" in Symbol 836 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerDestructObject(this._name, this._x, this._y, "tirroir");
this.gotoAndStop("Sleep");
}
Instance of Symbol 522 MovieClip "destruct37" in Symbol 836 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerDestructObject(this._name, this._x, this._y, "tirroir");
this.gotoAndStop("Sleep");
}
Instance of Symbol 374 MovieClip [minXBonus] "LifeBonus1" in Symbol 836 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerLifeBonus(this._name, this._x, this._y, 100, false);
}
Instance of Symbol 374 MovieClip [minXBonus] "LifeBonus2" in Symbol 836 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerLifeBonus(this._name, this._x, this._y, 100, false);
}
Instance of Symbol 374 MovieClip [minXBonus] "LifeBonus3" in Symbol 836 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerLifeBonus(this._name, this._x, this._y, 100, false);
}
Instance of Symbol 528 MovieClip "destruct34" in Symbol 836 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerDestructObject(this._name, this._x, this._y, "pot");
this.gotoAndStop("Sleep");
}
Instance of Symbol 818 MovieClip "destruct4" in Symbol 836 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerDestructObject(this._name, this._x, this._y, "tirroir");
this.gotoAndStop("Sleep");
}
Instance of Symbol 818 MovieClip "destruct3" in Symbol 836 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerDestructObject(this._name, this._x, this._y, "tirroir");
this.gotoAndStop("Sleep");
}
Instance of Symbol 374 MovieClip [minXBonus] "LifeBonus4" in Symbol 836 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerLifeBonus(this._name, this._x, this._y, 100, false);
}
Instance of Symbol 374 MovieClip [minXBonus] "LifeBonus5" in Symbol 836 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerLifeBonus(this._name, this._x, this._y, 100, false);
}
Instance of Symbol 374 MovieClip [minXBonus] "LifeBonus6" in Symbol 836 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerLifeBonus(this._name, this._x, this._y, 100, false);
}
Instance of Symbol 374 MovieClip [minXBonus] "LifeBonus7" in Symbol 836 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerLifeBonus(this._name, this._x, this._y, 100, false);
}
Instance of Symbol 374 MovieClip [minXBonus] "LifeBonus8" in Symbol 836 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerLifeBonus(this._name, this._x, this._y, 100, false);
}
Instance of Symbol 827 MovieClip "destruct14" in Symbol 836 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerDestructObject(this._name, this._x, this._y, "pot");
this.gotoAndStop("Sleep");
}
Instance of Symbol 832 MovieClip "destruct11" in Symbol 836 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerDestructObject(this._name, this._x, this._y, "pot");
this.gotoAndStop("Sleep");
}
Instance of Symbol 522 MovieClip "destruct13" in Symbol 836 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerDestructObject(this._name, this._x, this._y, "tirroir");
this.gotoAndStop("Sleep");
}
Instance of Symbol 522 MovieClip "destruct12" in Symbol 836 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerDestructObject(this._name, this._x, this._y, "tirroir");
this.gotoAndStop("Sleep");
}
Instance of Symbol 832 MovieClip "destruct16" in Symbol 836 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerDestructObject(this._name, this._x, this._y, "pot");
this.gotoAndStop("Sleep");
}
Instance of Symbol 827 MovieClip "destruct15" in Symbol 836 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerDestructObject(this._name, this._x, this._y, "pot");
this.gotoAndStop("Sleep");
}
Instance of Symbol 374 MovieClip [minXBonus] "LifeBonus9" in Symbol 836 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerLifeBonus(this._name, this._x, this._y, 100, false);
}
Instance of Symbol 374 MovieClip [minXBonus] "LifeBonus10" in Symbol 836 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerLifeBonus(this._name, this._x, this._y, 100, false);
}
Instance of Symbol 374 MovieClip [minXBonus] "LifeBonus11" in Symbol 836 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerLifeBonus(this._name, this._x, this._y, 100, false);
}
Instance of Symbol 522 MovieClip "destruct21" in Symbol 836 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerDestructObject(this._name, this._x, this._y, "tirroir");
this.gotoAndStop("Sleep");
}
Instance of Symbol 522 MovieClip "destruct20" in Symbol 836 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerDestructObject(this._name, this._x, this._y, "tirroir");
this.gotoAndStop("Sleep");
}
Instance of Symbol 522 MovieClip "destruct19" in Symbol 836 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerDestructObject(this._name, this._x, this._y, "tirroir");
this.gotoAndStop("Sleep");
}
Instance of Symbol 832 MovieClip "destruct22" in Symbol 836 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerDestructObject(this._name, this._x, this._y, "pot");
this.gotoAndStop("Sleep");
}
Instance of Symbol 832 MovieClip "destruct24" in Symbol 836 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerDestructObject(this._name, this._x, this._y, "pot");
this.gotoAndStop("Sleep");
}
Instance of Symbol 827 MovieClip "destruct23" in Symbol 836 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerDestructObject(this._name, this._x, this._y, "pot");
this.gotoAndStop("Sleep");
}
Instance of Symbol 549 MovieClip "LifeBonus102" in Symbol 836 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerLifeBonus(this._name, this._x, this._y, 0, false);
}
Instance of Symbol 374 MovieClip [minXBonus] "LifeBonus14" in Symbol 836 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerLifeBonus(this._name, this._x, this._y, 100, false);
}
Instance of Symbol 374 MovieClip [minXBonus] "LifeBonus15" in Symbol 836 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerLifeBonus(this._name, this._x, this._y, 100, false);
}
Instance of Symbol 374 MovieClip [minXBonus] "LifeBonus16" in Symbol 836 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerLifeBonus(this._name, this._x, this._y, 100, false);
}
Instance of Symbol 522 MovieClip "destruct26" in Symbol 836 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerDestructObject(this._name, this._x, this._y, "tirroir");
this.gotoAndStop("Sleep");
}
Instance of Symbol 522 MovieClip "destruct25" in Symbol 836 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerDestructObject(this._name, this._x, this._y, "tirroir");
this.gotoAndStop("Sleep");
}
Instance of Symbol 818 MovieClip "destruct27" in Symbol 836 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerDestructObject(this._name, this._x, this._y, "tirroir");
this.gotoAndStop("Sleep");
}
Instance of Symbol 818 MovieClip "destruct32" in Symbol 836 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerDestructObject(this._name, this._x, this._y, "tirroir");
this.gotoAndStop("Sleep");
}
Instance of Symbol 374 MovieClip [minXBonus] "LifeBonus17" in Symbol 836 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerLifeBonus(this._name, this._x, this._y, 100, false);
}
Instance of Symbol 374 MovieClip [minXBonus] "LifeBonus18" in Symbol 836 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerLifeBonus(this._name, this._x, this._y, 100, false);
}
Instance of Symbol 374 MovieClip [minXBonus] "LifeBonus19" in Symbol 836 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerLifeBonus(this._name, this._x, this._y, 100, false);
}
Instance of Symbol 478 MovieClip "Minion13" in Symbol 836 MovieClip Frame 2
onClipEvent (load) {
var Dir = "G";
var Type = "Blik";
_parent.Control.CreerShred(this._name, this._x, this._y, Dir, Type);
this.gotoAndStop(Dir);
this.Obj.gotoAndStop("Sleep");
}
Instance of Symbol 478 MovieClip "Minion16" in Symbol 836 MovieClip Frame 2
onClipEvent (load) {
var Dir = "G";
var Type = "Blik";
_parent.Control.CreerShred(this._name, this._x, this._y, Dir, Type);
this.gotoAndStop(Dir);
this.Obj.gotoAndStop("Sleep");
}
Instance of Symbol 478 MovieClip "Minion17" in Symbol 836 MovieClip Frame 2
onClipEvent (load) {
var Dir = "G";
var Type = "Gordon";
_parent.Control.CreerShred(this._name, this._x, this._y, Dir, Type);
this.gotoAndStop(Dir);
this.Obj.gotoAndStop("Sleep");
}
Instance of Symbol 478 MovieClip "Minion18" in Symbol 836 MovieClip Frame 2
onClipEvent (load) {
var Dir = "G";
var Type = "Blik";
_parent.Control.CreerShred(this._name, this._x, this._y, Dir, Type);
this.gotoAndStop(Dir);
this.Obj.gotoAndStop("Sleep");
}
Instance of Symbol 478 MovieClip "Minion20" in Symbol 836 MovieClip Frame 2
onClipEvent (load) {
var Dir = "G";
var Type = "Gordon";
_parent.Control.CreerShred(this._name, this._x, this._y, Dir, Type);
this.gotoAndStop(Dir);
this.Obj.gotoAndStop("Sleep");
}
Instance of Symbol 478 MovieClip "Minion21" in Symbol 836 MovieClip Frame 2
onClipEvent (load) {
var Dir = "D";
var Type = "Blik";
_parent.Control.CreerShred(this._name, this._x, this._y, Dir, Type);
this.gotoAndStop(Dir);
this.Obj.gotoAndStop("Sleep");
}
Instance of Symbol 478 MovieClip "Minion22" in Symbol 836 MovieClip Frame 2
onClipEvent (load) {
var Dir = "G";
var Type = "Blik";
_parent.Control.CreerShred(this._name, this._x, this._y, Dir, Type);
this.gotoAndStop(Dir);
this.Obj.gotoAndStop("Sleep");
}
Instance of Symbol 374 MovieClip [minXBonus] "LifeBonus12" in Symbol 836 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerLifeBonus(this._name, this._x, this._y, 100, false);
}
Instance of Symbol 374 MovieClip [minXBonus] "LifeBonus13" in Symbol 836 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerLifeBonus(this._name, this._x, this._y, 100, false);
}
Instance of Symbol 478 MovieClip "Minion12" in Symbol 836 MovieClip Frame 2
onClipEvent (load) {
var Dir = "G";
var Type = "Gordon";
_parent.Control.CreerShred(this._name, this._x, this._y, Dir, Type);
this.gotoAndStop(Dir);
this.Obj.gotoAndStop("Sleep");
}
Instance of Symbol 478 MovieClip "Minion15" in Symbol 836 MovieClip Frame 2
onClipEvent (load) {
var Dir = "G";
var Type = "Gordon";
_parent.Control.CreerShred(this._name, this._x, this._y, Dir, Type);
this.gotoAndStop(Dir);
this.Obj.gotoAndStop("Sleep");
}
Instance of Symbol 674 MovieClip "Pers" in Symbol 836 MovieClip Frame 2
onClipEvent (load) {
_parent.Control.CreerPers(this._x, this._y, "Waffle");
this.gotoAndStop("D");
Etat = "Die";
}
Symbol 960 Button
on (release) {
_global.ipbSend(_global.C.TotalScore);
}
Symbol 918 Button
on (release) {
gotoAndStop ("TitleCard");
}
Symbol 953 Button
on (press) {
ControlScroll.scrollDown = true;
}
on (release, releaseOutside) {
ControlScroll.scrollDown = false;
}
Symbol 954 Button
on (press) {
ControlScroll.scrollUp = true;
}
on (release, releaseOutside) {
ControlScroll.scrollUp = false;
}