Frame 1
stop();
loadMovieNum ("http://watches.whodidit.co.uk/watch66.swf", 10);
_root.tvc_media = "440";
_root.createEmptyMovieClip("TVC_mc", 0);
System.security.allowDomain("http://www.viralchart.com");
TVC_mc.loadMovie("http://www.viralchart.com/tvc_tracker.swf");
var ver = System.capabilities.version;
var spc = ver.indexOf(" ");
var typ = ver.substr(spc + 1, 1);
if (Number(typ) < 8) {
tfText.text = ("You have flash plugin ver. " + ver) + ".\nYou need at least version 8.0";
} else {
this.onEnterFrame = function () {
if (_root._framesloaded >= 11) {
this.onEnterFrame = null;
_root.gotoAndStop("loader");
}
};
}
Frame 11
stop();
var game = new Cronic(this);
System.security.allowDomain("*");
Symbol 6 MovieClip Frame 1
this._visible = false;
kv_v = {c:30, td:"kerb.kvcensus.com"};
System.security.allowDomain(kv_v.td);
kv_v.c_so = SharedObject.getLocal(kv_v.c, "/");
kv_v.d = (_root.ori_dom ? (_root.ori_dom) : (((_root._url.split("/")[0].indexOf("http") == -1) ? "Local" : (_root._url.split("/")[2].split("?")[0]))));
kv_v.fpv = getVersion().split(" ")[1].split(",")[0];
kv_v.lurl = ((((((((((("http://" + kv_v.td) + "/tracker.php") + "?c=") + kv_v.c) + "&r=") + Math.floor(Math.random() * 10000000000)) + "&d=") + kv_v.d) + "&u=") + (kv_v.c_so.data.u ? "1" : "")) + "&p=") + kv_v.fpv;
kv_v.c_so.data.u = true;
kv_v.c_so.flush();
kv_v.t_mc = this.createEmptyMovieClip("kv_tracker", 0);
kv_v.l_mcl = new MovieClipLoader();
if (kv_v.l_mcl.loadClip) {
kv_v.l_mcl.loadClip(kv_v.lurl, kv_v.t_mc);
} else {
loadMovie (kv_v.lurl, kv_v.t_mc);
}
stop();
Symbol 618 MovieClip [__Packages.Cronic] Frame 0
class Cronic
{
static var s_instance, s_levelsNumber;
var m_mcRoot, m_parsedLevels, m_bParsedLevels, m_bLoadedSwf, m_aLevels, m_swfLoader, m_aLevelParams;
function Cronic (mcRoot) {
s_instance = this;
m_mcRoot = mcRoot;
if (m_mcRoot.basepath != undefined) {
SCRIPTS_PATH = m_mcRoot.basepath;
}
m_parsedLevels = 0;
m_bParsedLevels = false;
m_bLoadedSwf = false;
m_aLevels = new Array();
m_swfLoader = new Loader(m_mcRoot.mcLoader, m_mcRoot);
m_swfLoader.addListener(this);
m_aLevelParams = new Array();
m_aLevelParams[0] = new Object({map:"level1.png", tileset:"tiles1.png"});
m_aLevelParams[1] = new Object({map:"level2.png", tileset:"tiles1.png"});
m_aLevelParams[2] = new Object({map:"level3.png", tileset:"tiles1.png"});
s_levelsNumber = m_aLevelParams.length;
}
function parseLevel(Void) {
var _local4 = m_aLevelParams[m_parsedLevels].map;
var _local2 = m_aLevelParams[m_parsedLevels].tileset;
var _local3 = new LevelParser(m_parsedLevels, _local4, _local2);
_local3.addListener(this);
}
function onParseLevel(oLevel) {
m_swfLoader.m_parsedLevels++;
m_parsedLevels++;
m_aLevels[oLevel.nr] = oLevel;
if (m_parsedLevels == s_levelsNumber) {
m_swfLoader.out();
} else {
parseLevel();
}
}
function onLoadSwf(Void) {
m_mcRoot.gotoAndStop(13);
parseLevel();
}
function startFront(Void) {
m_mcRoot.gotoAndStop("front");
var _local2 = new Front(m_mcRoot.mcFront);
Sounds.initButton(m_mcRoot.mcSoundBtn);
}
function startGame(Void) {
m_mcRoot.gotoAndStop("game");
var _local2 = new Game(m_mcRoot.mcGame, m_mcRoot, m_aLevels);
}
function onLoaderEnd(Void) {
Sounds.init();
startFront();
}
function onParseDataProgress(progress) {
m_swfLoader.setProgress(Math.floor(progress * 10));
}
static var SCRIPTS_PATH = "http://n2k.cimex.com/sftgame/";
static var SCRIPT_GET_SCORES = "GetScores.php";
static var SCRIPT_SAVE_SCORE = "SaveScore.php";
static var LEADERBOARD_LEN = 10;
static var GOD = false;
static var s_bFirstHelpFat = true;
}
Symbol 619 MovieClip [__Packages.Loader] Frame 0
class Loader
{
var m_mcLoader, m_mcRoot, m_parsedLevels, m_interval, m_percentage;
function Loader (mcLoader, mcRoot) {
m_mcLoader = mcLoader;
m_mcRoot = mcRoot;
AsBroadcaster.initialize(this);
m_mcLoader.onEnd = EventDelegate.create(this, onEnd);
m_parsedLevels = 0;
m_interval = setInterval(this, "onProgress", 10);
}
function broadcastMessage() {
}
function addListener() {
}
function removeListener() {
}
function onProgress(Void) {
var _local3 = m_mcRoot.getBytesLoaded();
var _local2 = m_mcRoot.getBytesTotal();
m_percentage = Math.round(((100 - (10 * Cronic.s_levelsNumber)) * _local3) / _local2);
setProgress(0);
if ((_local3 == _local2) && (_local2 > 100)) {
clearInterval(m_interval);
broadcastMessage("onLoadSwf");
}
}
function setProgress(value) {
var _local2 = m_parsedLevels * 10;
m_mcLoader.mcBar.gotoAndStop(((m_percentage + _local2) + value) + 1);
}
function out(Void) {
m_mcLoader.gotoAndPlay("out");
}
function onEnd(Void) {
broadcastMessage("onLoaderEnd");
}
}
Symbol 620 MovieClip [__Packages.EventDelegate] Frame 0
class EventDelegate
{
function EventDelegate () {
}
static function create(scope, method) {
var params = arguments.splice(2, arguments.length - 2);
var _local2 = function () {
method.apply(scope, arguments.concat(params));
};
return(_local2);
}
}
Symbol 621 MovieClip [__Packages.LevelParser] Frame 0
class LevelParser
{
var m_oLevel, m_bmpMap, m_ind, m_lastX, m_lastY, m_layers, m_width, m_height, m_aTiles, m_aSwitches, m_aFood, m_aEnemies, m_aObjects, m_mcControl;
function LevelParser (levelNr, sMapId, sTilesId) {
AsBroadcaster.initialize(this);
m_oLevel = new Object();
m_oLevel.nr = levelNr;
m_oLevel.bmpTiles = flash.display.BitmapData.loadBitmap(sTilesId);
m_bmpMap = flash.display.BitmapData.loadBitmap(sMapId);
m_ind = 0;
m_lastX = 0;
m_lastY = 0;
m_layers = 3;
m_width = m_bmpMap.width;
m_height = m_bmpMap.height / m_layers;
startParse();
}
function addListener() {
}
function removeListener() {
}
function broadcastMessage(sMsg) {
}
function startParse(Void) {
m_aTiles = new Array(m_layers);
var _local4 = 0;
while (_local4 < m_layers) {
m_aTiles[_local4] = new Array(m_height);
var _local3 = 0;
while (_local3 < m_height) {
m_aTiles[_local4][_local3] = new Array(m_width);
_local3++;
}
_local4++;
}
m_aSwitches = new Array(m_height);
_local4 = 0;
while (_local4 < m_height) {
m_aSwitches[_local4] = new Array(m_width);
_local4++;
}
m_aFood = new Array();
m_aEnemies = new Array();
m_aObjects = new Array();
var _local5 = _root.getNextHighestDepth();
m_mcControl = _root.createEmptyMovieClip("control" + _local5, _local5);
m_mcControl.onEnterFrame = EventDelegate.create(this, parseData);
}
function parseData(Void) {
var _local10 = 0;
var _local16 = getTimer();
var _local11 = m_bmpMap.width;
var _local14 = m_bmpMap.height;
var _local12 = false;
var _local8 = m_lastY;
while (_local8 < _local14) {
var _local2 = 0;
while (_local2 < _local11) {
if (m_lastX != 0) {
_local2 = m_lastX;
m_lastX = 0;
}
var _local6 = m_bmpMap.getPixel(_local2, _local8);
var _local5 = (_local6 >> 8) & 255;
if (_local5 == 255) {
_local5 = -1;
}
var _local4 = _local6 & 255;
if (_local4 == 255) {
_local4 = -1;
}
var _local9 = (m_layers - 1) - Math.floor(_local8 / m_height);
m_aTiles[_local9][_local8 % m_height][_local2] = new Object({x:_local5, y:_local4});
if (_local9 == 2) {
insertSpecial(_local5, _local4, _local2, _local8 % m_height, _local6);
}
m_ind++;
_local10++;
if (_local10 == ITERS) {
m_lastY = _local8;
m_lastX = _local2 + 1;
if (m_lastX == _local11) {
m_lastX = 0;
m_lastY = m_lastY + 1;
}
_local12 = true;
break;
}
_local2++;
}
if (_local12) {
break;
}
_local8++;
}
if (m_ind < ((m_width * m_height) * m_layers)) {
var _local15 = m_ind / ((m_width * m_height) * m_layers);
broadcastMessage("onParseDataProgress", _local15);
} else {
m_mcControl.onEnterFrame = null;
m_mcControl.removeMovieClip();
var _local13 = m_aEnemies.length;
_local8 = 0;
while (_local8 < _local13) {
var _local3 = m_aEnemies[_local8].x;
var _local7 = m_aEnemies[_local8].y;
while ((CTRL_BOLLARD.x != m_aTiles[2][_local7][_local3].x) && (CTRL_BOLLARD.y != m_aTiles[2][_local7][_local3].y)) {
_local3--;
}
m_aEnemies[_local8].left = _local3;
_local3 = m_aEnemies[_local8].x;
while ((CTRL_BOLLARD.x != m_aTiles[2][_local7][_local3].x) && (CTRL_BOLLARD.y != m_aTiles[2][_local7][_local3].y)) {
_local3++;
}
m_aEnemies[_local8].right = _local3;
_local8++;
}
m_oLevel.width = m_width;
m_oLevel.height = m_height;
m_oLevel.aTiles = m_aTiles;
m_oLevel.aSwitches = m_aSwitches;
m_oLevel.aEnemies = m_aEnemies;
broadcastMessage("onParseLevel", m_oLevel);
}
}
function insertSpecial(x, y, lx, ly, col) {
m_aSwitches[ly][lx] = -1;
if ((CTRL_CRONIC.x == x) && (CTRL_CRONIC.y == y)) {
m_oLevel.startPos = new flash.geom.Point(lx, ly);
} else if ((CTRL_EXIT.x == x) && (CTRL_EXIT.y == y)) {
m_oLevel.exitPos = new flash.geom.Point(lx, ly);
} else if ((CTRL_0_TO_1.x == x) && (CTRL_0_TO_1.y == y)) {
m_aSwitches[ly][lx] = 1;
} else if ((CTRL_1_TO_0.x == x) && (CTRL_1_TO_0.y == y)) {
m_aSwitches[ly][lx] = 0;
} else if ((CTRL_ENEMY_0.x == x) && (CTRL_ENEMY_0.y == y)) {
m_aEnemies.push({type:"enemy0", x:lx, y:ly});
} else if ((CTRL_ENEMY_1.x == x) && (CTRL_ENEMY_1.y == y)) {
m_aEnemies.push({type:"enemy1", x:lx, y:ly});
} else if ((CTRL_ENEMY_2.x == x) && (CTRL_ENEMY_2.y == y)) {
m_aEnemies.push({type:"enemy2", x:lx, y:ly});
}
}
static var CTRL_CRONIC = new flash.geom.Point(0, 0);
static var CTRL_EXIT = new flash.geom.Point(1, 0);
static var CTRL_0_TO_1 = new flash.geom.Point(0, 1);
static var CTRL_1_TO_0 = new flash.geom.Point(1, 1);
static var CTRL_ENEMY_0 = new flash.geom.Point(4, 2);
static var CTRL_ENEMY_1 = new flash.geom.Point(5, 2);
static var CTRL_ENEMY_2 = new flash.geom.Point(6, 2);
static var CTRL_BOLLARD = new flash.geom.Point(0, 4);
static var ITERS = 1000;
}
Symbol 622 MovieClip [__Packages.Front] Frame 0
class Front
{
var m_mcFront, m_btnCtrl;
function Front (mcFront) {
m_mcFront = mcFront;
m_mcFront.initButtonsFront = EventDelegate.create(this, initButtonsFront);
m_mcFront.initButtonsHowTo = EventDelegate.create(this, initButtonsHowTo);
m_mcFront.playGame = EventDelegate.create(this, playGame);
Sounds.stopSound("sndMusicFast");
Sounds.playSound("sndMusicFast", 99999);
}
function initButtonsFront(Void) {
m_mcFront.btnPlay.onRelease = EventDelegate.create(this, onReleasePlayFront);
m_mcFront.btnHowTo.onRelease = EventDelegate.create(this, onReleaseHowTo);
var _local2 = new Array();
_local2[0] = m_mcFront.btnPlay;
_local2[1] = m_mcFront.btnHowTo;
m_btnCtrl = new ButtonControl(_local2);
}
function initButtonsHowTo(page) {
var me = this;
if (page == 0) {
m_mcFront.mcInstructions.btnNext.onRelease = function () {
me.m_btnCtrl.remove();
this._parent.gotoAndStop("next");
};
var _local2 = new Array();
_local2[0] = m_mcFront.mcInstructions.btnNext;
m_btnCtrl = new ButtonControl(_local2);
} else if (page == 1) {
m_mcFront.mcInstructions.btnBack.onRelease = function () {
me.m_btnCtrl.remove();
this._parent.gotoAndStop("back");
};
m_mcFront.mcInstructions.btnPlay.onRelease = EventDelegate.create(this, onReleasePlayHowTo);
var _local2 = new Array();
_local2[0] = m_mcFront.mcInstructions.btnPlay;
_local2[1] = m_mcFront.mcInstructions.btnBack;
m_btnCtrl = new ButtonControl(_local2);
}
}
function playGame(Void) {
Cronic.s_instance.startGame();
}
function onReleasePlayFront(Void) {
m_btnCtrl.remove();
m_mcFront.gotoAndPlay("play1");
}
function onReleasePlayHowTo(Void) {
m_btnCtrl.remove();
m_mcFront.gotoAndPlay("play2");
}
function onReleaseHowTo(Void) {
m_btnCtrl.remove();
m_mcFront.gotoAndPlay("howto");
}
}
Symbol 623 MovieClip [__Packages.ButtonControl] Frame 0
class ButtonControl
{
var m_index, m_aButtons, m_aDontRemove, m_AcceptKey, m_oListener, m_mcMark;
function ButtonControl (aButtons, acceptKey, aDontRemove) {
m_index = 0;
m_aButtons = aButtons;
m_aDontRemove = aDontRemove;
if (acceptKey == undefined) {
m_AcceptKey = 32;
} else {
m_AcceptKey = acceptKey;
}
m_oListener = new Object();
m_oListener.onKeyDown = EventDelegate.create(this, handleKeyUp);
Key.addListener(m_oListener);
createMark();
}
function remove(Void) {
Key.removeListener(m_oListener);
m_mcMark.removeMovieClip();
}
function handleKeyUp(Void) {
switch (Key.getCode()) {
case 40 :
m_index++;
m_index = m_index % m_aButtons.length;
m_mcMark.removeMovieClip();
createMark();
break;
case 38 :
m_index--;
m_index = m_index + m_aButtons.length;
m_index = m_index % m_aButtons.length;
m_mcMark.removeMovieClip();
createMark();
break;
case m_AcceptKey :
m_aButtons[m_index].onRelease();
if (m_aDontRemove[m_index]) {
break;
}
remove();
}
}
function createMark(Void) {
var _local2 = m_aButtons[m_index];
var _local3 = _local2._parent;
m_mcMark = _local3.createEmptyMovieClip("mark", _local3.getNextHighestDepth());
m_mcMark._x = _local2._x;
m_mcMark._y = _local2._y;
m_mcMark.attachMovie("mark", "left", 1, {_y:(_local2._height / 2) - 3, _x:-11});
m_mcMark.attachMovie("mark", "right", 2, {_y:(_local2._height / 2) - 3, _x:_local2._width + 11});
switch (_local2) {
case _level0.mcFront.btnPlay :
m_mcMark.left._x = m_mcMark.left._x + 0;
m_mcMark.right._x = m_mcMark.right._x + -1;
break;
case _level0.mcFront.btnHowTo :
m_mcMark.left._x = m_mcMark.left._x + 3;
m_mcMark.right._x = m_mcMark.right._x + 0;
break;
case _level0.mcFront.mcInstructions.btnNext :
m_mcMark.left._x = m_mcMark.left._x + -2;
m_mcMark.right._x = m_mcMark.right._x + -5;
break;
case _level0.mcFront.mcInstructions.btnBack :
m_mcMark.left._x = m_mcMark.left._x + -2;
m_mcMark.right._x = m_mcMark.right._x + -5;
break;
case _level0.mcFront.mcInstructions.btnPlay :
m_mcMark.left._x = m_mcMark.left._x + 0;
m_mcMark.right._x = m_mcMark.right._x + -1;
}
}
}
Symbol 624 MovieClip [__Packages.Sounds] Frame 0
class Sounds
{
static var s_mainSounds, m_mcSoundsHolder, m_mcSoundButton, m_oSoundsList, m_aRandomSoundNamesList, m_ambienceInterval;
function Sounds () {
}
static function init(Void) {
if (s_mainSounds == undefined) {
s_mainSounds = new Sound(_root);
m_mcSoundsHolder = _root.createEmptyMovieClip("m_mcSoundsHolder", _root.getNextHighestDepth());
setSounds();
setVolume("sndBecomeFat", 200);
mainSoundUp();
}
}
static function initButton(btn) {
m_mcSoundButton = btn;
if (s_mainSounds.getVolume() == 0) {
mainSoundDown();
} else {
mainSoundUp();
}
}
static function mainSoundUp(Void) {
_root.mcSoundBtn.gotoAndStop("up");
_root.mcSoundBtn.btnSound.onRelease = mainSoundDown;
m_mcSoundButton.gotoAndStop("up");
m_mcSoundButton.onRelease = mainSoundDown;
s_mainSounds.setVolume(100);
}
static function mainSoundDown(Void) {
_root.mcSoundBtn.gotoAndStop("down");
_root.mcSoundBtn.btnSound.onRelease = mainSoundUp;
m_mcSoundButton.gotoAndStop("down");
m_mcSoundButton.onRelease = mainSoundUp;
s_mainSounds.setVolume(0);
}
static function setSounds(Void) {
var _local6 = new Array("sndMusicSlow", "sndMusicFast", "sndJump", "sndCollectDrop", "sndSpin", "sndBullyDead", "sndBreathing", "sndYouDead", "sndBounce", "sndBecomeFat");
m_oSoundsList = new Object();
var _local5 = _local6.length;
var _local2 = 0;
while (_local2 < _local5) {
var _local1 = _local6[_local2];
var _local4 = m_mcSoundsHolder.createEmptyMovieClip("holder" + _local2, _local2);
m_oSoundsList[_local1] = new Sound(_local4);
m_oSoundsList[_local1].attachSound(_local1);
_local2++;
}
m_aRandomSoundNamesList = new Array();
_local5 = m_aRandomSoundNamesList.length;
_local2 = 0;
while (_local2 < _local5) {
var _local1 = m_aRandomSoundNamesList[_local2];
if (m_oSoundsList[_local1] == undefined) {
var _local3 = m_mcSoundsHolder.getNextHighestDepth();
var _local4 = m_mcSoundsHolder.createEmptyMovieClip("holder" + _local3, _local3);
m_oSoundsList[_local1] = new Sound(_local4);
m_oSoundsList[_local1].attachSound(_local1);
}
_local2++;
}
}
static function playSound(sName, loops) {
if (loops == undefined) {
loops = 0;
}
m_oSoundsList[sName].start(0, loops);
}
static function stopSound(name) {
m_oSoundsList[name].stop();
}
static function stopAllSounds(sExcept) {
for (var _local1 in m_oSoundsList) {
if (_local1 != sExcept) {
stopSound(_local1);
}
}
}
static function setVolume(name, volume) {
m_oSoundsList[name].setVolume(volume);
}
static function getVolume(name) {
return(m_oSoundsList[name].getVolume());
}
static function playAmbience(Void) {
var _local2 = m_aRandomSoundNamesList.length;
var _local3 = Math.floor(_local2 * Math.random());
var _local1 = m_aRandomSoundNamesList[_local3];
var _local4 = 30 + Math.floor(30 * Math.random());
setVolume(_local1, _local4);
playSound(_local1, 0);
stopAmbience();
startAmbience();
}
static function startAmbience(bFirst) {
var _local1;
if (bFirst) {
_local1 = 1000 + Math.round(1000 * Math.random());
} else {
_local1 = 750 + Math.round(750 * Math.random());
}
clearInterval(m_ambienceInterval);
m_ambienceInterval = setInterval(playAmbience, _local1);
}
static function stopAmbience() {
clearInterval(m_ambienceInterval);
}
}
Symbol 625 MovieClip [__Packages.Game] Frame 0
class Game
{
static var s_instance;
var m_mcGame, m_mcRoot, m_mcGauges, m_mcPopUp, m_mcCurtain, m_mcMessage, m_aLevels, m_levelNr, m_lives, m_points, m_timer, m_ageRange, m_oLevel, m_boostLevel, m_aCollectedFood, m_aFoodMap, m_aActiveObj, m_scene, m_hero, m_interval, m_sPopUpLabel, m_btnCtrl, m_getter, m_sPopUpDest;
function Game (mcGame, mcRoot, aLevels) {
s_instance = this;
m_mcGame = mcGame;
m_mcRoot = mcRoot;
m_mcGauges = mcGame.mcGauges;
m_mcPopUp = mcGame.mcPopUp;
m_mcCurtain = mcGame.mcCurtain;
m_mcMessage = mcGame.mcMessage;
m_aLevels = aLevels;
m_levelNr = 0;
m_lives = 3;
m_points = 0;
m_timer = new Timer();
m_ageRange = AGE1;
displayLives();
displayTime();
displayPoints();
m_mcPopUp.setContent = EventDelegate.create(this, setPopUpContent);
m_mcPopUp.checkDest = EventDelegate.create(this, checkPopUpDest);
createLevel();
displayWeight();
displayFood();
startGame();
}
function createLevel(Void) {
m_oLevel = m_aLevels[m_levelNr];
m_boostLevel = 0;
m_aCollectedFood = new Array();
m_aFoodMap = new Array(m_oLevel.height);
var _local4 = 0;
while (_local4 < m_oLevel.height) {
m_aFoodMap[_local4] = new Array(m_oLevel.width);
_local4++;
}
m_aActiveObj = new Array();
m_aActiveObj.push(m_timer);
m_scene = new Scene(m_mcGame, m_oLevel, m_hero);
m_scene.addListener(this);
m_hero = new Hero(m_oLevel.startPos.x, (m_oLevel.height - 1) - m_oLevel.startPos.y, m_scene);
m_hero.addListener(this);
m_aActiveObj.push(m_hero);
m_scene.setHero(m_hero);
var _local11 = m_oLevel.startPos.x;
var _local10 = m_oLevel.startPos.y + 0.5;
var _local7 = _local11 - Math.floor(Scene.TILES_W / 2);
_local7 = _local7 * TILE_SIZE;
var _local13 = (_local10 * TILE_SIZE) - Scene.HERO_Y;
m_scene.draw(_local7, _local13);
var _local5 = m_oLevel.aEnemies.length;
_local4 = 0;
while (_local4 < _local5) {
var _local2 = m_oLevel.aEnemies[_local4];
var _local3;
switch (_local2.type) {
case "enemy0" :
_local3 = new Enemy(_local2.x, _local2.y, _local2.left, _local2.right, m_scene, m_hero, "enemy0");
break;
case "enemy1" :
_local3 = new Enemy(_local2.x, _local2.y, _local2.left, _local2.right, m_scene, m_hero, "enemy1");
break;
case "enemy2" :
_local3 = new Enemy(_local2.x, _local2.y, _local2.left, _local2.right, m_scene, m_hero, "enemy2");
}
addActiveObj(_local3);
_local4++;
}
var _local9 = (m_oLevel.exitPos.x + 0.5) * TILE_SIZE;
var _local8 = (m_oLevel.exitPos.y + 0.5) * TILE_SIZE;
var _local6 = m_scene.m_mcObjects.mc;
var _local12 = _local6.getNextHighestDepth();
_local6.attachMovie("exit", "exit", _local12, {_x:_local9, _y:_local8});
}
static function startGame(Void) {
s_instance.m_mcGame.onEnterFrame = EventDelegate.create(s_instance, s_instance.loop);
}
static function stopGame(Void) {
s_instance.m_mcGame.onEnterFrame = null;
}
function loop(Void) {
var _local3 = m_aActiveObj.length;
var _local2 = 0;
while (_local2 < _local3) {
m_aActiveObj[_local2].step();
m_aActiveObj[_local2].draw();
_local2++;
}
if (!m_hero.m_bIsDead) {
onRedrawScene();
}
displayTime();
}
function onRedrawScene(Void) {
var _local2 = m_hero.getPos();
var _local4 = _local2.x - (Scene.STAGE_W / 2);
var _local3 = _local2.y - Scene.HERO_Y;
if (m_hero.m_bExit) {
m_scene.draw(m_scene.m_cornerLeft, _local3);
} else {
m_scene.draw(_local4, _local3);
}
}
function removeActiveObj(obj) {
var _local3 = m_aActiveObj.length;
var _local2 = 0;
while (_local2 < _local3) {
if (m_aActiveObj[_local2] == obj) {
m_aActiveObj.splice(_local2, 1);
}
_local2++;
}
}
function addActiveObj(obj) {
m_aActiveObj.push(obj);
obj.addListener(this);
}
function onCollectFood(refFood, x, y) {
if (refFood.m_bGood) {
m_aCollectedFood.push(refFood.m_sType);
m_hero.addToWeight(0);
if (!refFood.m_bDropped) {
addPoints(POINTS_FOR_FOOD, refFood.m_x, refFood.m_y);
}
Sounds.playSound("sndCollectDrop");
} else {
m_hero.addToWeight(100);
Sounds.playSound("sndCollectDrop");
}
refFood.remove();
if (!refFood.m_bDropped) {
m_aFoodMap[y][x] = true;
}
displayFood();
}
function onGetHurt(sSide) {
if (Cronic.GOD) {
return(undefined);
}
if (m_aCollectedFood.length > 0) {
var _local4 = 90;
var _local3 = 1;
var _local11 = m_aCollectedFood.length;
var _local10 = 2;
var _local2 = 0;
while (_local2 < _local11) {
var _local6 = m_hero.getPos();
var _local9 = Math.floor(_local6.x / TILE_SIZE);
var _local8 = Math.floor(_local6.y / TILE_SIZE) - _local10;
var _local7 = String(m_aCollectedFood.shift());
var _local5 = new Food(_local7, _local9, _local8, m_scene, m_hero);
addActiveObj(_local5);
_local5.drop(_local4);
_local3 = -_local3;
_local4 = _local4 + ((_local3 * _local2) * 15);
if (_local4 == 180) {
_local4 = 90;
_local3 = 1;
_local10 = _local10 + 2;
}
_local2++;
}
m_aCollectedFood = new Array();
m_hero.onGetHurt(sSide);
displayFood();
displayWeight();
} else {
m_hero.onGetHurt(sSide);
m_hero.onLoseLife();
clearInterval(m_interval);
m_interval = setInterval(this, "loseLife", 1000);
m_hero.m_bKeyControl = false;
}
}
function loseLife(Void) {
clearInterval(m_interval);
if (m_hero.m_bIsFat) {
Sounds.stopSound("sndMusicSlow");
Sounds.playSound("sndMusicFast");
}
m_lives--;
if (m_lives < 0) {
stopGame();
displayPopUp("badLuck");
} else {
displayLives();
createLevel();
m_hero.m_bKeyControl = true;
m_timer.setTime(0);
displayTime();
displayWeight();
}
}
function displayTime(Void) {
m_mcGauges.tfTime.text = m_timer.getFormattedTime();
}
function displayLives(Void) {
m_mcGauges.mcLives.gotoAndStop(m_lives + 1);
}
function displayFood(Void) {
var _local5 = 0;
var _local4 = 0;
var _local3 = 0;
var _local6 = m_aCollectedFood.length;
var _local2 = 0;
while (_local2 < _local6) {
switch (m_aCollectedFood[_local2]) {
case "health0" :
_local5++;
break;
case "health1" :
_local4++;
break;
case "health2" :
_local3++;
}
_local2++;
}
m_mcGauges.tfHealth0.text = ((_local5 < 10) ? ("0" + _local5) : (_local5));
m_mcGauges.tfHealth1.text = ((_local4 < 10) ? ("0" + _local4) : (_local4));
m_mcGauges.tfHealth2.text = ((_local3 < 10) ? ("0" + _local3) : (_local3));
}
function displayWeight(Void) {
var _local3 = 1 - ((m_hero.getWeight() + Hero.MAX_WEIGHT) / (2 * Hero.MAX_WEIGHT));
var _local2 = Math.round(15 * _local3) + 1;
m_mcGauges.mcHealthBar.gotoAndStop(_local2);
}
function displayPoints(Void) {
m_mcGauges.tfScore.text = m_points;
}
function displayPopUp(sLabel) {
m_sPopUpLabel = sLabel;
if (sLabel == "helpFat") {
m_mcPopUp.gotoAndPlay("fatIn");
} else {
m_mcPopUp.gotoAndPlay("play");
}
}
function setPopUpContent(Void) {
m_mcPopUp.mcContent.gotoAndStop(m_sPopUpLabel);
switch (m_sPopUpLabel) {
case "badLuck" :
m_mcPopUp.mcContent.tfScore.text = m_points;
m_mcPopUp.mcContent.btnHiScore.onRelease = EventDelegate.create(this, onReleaseHiScore);
m_mcPopUp.mcContent.btnTryAgain.onRelease = EventDelegate.create(this, onReleaseTryAgain);
var _local4 = new Array();
_local4[0] = m_mcPopUp.mcContent.btnTryAgain;
_local4[1] = m_mcPopUp.mcContent.btnHiScore;
m_btnCtrl = new ButtonControl(_local4);
break;
case "hiScore" :
m_mcPopUp.btnPlayAgain.onRelease = EventDelegate.create(this, onReleaseTryAgain);
_local4 = new Array();
_local4[0] = m_mcPopUp.btnPlayAgain;
m_btnCtrl = new ButtonControl(_local4);
displayMessage("getting hiscore list...");
var _local2 = new LoadVars();
_local2.agerange = m_ageRange;
m_getter = new LoadVars();
m_getter.onLoad = EventDelegate.create(this, onGetScores);
_local2.sendAndLoad(Cronic.SCRIPTS_PATH + Cronic.SCRIPT_GET_SCORES, m_getter, "POST");
break;
case "nextLevel" :
var _local3 = calculateTimeBonus();
m_mcPopUp.mcContent.tfTimeBonus.text = _local3;
var _local5 = calculateFoodBonus();
m_mcPopUp.mcContent.tfFoodBonus.text = _local5;
m_points = m_points + (_local3 + _local5);
m_mcPopUp.mcContent.tfScore.text = m_points;
m_mcPopUp.mcContent.btnNextLevel.onRelease = EventDelegate.create(this, onReleaseNextLevel);
var _local7 = new Array("first", "second", "third");
var _local8 = _local7[m_levelNr - 1];
var _local6 = m_levelNr + 1;
m_mcPopUp.mcContent.tfHeader.text = ((("Congratulations, you have finished the " + _local8) + " level,\nnow try your luck on level ") + _local6) + ".";
_local4 = new Array();
_local4[0] = m_mcPopUp.mcContent.btnNextLevel;
m_btnCtrl = new ButtonControl(_local4);
break;
case "lastLevel" :
_local3 = calculateTimeBonus();
m_mcPopUp.mcContent.tfTimeBonus.text = _local3;
_local5 = calculateFoodBonus();
m_mcPopUp.mcContent.tfFoodBonus.text = _local5;
m_points = m_points + (_local3 + _local5);
m_mcPopUp.mcContent.tfScore.text = m_points;
m_mcPopUp.mcContent.btnOk.onRelease = EventDelegate.create(this, onReleaseLastLevel);
_local4 = new Array();
_local4[0] = m_mcPopUp.mcContent.btnOk;
m_btnCtrl = new ButtonControl(_local4);
break;
case "madeHiScore" :
m_mcPopUp.mcContent.tfScore.text = m_points;
m_mcPopUp.mcContent.tfName.tabIndex = 0;
m_mcPopUp.mcContent.tfAge.tabIndex = 1;
m_mcPopUp.mcContent.tfAge.restrict = "0-9";
Selection.setFocus(m_mcPopUp.mcContent.tfName);
Selection.setSelection(0, 10);
m_mcPopUp.mcContent.btnOk.onRelease = EventDelegate.create(this, onReleaseSaveScore);
_local4 = new Array();
var _local9 = new Array();
_local4[0] = m_mcPopUp.mcContent.btnOk;
_local9[0] = true;
m_btnCtrl = new ButtonControl(_local4, 13, _local9);
break;
case "noHiScore" :
m_mcPopUp.mcContent.tfScore.text = m_points;
m_mcPopUp.mcContent.btnPlayAgain.onRelease = EventDelegate.create(this, onReleaseTryAgain);
_local4 = new Array();
_local9 = new Array();
_local4[0] = m_mcPopUp.mcContent.btnPlayAgain;
m_btnCtrl = new ButtonControl(_local4);
break;
case "helpFat" :
m_mcPopUp.mcContent.btnOk.onRelease = EventDelegate.create(this, onReleaseOkHelpFat);
_local4 = new Array();
_local4[0] = m_mcPopUp.mcContent.btnOk;
m_btnCtrl = new ButtonControl(_local4);
}
}
function checkPopUpDest(Void) {
switch (m_sPopUpDest) {
case "tryAgain" :
Cronic.s_instance.startFront();
break;
case "hiScore" :
m_sPopUpLabel = "hiScore";
break;
case "nextLevel" :
m_mcPopUp.gotoAndStop("blank");
createLevel();
displayPoints();
m_timer.setTime(0);
displayTime();
displayWeight();
m_mcCurtain.gotoAndPlay("out");
startGame();
break;
case "helpFat" :
m_mcPopUp.gotoAndStop("blank");
startGame();
break;
case "madeHiScore" :
case "noHiScore" :
m_sPopUpLabel = m_sPopUpDest;
m_mcPopUp.gotoAndPlay("play2");
}
}
function onReleaseHiScore(Void) {
m_btnCtrl.remove();
m_sPopUpDest = "hiScore";
m_mcPopUp.gotoAndPlay("next");
}
function onReleaseTryAgain(Void) {
m_btnCtrl.remove();
m_sPopUpDest = "tryAgain";
if (m_sPopUpLabel == "hiScore") {
m_mcPopUp.gotoAndPlay("next1");
} else {
m_mcPopUp.gotoAndPlay("next");
}
}
function onReleaseNextLevel(Void) {
m_btnCtrl.remove();
m_sPopUpDest = "nextLevel";
m_mcPopUp.gotoAndPlay("next");
}
function onReleaseSaveScore(Void) {
var _local3 = m_mcPopUp.mcContent.tfName.text;
var _local4 = m_mcPopUp.mcContent.tfAge.text;
if ((_local3 == "Name...") || (_local3 == "")) {
Selection.setFocus(m_mcPopUp.mcContent.tfName);
Selection.setSelection(0, 20);
} else if (_local4 == "") {
Selection.setFocus(m_mcPopUp.mcContent.tfAge);
Selection.setSelection(0, 2);
} else {
m_btnCtrl.remove();
var _local5 = parseInt(_local4);
if (_local5 < 9) {
m_ageRange = AGE0;
} else if (_local5 < 15) {
m_ageRange = AGE1;
} else {
m_ageRange = AGE2;
}
displayMessage("sending...");
var _local2 = new LoadVars();
_local2.name = _local3;
_local2.agerange = m_ageRange;
_local2.score = m_points;
m_getter = new LoadVars();
m_getter.onLoad = EventDelegate.create(this, onSendScore);
_local2.sendAndLoad(Cronic.SCRIPTS_PATH + Cronic.SCRIPT_SAVE_SCORE, m_getter, "POST");
}
}
function onReleaseOkHelpFat(Void) {
m_btnCtrl.remove();
m_sPopUpDest = "helpFat";
m_mcPopUp.gotoAndPlay("fatOut");
}
function onReleaseLastLevel(Void) {
m_btnCtrl.remove();
displayMessage("checking your score...");
var _local2 = new LoadVars();
m_getter = new LoadVars();
m_getter.onLoad = EventDelegate.create(this, onCheckScore);
_local2.sendAndLoad(Cronic.SCRIPTS_PATH + Cronic.SCRIPT_GET_SCORES, m_getter, "POST");
}
function onLevelComplete(Void) {
stopGame();
if (m_hero.m_bIsFat) {
Sounds.stopSound("sndMusicSlow");
Sounds.playSound("sndMusicFast");
}
m_levelNr++;
if (m_levelNr == Cronic.s_levelsNumber) {
displayPopUp("lastLevel");
} else {
displayPopUp("nextLevel");
}
}
function calculateTimeBonus(Void) {
var _local2 = TIME_BONUS - (7 * Math.floor(m_timer.getTime() / 500));
if (_local2 < 0) {
_local2 = 0;
}
return(_local2);
}
function calculateFoodBonus(Void) {
return(m_aCollectedFood.length * FOOD_BONUS);
}
function displayMessage(sMsg) {
m_mcMessage.gotoAndStop("on");
m_mcMessage.tfMessage.text = sMsg.toUpperCase();
}
function hideMessage(Void) {
m_mcMessage.gotoAndStop("off");
}
function onSendScore(bSuccess) {
hideMessage();
m_sPopUpDest = "hiScore";
m_mcPopUp.gotoAndPlay("next");
}
function onGetScores(bSuccess) {
hideMessage();
var _local4;
var _local6;
var _local5;
var _local3;
var _local2 = 1;
while (_local2 < (Cronic.LEADERBOARD_LEN + 1)) {
_local4 = m_getter["name" + _local2];
if (_local4 == undefined) {
break;
}
_local6 = parseInt(m_getter["score" + _local2]);
_local5 = m_mcPopUp.mcHiScore.getNextHighestDepth();
_local3 = m_mcPopUp.mcHiScore.attachMovie("hi score row", "row" + _local5, _local5, {_y:(_local2 - 1) * 24});
_local3.tfNumber.text = _local2;
_local3.tfName.text = _local4;
_local3.tfScore.text = _local6;
_local2++;
}
}
function onCheckScore(bSuccess) {
hideMessage();
var _local3 = new Array();
for (var _local4 in m_getter) {
if (_local4.indexOf("score") != -1) {
var _local2 = parseInt(_local4.substr(5), 10) - 1;
_local3[_local2] = parseInt(m_getter[_local4], 10);
}
}
if (_local3.length < Cronic.LEADERBOARD_LEN) {
m_sPopUpDest = "madeHiScore";
} else if (m_points > _local3[_local3.length - 1]) {
m_sPopUpDest = "madeHiScore";
} else {
m_sPopUpDest = "noHiScore";
}
m_mcPopUp.gotoAndPlay("next");
}
function onDestroyEnemy(x, y) {
addPoints(POINTS_FOR_BULLY, x, y);
}
function addPoints(points, x, y) {
m_points = m_points + points;
displayPoints();
var _local2 = m_scene.m_mcObjects.mc;
new PointsCloud(_local2, x, y, points);
}
static var TILE_SIZE = 32;
static var TIME_BONUS = 5000;
static var FOOD_BONUS = 100;
static var POINTS_FOR_FOOD = 50;
static var POINTS_FOR_BULLY = 300;
static var AGE0 = 0;
static var AGE1 = 1;
static var AGE2 = 2;
}
Symbol 626 MovieClip [__Packages.Hero] Frame 0
class Hero
{
var m_scene, m_mcHero, m_mcAnims, m_mcHitArea, m_posX, m_posY, m_weight, m_vel, m_maxVel, m_velX, m_velY, m_rotation, m_animRot, m_shield, m_bumpTime, m_becomeFatFrame, m_bKeyControl, m_bAir, m_bGround, m_bAllowJump, m_bIsSpinning, m_bIsFat, m_bIsExercising, m_bIsDead, m_bExit, m_bReleasedExercise0, m_bReleasedExercise1, m_centerX, m_centerY, m_bmpLayer, m_aHitTests, m_pressTime, m_bPressedExercise0, m_bPressedExercise1, m_bPressedLeft, m_bPressedRight, m_bPressedSpin, m_bPressedJump, m_bIsHurted, m_lastPressed;
function Hero (startX, startY, scene) {
AsBroadcaster.initialize(this);
m_scene = scene;
m_mcHero = scene.m_mcTiles.attachMovie("hero", "mcHero", 20);
m_mcAnims = m_mcHero.mcAnims;
m_mcHitArea = m_mcAnims.mcHitArea;
m_mcHitArea._visible = false;
m_posX = (startX + 0.5) * Game.TILE_SIZE;
m_posY = (startY + 0.5) * Game.TILE_SIZE;
m_weight = -MAX_WEIGHT;
m_vel = 0;
m_maxVel = VEL_FAST;
m_velX = 0;
m_velY = 0;
m_rotation = 90;
m_animRot = 0;
m_shield = 0;
m_bumpTime = 0;
m_becomeFatFrame = 0;
m_bKeyControl = true;
m_bAir = false;
m_bGround = false;
m_bAllowJump = false;
m_bIsSpinning = false;
m_bIsFat = false;
m_bIsExercising = false;
m_bIsDead = false;
m_bExit = false;
m_bReleasedExercise0 = true;
m_bReleasedExercise1 = true;
m_centerX = Scene.STAGE_W / 2;
m_centerY = Scene.HERO_Y;
m_bmpLayer = m_scene["m_bmpBuffer" + DAFAULT_LAYER];
m_aHitTests = new Array();
m_aHitTests[HP_TOP] = m_mcHero.hT;
m_aHitTests[HP_BOTTOM] = m_mcHero.hB;
m_aHitTests[HP_LEFT] = m_mcHero.hL;
m_aHitTests[HP_RIGHT] = m_mcHero.hR;
var _local2 = 0;
while (_local2 < 4) {
m_aHitTests[_local2]._visible = false;
_local2++;
}
draw();
}
function addListener() {
}
function removeListener() {
}
function broadcastMessage(sMsg) {
}
function step(Void) {
if (!m_bExit) {
keyControl();
} else if ((m_mcHero._x < 0) || (m_mcHero._x > Scene.STAGE_W)) {
broadcastMessage("onLevelComplete");
}
var _local5 = getTimer() - m_pressTime;
if (((m_bIsFat && (m_bGround)) && (m_velX == 0)) && (((_local5 < 500) || (m_bPressedExercise0)) || (m_bPressedExercise1))) {
m_bIsExercising = true;
m_weight = m_weight - 0.1;
if (m_weight <= 0) {
m_bIsFat = false;
m_maxVel = VEL_FAST;
m_weight = 0;
Sounds.stopSound("sndMusicSlow");
Sounds.playSound("sndMusicFast", 99999);
}
broadcastMessage("displayWeight");
return(undefined);
}
m_bIsExercising = false;
m_rotation = Math.round(m_rotation);
if (m_bumpTime > 0) {
m_bumpTime--;
}
if (m_bIsDead || (m_bExit)) {
m_velY = m_velY - (3 * GRAVITY);
} else if (m_bIsFat) {
m_velY = m_velY - (GRAVITY + (0.8 * GRAVITY));
} else {
m_velY = m_velY - GRAVITY;
}
if (m_bPressedLeft) {
m_vel = m_vel - 0.5;
m_mcAnims._xscale = -100;
} else if (m_bPressedRight) {
m_vel = m_vel + 0.5;
m_mcAnims._xscale = 100;
} else if (m_vel != 0) {
if ((!m_bGround) || (m_bumpTime <= 0)) {
m_vel = m_vel - (m_vel * 0.05);
}
if (Math.abs(m_vel) < 1) {
m_vel = 0;
if (m_bGround) {
m_bIsSpinning = false;
}
}
}
if (m_bPressedSpin) {
m_bPressedSpin = false;
if ((m_bGround && (m_vel != 0)) && (!m_bIsSpinning)) {
m_bIsSpinning = true;
Sounds.playSound("sndSpin");
}
}
if ((m_bPressedJump && (m_bAllowJump)) && (m_bGround)) {
m_bAllowJump = false;
m_bAir = true;
m_bGround = false;
m_bIsSpinning = true;
var _local2 = (m_bIsFat ? 12 : 14);
var _local3 = (Math.PI * m_rotation) / 180;
m_rotation = m_rotation + 360;
m_rotation = m_rotation % 360;
if (((m_rotation > 45) && (m_rotation < 135)) || ((m_rotation > 225) && (m_rotation < 315))) {
m_vel = m_vel + (_local2 * Math.cos(_local3));
m_velY = m_velY + (_local2 * Math.sin(_local3));
} else if ((m_rotation <= 45) || (m_rotation >= 315)) {
m_velY = ((-m_vel) * 0.3) + (_local2 * Math.sin(_local3));
m_vel = (m_vel * 0.3) + (_local2 * Math.cos(_local3));
} else {
m_velY = (m_vel * 0.3) + (_local2 * Math.sin(_local3));
m_vel = (m_vel * 0.3) + (_local2 * Math.cos(_local3));
}
m_posY = m_posY + m_velY;
Sounds.playSound("sndJump");
}
var _local3 = (Math.PI * m_rotation) / 180;
if (m_bGround) {
if ((m_rotation > 91) || (m_rotation < 81)) {
m_vel = m_vel + (1.4 * Math.cos(_local3));
}
m_velX = m_vel * Math.sin(_local3);
m_velY = (-m_vel) * Math.cos(_local3);
}
if (m_vel > m_maxVel) {
m_vel = m_maxVel;
} else if (m_vel < (-m_maxVel)) {
m_vel = -m_maxVel;
}
if (m_velY > VEL_FAST) {
m_velY = VEL_FAST;
} else if (m_velY < (-VEL_FAST)) {
m_velY = -VEL_FAST;
}
_local3 = (Math.PI * (m_rotation - 90)) / 180;
if ((m_rotation >= 170) || (m_rotation <= 10)) {
if (Math.abs(m_vel) < 5) {
m_bAir = true;
m_bGround = false;
}
}
if (m_bGround) {
m_posX = m_posX + m_velX;
m_posY = m_posY + m_velY;
m_animRot = 0;
} else if (m_bAir) {
if ((!m_bIsDead) && (!m_bIsHurted)) {
m_bIsSpinning = true;
}
m_rotation = m_rotation + 360;
m_rotation = m_rotation % 360;
if (m_rotation != 90) {
m_animRot = 90 - m_rotation;
if ((m_rotation < 355) && (m_rotation > 185)) {
m_vel = -m_vel;
} else if (((m_rotation <= 185) && (m_rotation > 175)) && (m_vel > 0)) {
m_posX = m_posX - 3;
m_vel = m_vel * 0.4;
m_vel = ((m_vel < 3) ? 3 : (m_vel));
} else if (((m_rotation <= 5) || (m_rotation >= 355)) && (m_vel < 0)) {
m_posX = m_posX + 3;
m_vel = m_vel * 0.4;
m_vel = ((m_vel < 3) ? 3 : (m_vel));
}
}
m_rotation = 90;
m_mcHero._rotation = 90 - m_rotation;
m_velX = m_vel;
m_posX = m_posX + m_velX;
m_posY = m_posY + m_velY;
var _local4 = 10;
if (m_rotation > (90 + _local4)) {
m_rotation = m_rotation - _local4;
} else if (m_rotation < (90 - _local4)) {
m_rotation = m_rotation + _local4;
} else {
m_rotation = 90;
}
}
if (!m_bIsDead) {
broadcastMessage("onRedrawScene");
}
checkSwitch();
checkExit();
if (!m_bIsDead) {
checkGround();
}
}
function draw(Void) {
if (m_bIsDead) {
m_mcHero._x = m_mcHero._x + m_velX;
m_mcHero._y = m_mcHero._y - m_velY;
m_mcHero._xscale = m_mcHero._xscale + 2;
m_mcHero._yscale = m_mcHero._yscale + 2;
setAnim();
return(undefined);
}
if (m_bExit) {
m_mcHero._x = m_mcHero._x + m_velX;
setAnim();
return(undefined);
}
m_mcHero._x = m_centerX;
m_mcHero._y = m_centerY;
m_mcHero._rotation = 90 - m_rotation;
setAnim();
if (m_shield > 0) {
m_shield--;
if (m_shield > (MAX_SHIELD_TIME * 0.75)) {
m_bIsHurted = true;
} else if (m_shield > (MAX_SHIELD_TIME * 0.5)) {
m_bIsHurted = false;
if ((m_shield % 6) > 2) {
m_mcHero._alpha = 0;
} else {
m_mcHero._alpha = 100;
}
} else if (m_shield > (MAX_SHIELD_TIME * 0.2)) {
if ((m_shield % 4) > 1) {
m_mcHero._alpha = 0;
} else {
m_mcHero._alpha = 100;
}
} else if ((m_shield % 2) > 0) {
m_mcHero._alpha = 0;
} else {
m_mcHero._alpha = 100;
}
}
}
function keyControl(Void) {
if (!m_bKeyControl) {
return(undefined);
}
if (Key.isDown(KEY_LEFT)) {
m_bPressedLeft = true;
} else {
m_bPressedLeft = false;
}
if (Key.isDown(KEY_RIGHT)) {
m_bPressedRight = true;
} else {
m_bPressedRight = false;
}
if (Key.isDown(KEY_SPIN)) {
m_bPressedSpin = true;
} else {
m_bPressedSpin = false;
}
if (Key.isDown(KEY_JUMP) && (!m_bPressedJump)) {
m_bPressedJump = true;
} else {
m_bPressedJump = false;
}
if (Key.isDown(KEY_EXERCISE0)) {
if ((m_lastPressed != KEY_EXERCISE0) && (m_bReleasedExercise0)) {
m_bPressedExercise0 = true;
m_bReleasedExercise0 = false;
m_lastPressed = KEY_EXERCISE0;
m_pressTime = getTimer();
}
} else {
m_bPressedExercise0 = false;
m_bReleasedExercise0 = true;
}
if (Key.isDown(KEY_EXERCISE1)) {
if ((m_lastPressed != KEY_EXERCISE1) && (m_bReleasedExercise1)) {
m_bPressedExercise1 = true;
m_bReleasedExercise1 = false;
m_lastPressed = KEY_EXERCISE1;
m_pressTime = getTimer();
}
} else {
m_bPressedExercise1 = false;
m_bReleasedExercise1 = true;
}
}
function getPos(Void) {
return(new flash.geom.Point(Math.floor(m_posX), (m_scene.m_oLevel.height * Game.TILE_SIZE) - Math.floor(m_posY)));
}
function checkGround(Void) {
m_rotation = m_rotation + 360;
m_rotation = m_rotation % 360;
var _local3 = null;
var _local4 = null;
if (m_velX > 0) {
_local3 = moveHpBackH(m_aHitTests[HP_RIGHT], -1, m_bmpLayer);
if ((_local3 != null) && ((m_rotation > 200) || ((m_rotation > 20) && (m_rotation < 180)))) {
m_posX = m_posX - (_local3 + 1);
m_vel = -0.4 * Math.abs(m_vel);
broadcastMessage("onRedrawScene");
}
} else if (m_velX < 0) {
_local4 = moveHpBackH(m_aHitTests[HP_LEFT], 1, m_bmpLayer);
if ((_local4 != null) && ((m_rotation < 160) || ((m_rotation > 180) && (m_rotation < 340)))) {
m_posX = m_posX + (_local4 + 1);
m_vel = 0.4 * Math.abs(m_vel);
broadcastMessage("onRedrawScene");
}
}
var _local2 = moveHpBackV(m_aHitTests[HP_BOTTOM], -1, m_bmpLayer);
var _local7 = moveHpBackV(m_aHitTests[HP_TOP], 1, m_bmpLayer);
if (_local2 != null) {
if (m_bAir && (m_bIsSpinning)) {
m_bIsSpinning = false;
}
m_bAir = false;
m_bGround = true;
m_bAllowJump = true;
var _local6 = (Math.PI * m_rotation) / 180;
m_posX = m_posX + (_local2 * Math.cos(_local6));
m_posY = m_posY + (_local2 * Math.sin(_local6));
m_velY = 0;
if (m_velX > 0) {
moveHpBackV(m_aHitTests[HP_RIGHT], -1, m_bmpLayer);
var _local5 = getAngle(m_aHitTests[HP_BOTTOM], m_aHitTests[HP_RIGHT]);
m_rotation = (90 - m_mcHero._rotation) + _local5;
} else if (m_velX < 0) {
moveHpBackV(m_aHitTests[HP_LEFT], -1, m_bmpLayer);
var _local5 = getAngle(m_aHitTests[HP_LEFT], m_aHitTests[HP_BOTTOM]);
m_rotation = (90 - m_mcHero._rotation) + _local5;
} else {
moveHpBackV(m_aHitTests[HP_RIGHT], -1, m_bmpLayer);
var _local5 = getAngle(m_aHitTests[HP_BOTTOM], m_aHitTests[HP_RIGHT]);
moveHpBackV(m_aHitTests[HP_LEFT], -1, m_bmpLayer);
_local5 = _local5 + getAngle(m_aHitTests[HP_LEFT], m_aHitTests[HP_BOTTOM]);
_local5 = _local5 / 2;
m_rotation = (90 - m_mcHero._rotation) + _local5;
}
if (Math.abs(90 - m_rotation) < 2) {
m_rotation = 90;
}
} else if (_local7 != null) {
m_posY = m_posY - Math.abs(m_velY);
m_velY = m_velY * -0.6;
m_velY = -Math.abs(m_velY);
} else if (_local2 == null) {
m_bAir = true;
m_bGround = false;
}
if ((_local4 != null) || (_local3 != null)) {
m_velX = m_velX * -0.1;
}
}
function isCollision(hp, bmpGround) {
var _local3 = new flash.geom.Point(0, 0);
hp._y = 15;
var _local2 = new flash.geom.Point(hp._x, hp._y);
m_mcHero.localToGlobal(_local2);
if (bmpGround.hitTest(_local3, 50, _local2)) {
return(true);
}
return(false);
}
function moveHpBackV(hp, dirY, bmpGround) {
var _local8 = 27;
hp._y = _local8;
if (hp == m_aHitTests[HP_TOP]) {
hp._y = -15;
}
if (hp == m_aHitTests[HP_LEFT]) {
hp._x = -15;
} else if (hp == m_aHitTests[HP_RIGHT]) {
hp._x = 15;
}
var _local5 = false;
var _local9 = 0;
var _local4 = 0;
var _local2 = new flash.geom.Point();
var _local6 = new flash.geom.Point(-m_scene.m_dx, -m_scene.m_dy);
while (_local4 < 35) {
_local2.x = hp._x;
_local2.y = hp._y;
m_mcHero.localToGlobal(_local2);
if ((!_local5) && (bmpGround.hitTest(_local6, 50, _local2))) {
_local5 = true;
_local9 = _local4;
} else if (_local5 && (!bmpGround.hitTest(_local6, 50, _local2))) {
return(15 - (_local8 - _local4));
}
_local4++;
hp._y = hp._y + dirY;
}
if (!_local5) {
hp._y = 15;
if (hp == m_aHitTests[HP_TOP]) {
hp._y = -15;
} else if ((hp == m_aHitTests[HP_LEFT]) || (hp == m_aHitTests[HP_RIGHT])) {
hp._y = m_aHitTests[HP_BOTTOM]._y;
}
}
return(null);
}
function moveHpBackH(hp, dirX, bmpGround) {
var _local6 = 15;
hp._y = 0;
hp._x = (-dirX) * _local6;
var _local5 = false;
var _local4 = 0;
var _local3 = new flash.geom.Point();
var _local7 = new flash.geom.Point(-m_scene.m_dx, -m_scene.m_dy);
while (_local4 < 40) {
_local3.x = hp._x;
_local3.y = hp._y;
m_mcHero.localToGlobal(_local3);
if (((_local4 < 15) && (!_local5)) && (bmpGround.hitTest(_local7, 50, _local3))) {
_local5 = true;
} else if (_local5 && (!bmpGround.hitTest(_local7, 50, _local3))) {
hp._y = 15;
hp._x = (-dirX) * _local6;
return(15 - (_local6 - _local4));
}
_local4++;
hp._x = hp._x + dirX;
}
hp._y = 15;
hp._x = (-dirX) * _local6;
return(null);
}
function getAngle(hp0, hp1) {
var _local2 = hp1._x - hp0._x;
var _local1 = hp0._y - hp1._y;
var _local3 = Math.atan2(_local1, _local2);
return((180 * _local3) / Math.PI);
}
function checkSwitch(Void) {
var _local4 = Math.floor(m_posX / Game.TILE_SIZE);
var _local3 = (m_scene.m_oLevel.height - 1) - Math.floor(m_posY / Game.TILE_SIZE);
var _local2 = m_scene.m_oLevel.aSwitches[_local3][_local4];
if (_local2 == 0) {
m_bmpLayer = m_scene.m_bmpBuffer0;
} else if (_local2 == 1) {
m_bmpLayer = m_scene.m_bmpBuffer1;
}
}
function setAnim(Void) {
if (m_becomeFatFrame > 0) {
m_becomeFatFrame--;
m_mcAnims.gotoAndStop("thin_to_fat");
if ((m_becomeFatFrame == 0) && (Cronic.s_bFirstHelpFat)) {
Cronic.s_bFirstHelpFat = false;
Game.stopGame();
broadcastMessage("displayPopUp", "helpFat");
}
if (m_becomeFatFrame == 7) {
Sounds.playSound("sndBecomeFat");
}
} else if (m_bIsSpinning) {
m_mcAnims.gotoAndStop("spinning_thin");
} else if (m_bIsExercising) {
m_mcAnims.gotoAndStop("exercise_fat");
} else if (m_bIsDead || (m_bIsHurted)) {
if (m_bIsFat) {
m_mcAnims.gotoAndStop("dead_fat");
} else {
m_mcAnims.gotoAndStop("dead_thin");
}
} else if (!m_bIsFat) {
if (m_vel == 0) {
m_mcAnims.gotoAndStop("standing_thin");
} else if (Math.abs(m_vel) < 8) {
m_mcAnims.gotoAndStop("walking_thin");
} else {
m_mcAnims.gotoAndStop("running_thin");
}
} else if (m_vel == 0) {
m_mcAnims.gotoAndStop("standing_fat");
} else {
m_mcAnims.gotoAndStop("walking_fat");
}
if (m_animRot != 0) {
var _local2 = 5;
if (m_animRot > _local2) {
m_animRot = m_animRot - _local2;
} else if (m_animRot < (-_local2)) {
m_animRot = m_animRot + _local2;
} else {
m_animRot = 0;
}
}
m_mcAnims._rotation = m_animRot;
}
function isProtected(Void) {
if (m_shield > 0) {
return(true);
}
return(false);
}
function onGetHurt(sSide) {
m_shield = MAX_SHIELD_TIME;
if (m_vel != 0) {
m_vel = -8 * (Math.abs(m_vel) / m_vel);
}
if (sSide == "bottom") {
m_velY = 6;
m_posY = m_posY + 3;
} else {
m_velY = -4;
}
m_posY = m_posY + m_velY;
m_bAir = true;
m_bGround = false;
m_bAllowJump = false;
m_bIsSpinning = false;
m_bIsHurted = true;
Sounds.playSound("sndYouDead");
}
function onLoseLife() {
m_velY = 15;
m_bPressedLeft = false;
m_bPressedRight = false;
m_bPressedJump = false;
m_bIsDead = true;
var _local4 = m_mcHero._x;
var _local3 = m_mcHero._y;
var _local2 = m_mcHero._xscle;
m_mcHero.removeMovieClip();
m_mcHero = m_scene.m_mcObjects.attachMovie("hero", "mcHero", 1000);
m_mcHero._x = _local4;
m_mcHero._y = _local3;
m_mcHero._xscale = _local2;
m_mcHero.hT._visible = false;
m_mcHero.hR._visible = false;
m_mcHero.hB._visible = false;
m_mcHero.hL._visible = false;
m_mcAnims = m_mcHero.mcAnims;
m_mcHitArea = m_mcHero.mcAnims.mcHitArea;
m_mcHitArea._visible = false;
}
function bounceUp(Void) {
if (m_bAir && (m_velY < 0)) {
m_velY = m_velY * -0.9;
m_posY = m_posY + m_velY;
}
}
function setWeight(value) {
m_weight = value;
broadcastMessage("displayWeight");
}
function getWeight(Void) {
return(m_weight);
}
function addToWeight(value) {
m_weight = m_weight + value;
if (m_weight > MAX_WEIGHT) {
m_weight = MAX_WEIGHT;
} else if (m_weight < (-MAX_WEIGHT)) {
m_weight = -MAX_WEIGHT;
}
if (((m_weight > 0) && (!m_bIsFat)) && (value > 0)) {
m_bIsFat = true;
m_maxVel = VEL_SLOW;
Sounds.stopSound("sndMusicFast");
Sounds.playSound("sndMusicSlow", 99999);
m_becomeFatFrame = 15;
}
broadcastMessage("displayWeight");
}
function onBumper(vel) {
if (vel.y == 1) {
m_bAir = true;
m_bGround = false;
m_bIsSpinning = true;
m_velY = (m_bIsFat ? 15 : (VEL_FAST));
} else if (vel.y == -1) {
m_bAir = true;
m_bGround = false;
m_bIsSpinning = true;
m_velY = -5;
} else if (m_bIsFat) {
m_vel = (VEL_SLOW + 5) * vel.x;
m_bumpTime = 5;
} else {
m_vel = VEL_FAST * vel.x;
m_bumpTime = 50;
}
}
function checkExit(Void) {
var _local2 = getPos();
var _local6 = Math.floor(_local2.x / Game.TILE_SIZE);
var _local4 = Math.floor(_local2.y / Game.TILE_SIZE);
var _local5 = m_scene.m_oLevel.exitPos.x;
var _local3 = m_scene.m_oLevel.exitPos.y;
if ((((_local6 == _local5) && (_local4 <= _local3)) && (_local4 > (_local3 - 5))) && (!m_bExit)) {
if (m_velX > 0) {
m_bExit = true;
m_bPressedRight = true;
m_bPressedLeft = false;
} else if (m_velX < 0) {
m_bExit = true;
m_bPressedRight = false;
m_bPressedLeft = true;
}
}
}
static var GRAVITY = 0.7;
static var KEY_LEFT = 37;
static var KEY_RIGHT = 39;
static var KEY_SPIN = 40;
static var KEY_JUMP = 32;
static var KEY_PAUSE = 80;
static var KEY_EXERCISE0 = 65;
static var KEY_EXERCISE1 = 83;
static var MAX_SHIELD_TIME = 60;
static var HP_TOP = 0;
static var HP_BOTTOM = 1;
static var HP_LEFT = 2;
static var HP_RIGHT = 3;
static var VEL_SLOW = 7;
static var VEL_FAST = 26;
static var MAX_WEIGHT = 10;
static var DAFAULT_LAYER = 1;
}
Symbol 627 MovieClip [__Packages.Scene] Frame 0
class Scene
{
var m_oLevel, m_mcGame, m_mcScene, m_mcBg0, m_mcTiles, m_mcObjects, m_cornerLeft, m_cornerTop, m_bmpLayer0, m_bmpBuffer0, m_bmpLayer1, m_bmpBuffer1, m_bmpTiles, m_bg0ScaleX, m_bg0ScaleY, m_gridLeft, m_gridTop, m_gridRight, m_gridBottom, m_dx, m_dy, m_hero;
function Scene (mcGame, oLevel) {
AsBroadcaster.initialize(this);
m_oLevel = oLevel;
m_mcGame = mcGame;
m_mcScene = m_mcGame.mcScene;
m_mcBg0 = m_mcScene.createEmptyMovieClip("mcBg0", 100);
m_mcTiles = m_mcScene.createEmptyMovieClip("mcTiles", 300);
m_mcObjects = m_mcScene.createEmptyMovieClip("mcObjects", 400);
m_cornerLeft = null;
m_cornerTop = null;
var _local3 = Game.TILE_SIZE;
var _local2 = (TILES_W + 6) * _local3;
var _local4 = (TILES_H + 3) * _local3;
m_bmpLayer0 = new flash.display.BitmapData(STAGE_W, STAGE_H, true, 0);
m_bmpBuffer0 = new flash.display.BitmapData(_local2, _local4, true, 0);
m_bmpLayer1 = new flash.display.BitmapData(STAGE_W, STAGE_H, true, 0);
m_bmpBuffer1 = new flash.display.BitmapData(_local2, _local4, true, 0);
m_bmpTiles = m_oLevel.bmpTiles;
m_mcTiles.attachBitmap(m_bmpLayer0, 10);
m_mcTiles.attachBitmap(m_bmpLayer1, 30);
m_mcBg0.attachMovie("bg" + m_oLevel.nr, "mc", 1);
m_mcBg0.scrollRect = new flash.geom.Rectangle(0, 0, STAGE_W, STAGE_H);
m_bg0ScaleX = (m_mcBg0.mc._width - STAGE_W) / (m_oLevel.width * Game.TILE_SIZE);
m_bg0ScaleY = (m_mcBg0.mc._height - STAGE_H) / (m_oLevel.height * Game.TILE_SIZE);
m_mcObjects.createEmptyMovieClip("mc", 1);
}
function addListener() {
}
function removeListener() {
}
function broadcastMessage(sMsg) {
}
function draw(left, top) {
var _local2 = Game.TILE_SIZE;
var _local14 = new flash.geom.Point(0, 0);
if (m_cornerLeft == null) {
m_gridLeft = left / _local2;
m_gridTop = Math.floor(top / _local2);
m_cornerTop = m_gridTop * _local2;
m_cornerLeft = left;
m_gridRight = m_gridLeft + BUFFER_W;
m_gridBottom = m_gridTop + BUFFER_H;
var _local4;
if (((BUFFER_W - TILES_W) % 2) == 1) {
_local4 = Math.floor((BUFFER_W - TILES_W) / 2);
} else {
_local4 = Math.ceil((BUFFER_W - TILES_W) / 2);
}
var _local9 = m_oLevel.aTiles;
var _local6 = 0;
while (_local6 < 3) {
var _local5 = m_gridTop;
while (_local5 < m_gridBottom) {
var _local3 = m_gridLeft;
while (_local3 < m_gridRight) {
if (_local6 < 2) {
var _local12 = _local9[_local6][_local5][_local3 - _local4].x;
var _local13 = _local9[_local6][_local5][_local3 - _local4].y;
if (_local12 == undefined) {
_local12 = 0;
}
if (_local13 == undefined) {
_local13 = 0;
}
var _local10 = new flash.geom.Rectangle(_local12 * _local2, _local13 * _local2, _local2, _local2);
var _local11 = new flash.geom.Point((_local3 - m_gridLeft) * _local2, (_local5 - m_gridTop) * _local2);
if (_local6 == 0) {
m_bmpBuffer0.copyPixels(m_bmpTiles, _local10, _local11);
} else if (_local6 == 1) {
m_bmpBuffer1.copyPixels(m_bmpTiles, _local10, _local11);
}
} else {
var _local8 = (BUFFER_W - TILES_W) - 1;
var _local7 = (BUFFER_H - TILES_H) - 1;
if ((_local3 <= (m_gridRight - _local8)) && (_local5 <= (m_gridBottom - _local7))) {
var _local12 = _local9[_local6][_local5][_local3].x;
var _local13 = _local9[_local6][_local5][_local3].y;
if (_local12 > -1) {
drawObject(_local3, _local5, _local12, _local13);
}
}
}
_local3++;
}
_local5++;
}
_local6++;
}
m_bmpLayer0.copyPixels(m_bmpBuffer0, new flash.geom.Rectangle(_local4 * _local2, 0, STAGE_W, STAGE_H), _local14);
m_bmpLayer1.copyPixels(m_bmpBuffer1, new flash.geom.Rectangle(_local4 * _local2, 0, STAGE_W, STAGE_H), _local14);
m_mcBg0.mc._x = (-left) * m_bg0ScaleX;
m_mcBg0.mc._y = (-top) * m_bg0ScaleY;
m_mcObjects.mc._x = -left;
m_mcObjects.mc._y = -top;
} else {
m_dx = left - m_cornerLeft;
if (((BUFFER_W - TILES_W) % 2) == 1) {
var _local4 = Math.floor((BUFFER_W - TILES_W) / 2);
} else {
var _local4 = Math.ceil((BUFFER_W - TILES_W) / 2);
}
if (m_dx > _local2) {
m_bmpBuffer0.copyPixels(m_bmpBuffer0, new flash.geom.Rectangle(_local2, 0, m_bmpBuffer0.width - _local2, m_bmpBuffer0.height), _local14);
m_bmpBuffer0.fillRect(new flash.geom.Rectangle(m_bmpBuffer0.width - _local2, 0, _local2, m_bmpBuffer0.height), 0);
m_bmpBuffer1.copyPixels(m_bmpBuffer1, new flash.geom.Rectangle(_local2, 0, m_bmpBuffer1.width - _local2, m_bmpBuffer1.height), _local14);
m_bmpBuffer1.fillRect(new flash.geom.Rectangle(m_bmpBuffer1.width - _local2, 0, _local2, m_bmpBuffer1.height), 0);
m_cornerLeft = m_cornerLeft + _local2;
m_gridLeft = m_cornerLeft / _local2;
m_gridRight = (m_gridLeft + BUFFER_W) - 1;
m_gridTop = m_cornerTop / _local2;
m_gridBottom = m_gridTop + BUFFER_H;
var _local9 = m_oLevel.aTiles;
var _local6 = 0;
while (_local6 < 3) {
var _local5 = m_gridTop;
while (_local5 < m_gridBottom) {
if (_local6 < 2) {
var _local12 = _local9[_local6][_local5][m_gridRight - _local4].x;
var _local13 = _local9[_local6][_local5][m_gridRight - _local4].y;
if (_local12 == undefined) {
_local12 = 0;
}
if (_local13 == undefined) {
_local13 = 0;
}
var _local10 = new flash.geom.Rectangle(_local12 * _local2, _local13 * _local2, _local2, _local2);
var _local11 = new flash.geom.Point((BUFFER_W - 1) * _local2, (_local5 - m_gridTop) * _local2);
if (_local6 == 0) {
m_bmpBuffer0.copyPixels(m_bmpTiles, _local10, _local11);
} else if (_local6 == 1) {
m_bmpBuffer1.copyPixels(m_bmpTiles, _local10, _local11);
}
} else {
var _local12 = _local9[_local6][_local5][m_gridRight - _local4].x;
var _local13 = _local9[_local6][_local5][m_gridRight - _local4].y;
if (_local12 > -1) {
drawObject(m_gridRight - _local4, _local5, _local12, _local13);
}
}
_local5++;
}
_local6++;
}
m_dx = m_dx - _local2;
} else if (m_dx < 0) {
m_bmpBuffer0.copyPixels(m_bmpBuffer0, new flash.geom.Rectangle(0, 0, m_bmpBuffer0.width - _local2, m_bmpBuffer0.height), new flash.geom.Point(_local2, 0));
m_bmpBuffer0.fillRect(new flash.geom.Rectangle(0, 0, _local2, m_bmpBuffer0.height), 0);
m_bmpBuffer1.copyPixels(m_bmpBuffer1, new flash.geom.Rectangle(0, 0, m_bmpBuffer0.width - _local2, m_bmpBuffer0.height), new flash.geom.Point(_local2, 0));
m_bmpBuffer1.fillRect(new flash.geom.Rectangle(0, 0, _local2, m_bmpBuffer1.height), 0);
m_cornerLeft = m_cornerLeft - _local2;
m_gridLeft = m_cornerLeft / _local2;
m_gridRight = (m_gridLeft + BUFFER_W) - 1;
m_gridTop = m_cornerTop / _local2;
m_gridBottom = m_gridTop + BUFFER_H;
var _local9 = m_oLevel.aTiles;
var _local6 = 0;
while (_local6 < 3) {
var _local5 = m_gridTop;
while (_local5 < m_gridBottom) {
if (_local6 < 2) {
var _local12 = _local9[_local6][_local5][m_gridLeft - _local4].x;
var _local13 = _local9[_local6][_local5][m_gridLeft - _local4].y;
if (_local12 == undefined) {
_local12 = 0;
}
if (_local13 == undefined) {
_local13 = 0;
}
var _local10 = new flash.geom.Rectangle(_local12 * _local2, _local13 * _local2, _local2, _local2);
var _local11 = new flash.geom.Point(0, (_local5 - m_gridTop) * _local2);
if (_local6 == 0) {
m_bmpBuffer0.copyPixels(m_bmpTiles, _local10, _local11);
} else if (_local6 == 1) {
m_bmpBuffer1.copyPixels(m_bmpTiles, _local10, _local11);
}
} else {
var _local12 = _local9[_local6][_local5][m_gridLeft].x;
var _local13 = _local9[_local6][_local5][m_gridLeft].y;
if (_local12 > -1) {
drawObject(m_gridLeft, _local5, _local12, _local13);
}
}
_local5++;
}
_local6++;
}
m_dx = m_dx + _local2;
}
m_dy = top - m_cornerTop;
var _local17 = BUFFER_W - TILES_W;
if (m_dy > _local2) {
m_bmpBuffer0.copyPixels(m_bmpBuffer0, new flash.geom.Rectangle(0, _local2, m_bmpBuffer0.width, m_bmpBuffer0.height - _local2), _local14);
m_bmpBuffer0.fillRect(new flash.geom.Rectangle(0, m_bmpBuffer0.height - _local2, m_bmpBuffer0.width, _local2), 0);
m_bmpBuffer1.copyPixels(m_bmpBuffer1, new flash.geom.Rectangle(0, _local2, m_bmpBuffer1.width, m_bmpBuffer1.height - _local2), _local14);
m_bmpBuffer1.fillRect(new flash.geom.Rectangle(0, m_bmpBuffer1.height - _local2, m_bmpBuffer1.width, _local2), 0);
m_cornerTop = m_cornerTop + _local2;
m_gridLeft = m_cornerLeft / _local2;
m_gridRight = m_gridLeft + BUFFER_W;
m_gridTop = m_cornerTop / _local2;
m_gridBottom = (m_gridTop + BUFFER_H) - 1;
var _local9 = m_oLevel.aTiles;
var _local6 = 0;
while (_local6 < 3) {
var _local5 = m_gridLeft;
while (_local5 < m_gridRight) {
if (_local6 < 2) {
var _local12 = _local9[_local6][m_gridBottom][_local5 - _local4].x;
var _local13 = _local9[_local6][m_gridBottom][_local5 - _local4].y;
if (_local12 == undefined) {
_local12 = 0;
}
if (_local13 == undefined) {
_local13 = 0;
}
var _local10 = new flash.geom.Rectangle(_local12 * _local2, _local13 * _local2, _local2, _local2);
var _local11 = new flash.geom.Point((_local5 - m_gridLeft) * _local2, (BUFFER_H - 1) * _local2);
if (_local6 == 0) {
m_bmpBuffer0.copyPixels(m_bmpTiles, _local10, _local11);
} else if (_local6 == 1) {
m_bmpBuffer1.copyPixels(m_bmpTiles, _local10, _local11);
}
} else {
var _local12 = _local9[_local6][m_gridBottom][_local5].x;
var _local13 = _local9[_local6][m_gridBottom][_local5].y;
if (_local12 > -1) {
drawObject(_local5, m_gridBottom, _local12, _local13);
}
}
_local5++;
}
_local6++;
}
m_dy = m_dy - _local2;
} else if (m_dy < 0) {
m_bmpBuffer0.copyPixels(m_bmpBuffer0, new flash.geom.Rectangle(0, 0, m_bmpBuffer0.width, m_bmpBuffer0.height - _local2), new flash.geom.Point(0, _local2));
m_bmpBuffer0.fillRect(new flash.geom.Rectangle(0, 0, m_bmpBuffer0.width, _local2), 0);
m_bmpBuffer1.copyPixels(m_bmpBuffer1, new flash.geom.Rectangle(0, 0, m_bmpBuffer0.width, m_bmpBuffer0.height - _local2), new flash.geom.Point(0, _local2));
m_bmpBuffer1.fillRect(new flash.geom.Rectangle(0, 0, m_bmpBuffer0.width, _local2), 0);
m_cornerTop = m_cornerTop - _local2;
m_gridLeft = m_cornerLeft / _local2;
m_gridRight = m_gridLeft + BUFFER_W;
m_gridTop = m_cornerTop / _local2;
m_gridBottom = (m_gridTop + BUFFER_H) - 1;
var _local9 = m_oLevel.aTiles;
var _local6 = 0;
while (_local6 < 3) {
var _local5 = m_gridLeft;
while (_local5 < m_gridRight) {
if (_local6 < 2) {
var _local12 = _local9[_local6][m_gridTop][_local5 - _local4].x;
var _local13 = _local9[_local6][m_gridTop][_local5 - _local4].y;
if (_local12 == undefined) {
_local12 = 0;
}
if (_local13 == undefined) {
_local13 = 0;
}
var _local10 = new flash.geom.Rectangle(_local12 * _local2, _local13 * _local2, _local2, _local2);
var _local11 = new flash.geom.Point((_local5 - m_gridLeft) * _local2, 0);
if (_local6 == 0) {
m_bmpBuffer0.copyPixels(m_bmpTiles, _local10, _local11);
} else if (_local6 == 1) {
m_bmpBuffer1.copyPixels(m_bmpTiles, _local10, _local11);
}
} else {
var _local12 = _local9[_local6][m_gridTop][_local5].x;
var _local13 = _local9[_local6][m_gridTop][_local5].y;
if (_local12 > -1) {
drawObject(_local5, m_gridTop, _local12, _local13);
}
}
_local5++;
}
_local6++;
}
m_dy = m_dy + _local2;
}
if (m_dx < 0) {
m_dx = m_dx + _local2;
}
if (m_dy < 0) {
m_dy = m_dy + _local2;
}
if (((BUFFER_W - TILES_W) % 2) == 1) {
m_dx = m_dx + (_local2 * Math.floor((BUFFER_W - TILES_W) / 2));
} else {
m_dx = m_dx + (_local2 * Math.ceil((BUFFER_W - TILES_W) / 2));
}
m_bmpLayer0.copyPixels(m_bmpBuffer0, new flash.geom.Rectangle(m_dx, m_dy, STAGE_W, STAGE_H), _local14);
m_bmpLayer1.copyPixels(m_bmpBuffer1, new flash.geom.Rectangle(m_dx, m_dy, STAGE_W, STAGE_H), _local14);
m_mcBg0.mc._x = (-left) * m_bg0ScaleX;
m_mcBg0.mc._y = (-top) * m_bg0ScaleY;
m_mcObjects.mc._x = -left;
m_mcObjects.mc._y = -top;
}
}
function drawObject(posX, posY, x, y) {
var _local2;
if ((CTRL_HEALH_0.x == x) && (CTRL_HEALH_0.y == y)) {
if (!Game.s_instance.m_aFoodMap[posY][posX]) {
_local2 = new Food("health0", posX, posY, this, m_hero);
Game.s_instance.addActiveObj(_local2);
}
} else if ((CTRL_HEALH_1.x == x) && (CTRL_HEALH_1.y == y)) {
if (!Game.s_instance.m_aFoodMap[posY][posX]) {
_local2 = new Food("health1", posX, posY, this, m_hero);
Game.s_instance.addActiveObj(_local2);
}
} else if ((CTRL_HEALH_2.x == x) && (CTRL_HEALH_2.y == y)) {
if (!Game.s_instance.m_aFoodMap[posY][posX]) {
_local2 = new Food("health2", posX, posY, this, m_hero);
Game.s_instance.addActiveObj(_local2);
}
} else if ((CTRL_JUNK_0.x == x) && (CTRL_JUNK_0.y == y)) {
if (!Game.s_instance.m_aFoodMap[posY][posX]) {
_local2 = new Food("junk0", posX, posY, this, m_hero);
Game.s_instance.addActiveObj(_local2);
}
} else if ((CTRL_JUNK_1.x == x) && (CTRL_JUNK_1.y == y)) {
if (!Game.s_instance.m_aFoodMap[posY][posX]) {
_local2 = new Food("junk1", posX, posY, this, m_hero);
Game.s_instance.addActiveObj(_local2);
}
} else if ((CTRL_JUNK_2.x == x) && (CTRL_JUNK_2.y == y)) {
if (!Game.s_instance.m_aFoodMap[posY][posX]) {
_local2 = new Food("junk2", posX, posY, this, m_hero);
Game.s_instance.addActiveObj(_local2);
}
} else if ((CTRL_SPIKE_UP.x == x) && (CTRL_SPIKE_UP.y == y)) {
_local2 = new Obstacle(posX, posY, 0, this, m_hero, "spikes");
Game.s_instance.addActiveObj(_local2);
} else if ((CTRL_SPIKE_RIGHT.x == x) && (CTRL_SPIKE_RIGHT.y == y)) {
_local2 = new Obstacle(posX, posY, 1, this, m_hero, "spikes");
Game.s_instance.addActiveObj(_local2);
} else if ((CTRL_SPIKE_DOWN.x == x) && (CTRL_SPIKE_DOWN.y == y)) {
_local2 = new Obstacle(posX, posY, 2, this, m_hero, "spikes");
Game.s_instance.addActiveObj(_local2);
} else if ((CTRL_SPIKE_LEFT.x == x) && (CTRL_SPIKE_LEFT.y == y)) {
_local2 = new Obstacle(posX, posY, 3, this, m_hero, "spikes");
Game.s_instance.addActiveObj(_local2);
} else if ((CTRL_BUMPER_UP.x == x) && (CTRL_BUMPER_UP.y == y)) {
_local2 = new Bumper(posX, posY, 0, this, m_hero, "bumper");
Game.s_instance.addActiveObj(_local2);
} else if ((CTRL_BUMPER_RIGHT.x == x) && (CTRL_BUMPER_RIGHT.y == y)) {
_local2 = new Bumper(posX, posY, 1, this, m_hero, "bumper");
Game.s_instance.addActiveObj(_local2);
} else if ((CTRL_BUMPER_DOWN.x == x) && (CTRL_BUMPER_DOWN.y == y)) {
_local2 = new Bumper(posX, posY, 2, this, m_hero, "bumper");
Game.s_instance.addActiveObj(_local2);
} else if ((CTRL_BUMPER_LEFT.x == x) && (CTRL_BUMPER_LEFT.y == y)) {
_local2 = new Bumper(posX, posY, 3, this, m_hero, "bumper");
Game.s_instance.addActiveObj(_local2);
} else if ((CTRL_WARNING.x == x) && (CTRL_WARNING.y == y)) {
var _local10 = (posX + 0.5) * Game.TILE_SIZE;
var _local9 = (posY + 0.5) * Game.TILE_SIZE;
var _local7 = m_mcObjects.mc;
var _local8 = _local7.getNextHighestDepth();
_local7.attachMovie("warning", "warning" + _local8, _local8, {_x:_local10, _y:_local9});
}
}
function setHero(refHero) {
m_hero = refHero;
}
static var TILES_W = 15;
static var TILES_H = 12;
static var STAGE_W = 480;
static var STAGE_H = 360;
static var HERO_Y = 230;
static var CONTROL_LAYER = 2;
static var BUFFER_W = TILES_W + 2;
static var BUFFER_H = TILES_H + 2;
static var CTRL_SPIKE_UP = new flash.geom.Point(0, 2);
static var CTRL_SPIKE_RIGHT = new flash.geom.Point(1, 2);
static var CTRL_SPIKE_DOWN = new flash.geom.Point(2, 2);
static var CTRL_SPIKE_LEFT = new flash.geom.Point(3, 2);
static var CTRL_HEALH_0 = new flash.geom.Point(0, 3);
static var CTRL_HEALH_1 = new flash.geom.Point(1, 3);
static var CTRL_HEALH_2 = new flash.geom.Point(2, 3);
static var CTRL_JUNK_0 = new flash.geom.Point(3, 3);
static var CTRL_JUNK_1 = new flash.geom.Point(4, 3);
static var CTRL_JUNK_2 = new flash.geom.Point(5, 3);
static var CTRL_BUMPER_UP = new flash.geom.Point(0, 5);
static var CTRL_BUMPER_RIGHT = new flash.geom.Point(1, 5);
static var CTRL_BUMPER_DOWN = new flash.geom.Point(2, 5);
static var CTRL_BUMPER_LEFT = new flash.geom.Point(3, 5);
static var CTRL_WARNING = new flash.geom.Point(0, 6);
}
Symbol 628 MovieClip [__Packages.Food] Frame 0
class Food
{
var m_sType, m_scene, m_mcTarget, m_bmpGround, m_gridX, m_gridY, m_x, m_y, m_velX, m_velY, m_delay, m_time, m_hero, m_bDropped, m_bGood, m_mcFood;
function Food (sType, x, y, scene, hero) {
AsBroadcaster.initialize(this);
m_sType = sType;
m_scene = scene;
m_mcTarget = m_scene.m_mcObjects.mc;
m_bmpGround = m_scene.m_bmpBuffer1;
m_gridX = x;
m_gridY = y;
m_x = (x + 0.5) * Game.TILE_SIZE;
m_y = (y + 0.5) * Game.TILE_SIZE;
m_velX = null;
m_velY = null;
m_delay = -1;
m_time = LIFE_TIME + Math.round(30 * Math.random());
m_hero = hero;
m_bDropped = false;
m_bGood = false;
if (m_sType.indexOf("health") >= 0) {
m_bGood = true;
}
var _local2;
var _local3 = m_mcTarget.getNextHighestDepth();
if (m_sType == "health0") {
_local2 = "health food 0";
} else if (m_sType == "health1") {
_local2 = "health food 1";
} else if (m_sType == "health2") {
_local2 = "health food 2";
} else if (m_sType == "junk0") {
_local2 = "junk food 0";
} else if (m_sType == "junk1") {
_local2 = "junk food 1";
} else if (m_sType == "junk2") {
_local2 = "junk food 2";
}
m_mcFood = m_mcTarget.attachMovie(_local2, "food" + _local3, _local3, {_x:m_x, _y:m_y});
}
function remove(Void) {
broadcastMessage("removeActiveObj", this);
m_mcFood.removeMovieClip();
}
function addListener() {
}
function removeListener() {
}
function broadcastMessage(sMsg) {
}
function step(Void) {
if (m_bDropped) {
m_time--;
if (m_time < 0) {
remove();
} else if (m_time < 5) {
if ((m_time % 2) < 1) {
m_mcFood._alpha = 0;
} else {
m_mcFood._alpha = 100;
}
} else if (m_time < 10) {
if ((m_time % 4) < 2) {
m_mcFood._alpha = 0;
} else {
m_mcFood._alpha = 100;
}
} else if (m_time < 20) {
if ((m_time % 6) < 3) {
m_mcFood._alpha = 0;
} else {
m_mcFood._alpha = 100;
}
}
}
var _local2;
if (m_velX != null) {
_local2 = new flash.geom.Point(m_x, m_y);
m_mcTarget.localToGlobal(_local2);
_local2.x = _local2.x + m_scene.m_dx;
_local2.y = _local2.y + m_scene.m_dy;
_local2.y = _local2.y + 16;
if (m_bmpGround.hitTest(new flash.geom.Point(0, 0), 50, _local2)) {
_local2.y = _local2.y - 16;
if (!m_bmpGround.hitTest(new flash.geom.Point(0, 0), 50, _local2)) {
m_y = m_y - Math.abs(m_velY);
m_velY = -0.7 * Math.abs(m_velY);
if ((Math.abs(m_velX) < 0.05) && (Math.abs(m_velY) < 0.01)) {
m_velX = null;
m_velY = null;
}
}
}
if (m_velX < 0) {
_local2.x = _local2.x - 16;
if (m_bmpGround.hitTest(new flash.geom.Point(0, 0), 50, _local2)) {
m_x = m_x - m_velY;
m_velX = m_velX * -0.7;
}
_local2.x = _local2.x + 16;
} else {
_local2.x = _local2.x + 16;
if (m_bmpGround.hitTest(new flash.geom.Point(0, 0), 50, _local2)) {
m_x = m_x - m_velY;
m_velX = m_velX * -0.7;
}
_local2.x = _local2.x - 16;
}
m_velX = m_velX * 0.97;
m_velY = m_velY + 0.5;
if (m_velY > 15) {
m_velY = 15;
}
m_x = m_x + m_velX;
m_y = m_y + m_velY;
m_gridX = Math.floor(m_x / Game.TILE_SIZE);
m_gridY = Math.floor(m_y / Game.TILE_SIZE);
}
if (m_delay >= 0) {
m_delay--;
}
if (m_delay < 0) {
var _local5 = m_hero.getPos();
var _local4 = _local5.x - m_x;
var _local3 = _local5.y - m_y;
var _local6 = (_local4 * _local4) + (_local3 * _local3);
if (_local6 < 1600) {
broadcastMessage("onCollectFood", this, m_gridX, m_gridY);
}
}
if (!m_bDropped) {
if ((((m_gridX < m_scene.m_gridLeft) || (m_gridX > m_scene.m_gridRight)) || (m_gridY > m_scene.m_gridBottom)) || (m_gridY < m_scene.m_gridTop)) {
remove();
}
} else if ((_local2.y > ((Scene.BUFFER_H - 0.5) * Game.TILE_SIZE)) || (_local2.y < -50)) {
remove();
}
}
function draw(Void) {
m_mcFood._x = m_x;
m_mcFood._y = m_y;
}
function drop(angle) {
m_bDropped = true;
m_delay = 10;
m_y = m_y - 10;
var _local2 = (Math.PI * angle) / 180;
var _local3 = 14;
m_velX = _local3 * Math.cos(_local2);
m_velY = (-_local3) * Math.sin(_local2);
}
static var LIFE_TIME = 200;
}
Symbol 629 MovieClip [__Packages.Obstacle] Frame 0
class Obstacle
{
var m_mcTarget, m_scene, m_gridX, m_gridY, m_x, m_y, m_hero, m_mcObstacle;
function Obstacle (x, y, dir, refScene, hero, sId) {
AsBroadcaster.initialize(this);
m_mcTarget = refScene.m_mcObjects.mc;
m_scene = refScene;
m_gridX = x;
m_gridY = y;
m_x = (x + 0.5) * Game.TILE_SIZE;
m_y = (y + 0.5) * Game.TILE_SIZE;
m_hero = hero;
var _local2 = m_mcTarget.getNextHighestDepth();
m_mcObstacle = m_mcTarget.attachMovie(sId, "obstacle" + _local2, _local2, {_x:m_x, _y:m_y});
m_mcObstacle.gotoAndStop(dir + 1);
}
function remove(Void) {
broadcastMessage("removeActiveObj", this);
m_mcObstacle.removeMovieClip();
}
function addListener() {
}
function removeListener() {
}
function broadcastMessage(sMsg) {
}
function step(Void) {
if ((((m_gridX >= (m_scene.m_gridLeft - 1)) && (m_gridX < (m_scene.m_gridRight + 1))) && (m_gridY >= (m_scene.m_gridTop - 1))) && (m_gridY < (m_scene.m_gridBottom + 1))) {
if (m_hero.isProtected()) {
return(undefined);
}
var _local5 = m_hero.getPos();
var _local4 = _local5.x - m_x;
var _local2 = _local5.y - m_y;
var _local6 = (_local4 * _local4) + (_local2 * _local2);
if (_local6 < 1000) {
var _local3;
if (_local2 < 3) {
_local3 = "bottom";
} else {
_local3 = "top";
}
broadcastMessage("onGetHurt", _local3);
}
} else {
remove();
}
}
function draw(Void) {
}
}
Symbol 630 MovieClip [__Packages.Bumper] Frame 0
class Bumper
{
var m_mcTarget, m_scene, m_dir, m_gridX, m_gridY, m_x, m_y, m_hero, m_mcBumper;
function Bumper (x, y, dir, refScene, hero, sId) {
AsBroadcaster.initialize(this);
m_mcTarget = refScene.m_mcObjects.mc;
m_scene = refScene;
m_dir = dir;
m_gridX = x;
m_gridY = y;
m_x = (x + 0.5) * Game.TILE_SIZE;
m_y = (y + 0.5) * Game.TILE_SIZE;
m_hero = hero;
var _local2 = m_mcTarget.getNextHighestDepth();
m_mcBumper = m_mcTarget.attachMovie(sId, "bumper" + _local2, _local2, {_x:m_x, _y:m_y});
m_mcBumper.gotoAndStop(dir + 1);
}
function remove(Void) {
broadcastMessage("removeActiveObj", this);
m_mcBumper.removeMovieClip();
}
function addListener() {
}
function removeListener() {
}
function broadcastMessage(sMsg) {
}
function step(Void) {
if ((((m_gridX >= (m_scene.m_gridLeft - 1)) && (m_gridX < (m_scene.m_gridRight + 1))) && (m_gridY >= (m_scene.m_gridTop - 1))) && (m_gridY < (m_scene.m_gridBottom + 1))) {
if (m_hero.m_bIsHurted || (m_hero.m_bIsDead)) {
return(undefined);
}
var _local4 = m_hero.getPos();
var _local3 = _local4.x - m_x;
var _local2 = _local4.y - m_y;
var _local7 = (_local3 * _local3) + (_local2 * _local2);
if (_local7 < 1000) {
var _local5 = new Array(new flash.geom.Point(0, 1), new flash.geom.Point(1, 0), new flash.geom.Point(0, -1), new flash.geom.Point(-1, 0));
var _local6 = _local5[m_dir];
m_hero.onBumper(_local6);
m_mcBumper.mcAnim.gotoAndPlay(2);
Sounds.playSound("sndJump");
}
} else {
remove();
}
}
function draw(Void) {
}
}
Symbol 631 MovieClip [__Packages.Timer] Frame 0
class Timer
{
var m_time;
function Timer (Void) {
m_time = 0;
}
function step(Void) {
m_time++;
}
function draw(Void) {
}
function setTime(miliseconds) {
m_time = Math.round((FPS * miliseconds) / 1000);
}
function getTime(Void) {
var _local2 = Math.round((1000 * m_time) / FPS);
return(_local2);
}
function getFormattedTime(Void) {
var _local4 = Math.ceil(m_time / FPS);
var _local3 = Math.floor(_local4 / 60);
var _local2 = _local4 % 60;
var _local6 = ((_local3 < 10) ? ("0" + _local3) : ("" + _local3));
var _local5 = ((_local2 < 10) ? ("0" + _local2) : ("" + _local2));
return((_local6 + ":") + _local5);
}
static var FPS = 33;
}
Symbol 632 MovieClip [__Packages.Enemy] Frame 0
class Enemy
{
var m_gridX, m_gridY, m_x, m_y, m_left, m_right, m_velX, m_scene, m_hero, m_bDestroyed, m_delay, m_mcTarget, m_mcEnemy;
function Enemy (x, y, left, right, refScene, refHero, sId) {
AsBroadcaster.initialize(this);
m_gridX = x;
m_gridY = y;
m_x = (x + 0.5) * Game.TILE_SIZE;
m_y = (y + 0.5) * Game.TILE_SIZE;
m_left = (left + 0.5) * Game.TILE_SIZE;
m_right = (right + 0.5) * Game.TILE_SIZE;
m_velX = 4;
m_scene = refScene;
m_hero = refHero;
m_bDestroyed = false;
m_delay = DYING_TIME;
m_mcTarget = m_scene.m_mcObjects.mc;
var _local2 = m_mcTarget.getNextHighestDepth();
m_mcEnemy = m_mcTarget.attachMovie(sId, "enemy" + _local2, _local2);
draw();
}
function remove(Void) {
broadcastMessage("removeActiveObj", this);
m_mcEnemy.removeMovieClip();
}
function addListener() {
}
function removeListener() {
}
function broadcastMessage(sMsg) {
}
function step(Void) {
if (m_bDestroyed) {
if ((m_delay--) < 0) {
broadcastMessage("onDestroyEnemy", "teacher", this);
remove();
}
return(undefined);
}
m_x = m_x + m_velX;
m_gridX = Math.floor(m_x / Game.TILE_SIZE);
if (m_x < m_left) {
m_x = m_left;
m_velX = -m_velX;
m_mcEnemy._xscale = 100;
} else if (m_x > m_right) {
m_x = m_right;
m_velX = -m_velX;
m_mcEnemy._xscale = -100;
}
if ((((m_gridX >= m_scene.m_gridLeft) && (m_gridX < m_scene.m_gridRight)) && (m_gridY >= m_scene.m_gridTop)) && (m_gridY < m_scene.m_gridBottom)) {
var _local5 = m_hero.getPos();
var _local4 = _local5.x - m_x;
var _local2 = _local5.y - m_y;
var _local6 = (_local4 * _local4) + (_local2 * _local2);
if ((_local6 < 4900) && (m_mcEnemy.hitTest(m_hero.m_mcHitArea))) {
if (m_hero.m_bIsSpinning) {
destroy();
m_hero.bounceUp();
Sounds.playSound("sndBullyDead");
} else if (!m_hero.isProtected()) {
var _local3;
if (_local2 < 3) {
_local3 = "bottom";
} else {
_local3 = "top";
}
broadcastMessage("onGetHurt", _local3);
}
}
}
}
function draw(Void) {
m_mcEnemy._x = m_x;
m_mcEnemy._y = m_y;
}
function destroy(Void) {
m_bDestroyed = true;
m_mcEnemy.gotoAndStop("dead");
broadcastMessage("onDestroyEnemy", m_x, m_y - 30);
}
static var DYING_TIME = 20;
}
Symbol 633 MovieClip [__Packages.PointsCloud] Frame 0
class PointsCloud
{
var m_timer, m_mcCloud;
function PointsCloud (mcTarget, x, y, points) {
m_timer = 40;
var _local2 = mcTarget.getNextHighestDepth();
m_mcCloud = mcTarget.attachMovie("points", "cloud" + _local2, _local2, {_x:x, _y:y});
m_mcCloud.mcText.tfPoints.text = points;
m_mcCloud.onEnterFrame = EventDelegate.create(this, loop);
}
function loop(Void) {
m_timer--;
m_mcCloud._y = m_mcCloud._y - 2;
if (m_timer < 20) {
m_mcCloud._alpha = m_mcCloud._alpha - 5;
}
if (m_timer < 0) {
m_mcCloud.removeMovieClip();
}
}
}
Symbol 12 MovieClip Frame 1
link_btn.onRelease = function () {
getURL ("http://www.schoolfoodtrust.org.uk/index.asp", "_blank");
};
Symbol 22 MovieClip Frame 1
stop();
Symbol 29 MovieClip Frame 1
stop();
Symbol 29 MovieClip Frame 43
onEnd();
Symbol 189 MovieClip Frame 8
stop();
Symbol 272 MovieClip Frame 1
stop();
Symbol 304 MovieClip Frame 20
stop();
Symbol 305 MovieClip [enemy0] Frame 1
stop();
Symbol 325 MovieClip Frame 1
stop();
Symbol 367 MovieClip Frame 18
stop();
Symbol 368 MovieClip [enemy1] Frame 1
stop();
Symbol 385 MovieClip Frame 16
stop();
Symbol 386 MovieClip [enemy2] Frame 1
stop();
Symbol 494 MovieClip Frame 1
stop();
_parent.initButtonsHowTo(0);
Symbol 494 MovieClip Frame 11
_parent.initButtonsHowTo(1);
Symbol 502 MovieClip Frame 86
stop();
initButtonsFront();
Symbol 502 MovieClip Frame 214
stop();
Symbol 502 MovieClip Frame 237
stop();
playGame();
Symbol 502 MovieClip Frame 261
stop();
playGame();
Symbol 507 MovieClip Frame 1
stop();
Symbol 520 MovieClip Frame 1
stop();
Symbol 526 MovieClip Frame 12
stop();
Symbol 603 MovieClip Frame 1
stop();
Symbol 614 MovieClip Frame 1
stop();
Symbol 614 MovieClip Frame 45
stop();
setContent();
Symbol 614 MovieClip Frame 56
checkDest();
Symbol 614 MovieClip Frame 80
stop();
setContent();
Symbol 614 MovieClip Frame 101
checkDest();
Symbol 614 MovieClip Frame 127
stop();
setContent();
Symbol 614 MovieClip Frame 144
checkDest();
Symbol 616 MovieClip Frame 1
stop();
Symbol 616 MovieClip Frame 11
btnBlockade.useHandCursor = false;