Frame 1
gui._visible = false;
Instance of Symbol 248 MovieClip "gui" in Frame 1
/* no clip actions */
Symbol 7 MovieClip [led] Frame 1
stop();
Symbol 38 MovieClip Frame 9
stop();
Symbol 49 MovieClip Frame 1
stop();
Symbol 50 MovieClip [Game_PlayerBad_Snake] Frame 1
#initclip 13
Object.registerClass("Game_PlayerBad_Snake", com.Game.PlayerBad.Snake);
#endinitclip
stop();
Symbol 50 MovieClip [Game_PlayerBad_Snake] Frame 10
stop();
Symbol 50 MovieClip [Game_PlayerBad_Snake] Frame 20
stop();
Symbol 50 MovieClip [Game_PlayerBad_Snake] Frame 30
stop();
Symbol 50 MovieClip [Game_PlayerBad_Snake] Frame 40
stop();
Symbol 50 MovieClip [Game_PlayerBad_Snake] Frame 50
stop();
Symbol 50 MovieClip [Game_PlayerBad_Snake] Frame 60
stop();
Symbol 50 MovieClip [Game_PlayerBad_Snake] Frame 70
stop();
Symbol 50 MovieClip [Game_PlayerBad_Snake] Frame 80
stop();
Symbol 98 MovieClip Frame 16
stop();
Symbol 99 MovieClip [HeroP2_mc] Frame 1
#initclip 10
Object.registerClass("HeroP2_mc", com.Game.PlayerGood.Hero);
#endinitclip
stop();
Symbol 99 MovieClip [HeroP2_mc] Frame 10
stop();
Symbol 99 MovieClip [HeroP2_mc] Frame 20
stop();
Symbol 99 MovieClip [HeroP2_mc] Frame 30
stop();
Symbol 99 MovieClip [HeroP2_mc] Frame 40
stop();
Symbol 99 MovieClip [HeroP2_mc] Frame 50
stop();
Symbol 99 MovieClip [HeroP2_mc] Frame 60
stop();
Symbol 99 MovieClip [HeroP2_mc] Frame 70
stop();
Symbol 99 MovieClip [HeroP2_mc] Frame 80
stop();
Symbol 99 MovieClip [HeroP2_mc] Frame 90
stop();
Symbol 99 MovieClip [HeroP2_mc] Frame 101
stop();
Symbol 100 MovieClip [HeroP1_mc] Frame 1
#initclip 11
Object.registerClass("HeroP1_mc", com.Game.PlayerGood.Hero);
#endinitclip
stop();
Symbol 100 MovieClip [HeroP1_mc] Frame 10
stop();
Symbol 100 MovieClip [HeroP1_mc] Frame 20
stop();
Symbol 100 MovieClip [HeroP1_mc] Frame 30
stop();
Symbol 100 MovieClip [HeroP1_mc] Frame 40
stop();
Symbol 100 MovieClip [HeroP1_mc] Frame 50
stop();
Symbol 100 MovieClip [HeroP1_mc] Frame 60
stop();
Symbol 100 MovieClip [HeroP1_mc] Frame 70
stop();
Symbol 100 MovieClip [HeroP1_mc] Frame 80
stop();
Symbol 100 MovieClip [HeroP1_mc] Frame 90
stop();
Symbol 100 MovieClip [HeroP1_mc] Frame 101
stop();
Symbol 104 MovieClip [SnakecomeIn] Frame 45
this.removeMovieClip();
Symbol 104 MovieClip [SnakecomeIn] Frame 56
gotoAndPlay (1);
Symbol 104 MovieClip [SnakecomeIn] Frame 67
gotoAndPlay (1);
Symbol 105 MovieClip [SnakecomeOut] Frame 45
initSnake.init();
this.removeMovieClip();
Symbol 112 MovieClip Frame 30
stop();
Symbol 113 MovieClip Frame 1
stop();
Symbol 113 MovieClip Frame 2
this.onEnterFrame = function () {
data._y = data._y - 2;
};
_parent.flower._visible = false;
Symbol 113 MovieClip Frame 16
stop();
this.onEnterFrame = function () {
if (this._parent._alpha >= 0) {
this._parent._alpha--;
} else {
trace("removed this" + _parent);
_parent.removeMovieClip();
}
};
Symbol 139 MovieClip [MovieClip_Flower] Frame 1
#initclip 12
Object.registerClass("MovieClip_Flower", com.MovieClip.Flower);
#endinitclip
Symbol 139 MovieClip [MovieClip_Flower] Frame 223
stop();
Instance of Symbol 142 MovieClip "ground7" in Symbol 173 MovieClip [level_4] Frame 1
/* no clip actions */
Instance of Symbol 142 MovieClip "ground8" in Symbol 173 MovieClip [level_4] Frame 1
/* no clip actions */
Instance of Symbol 142 MovieClip "ground6" in Symbol 173 MovieClip [level_4] Frame 1
/* no clip actions */
Instance of Symbol 142 MovieClip "ground2" in Symbol 173 MovieClip [level_4] Frame 1
/* no clip actions */
Instance of Symbol 142 MovieClip "ground7" in Symbol 174 MovieClip [level_3] Frame 1
/* no clip actions */
Instance of Symbol 142 MovieClip "ground8" in Symbol 174 MovieClip [level_3] Frame 1
/* no clip actions */
Instance of Symbol 142 MovieClip "ground6" in Symbol 174 MovieClip [level_3] Frame 1
/* no clip actions */
Instance of Symbol 142 MovieClip "ground2" in Symbol 174 MovieClip [level_3] Frame 1
/* no clip actions */
Instance of Symbol 142 MovieClip "ground7" in Symbol 175 MovieClip [level_2] Frame 1
/* no clip actions */
Instance of Symbol 142 MovieClip "ground8" in Symbol 175 MovieClip [level_2] Frame 1
/* no clip actions */
Instance of Symbol 142 MovieClip "ground6" in Symbol 175 MovieClip [level_2] Frame 1
/* no clip actions */
Instance of Symbol 142 MovieClip "ground2" in Symbol 175 MovieClip [level_2] Frame 1
/* no clip actions */
Instance of Symbol 142 MovieClip "ground6" in Symbol 176 MovieClip [level_1] Frame 1
/* no clip actions */
Instance of Symbol 142 MovieClip "ground7" in Symbol 176 MovieClip [level_1] Frame 1
/* no clip actions */
Instance of Symbol 142 MovieClip "ground8" in Symbol 176 MovieClip [level_1] Frame 1
/* no clip actions */
Symbol 185 MovieClip [popUpWindow_GameOver] Frame 1
ok.btnName.text = "Start Level";
_x = ((Stage.width / 2) - (this._width / 2));
_y = ((Stage.height / 2) - (this._height / 2));
Symbol 188 MovieClip [popUpWindow_Level] Frame 1
ok.btnName.text = "Start Level";
_x = ((Stage.width / 2) - (this._width / 2));
_y = ((Stage.height / 2) - (this._height / 2));
Symbol 190 MovieClip [popUpWindow_PlayerStart] Frame 1
ok.btnName.text = "Continue";
_x = ((Stage.width / 2) - (this._width / 2));
_y = ((Stage.height / 2) - (this._height / 2));
Symbol 191 MovieClip [dirtSmoke] Frame 50
stop();
this.removeMovieClip();
Symbol 203 MovieClip Frame 1
stop();
Symbol 212 MovieClip Frame 1
visual.text = "";
visual1.text = "";
visual2.text = "";
visual3.text = "";
visual4.text = "";
Symbol 217 MovieClip Frame 1
stop();
Symbol 217 MovieClip Frame 25
stop();
Symbol 217 MovieClip Frame 50
stop();
Symbol 217 MovieClip Frame 75
stop();
Symbol 217 MovieClip Frame 100
stop();
Symbol 230 MovieClip Frame 1
stop();
Symbol 237 MovieClip Frame 1
stop();
Symbol 248 MovieClip Frame 1
test.btnName.text = "Skip Level";
test.onPress = function () {
_global.game.nextLevel();
};
score.text = "";
score1.text = "";
score2.text = "";
score3.text = "";
score4.text = "";
Symbol 263 MovieClip Frame 1
function clearPlayers(o) {
var _local2 = this;
var _local3 = o;
var _local1 = 1;
while (typeof(_local2["player" + _local1]) == "movieclip") {
_local2["player" + _local1].gotoAndStop(1);
_local1++;
}
if (typeof(_local3) == "undefined") {
_local2.activePlayer = "undefined";
} else {
_local2.activePlayer = _local3;
_local3.gotoAndStop("on");
}
}
instructions.btnName.text = "Instructions";
ok.btnName.text = "Start Game";
ok.onPress = function () {
gotoAndPlay (61);
};
var playerPrefs = [];
var x = 1;
while (typeof(this["player" + x]) == "movieclip") {
var cPlayer = this["player" + x];
cPlayer.gotoAndStop(1);
cPlayer.onPress = function () {
clearPlayers(this);
};
cPlayer.onRollOver = function () {
this._alpha = 50;
};
cPlayer.onRollOut = function () {
this._alpha = 100;
};
cPlayer.prefs = playerPrefs[x - 1];
cPlayer.visualGameID = ("HeroP" + x) + "_mc";
x++;
}
msg_txt.text = "Please select a player from the choices below.\n\nEach player has a different skill level and specialty";
this.activePlayer = this.player1;
Symbol 263 MovieClip Frame 60
stop();
Symbol 263 MovieClip Frame 80
stop();
this._visible = false;
_parent.gui._visible = true;
_parent.bgHolder._visible = true;
_global.game = new com.Game.Game("HeroP1_mc", "", _parent, activePlayer.prefs);
_global.startDepth = 50;
Symbol 264 MovieClip [__Packages.com.Game.Game] Frame 0
class com.Game.Game
{
var level, isPaused, isSoundPaused;
function Game ($idName, $playerName, $path, $playerPrefs) {
var _local1 = this;
_local1.isPaused = false;
_local1.isSoundPaused = false;
_local1.idName = $idName;
_local1.playerName = $playerName;
_local1.playerPrefs = $playerPrefs;
_local1.gravity = 2.1;
_local1.runDecay = 0.6;
_local1.climbDecay = 0.2;
_local1.windResistance = 0.95;
_local1.path = $path;
_local1.currentLevel = 0;
_local1.displayCurrentLevel = 0;
_local1.totalLevelsBuilt = 4;
_local1.itemsToCollect = 2;
_local1.enemyAmount = 1;
_local1.gui = new Object();
_local1.gui.visual = _local1.path.gui;
_local1.gui.windowStart = "startWindow";
_local1.gui.windowLevel = "popUpWindow_Level";
_local1.gui.windowGameOver = "popUpWindow_GameOver";
_local1.gui.windowPlayerStart = "popUpWindow_PlayerStart";
_local1.gui.visual.soundGUI.game = _local1;
_local1.gui.visual.soundGUI.onPress = function () {
var _local1 = this;
_local1.gotoAndStop(((_local1._currentframe == 1) ? 2 : 1));
_local1.game.isSoundPaused = ((_local1._currentframe == 1) ? false : true);
trace("This game is : " + _local1.isSoundPaused);
};
_local1.nextLevel();
_local1.scoreboard = new com.Game.Scoreboard(400, null, _local1);
}
function nextLevel() {
var _local1 = this;
if (_local1.currentLevel == _local1.totalLevelsBuilt) {
_local1.currentLevel = 1;
} else {
_local1.currentLevel++;
}
_local1.displayCurrentLevel++;
if (_local1.itemsToCollect < 8) {
_local1.itemsToCollect++;
}
if (_local1.enemyAmount < 10) {
_local1.enemyAmount++;
}
if (_local1.displayCurrentLevel <= 3) {
_local1.path.bgHolder.gotoAndStop(_local1.displayCurrentLevel);
}
if (_local1.displayCurrentLevel != 1) {
_local1.pause();
var orchidPl = ((_local1.scoreboard.totalObjCol > 1) ? " orchids" : " orchid");
var _local2 = ((((((("You collected " + _local1.scoreboard.totalObjCol) + " ") + orchidPl) + " with ") + _local1.scoreboard.timer.outputMin) + ":") + _local1.scoreboard.timer.outputSec) + "seconds left. Are you ready to move down further into the cave to search for more orchids?";
trace("this is the tmsg = " + _local2);
var _local3 = _local1.path.attachMovie(_local1.gui.windowLevel, "popUp", _global.startDepth++, {msg:_local2, level:"LEVEL " + _local1.displayCurrentLevel, game:_local1});
_local3.ok.btnName.text = "Start Again";
_local3.ok.onPress = function () {
var _local1 = this;
trace("THIS = " + _local1);
_local1._parent.game.buildLevel();
_local1.level.mc._alpha = 100;
_local1._parent.removeMovieClip();
};
} else {
_local1.buildLevel();
}
}
function buildLevel() {
var _local1 = this;
var _local2 = 1;
while (typeof(_local1.gui.visual.flowersCollected["f" + _local2]) == "movieclip") {
_local1.gui.visual.flowersCollected["f" + _local2]._alpha = 50;
_local2++;
}
_local2 = _local1.itemsToCollect + 1;
while (typeof(_local1.gui.visual.flowersCollected["f" + _local2]) == "movieclip") {
_local1.gui.visual.flowersCollected["f" + _local2]._alpha = 0;
_local2++;
}
_local1.mplay();
_local1.scoreboard.totalObjCol = 0;
_local1.gui.visual.itemsCollected.text = (_local1.scoreboard.totalObjCol + " out of ") + _local1.level.collectNeeded;
_local1.gui.visual.levelNumber.text = _local1.displayCurrentLevel;
_local1.level.mc.removeMovieClip();
delete _local1.level;
var _local3 = _local1;
_local1.level = new com.Game.Level(_local1.pl, _local3, _local1.currentLevel, _local1.itemsToCollect);
_local1.level.init();
_local1.scoreboard.timer.countDown(0, 1, 0);
_local1.path.bgHolder.tempResponse = function () {
trace("temp response tried");
};
}
function over() {
var _local1 = this;
_local1.pause();
var _local2 = ((((("You collected " + _local1.scoreboard.totalObjCol) + " orchids with ") + _local1.scoreboard.timer.outputMin) + ":") + _local1.scoreboard.timer.outputSec) + " seconds left. \n Click the start button at the bottom to start over. ";
var _local3 = _local1.path.attachMovie(_local1.gui.windowGameOver, "popUp", _global.startDepth++, {msg:_local2, level:"LEVEL " + _local1.displayCurrentLevel, game:_local1});
_local3.ok.onPress = function () {
getURL ("./");
};
}
function pause() {
level.mc._alpha = 50;
isPaused = true;
}
function mplay() {
level.mc._alpha = 100;
isPaused = false;
}
function playSound(linkage, $loops, $soundTarget) {
if ((linkage == undefined) || ($soundTarget == undefined)) {
} else {
var _local2 = (($loops == undefined) ? 0 : ($loops));
if (isSoundPaused) {
} else {
trace("Try to play music again");
var _local1 = {};
_local1 = new Sound($soundTarget);
_local1.attachSound(linkage);
_local1.start(0, _local2);
_local1.active = true;
return(_local1);
}
}
return(undefined);
}
function stopSoundObj(obj) {
obj.active = false;
obj.stop();
}
}
Symbol 265 MovieClip [__Packages.com.Game.Level] Frame 0
class com.Game.Level
{
function Level (p, g, levelNumber, collect) {
var _local1 = this;
_local1.player = p;
_local1.game = g;
_local1.collectNeeded = collect;
_local1.mc = _local1.game.path.levelTarget.attachMovie("level_" + levelNumber, "level", _global.startDepth++);
_local1.platforms = {};
_local1.latters = [];
_local1.platforms.column = [];
_local1.snakeHoles = [];
var _local2 = 0;
while (typeof(_local1.mc["ground" + _local2]) == "movieclip") {
_local1.addPlatforms(_local1.mc["ground" + _local2], _local2);
_local1.mc["ground" + _local2].visual._visible = false;
_local2++;
}
_local1.flowers.amount = 10;
_local1.flowers.offsetCreation = 1000;
_local1.flowers.speed = 50;
delete _local1.flowers;
delete _local1.snakes;
_local1.flowers = new com.Game.FlowerController(10, 4000, 50, _local1);
_local1.snakes = new com.Game.PlayerBad.SnakeController(_local1.game.enemyAmount, 1000, 50, _local1);
}
function init() {
var _local1 = this;
_local1.game.floor = Stage.height;
_local1.createPlayer();
_local1.snakes.init();
_local1.flowers.init();
}
function createPlayer() {
var _local1 = this;
_local1.player.removeMovieClip();
_local1.player = _local1.game.path.attachMovie(_local1.game.idName, _local1.game.idName, _global.startDepth++, {game:_local1.game, prefs:_local1.game.playerPrefs});
_local1.player._y = 50;
_local1.player.level = _local1;
var isJumpingTimerInt = setInterval(function () {
clearInterval(isJumpingTimerInt);
this.player.jump();
}, 500);
_local1.game.pl = _local1.player;
}
function playerKilled() {
var _local1 = this;
if (_local1.game.scoreboard.playerLife <= 1) {
_local1.game.over();
_local1.game.scoreboard.playerLife--;
_local1.game.gui.visual.lives.gotoAndStop(_local1.game.scoreboard.playerLife);
} else {
_local1.game.pause();
var _local2 = ((_local1.game.scoreboard.totalObjCol > 1) ? " orchids" : " orchid");
var _local3 = (("You've collected " + _local1.game.scoreboard.totalObjCol) + _local2) + " so far. Click the continue button to search for more orchids. ";
var pWindow = _local1.game.path.attachMovie(_local1.game.gui.windowPlayerStart, "popUp", _global.startDepth++, {game:_local1.game, msg:_local3});
pWindow.ok.onPress = function () {
var _local1 = this;
_local1._parent.game.mplay();
_local1._parent.game.scoreboard.playerLife--;
_local1._parent.game.gui.visual.lives.gotoAndStop(_local1._parent.game.scoreboard.playerLife);
_local1._parent.game.level.createPlayer();
_local1._parent.game.gui.visual.powerbar.gotoAndStop(1);
_local1._parent.removeMovieClip();
};
}
}
function addPlatforms(o, id) {
var _local3 = this;
if (typeof(o) != "movieclip") {
} else {
var _local1 = new Object();
_local1.clip = o;
_local1.x = _local1.clip._x;
_local1.y = _local1.clip._y;
_local1.width = _local1.clip._width;
_local1.height = _local1.clip._height;
_local1.clip.me = _local1;
if (typeof(_local3.mc["climb" + id]) == "movieclip") {
_local1.latterUp = _local3.mc["climb" + id];
}
_local1.latterUp.visual._visible = false;
if (typeof(_local3.mc["snakeHole" + id]) == "movieclip") {
_local1.snakeHole = _local3.mc["snakeHole" + id];
_local1.snakeHole.id = id;
_local3.snakeHoles.push(_local1.snakeHole);
}
var _local2 = 0;
while (typeof(_local3.mc["ground" + _local2]) == "movieclip") {
if (((typeof(_local3.mc["climb" + _local2]) == "movieclip") && (_local1.clip.hitTest(_local3.mc["climb" + _local2]))) && (_local3.mc["climb" + _local2] != _local1.latterUp)) {
_local1.latterDown = _local3.mc["climb" + _local2];
_local1.latterDown.visual._visible = false;
break;
}
_local2++;
}
_local3.platforms.column.push(_local1);
}
}
}
Symbol 266 MovieClip [__Packages.com.Game.FlowerController] Frame 0
class com.Game.FlowerController extends Object
{
var level;
function FlowerController (am, of, sp, lev) {
var _local1 = this;
super();
_local1.amount = am;
_local1.offsetCreation = of;
_local1.speed = sp;
_local1.level = lev;
_local1.flowerPath = _local1.level.game.target;
_local1.activeFlowers = new Array();
_local1.flowerId = 0;
}
function init() {
var _local1 = this;
clearInterval(flowerStartInt);
flowerStartInt = setInterval(_local1.placeFlower, _local1.offsetCreation, _local1.level, _local1);
}
function placeFlower(level, controller) {
var _local2 = this;
var _local3 = level;
if (_local3.game.isPaused) {
} else {
var sPosX;
var sPosY;
var path = _local3.mc;
var _local1 = controller.chooseRandomPlatform();
var id = controller.flowerId;
while ((_local1 == controller.lastPlatformChoosen) && (_local1 == game.pl.activePlatform.clip)) {
_local1 = controller.chooseRandomPlatform();
}
controller.lastPlatformChoosen = _local1;
sPosX = _local1._x + random(_local1._width);
sPosY = _local1._y - 30;
curFlower = path.attachMovie("MovieClip_Flower", "fl" + id, _global.startDepth++, {_x:sPosX, _y:sPosY, player:_local3.player, scoreboard:_local3.game.scoreboard});
curFlower.score._visible = false;
curFlower.onEnterFrame = function () {
var _local1 = this;
if (_local1.level.game.isPaused) {
} else {
if ((_local1.hitTest(_local1.player) && (!_local1.player.isClimbing)) && (!_local1.player.inAir)) {
_local1.stop();
_local1.flowerSound = game.playSound("sound_Flower", "", _local1);
_local1.score._visible = true;
_local1.score.data.text = _local1._totalframes - _local1._currentframe;
_local1.score.play();
_local1.scoreboard.addScore(_local1._totalframes - _local1._currentframe);
delete _local1.onEnterFrame;
}
if (_local1._currentframe == _local1._totalframes) {
_local1.removeMovieClip();
}
controller.activeFlowers[id] = curFlower;
controller.flowerId++;
}
};
}
}
function chooseRandomPlatform() {
return(level.platforms.column[random(level.platforms.column.length)].clip);
}
}
Symbol 267 MovieClip [__Packages.com.Game.PlayerBad.SnakeController] Frame 0
class com.Game.PlayerBad.SnakeController extends Object
{
var snakeStartInt, level;
function SnakeController (am, of, sp, lev) {
var _local1 = this;
super();
_local1.amount = am;
_local1.offsetCreation = of;
_local1.speed = sp;
_local1.level = lev;
_local1.snakePath = _local1.level.groundPlanes._parent;
_local1.activeSnakes = new Array();
_local1.snakeId = 0;
}
function init() {
var _local1 = this;
clearInterval(snakeStartInt);
snakeStartInt = setInterval(_local1.placeSnake, _local1.offsetCreation, _local1.level, _local1);
}
function stopCreation() {
clearInterval(snakeStartInt);
}
function placeSnake(level, controller) {
var _local2 = level;
if ((controller.snakeId > controller.amount) || (_local2.game.isPaused)) {
} else {
var sPosX;
var sPosY;
var _local1 = controller.chooseRandomPlatform();
var id = controller.snakeId;
while (_local1 == controller.lastPlatformChoosen) {
_local1 = controller.chooseRandomPlatform();
}
controller.lastPlatformChoosen = _local1;
var tp = Math.random(1);
if (tp >= 0.5) {
sPosX = _local1._x - _local1._width;
} else {
sPosX = _local1._x + _local1._width;
}
sPosY = _local1._y + _local1._height;
var sXScale = (100 + ((controller.level.game.displayCurrentLevel * 100) / 10));
var _local3 = 100 + ((controller.level.game.displayCurrentLevel * 100) / 10);
sXScale = ((sXScale >= 125) ? 125 : (sXScale));
_local3 = ((_local3 >= 125) ? 125 : (_local3));
if ((controller.activeSnakes.length + 1) >= controller.amount) {
x = 0;
while (x <= controller.activeSnakes.length) {
if (typeof(controller.activeSnakes[x]) == "undefined") {
controller.curSnake = _local2.mc.attachMovie("Game_Playerbad_Snake", "snake" + x, _global.startDepth++, {_x:sPosX, _y:sPosY, game:_local2.game, controller:controller, indexId:x, activePlatform:_local2.platforms.column[_local1.id], _xscale:sXScale, _yscale:_local3});
controller.activeSnakes[x] = controller.curSnake;
break;
}
x++;
}
} else {
controller.curSnake = _local2.mc.attachMovie("Game_Playerbad_Snake", "snake" + id, _global.startDepth++, {_x:sPosX, _y:sPosY, game:_local2.game, controller:controller, indexId:id, activePlatform:_local2.platforms.column[_local1.id], _xscale:sXScale, _yscale:_local3});
controller.activeSnakes.push(controller.curSnake);
}
controller.curSnake.init = controller.curSnake.startAI;
_local2.mc.attachMovie("SnakecomeOut", "SnakecomeOut" + controller.curSnake.indexId, _global.startDepth++, {_x:_local1._x, _y:_local1._y, initSnake:controller.curSnake});
controller.snakeId++;
}
}
function chooseRandomPlatform() {
return(level.snakeHoles[random(level.snakeHoles.length)]);
}
}
Symbol 268 MovieClip [__Packages.com.Game.Scoreboard] Frame 0
class com.Game.Scoreboard extends Object
{
function Scoreboard (hi, c, ga) {
var _local1 = this;
super();
_local1.game = ga;
_local1.highScore = hi;
_local1.playerLife = 4;
_local1.currentScore = ((c != null) ? (c) : 0);
_local1.totalObjCol = 0;
_local1.timer = new Object();
_local1.timer.mc = _local1.game.gui.visual.timer_mc;
_local1.timer.parent = _local1;
_local1.timer.countDown = function (fHr, fMin, fSec) {
var _local1 = this;
_local1.outputMin = fMin;
_local1.outputSec = fSec;
clearInterval(_local1.timerInterval);
_local1.timerInterval = setInterval(_local1.upDateTime, 1000, _local1);
};
_local1.timer.upDateTime = function (o, cBack) {
var _local1 = o;
if (_local1.parent.game.isPaused) {
} else {
if ((Math.round(_local1.outputMin) == 0) && (Math.round(_local1.outputSec) == 0)) {
clearInterval(_local1.timerInterval);
_local1.parent.game.over();
} else {
if (_local1.outputSec != "00") {
_local1.outputSec = Math.round(_local1.outputSec) - 1;
} else {
_local1.outputSec = 59;
_local1.outputMin = Math.round(_local1.outputMin) - 1;
}
if ((_local1.outputSec <= 9) && (_local1.outputSec > 0)) {
_local1.outputSec = "0" + _local1.outputSec;
} else if (_local1.outputSec == 0) {
_local1.outputSec = "00";
}
}
_local1.mc.visual.text = (_local1.outPutMin + ":") + _local1.outPutSec;
_local1.mc.visualShadow1.text = (_local1.outPutMin + ":") + _local1.outPutSec;
_local1.mc.visualShadow2.text = (_local1.outPutMin + ":") + _local1.outPutSec;
_local1.mc.visualShadow3.text = (_local1.outPutMin + ":") + _local1.outPutSec;
_local1.mc.visualShadow4.text = (_local1.outPutMin + ":") + _local1.outPutSec;
}
};
_local1.game.gui.visual.score.text = _local1.currentScore;
_local1.game.gui.visual.score1.text = _local1.currentScore;
_local1.game.gui.visual.score2.text = _local1.currentScore;
_local1.game.gui.visual.score3.text = _local1.currentScore;
_local1.game.gui.visual.score4.text = _local1.currentScore;
_local1.game.gui.visual.lives.gotoAndStop(_local1.playerLife);
_local1.game.gui.visual.itemsCollected.text = (_local1.totalObjCol + " out of ") + _local1.game.level.collectNeeded;
_local1.timer.countDown(0, 1, 0);
}
function addScore(figure) {
var _local1 = this;
if (_local1.game.isPaused) {
} else {
_local1.totalObjCol++;
if (_local1.game.level.collectNeeded == _local1.totalObjCol) {
_local1.game.nextLevel();
}
_local1.game.gui.visual.itemsCollected.text = (_local1.totalObjCol + " out of ") + _local1.game.level.collectNeeded;
_local1.game.gui.visual.flowersCollected["f" + _local1.totalObjCol]._alpha = 100;
_local1.currentScore = _local1.currentScore + figure;
Math.abs(_local1.currentScore);
_local1.game.gui.visual.score.text = _local1.currentScore;
_local1.game.gui.visual.score1.text = _local1.currentScore;
_local1.game.gui.visual.score2.text = _local1.currentScore;
_local1.game.gui.visual.score3.text = _local1.currentScore;
_local1.game.gui.visual.score4.text = _local1.currentScore;
}
}
}
Symbol 269 MovieClip [__Packages.com.Game.Player] Frame 0
class com.Game.Player extends MovieClip
{
var $pDirection;
function Player () {
var _local1 = this;
super();
_local1.groundWalkIncrement = ((_local1.prefs.groundWalkIncrement == undefined) ? 4 : (_local1.prefs.groundWalkIncrement));
_local1.walkIncrement = _local1.groundWalkIncrement;
_local1.minXmov = ((_local1.prefs.minXmov == undefined) ? 0.75 : (_local1.prefs.minXmov));
_local1.maxXmov = ((_local1.prefs.maxXmov == undefined) ? 10 : (_local1.prefs.maxXmov));
_local1.startx = ((_local1.prefs.startx == undefined) ? 100 : (_local1.prefs.startx));
_local1.starty = ((_local1.prefs.starty == undefined) ? 5 : (_local1.prefs.starty));
_local1.xmov = 0;
_local1.ymov = 0;
_local1.x = _local1.startx;
_local1.y = _local1.starty;
_local1.jumpSpeed = ((_local1.prefs.jumpSpeed == undefined) ? 15 : (_local1.prefs.jumpSpeed));
_local1.climbSpeed = ((_local1.prefs.climbSpeed == undefined) ? 20 : (_local1.prefs.climbSpeed));
_local1.isClimbing = false;
_local1.isDead = false;
}
function get pDirection() {
return($pDirection);
}
function set pDirection(val) {
var _local1 = this;
var _local2 = val;
if (_local2 == _local1.__get__pDirection()) {
} else {
_local1.$pDirection = _local2;
var _local3 = _local1.visual._currentframe;
(_local1.gotoAndStop(_local1.$pDirection));// not popped
if ((_local2 == "JUMPRIGHT") || (_local2 == "JUMPLEFT")) {
_local1.visual.gotoAndPlay(_local3);
}
//return(_local1.__get__pDirection());
}
return;
}
}
Symbol 270 MovieClip [__Packages.com.Game.PlayerGood.Hero] Frame 0
class com.Game.PlayerGood.Hero extends com.Game.Player
{
var isJumping, releaseTop, releaseBottom;
function Hero () {
super();
isInvincibleTimer();
}
function listenForKeys() {
var _local1 = this;
if (_local1.isDead) {
} else {
if (Key.isDown(37) && (!_local1.isClimbing)) {
_local1.xmov = _local1.xmov - _local1.walkIncrement;
_local1.walkLeft();
} else if (Key.isDown(39) && (!_local1.isClimbing)) {
_local1.xmov = _local1.xmov + _local1.walkIncrement;
_local1.walkRight();
} else if (((!_local1.isClimbing) && (!_local1.isJumping)) && (!_local1.inAir)) {
_local1.game.stopSoundObj(_local1.runningSound);
if (_local1.lastX > _local1.x) {
_local1.__set__pDirection("SLIDERIGHT");
} else if (_local1.lastX < _local1.x) {
_local1.__set__pDirection("SLIDELEFT");
}
}
if (Key.isDown(32) && (_local1.okToJump)) {
_local1.okToJump = false;
if ((!_local1.isJumping) && (!_local1.inAir)) {
_local1.inAir = true;
_local1.ymov = _local1.ymov - _local1.jumpSpeed;
_local1.jump();
}
}
if ((Key.isDown(38) && (_local1.okToClimb)) && ((_local1.climbDirection == "UP") || (_local1.isClimbing))) {
_local1.ymov = _local1.ymov - _local1.climbSpeed;
_local1.xmov = 0;
_local1.x = _local1.currentLatter._x + (_local1.currentLatter.visual._width / 3);
_local1.visual.gotoAndStop(((_local1.visual._currentframe == _local1.visual._totalframes) ? 1 : (_local1.visual._currentframe + 1)));
_local1.climbUp();
} else if ((Key.isDown(40) && (_local1.okToClimb)) && ((_local1.climbDirection == "DOWN") || (_local1.isClimbing))) {
_local1.ymov = _local1.ymov + _local1.climbSpeed;
_local1.xmov = 0;
_local1.x = _local1.currentLatter._x + (_local1.currentLatter.visual._width / 3);
_local1.visual.gotoAndStop(((_local1.visual._currentframe == _local1.visual._totalframes) ? 1 : (_local1.visual._currentframe + 1)));
_local1.climbDown();
} else if (!Key.isDown(32)) {
_local1.okToJump = true;
}
}
}
function walkLeft() {
var _local1 = this;
_local1.isWalking = true;
if ((!_local1.inAir) && (!_local1.isHit)) {
if (!_local1.runningSound.active) {
_local1.runningSound = _local1.game.playSound("sound_Running", 40, _local1);
}
if (_local1.lastX > _local1.x) {
_local1.__set__pDirection("RUNLEFT");
} else {
_local1.__set__pDirection("SLIDELEFT");
}
} else if (_local1.inAir) {
_local1.__set__pDirection("JUMPLEFT");
}
}
function walkRight() {
var _local1 = this;
_local1.isWalking = true;
if ((!_local1.inAir) && (!_local1.isHit)) {
if (!_local1.runningSound.active) {
_local1.runningSound = _local1.game.playSound("sound_Running", 40, _local1);
}
if (_local1.lastX < _local1.x) {
_local1.__set__pDirection("RUNRIGHT");
} else {
_local1.__set__pDirection("SLIDERIGHT");
}
} else if (_local1.inAir) {
_local1.__set__pDirection("JUMPRIGHT");
}
}
function hit() {
var _local1 = this;
if (_local1.isHit || (_local1.isInvincible)) {
} else {
_local1.isHit = true;
_local1.isJumping = true;
if ((_local1.game.gui.visual.powerbar._currentframe + 20) >= 100) {
_local1.killMe(_local1);
} else {
_local1.game.gui.visual.powerbar.gotoAndStop(_local1.game.gui.visual.powerbar._currentframe + 20);
_local1.isInvincibleTimer();
_local1.__set__pDirection("DAMAGEHIT");
_local1.__set__pDirection("IDLE");
}
}
}
function isInvincibleTimer() {
var _local1 = this;
if (_local1.isInvincible) {
} else {
_local1.isInvincible = true;
var o = _local1;
var isInvincibleFlashInt = setInterval(function () {
o._alpha = ((o._alpha == 50) ? 100 : 50);
}, 100);
var isInvincibleTimerInt = setInterval(function () {
clearInterval(isInvincibleFlashInt);
clearInterval(isInvincibleTimerInt);
o._alpha = 100;
o.isInvincible = false;
trace("Set invincible to " + o.isInvincible);
}, 2000);
}
}
function jump() {
var _local1 = this;
_local1.game.stopSoundObj(_local1.runningSound);
_local1.jumpingSound = _local1.game.playSound("sound_Jumping", 0, _local1);
_local1.game.level.mc.attachMovie("dirtSmoke", "dirtSmoke" + _global.startDepth, _global.startDepth++, {_x:_local1._x, _y:_local1._y});
_local1.isJumping = true;
if (_local1.lastX > _local1.x) {
_local1.__set__pDirection("JUMPLEFT");
} else if (_local1.lastX < _local1.x) {
_local1.__set__pDirection("JUMPRIGHT");
} else {
_local1.__set__pDirection("JUMPRIGHT");
}
}
function climbUp() {
var _local1 = this;
_local1.game.stopSoundObj(_local1.runningSound);
if (_local1.climbDirection != "UP") {
_local1.checkLatterBounds(_local1.currentLatter);
}
_local1.climbDirection = "UP";
if (_local1.lastY > _local1.y) {
if (_local1.y <= _local1.releaseTop) {
_local1.stopClimbing();
return;
}
} else if (_local1.lastY < _local1.y) {
if (_local1.y >= _local1.releaseBottom) {
_local1.stopClimbing();
return;
}
} else {
_local1.isClimbing = true;
_local1.__set__pDirection("CLIMBUP");
}
}
function climbDown() {
var _local1 = this;
_local1.game.stopSoundObj(_local1.runningSound);
if (_local1.climbDirection != "DOWN") {
_local1.checkLatterBounds(_local1.currentLatter);
}
_local1.climbDirection = "DOWN";
if (_local1.lastY > _local1.y) {
if (_local1.y <= _local1.releaseTop) {
_local1.stopClimbing();
return;
}
} else if (_local1.lastY < _local1.y) {
if (_local1.y >= _local1.releaseBottom) {
_local1.stopClimbing();
return;
}
} else {
_local1.isClimbing = true;
_local1.__set__pDirection("CLIMBUP");
}
}
function stopClimbing() {
var _local1 = this;
_local1.__set__pDirection("IDLE");
_local1.isClimbing = false;
_local1.okToClimb = false;
_local1.inAir = true;
_local1.isJumping = true;
_local1.ymov = 0;
}
function stopJumping() {
if (isJumping) {
isJumping = false;
}
}
function stopWalking() {
var _local1 = this;
if (_local1.isWalking && (!_local1.isHit)) {
_local1.__set__pDirection("IDLE");
_local1.isWalking = false;
}
}
function killMe(o) {
var _local1 = this;
_local1.isDead = true;
_local1.__set__pDirection("KILL");
_local1.game.stopSoundObj(_local1.runningSound);
var isDeadDelayInt = setInterval(function () {
clearInterval(isDeadDelayInt);
o.game.level.playerKilled();
}, 1000);
}
function addFrictionAndGravity() {
var _local1 = this;
if (!_local1.isClimbing) {
_local1.ymov = _local1.ymov + _local1.game.gravity;
} else if (_local1.isClimbing) {
_local1.climbUp();
_local1.ymov = _local1.ymov * _local1.game.climbDecay;
}
if ((!_local1.inAir) && (!_local1.isClimbing)) {
_local1.xmov = _local1.xmov * _local1.game.runDecay;
} else {
_local1.xmov = _local1.xmov * _local1.game.windResistance;
}
if (Math.abs(_local1.xmov) < _local1.minXmov) {
if (_local1.isWalking && (!_local1.isClimbing)) {
_local1.stopWalking();
}
_local1.xmov = 0;
} else if (Math.abs(_local1.xmov) > _local1.maxXmov) {
_local1.xmov = (Math.abs(_local1.xmov) / _local1.xmov) * _local1.maxXmov;
}
}
function createTempPosition() {
var _local1 = this;
if ((_local1.x >= 20) && (_local1.x <= ((Stage.width - _local1._width) + 20))) {
_local1.tempx = _local1.x + _local1.xmov;
} else {
_local1.xmov = _local1.xmov * -1.5;
_local1.tempx = _local1.x + _local1.xmov;
}
_local1.tempy = _local1.y + _local1.ymov;
var _local2 = Math.abs(_local1.ymov);
if (_local1.tempy > ((Stage.height + _local1._height) + 25)) {
_local1.killMe(_local1);
}
if (_local2 > 10) {
if (_local2 > 22) {
_local1.ymov = 22 * (_local1.ymov / _local2);
}
_local1.game.totalIterations = 2;
} else {
_local1.game.totalIterations = 1;
}
}
function renderScreen() {
var _local1 = this;
_local1.lastX = _local1.x;
_local1.lastY = _local1.y;
_local1.x = _local1.tempx;
_local1.y = _local1.tempy;
_local1._x = _local1.x;
_local1._y = _local1.y;
}
function platformDetect() {
var _local1 = this;
_local1.oldOnPlatform = _local1.onPlatform;
_local1.onPlatform = false;
var i = 0;
while (i < _local1.game.level.platforms.column.length) {
var platform = _local1.game.level.platforms.column[i];
var _local2 = platform.x;
var _local3 = platform.y;
var pw = platform.width;
var ph = platform.height;
var type = platform.type;
var latterUp = platform.latterUp;
var latterDown = platform.latterDown;
var iteration = 1;
while (iteration <= _local1.game.totalIterations) {
_local1.tempx = _local1.x + ((_local1.xmov / _local1.game.totalIterations) * iteration);
_local1.tempy = _local1.y + ((_local1.ymov / _local1.game.totalIterations) * iteration);
if ((((((_local1.tempx + _local1.detect._width) > _local2) && (_local1.tempx < (_local2 + pw))) && ((_local1.tempy - _local1.detect._height) < (_local3 + ph))) && (_local1.tempy > _local3)) && (!_local1.isClimbing)) {
if ((((_local1.tempy > _local3) && (_local1.y <= (_local3 + 0.01))) && (_local1.tempy < (_local3 + ph))) && (_local1.ymov > 0)) {
_local1.onPlatform = true;
var platformTop = _local3;
if (((((latterUp._x < _local1.tempx) && ((latterUp._x + latterUp.visual._width) > _local1.tempx)) && (((latterUp._y + latterUp.visual._height) + 10) > _local1.tempy)) && (latterUp._y < _local1.tempy)) && (!_local1.isClimbing)) {
_local1.okToClimb = true;
_local1.checkLatterBounds(latterUp);
_local1.climbDirection = "UP";
_local1.currentLatter = latterUp;
} else if ((latterDown._x < _local1.tempx) && ((latterDown._x + latterDown.visual._width) > _local1.tempx)) {
_local1.okToClimb = true;
_local1.checkLatterBounds(latterDown);
_local1.climbDirection = "DOWN";
_local1.currentLatter = latterDown;
} else {
_local1.okToClimb = false;
_local1.climbDirection = null;
}
_local1.landOnPlatform(platformTop);
_local1.activePlatform = platform;
} else if ((((((_local1.tempy - _local1.detect._height) > _local3) && ((_local1.tempy - _local1.detect._height) < (_local3 + ph))) && ((_local1.tempx + (_local1.detect._width / 2)) > _local2)) && (_local1.tempx < ((_local2 + pw) - (_local1.detect._width / 2)))) && (_local1.ymov < 0)) {
var newy = ((_local3 + ph) + _local1.detect._height);
_local1.bounceOffOfBottom(newy);
} else if (((_local1.tempx + _local1.detect._width) > _local2) && ((_local1.tempx + _local1.detect._width) < (_local2 + pw))) {
trace("hit the left");
var newx = (_local2 - _local1.detect._width);
_local1.bounceOffOfPlatform(newx);
} else if ((_local1.tempx > _local2) && (_local1.tempx < (_local2 + pw))) {
trace("hit the right");
var newx = (_local2 + pw);
_local1.bounceOffOfPlatform(newx);
}
}
iteration++;
}
i++;
}
if ((!_local1.onPlatform) && (_local1.oldOnPlatform)) {
_local1.inAir = true;
_local1.activePlatform = "";
}
}
function checkLatterBounds(o) {
var _local1 = o;
releaseTop = _local1._y;
releaseBottom = _local1._y + (_local1.visual._height - 30);
}
function bounceOffOfPlatform(newx) {
var _local1 = this;
_local1.x = newx;
_local1.xmov = 0;
_local1.tempx = _local1.x + _local1.xmov;
}
function bounceOffOfBottom(newy) {
var _local1 = this;
_local1.y = newy;
_local1.ymov = 0;
_local1.tempy = _local1.y + _local1.ymov;
}
function landOnPlatform(platformTop) {
var _local1 = this;
_local1.isHit = false;
_local1.ymov = 0;
_local1.y = platformTop;
_local1.tempy = _local1.y + _local1.ymov;
_local1.inAir = false;
_local1.stopJumping();
}
function onEnterFrame() {
var _local1 = this;
if (_local1.game.isPaused) {
_local1.__set__pDirection("IDLE");
_local1.game.stopSoundObj(_local1.runningSound);
}
if (_local1.isDead || (_local1.game.isPaused)) {
} else {
_local1.listenForKeys();
_local1.addFrictionAndGravity();
_local1.createTempPosition();
_local1.platformDetect();
_local1.renderScreen();
}
}
}
Symbol 271 MovieClip [__Packages.com.MovieClip.Flower] Frame 0
class com.MovieClip.Flower extends MovieClip
{
function Flower () {
super();
}
}
Symbol 272 MovieClip [__Packages.com.Game.PlayerBad.Snake] Frame 0
class com.Game.PlayerBad.Snake extends com.Game.Player
{
var $pDirection, dead, AICurrentDirection, isJumping;
function Snake () {
var _local1 = this;
super();
_local1.active = false;
_local1.inAir = true;
_local1.dead = false;
_local1.groundWalkIncrement = 4 + Math.random(4);
_local1.walkIncrement = _local1.groundWalkIncrement;
_local1.minXmov = 0.75;
_local1.maxXmov = 1;
_local1.startx = _local1._x;
_local1.starty = _local1._y;
_local1.xmov = 1;
_local1.x = _local1.startx;
_local1.y = _local1.starty;
_local1.jumpSpeed = 15;
_local1.climbSpeed = 1.7;
_local1.isClimbing = false;
_local1.diveInHole = ((random(2) == 0) ? true : false);
}
function get pDirection() {
return($pDirection);
}
function set pDirection(val) {
var _local1 = this;
if (_local1.$pDirection == val) {
} else {
_local1.$pDirection = val;
(_local1.gotoAndStop(_local1.$pDirection));// not popped
//return(_local1.__get__pDirection());
}
return;
}
function startAI() {
var _local1 = this;
_local1.active = true;
var tp = Math.random(1);
if (_local1._x <= _local1.activePlatform.snakeHole._x) {
if (_local1.activePlatform.clip._x <= _local1._x) {
_local1.AICurrentDirection = function () {
var _local1 = this;
_local1.walkRight();
_local1.xmov = _local1.xmov + _local1.walkIncrement;
};
} else {
_local1.AICurrentDirection = function () {
var _local1 = this;
_local1.walkLeft();
_local1.xmov = _local1.xmov - _local1.walkIncrement;
};
}
} else if ((_local1.activePlatform.clip._x + _local1.activePlatform.clip._width) <= _local1._x) {
_local1.AICurrentDirection = function () {
var _local1 = this;
_local1.walkLeft();
_local1.xmov = _local1.xmov - _local1.walkIncrement;
};
} else {
_local1.AICurrentDirection = function () {
var _local1 = this;
_local1.walkRight();
_local1.xmov = _local1.xmov + _local1.walkIncrement;
};
}
}
function AI() {
if (dead) {
return(undefined);
}
AICurrentDirection();
}
function AICheckDirection() {
var _local1 = this;
_local1.xmov = 0;
if (_local1.lastX < _local1.x) {
_local1.x = (_local1.activePlatform.clip._x + _local1.activePlatform.clip._width) - _local1._width;
_local1.AICurrentDirection = function () {
var _local1 = this;
_local1.walkLeft();
_local1.xmov = _local1.xmov - _local1.walkIncrement;
};
}
if (_local1.lastX > _local1.x) {
xx = _local1.activePlatform.clip._x - _local1._width;
_local1.AICurrentDirection = function () {
var _local1 = this;
_local1.walkRight();
_local1.xmov = _local1.xmov + _local1.walkIncrement;
};
}
_local1.diveInHole = ((random(2) == 0) ? true : false);
}
function walkLeft() {
var _local1 = this;
_local1.isWalking = true;
if (!_local1.isJumping) {
_local1.__set__pDirection("RUNLEFT");
}
}
function walkRight() {
var _local1 = this;
_local1.isWalking = true;
if (!_local1.isJumping) {
_local1.__set__pDirection("RUNRIGHT");
}
}
function jump() {
var _local1 = this;
if (_local1.lastX > _local1.x) {
_local1.__set__pDirection("JUMPLEFT");
}
if (_local1.lastX < _local1.x) {
_local1.__set__pDirection("JUMPRIGHT");
}
_local1.isJumping = true;
}
function stopJumping() {
if (isJumping) {
isJumping = false;
}
}
function stopWalking() {
var _local1 = this;
_local1.__set__pDirection("IDLE");
if (_local1.isWalking) {
_local1.isWalking = false;
}
}
function runEdgeDetHandler() {
moveFall();
}
function addFrictionAndGravity() {
var _local1 = this;
if (!_local1.isClimbing) {
} else if (_local1.isClimbing) {
_local1.ymov = _local1.ymov * _local1.game.climbDecay;
}
if ((!_local1.inAir) && (!_local1.isClimbing)) {
_local1.xmov = _local1.xmov * _local1.game.runDecay;
} else {
_local1.xmov = _local1.xmov * _local1.game.windResistance;
}
if (Math.abs(_local1.xmov) < _local1.minXmov) {
_local1.xmov = 0;
} else if (Math.abs(_local1.xmov) > _local1.maxXmov) {
_local1.xmov = (Math.abs(_local1.xmov) / _local1.xmov) * _local1.maxXmov;
}
}
function createTempPosition() {
var _local1 = this;
_local1.tempx = _local1.x + _local1.xmov;
_local1.tempy = _local1.y + _local1.ymov;
var _local2 = Math.abs(_local1.ymov);
if (_local2 > 10) {
if (_local2 > 22) {
_local1.ymov = 22 * (_local1.ymov / _local2);
}
_local1.game.totalIterations = 2;
} else {
_local1.game.totalIterations = 1;
}
}
function renderScreen() {
var _local1 = this;
_local1.lastX = _local1.x;
_local1.lastY = _local1.y;
_local1.x = _local1.tempx;
_local1.y = _local1.tempy;
_local1._x = _local1.x;
_local1._y = _local1.y;
}
function bounceOffOfPlatform(newx) {
var _local1 = this;
_local1.x = newx;
_local1.xmov = 0;
_local1.tempx = _local1.x + _local1.xmov;
}
function bounceOffOfBottom(newy) {
var _local1 = this;
_local1.y = newy;
_local1.ymov = 0;
_local1.tempy = _local1.y + _local1.ymov;
}
function landOnPlatform(platformTop) {
var _local1 = this;
_local1.ymov = 0;
_local1.y = platformTop;
_local1.tempy = _local1.y + _local1.ymov;
_local1.inAir = false;
_local1.stopJumping();
}
function killMe() {
var _local1 = this;
var _local2 = _local1.game.level.mc.attachMovie("Snakecomein", "Snakecomein" + _local1.indexId, _global.startDepth++, {_x:_local1.activePlatform.snakeHole._x, _y:_local1.activePlatform.snakeHole._y});
_local2.gotoAndPlay(((_local1.lastX <= _local1.x) ? "LEFT" : "RIGHT"));
_local1.dead = true;
_local1.controller.activeSnakes[_local1.indexId] = undefined;
_local1.controller.snakeId = _local1.controller.snakeId - 1;
_local1.removeMovieClip();
}
function platformDetect() {
var _local1 = this;
if ((_local1.activePlatform.clip._x >= _local1._x) || ((_local1.activePlatform.clip._x + _local1.activePlatform.clip._width) <= (_local1._x + _local1._width))) {
_local1.AICheckDirection();
}
if (((_local1.activePlatform.snakeHole._x < (_local1.tempx + _local1._width)) && ((_local1.activePlatform.snakeHole._x + _local1.activePlatform.snakeHole._width) > _local1.tempx)) && (_local1.diveInHole)) {
_local1.killMe();
}
}
function checkHit() {
var _local1 = this;
if (!_local1.active) {
} else if ((((_local1.game.pl.activePlatform.clip == _local1.activePlatform.clip) && (_local1.tempx < _local1.game.pl.tempx)) && ((_local1.tempx + _local1._width) > _local1.game.pl.tempx)) && (!_local1.game.pl.inAir)) {
_local1.game.pl.hit();
_local1.snakeSound = _local1.game.playSound("sound_Snake", "", _local1);
}
}
function onEnterFrame() {
var _local1 = this;
if (_local1.dead || (_local1.game.isPaused)) {
} else {
_local1.platformDetect();
_local1.checkHit();
_local1.AI();
_local1.addFrictionAndGravity();
_local1.createTempPosition();
_local1.renderScreen();
}
}
}