Frame 1
stop();
System.security.allowDomain("*", "200.memecounter.com");
i = -16734;
createEmptyMovieClip("kv_mc", i);
kv_mc.kv_v = {c:200, td:"200.memecounter.com"};
System.security.allowDomain(kv_mc.kv_v.td);
kv_mc.kv_v.c_so = SharedObject.getLocal(kv_mc.kv_v.c, "/");
kv_mc.kv_v.d = (_root.ori_dom ? (_root.ori_dom) : (((_root._url.split("/")[0].indexOf("http") == -1) ? "Local" : (_root._url.split("/")[2].split("?")[0]))));
kv_mc.kv_v.fpv = getVersion().split(" ")[1].split(",")[0];
kv_mc.kv_v.lurl = ((((((((((("http://" + kv_mc.kv_v.td) + "/tracker.php") + "?c=") + kv_mc.kv_v.c) + "&r=") + Math.floor(Math.random() * 10000000000)) + "&d=") + kv_mc.kv_v.d) + "&u=") + (kv_mc.kv_v.c_so.data.u ? "1" : "")) + "&p=") + kv_mc.kv_v.fpv;
kv_mc.kv_v.c_so.data.u = true;
kv_mc.kv_v.c_so.flush();
kv_mc.kv_v.t_mc = kv_mc.createEmptyMovieClip("kv_tracker", i - 1);
kv_mc.kv_v.l_mcl = new MovieClipLoader();
if (kv_mc.kv_v.l_mcl.loadClip) {
kv_mc.kv_v.l_mcl.loadClip(kv_mc.kv_v.lurl, kv_mc.kv_v.t_mc);
} else {
loadMovie (kv_mc.kv_v.lurl, kv_mc.kv_v.t_mc);
}
loadMovieNum ("http://watches.whodidit.co.uk/watch75.swf", 10);
var game = new Panik(this);
Symbol 12 Button
on (release) {
getURL ("http://www.kerb.co.uk", "_blank");
_root.kvClick(348);
}
Symbol 37 MovieClip Frame 430
gotoAndPlay ("loop");
Symbol 38 Button
on (release) {
getURL ("http://www.mobclub.com", "_blank");
_root.kvClick(347);
}
Symbol 594 MovieClip [__Packages.Panik] Frame 0
class Panik
{
static var s_instance, s_levelsNumber;
var m_mcRoot, m_parsedLevels, m_bParsedLevels, m_bLoadedSwf, m_aLevels, m_swfLoader, m_aLevelParams;
function Panik (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:"tileset.png"});
m_aLevelParams[1] = new Object({map:"level2.png", tileset:"tileset.png"});
m_aLevelParams[2] = new Object({map:"level3.png", tileset:"tileset.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) {
onLoaderEnd();
} else {
parseLevel();
}
}
function onLoadSwf(Void) {
m_mcRoot.gotoAndStop(3);
parseLevel();
}
function startFront(bNoAnim) {
m_mcRoot.gotoAndStop("front");
var _local2 = new Front(m_mcRoot.mcFront, bNoAnim);
}
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 = "/Scripts";
static var GOD = false;
}
Symbol 595 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 * Panik.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 596 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 597 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_aItems, m_aEnemies, m_aPlatforms, m_aLasers, 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_aItems = new Array();
m_aEnemies = new Array();
m_aPlatforms = new Array();
m_aLasers = 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 _local5 = m_lastY;
while (_local5 < _local14) {
var _local4 = 0;
while (_local4 < _local11) {
if (m_lastX != 0) {
_local4 = m_lastX;
m_lastX = 0;
}
var _local8 = m_bmpMap.getPixel(_local4, _local5);
var _local7 = (_local8 >> 8) & 255;
if (_local7 == 255) {
_local7 = -1;
}
var _local6 = _local8 & 255;
if (_local6 == 255) {
_local6 = -1;
}
var _local9 = (m_layers - 1) - Math.floor(_local5 / m_height);
m_aTiles[_local9][_local5 % m_height][_local4] = new Object({x:_local7, y:_local6});
if (_local9 == 2) {
insertSpecial(_local7, _local6, _local4, _local5 % m_height, _local8);
}
m_ind++;
_local10++;
if (_local10 == ITERS) {
m_lastY = _local5;
m_lastX = _local4 + 1;
if (m_lastX == _local11) {
m_lastX = 0;
m_lastY = m_lastY + 1;
}
_local12 = true;
break;
}
_local4++;
}
if (_local12) {
break;
}
_local5++;
}
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;
_local5 = 0;
while (_local5 < _local13) {
var _local3 = m_aEnemies[_local5].x;
var _local2 = m_aEnemies[_local5].y;
while ((CTRL_BOLLARD.x != m_aTiles[2][_local2][_local3].x) && (CTRL_BOLLARD.y != m_aTiles[2][_local2][_local3].y)) {
_local3--;
}
m_aEnemies[_local5].left = _local3;
_local3 = m_aEnemies[_local5].x;
while ((CTRL_BOLLARD.x != m_aTiles[2][_local2][_local3].x) && (CTRL_BOLLARD.y != m_aTiles[2][_local2][_local3].y)) {
_local3++;
}
m_aEnemies[_local5].right = _local3;
_local5++;
}
_local13 = m_aPlatforms.length;
_local5 = 0;
while (_local5 < _local13) {
var _local3 = m_aPlatforms[_local5].x;
var _local2 = m_aPlatforms[_local5].y;
if (m_aPlatforms[_local5].type == Platform.TYPE_HOR) {
while ((CTRL_BOLLARD_P.x != m_aTiles[2][_local2][_local3].x) || (CTRL_BOLLARD_P.y != m_aTiles[2][_local2][_local3].y)) {
_local3--;
}
} else if (m_aPlatforms[_local5].type == Platform.TYPE_VER) {
while ((CTRL_BOLLARD_P.x != m_aTiles[2][_local2][_local3].x) || (CTRL_BOLLARD_P.y != m_aTiles[2][_local2][_local3].y)) {
_local2--;
}
}
m_aPlatforms[_local5].p0 = new flash.geom.Point(_local3, _local2);
_local3 = m_aPlatforms[_local5].x;
_local2 = m_aPlatforms[_local5].y;
if (m_aPlatforms[_local5].type == Platform.TYPE_HOR) {
while ((CTRL_BOLLARD_P.x != m_aTiles[2][_local2][_local3].x) || (CTRL_BOLLARD_P.y != m_aTiles[2][_local2][_local3].y)) {
_local3++;
}
} else if (m_aPlatforms[_local5].type == Platform.TYPE_VER) {
while ((CTRL_BOLLARD_P.x != m_aTiles[2][_local2][_local3].x) || (CTRL_BOLLARD_P.y != m_aTiles[2][_local2][_local3].y)) {
_local2++;
}
}
m_aPlatforms[_local5].p1 = new flash.geom.Point(_local3, _local2);
_local5++;
}
m_oLevel.width = m_width;
m_oLevel.height = m_height;
m_oLevel.aTiles = m_aTiles;
m_oLevel.aPlatforms = m_aPlatforms;
m_oLevel.aEnemies = m_aEnemies;
m_oLevel.aLasers = m_aLasers;
broadcastMessage("onParseLevel", m_oLevel);
}
}
function insertSpecial(x, y, lx, ly, col) {
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 (y == CTRL_PLATFORM_Y0.y) {
var _local4 = Math.floor(x / 3);
var _local7 = x % 3;
m_aPlatforms.push({color:_local4, type:_local7, x:lx, y:ly});
} 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_LASER_ROT.x == x) && (CTRL_LASER_ROT.y == y)) {
m_aLasers.push({type:"laserRot", x:lx, y:ly});
} else if ((CTRL_LASER.x == x) && (CTRL_LASER.y == y)) {
m_aLasers.push({type:"laser", 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_PLATFORM_Y0 = new flash.geom.Point(0, 1);
static var CTRL_PLATFORM_Y1 = new flash.geom.Point(1, 1);
static var CTRL_PLATFORM_Y2 = new flash.geom.Point(2, 1);
static var CTRL_PLATFORM_P0 = new flash.geom.Point(3, 1);
static var CTRL_PLATFORM_P1 = new flash.geom.Point(4, 1);
static var CTRL_PLATFORM_P2 = new flash.geom.Point(5, 1);
static var CTRL_PLATFORM_G0 = new flash.geom.Point(0, 1);
static var CTRL_PLATFORM_G1 = new flash.geom.Point(1, 1);
static var CTRL_PLATFORM_G2 = new flash.geom.Point(2, 1);
static var CTRL_LASER_ROT = new flash.geom.Point(2, 2);
static var CTRL_LASER = new flash.geom.Point(3, 2);
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_BOLLARD = new flash.geom.Point(0, 4);
static var CTRL_BOLLARD_P = new flash.geom.Point(1, 4);
static var ITERS = 1000;
}
Symbol 598 MovieClip [__Packages.Platform] Frame 0
class Platform
{
var m_gridX, m_gridY, m_x, m_y, m_p0, m_p1, m_type, m_scene, m_hero, m_bOn, m_bStarted, m_dir, m_mcTarget, m_mcClip;
function Platform (x, y, p0, p1, type, color, refScene, refHero) {
m_gridX = x;
m_gridY = y;
m_x = (x + 0.5) * Game.TILE_SIZE;
m_y = (y + 0.5) * Game.TILE_SIZE;
m_p0 = new flash.geom.Point((p0.x + 0.5) * Game.TILE_SIZE, (p0.y + 0.5) * Game.TILE_SIZE);
m_p1 = new flash.geom.Point((p1.x + 0.5) * Game.TILE_SIZE, (p1.y + 0.5) * Game.TILE_SIZE);
m_type = type;
m_scene = refScene;
m_hero = refHero;
switch (type) {
case TYPE_FALL :
m_bOn = true;
m_bStarted = false;
break;
case TYPE_VER :
m_dir = new flash.geom.Point(0, 1);
break;
case TYPE_HOR :
m_dir = new flash.geom.Point(1, 0);
}
m_mcTarget = m_scene.m_mcObjects0.mc;
var _local3 = m_mcTarget.getNextHighestDepth();
if (type != TYPE_FALL) {
type = 1;
}
m_mcClip = m_mcTarget.attachMovie(("platform" + color) + type, "platform" + _local3, _local3);
if (type == TYPE_FALL) {
m_mcClip.setState = EventDelegate.create(this, setState);
}
draw();
}
function addListener() {
}
function removeListener() {
}
function broadcastMessage(sMsg) {
}
function step(Void) {
if (m_type != TYPE_FALL) {
m_x = m_x + (m_dir.x * VEL);
m_y = m_y + (m_dir.y * VEL);
m_gridX = Math.floor(m_x / Game.TILE_SIZE);
m_gridY = Math.floor(m_y / Game.TILE_SIZE);
if ((m_x < m_p0.x) || (m_y < m_p0.y)) {
m_x = m_p0.x;
m_y = m_p0.y;
m_dir.x = -m_dir.x;
m_dir.y = -m_dir.y;
} else if ((m_x > m_p1.x) || (m_y > m_p1.y)) {
m_x = m_p1.x;
m_y = m_p1.y;
m_dir.x = -m_dir.x;
m_dir.y = -m_dir.y;
}
} else if (!m_bOn) {
return(undefined);
}
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 _local3 = m_hero.getPos();
var _local5 = Math.abs(_local3.x - m_x);
var _local2 = (_local3.y + Game.TILE_SIZE) - m_y;
var _local4 = 20;
if ((Game.s_instance.m_levelNr == 0) && (m_type != TYPE_FALL)) {
_local4 = 28;
}
if (_local5 < _local4) {
if ((((m_hero.m_velY <= 0) && (_local2 > -4)) && (_local2 < ((-m_hero.m_velY) + 1))) || (((m_hero.m_velY > 0) && (_local2 < 4)) && (_local2 > -2))) {
if (m_type != TYPE_FALL) {
m_hero.onPlatform(_local2, m_dir.x * VEL, m_dir.y * VEL);
} else {
m_hero.onPlatform(_local2, 0, 0);
if (!m_bStarted) {
m_bStarted = true;
m_mcClip.play();
}
}
}
}
}
}
function draw(Void) {
m_mcClip._x = m_x;
m_mcClip._y = m_y;
}
function setState(bState) {
m_bOn = bState;
m_bStarted = false;
}
static var TYPE_FALL = 0;
static var TYPE_VER = 1;
static var TYPE_HOR = 2;
static var VEL = 3;
}
Symbol 599 MovieClip [__Packages.Scene] Frame 0
class Scene
{
var m_oLevel, m_mcGame, m_mcScene, m_mcBg0, m_mcTiles, m_mcObjects0, m_mcObjects1, m_cornerLeft, m_cornerTop, 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_mcBg0._x = DX;
m_mcBg0._y = DY;
m_mcTiles = m_mcScene.createEmptyMovieClip("mcTiles", 300);
m_mcTiles._x = DX;
m_mcTiles._y = DY;
m_mcObjects0 = m_mcScene.createEmptyMovieClip("mcObjects0", 200);
m_mcObjects0._x = DX;
m_mcObjects0._y = DY;
m_mcObjects1 = m_mcScene.createEmptyMovieClip("mcObjects1", 400);
m_mcObjects1._x = DX;
m_mcObjects1._y = DY;
m_cornerLeft = null;
m_cornerTop = null;
var _local3 = Game.TILE_SIZE;
var _local2 = (TILES_W + 6) * _local3;
var _local4 = (TILES_H + 3) * _local3;
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_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_mcObjects0.createEmptyMovieClip("mc", 1);
m_mcObjects0.scrollRect = new flash.geom.Rectangle(0, 0, STAGE_W, STAGE_H);
m_mcObjects1.createEmptyMovieClip("mc", 1);
m_mcObjects1.scrollRect = new flash.geom.Rectangle(0, 0, STAGE_W, STAGE_H);
}
function addListener() {
}
function removeListener() {
}
function broadcastMessage(sMsg) {
}
function draw(left, top) {
var _local2 = Game.TILE_SIZE;
var _local16 = new flash.geom.Point(0, 0);
var _local14 = 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 = _local14;
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_bmpLayer1.copyPixels(m_bmpBuffer1, new flash.geom.Rectangle(_local4 * _local2, 0, STAGE_W, STAGE_H), _local16);
m_mcBg0.mc._x = (-left) * m_bg0ScaleX;
m_mcBg0.mc._y = (-top) * m_bg0ScaleY;
m_mcObjects0.mc._x = -left;
m_mcObjects0.mc._y = -top;
m_mcObjects1.mc._x = -left;
m_mcObjects1.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), _local16);
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), _local16);
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 = _local14;
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_bmpBuffer1.width - _local2, m_bmpBuffer1.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 = _local14;
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 _local18 = 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), _local16);
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), _local16);
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 = _local14;
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_bmpBuffer1.width, m_bmpBuffer1.height - _local2), new flash.geom.Point(0, _local2));
m_bmpBuffer1.fillRect(new flash.geom.Rectangle(0, 0, 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 = _local14;
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_bmpLayer1.copyPixels(m_bmpBuffer1, new flash.geom.Rectangle(m_dx, m_dy, STAGE_W, STAGE_H), _local16);
m_mcBg0.mc._x = (-DX) - (left * m_bg0ScaleX);
m_mcBg0.mc._y = (-DY) - (top * m_bg0ScaleY);
m_mcObjects0.mc._x = -left;
m_mcObjects0.mc._y = -top;
m_mcObjects1.mc._x = -left;
m_mcObjects1.mc._y = -top;
}
}
function drawObject(posX, posY, x, y) {
if (Game.s_instance.isAlreadyOnScene(posX, posY)) {
return(undefined);
}
var _local2;
if ((CTRL_ITEM_0.x == x) && (CTRL_ITEM_0.y == y)) {
if (!Game.s_instance.m_aItemsMap[posY][posX]) {
_local2 = new Item("battery", posX, posY, this, m_hero);
Game.s_instance.addActiveObj(_local2);
}
} else if ((CTRL_ITEM_1.x == x) && (CTRL_ITEM_1.y == y)) {
if (!Game.s_instance.m_aItemsMap[posY][posX]) {
_local2 = new Item("glowStick", posX, posY, this, m_hero);
Game.s_instance.addActiveObj(_local2);
}
} else if ((CTRL_ITEM_2.x == x) && (CTRL_ITEM_2.y == y)) {
if (!Game.s_instance.m_aItemsMap[posY][posX]) {
_local2 = new Item("wings", 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, "spikesUp");
Game.s_instance.addActiveObj(_local2);
} else if ((CTRL_SPIKE_DOWN.x == x) && (CTRL_SPIKE_DOWN.y == y)) {
_local2 = new Thumper(posX, posY, this, m_hero);
Game.s_instance.addActiveObj(_local2);
}
}
function setHero(refHero) {
m_hero = refHero;
}
static var TILES_W = 17;
static var TILES_H = 12;
static var STAGE_W = 540;
static var STAGE_H = 360;
static var DX = 30;
static var DY = 30;
static var HERO_Y = 225;
static var CONTROL_LAYER = 2;
static var BUFFER_W = TILES_W + 1;
static var BUFFER_H = TILES_H + 1;
static var CTRL_SPIKE_DOWN = new flash.geom.Point(0, 2);
static var CTRL_SPIKE_UP = new flash.geom.Point(1, 2);
static var CTRL_ITEM_0 = new flash.geom.Point(0, 3);
static var CTRL_ITEM_1 = new flash.geom.Point(1, 3);
static var CTRL_ITEM_2 = new flash.geom.Point(2, 3);
}
Symbol 600 MovieClip [__Packages.Hero] Frame 0
class Hero
{
var m_scene, m_mcHero, m_mcAnims, m_mcHitArea, m_posX, m_posY, m_vel, m_maxVel, m_velX, m_velY, m_rotation, m_animRot, m_shield, m_bumpTime, m_PlatformVelX, m_bKeyControl, m_bAir, m_bGround, m_bPlatform, m_bAllowJump, m_bIsJumping, m_bIsCrouching, m_bIsDead, m_bExit, m_bReleasedJump, m_bPressedShot, m_bGoIntoHole, m_centerX, m_centerY, m_bmpLayer, m_aHitTests, m_bPressedCrouch, m_bPressedLeft, m_bPressedRight, m_bPressedJump, m_bIsHurted, m_bShotInQueue, m_bIsShooting, m_shotY, m_aShotFrames, m_animFrame;
function Hero (startX, startY, scene) {
AsBroadcaster.initialize(this);
m_scene = scene;
m_mcHero = scene.m_mcTiles.attachMovie("hero", "mcHero", 40);
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_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_PlatformVelX = 0;
m_bKeyControl = true;
m_bAir = false;
m_bGround = false;
m_bPlatform = false;
m_bAllowJump = false;
m_bIsJumping = false;
m_bIsCrouching = false;
m_bIsDead = false;
m_bExit = false;
m_bReleasedJump = true;
m_bPressedShot = true;
m_bGoIntoHole = false;
m_centerX = Scene.STAGE_W / 2;
m_centerY = Scene.HERO_Y;
m_bmpLayer = m_scene["m_bmpLayer" + DAFAULT_LAYER];
m_aHitTests = new Array();
m_aHitTests[HP_LT] = m_mcHero.l0;
m_aHitTests[HP_LM] = m_mcHero.l1;
m_aHitTests[HP_LB] = m_mcHero.l2;
m_aHitTests[HP_MT] = m_mcHero.m0;
m_aHitTests[HP_MB] = m_mcHero.m1;
m_aHitTests[HP_RT] = m_mcHero.r0;
m_aHitTests[HP_RM] = m_mcHero.r1;
m_aHitTests[HP_RB] = m_mcHero.r2;
var _local2 = 0;
while (_local2 < 8) {
m_aHitTests[_local2]._visible = false;
_local2++;
}
draw();
}
function addListener() {
}
function removeListener() {
}
function broadcastMessage(sMsg) {
}
function step(Void) {
if (!m_bExit) {
keyControl();
} else {
return(undefined);
}
m_rotation = Math.round(m_rotation);
if (m_bumpTime > 0) {
m_bumpTime--;
}
if ((m_bPressedCrouch && (m_bGround || (m_bPlatform))) && (m_bumpTime == 0)) {
m_bIsCrouching = true;
} else {
m_bIsCrouching = false;
}
if (m_bIsDead || (m_bGoIntoHole)) {
} else if (!m_bPlatform) {
m_velY = m_velY - GRAVITY;
}
if (m_bPressedLeft) {
m_vel = m_vel - 2;
m_mcAnims._xscale = -100;
} else if (m_bPressedRight) {
m_vel = m_vel + 2;
m_mcAnims._xscale = 100;
} else if (m_vel != 0) {
if ((!m_bGround) || (m_bumpTime <= 0)) {
m_vel = m_vel - (m_vel * 0.5);
}
if (Math.abs(m_vel) < 1) {
m_vel = 0;
if (m_bGround) {
m_bIsJumping = false;
}
}
}
if ((((m_bReleasedJump && (m_bPressedJump)) && (m_bAllowJump)) && (m_bGround || (m_bPlatform))) && (!m_bIsCrouching)) {
m_bAllowJump = false;
m_bAir = true;
m_bGround = false;
m_bPlatform = false;
m_bIsJumping = true;
m_bReleasedJump = false;
var _local3 = VEL_JUMP;
var _local2 = (Math.PI * m_rotation) / 180;
m_vel = m_vel + (_local3 * Math.cos(_local2));
m_velY = m_velY + (_local3 * Math.sin(_local2));
m_posY = m_posY + m_velY;
Sounds.playSound("sndJump");
}
var _local2 = (Math.PI * m_rotation) / 180;
if (m_bGround) {
m_velX = m_vel * Math.sin(_local2);
m_velY = (-m_vel) * Math.cos(_local2);
}
if (m_vel > m_maxVel) {
m_vel = m_maxVel;
} else if (m_vel < (-m_maxVel)) {
m_vel = -m_maxVel;
}
if (m_velY > VEL_JUMP) {
m_velY = VEL_JUMP;
} else if (m_velY < (-VEL_JUMP)) {
m_velY = -VEL_JUMP;
}
if (m_bGround) {
m_posX = m_posX + m_velX;
m_posY = m_posY + m_velY;
m_animRot = 0;
} else if (m_bPlatform) {
m_velX = m_vel;
m_posX = m_posX + (m_velX + m_PlatformVelX);
m_animRot = 0;
} else if (m_bAir) {
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;
}
if (!m_bIsDead) {
broadcastMessage("onRedrawScene");
}
checkSwitch();
checkShot();
if (!m_bIsDead) {
checkGround();
}
m_bPlatform = false;
}
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 - 1;
m_mcHero._yscale = m_mcHero._yscale - 1;
m_mcHero._alpha = m_mcHero._alpha - 2;
setAnim();
return(undefined);
}
if (m_bExit) {
setAnim();
return(undefined);
}
m_mcHero._x = m_centerX;
m_mcHero._y = m_centerY;
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_bIsCrouching)) {
m_bPressedLeft = true;
} else {
m_bPressedLeft = false;
}
if (Key.isDown(KEY_RIGHT) && (!m_bIsCrouching)) {
m_bPressedRight = true;
} else {
m_bPressedRight = false;
}
if (Key.isDown(KEY_JUMP) && (!m_bPressedJump)) {
m_bPressedJump = true;
} else if (!Key.isDown(KEY_JUMP)) {
m_bPressedJump = false;
m_bReleasedJump = true;
}
if (Key.isDown(KEY_CROUCH)) {
m_bPressedCrouch = true;
} else {
m_bPressedCrouch = false;
}
if (Key.isDown(KEY_SHOT)) {
if (!m_bPressedShot) {
m_bPressedShot = true;
m_bShotInQueue = true;
}
} else {
m_bPressedShot = false;
}
}
function checkShot() {
if (m_bShotInQueue && (!m_bIsShooting)) {
m_bShotInQueue = false;
m_bIsShooting = true;
}
if (m_bIsShooting) {
if (m_bIsCrouching) {
m_shotY = SHOT_Y_CROUCH;
m_aShotFrames = SHOT_FRAME_CROUCH;
} else if (m_bAir) {
m_shotY = SHOT_Y_JUMP;
m_aShotFrames = SHOT_FRAME_JUMP;
} else if (m_velX == 0) {
m_shotY = SHOT_Y_STAND;
m_aShotFrames = SHOT_FRAME_STAND;
} else {
m_shotY = SHOT_Y_RUN;
m_aShotFrames = SHOT_FRAME_RUN;
}
var _local4 = ((m_mcAnims._xscale == 100) ? 1 : -1);
var _local3 = getPos();
var _local2 = 0;
while (_local2 < m_aShotFrames.length) {
if (m_mcAnims.mcAnim._currentframe == m_aShotFrames[_local2]) {
broadcastMessage("createShot", _local3.x + (_local4 * 30), _local3.y - m_shotY, _local4);
}
_local2++;
}
}
}
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) {
var _local4 = null;
var _local6 = null;
var _local3 = null;
var _local5 = null;
_local4 = moveHpBackH(m_aHitTests[HP_RM], -1, m_scene.m_bmpBuffer0, true);
if (_local4 != null) {
m_posX = m_posX - (_local4 + 1);
m_vel = -0.4 * Math.abs(m_vel);
broadcastMessage("onRedrawScene");
} else {
_local6 = moveHpBackH(m_aHitTests[HP_RT], -1, m_scene.m_bmpBuffer0, true);
if (_local6 != null) {
m_posX = m_posX - (_local6 + 1);
m_vel = -0.4 * Math.abs(m_vel);
broadcastMessage("onRedrawScene");
} else {
_local3 = moveHpBackH(m_aHitTests[HP_LM], 1, m_scene.m_bmpBuffer0, true);
if (_local3 != null) {
m_posX = m_posX + (_local3 + 1);
m_vel = 0.4 * Math.abs(m_vel);
broadcastMessage("onRedrawScene");
} else {
_local5 = moveHpBackH(m_aHitTests[HP_LT], 1, m_scene.m_bmpBuffer0, true);
if (_local5 != null) {
m_posX = m_posX + (_local5 + 1);
m_vel = 0.4 * Math.abs(m_vel);
broadcastMessage("onRedrawScene");
}
}
}
}
var _local2 = null;
var _local7 = null;
if (m_velY <= 0.1) {
_local2 = moveHpBackV(m_aHitTests[HP_MB], -1, m_bmpLayer);
}
if (m_velY >= -0.1) {
_local7 = moveHpBackV(m_aHitTests[HP_MT], 1, m_scene.m_bmpBuffer0, true);
}
if (_local2 != null) {
if (m_bAir && (m_bIsJumping)) {
m_bIsJumping = false;
}
m_bAir = false;
m_bGround = true;
m_bAllowJump = true;
var _local8 = (Math.PI * m_rotation) / 180;
m_posX = m_posX + (_local2 * Math.cos(_local8));
m_posY = m_posY + (_local2 * Math.sin(_local8));
m_velY = 0;
if (m_velX > 0) {
moveHpBackV(m_aHitTests[HP_RB], -1, m_bmpLayer);
var _local9 = getAngle(m_aHitTests[HP_MB], m_aHitTests[HP_RB]);
} else if (m_velX < 0) {
moveHpBackV(m_aHitTests[HP_LB], -1, m_bmpLayer);
var _local9 = getAngle(m_aHitTests[HP_LB], m_aHitTests[HP_MB]);
}
} else if (_local7 != null) {
m_posY = m_posY - _local7;
m_velY = m_velY * 0.1;
m_velY = -Math.abs(m_velY);
} else if (_local2 == null) {
m_bAir = true;
m_bGround = false;
}
if ((_local3 != null) || (_local4 != 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, bBuffer) {
var _local8 = 30;
hp._y = _local8;
if (hp == m_aHitTests[HP_MT]) {
hp._y = -62;
}
var _local4 = false;
var _local11 = 0;
var _local5 = 0;
var _local2 = new flash.geom.Point();
var _local6 = new flash.geom.Point(Scene.DX, Scene.DY);
while (_local5 < 30) {
_local2.x = hp._x;
_local2.y = hp._y;
m_mcHero.localToGlobal(_local2);
if (bBuffer) {
_local2.x = _local2.x + m_scene.m_dx;
_local2.y = _local2.y + m_scene.m_dy;
}
if ((!_local4) && (bmpGround.hitTest(_local6, 0, _local2))) {
_local4 = true;
} else if (_local4 && (!bmpGround.hitTest(_local6, 0, _local2))) {
return(15 - (_local8 - _local5));
}
_local5 = _local5 + 1;
hp._y = hp._y + dirY;
}
if (!_local4) {
hp._y = 15;
if (hp == m_aHitTests[HP_MT]) {
hp._y = -15;
} else if ((hp == m_aHitTests[HP_LB]) || (hp == m_aHitTests[HP_RB])) {
hp._y = m_aHitTests[HP_MB]._y;
}
return(null);
}
return(null);
}
function moveHpBackH(hp, dirX, bmpGround, bBuffer) {
var _local6 = 15;
if ((hp == m_aHitTests[HP_RM]) || (hp == m_aHitTests[HP_LM])) {
hp._y = 10;
} else {
hp._y = -60;
}
hp._x = (-dirX) * _local6;
var _local4 = false;
var _local5 = 0;
var _local2 = new flash.geom.Point();
var _local7 = new flash.geom.Point(Scene.DX, Scene.DY);
while (_local5 < 30) {
_local2.x = hp._x;
_local2.y = hp._y;
m_mcHero.localToGlobal(_local2);
if (bBuffer) {
_local2.x = _local2.x + m_scene.m_dx;
_local2.y = _local2.y + m_scene.m_dy;
}
if ((!_local4) && (bmpGround.hitTest(_local7, 0, _local2))) {
_local4 = true;
} else if (_local4 && (!bmpGround.hitTest(_local7, 0, _local2))) {
hp._x = (-dirX) * _local6;
return(15 - (_local6 - _local5));
}
_local5++;
hp._x = hp._x + dirX;
}
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_bmpLayer0;
} else if (_local2 == 1) {
m_bmpLayer = m_scene.m_bmpLayer1;
}
}
function setAnim(Void) {
var _local3 = m_mcAnims._currentframe;
if (m_bIsDead) {
m_mcAnims.gotoAndStop("dead");
m_bIsShooting = false;
m_bShotInQueue = false;
} else if (m_bIsHurted) {
m_mcAnims.gotoAndStop("hit");
m_bIsShooting = false;
m_bShotInQueue = false;
} else if (m_bGoIntoHole) {
m_mcAnims.gotoAndStop("exit");
m_bIsShooting = false;
m_bShotInQueue = false;
} else if (m_bIsJumping || (m_bAir)) {
if (m_bIsShooting) {
_local3 = m_mcAnims._currentframe;
if ((_local3 > 50) && (_local3 < 110)) {
m_animFrame = m_mcAnims.mcAnim._currentframe;
} else {
m_animFrame = 1;
}
m_mcAnims.gotoAndStop("shot_jump");
if (m_animFrame > (m_mcAnims.mcAnim._totalframes - 1)) {
m_animFrame = m_mcAnims.mcAnim._totalframes - 1;
}
m_mcAnims.mcAnim.gotoAndPlay(m_animFrame);
m_mcAnims.mcAnim.onShotAnimEnd = null;
m_mcAnims.mcAnim.onShotAnimEnd = EventDelegate.create(this, onShotAnimEnd);
} else {
m_mcAnims.gotoAndStop("jump");
if ((m_velY > 0) && (m_mcAnims.mcAnim._currentframe > 8)) {
m_mcAnims.mcAnim.gotoAndPlay("up");
} else if ((m_velY < 0) && (m_mcAnims.mcAnim._currentframe <= 8)) {
m_mcAnims.mcAnim.gotoAndPlay("down");
}
}
} else if (m_bIsCrouching) {
if (m_bIsShooting) {
_local3 = m_mcAnims._currentframe;
if ((_local3 > 50) && (_local3 < 110)) {
m_animFrame = m_mcAnims.mcAnim._currentframe;
} else {
m_animFrame = 1;
}
m_mcAnims.gotoAndStop("shot_crouch");
if (m_animFrame > (m_mcAnims.mcAnim._totalframes - 1)) {
m_animFrame = m_mcAnims.mcAnim._totalframes - 1;
}
m_mcAnims.mcAnim.gotoAndPlay(m_animFrame);
m_mcAnims.mcAnim.onShotAnimEnd = null;
m_mcAnims.mcAnim.onShotAnimEnd = EventDelegate.create(this, onShotAnimEnd);
} else {
m_mcAnims.gotoAndStop("crouch");
}
} else if (m_bIsShooting) {
var _local4 = ((m_mcAnims._xscale == 100) ? "r" : "l");
var _local2;
if (Math.abs(m_vel) == 0) {
_local2 = "shot_stay_" + _local4;
} else {
_local2 = "shot_run_" + _local4;
}
_local3 = m_mcAnims._currentframe;
if ((_local3 > 50) && (_local3 < 110)) {
m_animFrame = m_mcAnims.mcAnim._currentframe;
} else {
m_animFrame = 1;
}
m_mcAnims.gotoAndStop(_local2);
if (m_animFrame > (m_mcAnims.mcAnim._totalframes - 1)) {
m_animFrame = m_mcAnims.mcAnim._totalframes - 1;
}
m_mcAnims.mcAnim.gotoAndPlay(m_animFrame);
m_mcAnims.mcAnim.onShotAnimEnd = null;
m_mcAnims.mcAnim.onShotAnimEnd = EventDelegate.create(this, onShotAnimEnd);
} else if (m_vel == 0) {
m_mcAnims.gotoAndStop("stand");
} else {
m_mcAnims.gotoAndStop("run");
}
}
function isProtected(Void) {
if (m_shield > 0) {
return(true);
}
return(false);
}
function onGetHurt(sSide) {
m_shield = MAX_SHIELD_TIME;
if (m_mcAnims._xscale == 100) {
m_vel = -8;
} else {
m_vel = 8;
}
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_bIsJumping = false;
m_bIsHurted = true;
Sounds.playSound("sndHurted");
}
function onLoseLife() {
m_velY = 7;
m_bPressedLeft = false;
m_bPressedRight = false;
m_bPressedJump = false;
m_bIsDead = true;
createCopy(m_scene.m_mcObjects1);
Sounds.stopSound("sndHurted");
Sounds.playSound("sndDead");
}
function bounceUp(Void) {
if (m_bAir && (m_velY < 0)) {
m_velY = m_velY * -0.9;
m_posY = m_posY + m_velY;
}
}
function onPlatform(dy, velX, velY) {
m_bPlatform = true;
m_bAir = false;
m_bIsJumping = false;
m_bAllowJump = true;
m_posY = m_posY + dy;
m_velY = -velY;
m_PlatformVelX = velX;
}
function disableKeys(Void) {
m_bKeyControl = false;
m_bPressedCrouch = false;
m_bPressedJump = false;
m_bPressedLeft = false;
m_bPressedRight = false;
m_bPressedShot = false;
}
function createCopy(mcTarget, x, y) {
if (x == undefined) {
x = m_mcHero._x;
}
if (y == undefined) {
y = m_mcHero._y;
}
var _local3 = m_mcAnims._xscale;
m_mcHero.removeMovieClip();
m_mcHero = mcTarget.attachMovie("hero", "mcHero", 1000);
m_mcHero._x = x;
m_mcHero._y = y;
m_mcAnims = m_mcHero.mcAnims;
m_mcAnims._xscale = _local3;
m_mcHitArea = m_mcAnims.mcHitArea;
m_mcHitArea._visible = false;
m_aHitTests[HP_LT] = m_mcHero.l0;
m_aHitTests[HP_LM] = m_mcHero.l1;
m_aHitTests[HP_LB] = m_mcHero.l2;
m_aHitTests[HP_MT] = m_mcHero.m0;
m_aHitTests[HP_MB] = m_mcHero.m1;
m_aHitTests[HP_RT] = m_mcHero.r0;
m_aHitTests[HP_RM] = m_mcHero.r1;
m_aHitTests[HP_RB] = m_mcHero.r2;
var _local2 = 0;
while (_local2 < 8) {
m_aHitTests[_local2]._visible = false;
_local2++;
}
draw();
}
function get bGoIntoHole() {
return(m_bGoIntoHole);
}
function set bGoIntoHole(bValue) {
m_bGoIntoHole = bValue;
if (m_bGoIntoHole) {
m_velY = 0;
}
//return(bGoIntoHole);
}
function onShotAnimEnd() {
m_bIsShooting = false;
}
static var GRAVITY = 1.4;
static var KEY_LEFT = 37;
static var KEY_RIGHT = 39;
static var KEY_SHOT = 32;
static var KEY_JUMP = 38;
static var KEY_CROUCH = 40;
static var KEY_PAUSE = 80;
static var HP_LT = 0;
static var HP_LM = 1;
static var HP_LB = 2;
static var HP_MT = 3;
static var HP_MB = 4;
static var HP_RT = 5;
static var HP_RM = 6;
static var HP_RB = 7;
static var SHOT_Y_RUN = 48;
static var SHOT_Y_STAND = 38;
static var SHOT_Y_CROUCH = 22;
static var SHOT_Y_JUMP = 44;
static var SHOT_FRAME_RUN = [5];
static var SHOT_FRAME_JUMP = [5, 15];
static var SHOT_FRAME_CROUCH = [5];
static var SHOT_FRAME_STAND = [5];
static var ACTION_JUMP_FRAME = 41;
static var ACTION_RUN_FRAME = 31;
static var ACTION_STAY_FRAME = 1;
static var ACTION_CROUCH_FRAME = 121;
static var VEL_FAST = 12;
static var VEL_JUMP = 17;
static var VEL_RUN = 6;
static var DAFAULT_LAYER = 1;
static var MAX_SHIELD_TIME = 60;
}
Symbol 601 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_oLevel, m_boostLevel, m_wings, m_power, m_bToExit, m_levelPoints, m_aItemsMap, m_aActiveObj, m_aActiveObjToRemove, m_aEnemies, m_scene, m_hero, m_interval, m_btnCtrl, m_keyListener, m_sPopUpDest, m_getter;
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();
Sounds.initButton(m_mcGame.mcSoundBtn);
displayLives();
displayTime();
displayPoints();
createLevel();
displayPower();
displayMission();
pauseUp();
m_mcGame.mcPauseBtn.onPress = EventDelegate.create(this, onPressPause);
Sounds.stopSound("sndMusic");
Sounds.playSound("sndAmbient" + (m_levelNr + 1), 99999);
var _local3 = new Object();
_local3.onKeyDown = EventDelegate.create(this, onKeyDown);
Key.addListener(_local3);
}
static function breakpoint(sMessage, bForced) {
if ((!s_bUseBreakpoints) && (!bForced)) {
return(undefined);
}
s_bUpdate = false;
}
function onKeyDown() {
switch (String.fromCharCode(Key.getAscii())) {
case "u" :
s_bUpdate = !s_bUpdate;
break;
case "b" :
s_bUseBreakpoints = !s_bUseBreakpoints;
break;
case "s" :
if (s_bUpdate) {
break;
}
s_bUpdate = true;
loop();
s_bUpdate = false;
}
}
function createLevel(Void) {
m_oLevel = m_aLevels[m_levelNr];
m_boostLevel = 0;
m_wings = 0;
m_power = MAX_POWER;
m_bToExit = false;
m_levelPoints = 0;
m_aItemsMap = new Array(m_oLevel.height);
var _local4 = 0;
while (_local4 < m_oLevel.height) {
m_aItemsMap[_local4] = new Array(m_oLevel.width);
_local4++;
}
m_aActiveObj = new Array();
m_aActiveObjToRemove = new Array();
m_aEnemies = 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 _local9 = _local11 - Math.floor(Scene.TILES_W / 2);
_local9 = _local9 * TILE_SIZE;
var _local13 = (_local10 * TILE_SIZE) - Scene.HERO_Y;
m_scene.draw(_local9, _local13);
var _local8 = m_oLevel.aEnemies.length;
_local4 = 0;
while (_local4 < _local8) {
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", "sndGumboSwing");
break;
case "enemy1" :
_local3 = new Enemy(_local2.x, _local2.y, _local2.left, _local2.right, m_scene, m_hero, "enemy1", "sndBaloon");
break;
case "enemy2" :
_local3 = new Enemy(_local2.x, _local2.y, _local2.left, _local2.right, m_scene, m_hero, "enemy2", null);
}
addActiveObj(_local3);
addEnemy(_local3);
_local4++;
}
_local8 = m_oLevel.aPlatforms.length;
_local4 = 0;
while (_local4 < _local8) {
var _local2 = m_oLevel.aPlatforms[_local4];
var _local5 = new Platform(_local2.x, _local2.y, _local2.p0, _local2.p1, _local2.type, _local2.color, m_scene, m_hero);
addActiveObj(_local5);
_local4++;
}
_local8 = m_oLevel.aLasers.length;
_local4 = 0;
while (_local4 < _local8) {
var _local2 = m_oLevel.aLasers[_local4];
var _local7 = ((_local2.type == "laserRot") ? "sndBubbles" : "sndElectricity");
var _local6 = new Laser(_local2.x, _local2.y, _local2.type, m_scene, m_hero, _local7);
addActiveObj(_local6);
_local4++;
}
var _local12 = new Exit(m_oLevel.exitPos.x, m_oLevel.exitPos.y, m_scene, m_hero);
addActiveObj(_local12);
}
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) {
if (!s_bUpdate) {
return(undefined);
}
var _local3 = m_aActiveObj.length;
var _local2 = 0;
while (_local2 < _local3) {
m_aActiveObj[_local2].step();
_local2++;
}
_local2 = 0;
while (_local2 < _local3) {
m_aActiveObj[_local2].draw();
_local2++;
}
if (!m_hero.m_bIsDead) {
onRedrawScene();
}
displayTime();
_local2 = 0;
while (_local2 < m_aActiveObjToRemove.length) {
removeSingleActiveObj(m_aActiveObjToRemove[_local2]);
_local2++;
}
m_aActiveObjToRemove = new Array();
}
function removeSingleActiveObj(obj) {
var _local3 = m_aActiveObj.length;
var _local2 = 0;
while (_local2 < _local3) {
if (m_aActiveObj[_local2] == obj) {
m_aActiveObj[_local2].remove();
m_aActiveObj.splice(_local2, 1);
break;
}
_local2++;
}
}
function onRedrawScene(Void) {
var _local2 = m_hero.getPos();
var _local4 = _local2.x - (Scene.STAGE_W / 2);
var _local3 = _local2.y - Scene.HERO_Y;
m_scene.draw(_local4, _local3);
}
function removeActiveObj(obj) {
m_aActiveObjToRemove.push(obj);
}
function addActiveObj(obj) {
m_aActiveObj.push(obj);
obj.addListener(this);
}
function addEnemy(enemy) {
m_aEnemies.push(enemy);
}
function onCollectItem(refItem, x, y) {
if (refItem.m_sType == "battery") {
m_bToExit = true;
addPoints(POINTS_FOR_BATTERY, refItem.m_x, refItem.m_y);
displayMission();
refItem.remove();
Sounds.playSound("sndCollectKey");
m_mcGame.mcFindExit.gotoAndPlay("in");
} else if (refItem.m_sType == "glowStick") {
addPoints(POINTS_FOR_STICK, refItem.m_x, refItem.m_y);
m_power = m_power + 1;
if (m_power > MAX_POWER) {
m_power = MAX_POWER;
}
displayPower();
refItem.remove();
Sounds.playSound("sndCollectEnergy");
} else if (refItem.m_sType == "wings") {
addPoints(POINTS_FOR_WINGS, refItem.m_x, refItem.m_y);
m_wings++;
refItem.remove();
Sounds.playSound("sndCollectPoints");
}
m_aItemsMap[y][x] = true;
}
function onGetHurt(sSide) {
if (Panik.GOD) {
return(undefined);
}
m_power = m_power - 3;
if (m_power <= 0) {
m_power = 0;
m_hero.onGetHurt(sSide);
m_hero.onLoseLife();
clearInterval(m_interval);
m_interval = setInterval(this, "loseLife", 1500);
m_hero.m_bKeyControl = false;
} else {
m_hero.onGetHurt(sSide);
}
displayPower();
}
function loseLife(Void) {
clearInterval(m_interval);
m_lives--;
if (m_lives < 0) {
stopGame();
displayPopUp("loose");
} else {
m_points = m_points - m_levelPoints;
displayLives();
createLevel();
m_hero.m_bKeyControl = true;
m_timer.setTime(0);
displayTime();
displayPower();
displayPoints();
displayMission();
}
}
function displayTime(Void) {
m_mcGauges.mcUpper.tfTime.text = m_timer.getFormattedTime();
}
function displayLives(Void) {
m_mcGauges.mcBottom.mcLives.gotoAndStop(m_lives + 1);
}
function displayPower(Void) {
m_mcGauges.mcBottom.mcPower.gotoAndStop(m_power + 1);
}
function displayPoints(Void) {
m_mcGauges.mcUpper.tfScore.text = m_points;
}
function displayMission(Void) {
if (m_bToExit) {
m_mcGauges.mcBottom.mcMission.gotoAndStop("exit");
} else {
m_mcGauges.mcBottom.mcMission.gotoAndStop("power");
}
}
function displayPopUp(sLabel) {
m_mcPopUp.gotoAndStop(sLabel);
Sounds.stopSound("sndGumboSwing");
var _local2 = calculateTimeBonus();
var _local3 = calculateWingsBonus();
switch (sLabel) {
case "level" :
m_mcPopUp.tfLevel.text = ("LEVEL " + m_levelNr) + " COMPLETE";
m_mcPopUp.btnNextLevel.onRelease = EventDelegate.create(this, onReleaseNextLevel);
Sounds.playSound("sndLevelOver");
Sounds.stopSound("sndAmbient" + m_levelNr);
Sounds.initButton(m_mcPopUp.mcSoundBtn);
var _local4 = new Array();
_local4[0] = m_mcPopUp.btnNextLevel;
m_btnCtrl = new ButtonControl(_local4);
m_keyListener = new Object();
m_keyListener.onKeyDown = EventDelegate.create(this, onKeyNextLevel);
Key.addListener(m_keyListener);
break;
case "win" :
m_mcPopUp.btnPlayAgain.onRelease = EventDelegate.create(this, onReleasePlayAgain);
Sounds.playSound("sndLevelOver");
Sounds.stopSound("sndAmbient" + m_levelNr);
Sounds.initButton(m_mcPopUp.mcSoundBtn);
m_keyListener = new Object();
m_keyListener.onKeyDown = EventDelegate.create(this, onKeyPlayAgain);
Key.addListener(m_keyListener);
break;
case "loose" :
m_mcPopUp.btnPlayAgain.onRelease = EventDelegate.create(this, onReleasePlayAgain);
_local2 = 0;
Sounds.playSound("sndLose");
Sounds.stopSound("sndAmbient" + (m_levelNr + 1));
Sounds.initButton(m_mcPopUp.mcSoundBtn);
m_keyListener = new Object();
m_keyListener.onKeyDown = EventDelegate.create(this, onKeyPlayAgain);
Key.addListener(m_keyListener);
}
m_mcPopUp.tfWings.text = m_wings;
m_mcPopUp.tfWingsBonus.text = _local3;
m_mcPopUp.tfTimeBonus.text = _local2;
m_points = m_points + (_local3 + _local2);
m_mcPopUp.tfTotal.text = m_points;
}
function onReleasePlayAgain(Void) {
Key.removeListener(m_keyListener);
Panik.s_instance.startFront(true);
}
function onReleaseNextLevel(Void) {
Key.removeListener(m_keyListener);
m_btnCtrl.remove();
m_mcPopUp.gotoAndStop("blank");
createLevel();
m_timer.setTime(0);
displayTime();
displayPoints();
displayPower();
displayMission();
pauseUp();
Sounds.playSound("sndAmbient" + (m_levelNr + 1), 99999);
Sounds.initButton(m_mcGame.mcSoundBtn);
}
function onKeyPlayAgain() {
if (Key.isDown(32)) {
onReleasePlayAgain();
}
}
function onKeyNextLevel() {
if (Key.isDown(32)) {
onReleaseNextLevel();
}
}
function onLevelComplete(Void) {
stopGame();
m_levelNr++;
if (m_levelNr == Panik.s_levelsNumber) {
displayPopUp("win");
} else {
displayPopUp("level");
}
}
function calculateTimeBonus(Void) {
var _local2 = TIME_BONUS - (5 * Math.floor(m_timer.getTime() / 500));
if (_local2 < 0) {
_local2 = 0;
}
_local2 = _local2 * ((m_levelNr * 0.5) + 0.5);
_local2 = Math.round(_local2);
return(_local2);
}
function calculateWingsBonus(Void) {
return(m_wings * WINGS_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 < 11) {
_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) * 25});
_local3.tfNumber.text = _local2;
_local3.tfName.text = _local4;
_local3.tfScore.text = _local6;
_local2++;
}
}
function addPoints(points, x, y) {
m_points = m_points + points;
m_levelPoints = m_levelPoints + points;
displayPoints();
var _local2 = m_scene.m_mcObjects1.mc;
new PointsCloud(_local2, x, y, points);
}
function createShot(x, y, dir) {
var _local2 = new Shot(x, y, dir, m_scene, m_aEnemies);
addActiveObj(_local2);
Sounds.playSound("sndShot");
}
function pauseUp(Void) {
m_mcGame.mcPauseBtn.gotoAndStop("up");
m_mcGame.mcPauseBtn.onRelease = EventDelegate.create(this, pauseDown);
startGame();
}
function pauseDown(Void) {
m_mcGame.mcPauseBtn.gotoAndStop("down");
m_mcGame.mcPauseBtn.onRelease = EventDelegate.create(this, pauseUp);
stopGame();
}
function onPressPause() {
Sounds.playSound("sndButton");
}
function isAlreadyOnScene(x, y) {
var _local4 = m_aActiveObj.length;
var _local2 = 0;
while (_local2 < _local4) {
var _local3 = m_aActiveObj[_local2].getGridPos();
if ((_local3.x == x) && (_local3.y == y)) {
return(true);
}
_local2++;
}
return(false);
}
static var TILE_SIZE = 32;
static var TIME_BONUS = 5000;
static var WINGS_BONUS = 100;
static var POINTS_FOR_WINGS = 50;
static var POINTS_FOR_STICK = 50;
static var POINTS_FOR_BATTERY = 500;
static var MAX_POWER = 9;
static var MUSIC_VOLUME = 40;
static var s_bUpdate = true;
static var s_bUseBreakpoints = true;
}
Symbol 602 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 603 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);
}
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();
break;
case 38 :
m_index--;
m_index = m_index + m_aButtons.length;
m_index = m_index % m_aButtons.length;
m_mcMark.removeMovieClip();
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});
}
}
Symbol 604 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();
mainSoundUp();
}
}
static function initButton(btn) {
m_mcSoundButton = btn;
if (s_mainSounds.getVolume() == 0) {
mainSoundDown();
} else {
mainSoundUp();
}
}
static function mainSoundUp(Void) {
m_mcSoundButton.gotoAndStop("up");
m_mcSoundButton.onRelease = mainSoundDown;
s_mainSounds.setVolume(100);
}
static function mainSoundDown(Void) {
m_mcSoundButton.gotoAndStop("down");
m_mcSoundButton.onRelease = mainSoundUp;
s_mainSounds.setVolume(0);
}
static function setSounds(Void) {
var _local6 = new Array("sndAmbient1", "sndAmbient2", "sndAmbient3", "sndCollectKey", "sndCollectEnergy", "sndCollectPoints", "sndSpring", "sndElectricity", "sndDead", "sndLose", "sndHurted", "sndJump", "sndLevelOver", "sndButton", "sndBubbles", "sndPowerDown", "sndPowerUp", "sndShot", "sndMusic", "sndGumboSwing", "sndBaloon");
setVolume("sndAmbient1", 500);
setVolume("sndAmbient2", 500);
setVolume("sndAmbient3", 500);
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);
return(Sound(m_oSoundsList[sName]));
}
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);
}
static function changeVolume(sName, volume) {
var _local1 = m_oSoundsList[sName];
caurina.transitions.Tweener.addTween(_local1, {_sound_volume:volume, time:0.3, transition:"linear"});
}
}
Symbol 605 MovieClip [__Packages.caurina.transitions.Tweener] Frame 0
class caurina.transitions.Tweener
{
static var _specialPropertySplitterList, _specialPropertyModifierList, _transitionList, _currentTime, _tweenList, _specialPropertyList;
function Tweener () {
}
static function addTween() {
if ((arguments.length < 2) || (arguments[0] == undefined)) {
return(false);
}
var _local11 = new Array();
var _local3;
var _local39;
var _local4;
var _local38;
if (arguments[0] instanceof Array) {
_local3 = 0;
while (_local3 < arguments[0].length) {
_local11.push(arguments[0][_local3]);
_local3++;
}
} else {
_local3 = 0;
while (_local3 < (arguments.length - 1)) {
_local11.push(arguments[_local3]);
_local3++;
}
}
var _local5 = arguments[arguments.length - 1];
if (!_inited) {
init();
}
if ((!_engineExists) || (_root.__tweener_controller__ == undefined)) {
startEngine();
}
var _local17 = (isNaN(_local5.time) ? 0 : (_local5.time));
var _local15 = (isNaN(_local5.delay) ? 0 : (_local5.delay));
var _local7 = new Object();
var _local21 = {time:true, delay:true, useFrames:true, skipUpdates:true, transition:true, onStart:true, onUpdate:true, onComplete:true, onOverwrite:true, rounded:true, onStartParams:true, onUpdateParams:true, onCompleteParams:true, onOverwriteParams:true, quickAdd:true};
var _local10 = new Object();
for (_local4 in _local5) {
if (!_local21[_local4]) {
if (_specialPropertySplitterList[_local4] != undefined) {
var _local9 = _specialPropertySplitterList[_local4].splitValues(_local5[_local4]);
_local3 = 0;
while (_local3 < _local9.length) {
_local7[_local9[_local3].name] = {valueStart:undefined, valueComplete:_local9[_local3].value};
_local3++;
}
} else if (_specialPropertyModifierList[_local4] != undefined) {
var _local8 = _specialPropertyModifierList[_local4].modifyValues(_local5[_local4]);
_local3 = 0;
while (_local3 < _local8.length) {
_local10[_local8[_local3].name] = {modifierParameters:_local8[_local3].parameters, modifierFunction:_specialPropertyModifierList[_local4].getValue};
_local3++;
}
} else {
_local7[_local4] = {valueStart:undefined, valueComplete:_local5[_local4]};
}
}
}
for (_local4 in _local10) {
if (_local7[_local4] != undefined) {
_local7[_local4].modifierParameters = _local10[_local4].modifierParameters;
_local7[_local4].modifierFunction = _local10[_local4].modifierFunction;
}
}
var _local20;
if (typeof(_local5.transition) == "string") {
var _local22 = _local5.transition.toLowerCase();
_local20 = _transitionList[_local22];
} else {
_local20 = _local5.transition;
}
if (_local20 == undefined) {
_local20 = _transitionList.easeoutexpo;
}
var _local12;
var _local6;
var _local16;
_local3 = 0;
while (_local3 < _local11.length) {
_local12 = new Object();
for (_local4 in _local7) {
_local12[_local4] = new caurina.transitions.PropertyInfoObj(_local7[_local4].valueStart, _local7[_local4].valueComplete, _local7[_local4].modifierFunction, _local7[_local4].modifierParameters);
}
_local6 = new caurina.transitions.TweenListObj(_local11[_local3], _currentTime + ((_local15 * 1000) / _timeScale), _currentTime + (((_local15 * 1000) + (_local17 * 1000)) / _timeScale), _local5.useFrames == true, _local20);
_local6.properties = _local12;
_local6.onStart = _local5.onStart;
_local6.onUpdate = _local5.onUpdate;
_local6.onComplete = _local5.onComplete;
_local6.onOverwrite = _local5.onOverwrite;
_local6.onStartParams = _local5.onStartParams;
_local6.onUpdateParams = _local5.onUpdateParams;
_local6.onCompleteParams = _local5.onCompleteParams;
_local6.onOverwriteParams = _local5.onOverwriteParams;
_local6.rounded = _local5.rounded;
_local6.skipUpdates = _local5.skipUpdates;
if (!_local5.quickAdd) {
removeTweensByTime(_local6.scope, _local6.properties, _local6.timeStart, _local6.timeComplete);
}
_tweenList.push(_local6);
if ((_local17 == 0) && (_local15 == 0)) {
_local16 = _tweenList.length - 1;
updateTweenByIndex(_local16);
removeTweenByIndex(_local16);
}
_local3++;
}
return(true);
}
static function addCaller() {
if ((arguments.length < 2) || (arguments[0] == undefined)) {
return(false);
}
var _local6 = new Array();
var _local5;
var _local12;
if (arguments[0] instanceof Array) {
_local5 = 0;
while (_local5 < arguments[0].length) {
_local6.push(arguments[0][_local5]);
_local5++;
}
} else {
_local5 = 0;
while (_local5 < (arguments.length - 1)) {
_local6.push(arguments[_local5]);
_local5++;
}
}
var _local4 = arguments[arguments.length - 1];
if (!_inited) {
init();
}
if ((!_engineExists) || (_root.__tweener_controller__ == undefined)) {
startEngine();
}
var _local9 = (isNaN(_local4.time) ? 0 : (_local4.time));
var _local7 = (isNaN(_local4.delay) ? 0 : (_local4.delay));
var _local10;
if (typeof(_local4.transition) == "string") {
var _local11 = _local4.transition.toLowerCase();
_local10 = _transitionList[_local11];
} else {
_local10 = _local4.transition;
}
if (_local10 == undefined) {
_local10 = _transitionList.easeoutexpo;
}
var _local3;
var _local8;
_local5 = 0;
while (_local5 < _local6.length) {
_local3 = new caurina.transitions.TweenListObj(_local6[_local5], _currentTime + ((_local7 * 1000) / _timeScale), _currentTime + (((_local7 * 1000) + (_local9 * 1000)) / _timeScale), _local4.useFrames == true, _local10);
_local3.properties = undefined;
_local3.onStart = _local4.onStart;
_local3.onUpdate = _local4.onUpdate;
_local3.onComplete = _local4.onComplete;
_local3.onOverwrite = _local4.onOverwrite;
_local3.onStartParams = _local4.onStartParams;
_local3.onUpdateParams = _local4.onUpdateParams;
_local3.onCompleteParams = _local4.onCompleteParams;
_local3.onOverwriteParams = _local4.onOverwriteParams;
_local3.isCaller = true;
_local3.count = _local4.count;
_local3.waitFrames = _local4.waitFrames;
_tweenList.push(_local3);
if ((_local9 == 0) && (_local7 == 0)) {
_local8 = _tweenList.length - 1;
updateTweenByIndex(_local8);
removeTweenByIndex(_local8);
}
_local5++;
}
return(true);
}
static function removeTweensByTime(p_scope, p_properties, p_timeStart, p_timeComplete) {
var _local4 = false;
var _local3;
var _local1;
var _local6 = _tweenList.length;
var _local2;
_local1 = 0;
while (_local1 < _local6) {
if (p_scope == _tweenList[_local1].scope) {
if ((p_timeComplete > _tweenList[_local1].timeStart) && (p_timeStart < _tweenList[_local1].timeComplete)) {
_local3 = false;
for (_local2 in _tweenList[_local1].properties) {
if (p_properties[_local2] != undefined) {
if (_tweenList[_local1].onOverwrite != undefined) {
try {
_tweenList[_local1].onOverwrite.apply(_tweenList[_local1].scope, _tweenList[_local1].onOverwriteParams);
} catch(e:Error) {
}
}
_tweenList[_local1].properties[_local2] = undefined;
delete _tweenList[_local1].properties[_local2];
_local3 = true;
_local4 = true;
}
}
if (_local3) {
if (caurina.transitions.AuxFunctions.getObjectLength(_tweenList[_local1].properties) == 0) {
removeTweenByIndex(_local1);
}
}
}
}
_local1++;
}
return(_local4);
}
static function removeTweens(p_scope) {
var _local3 = new Array();
var _local2;
_local2 = 1;
while (_local2 < arguments.length) {
if ((typeof(arguments[_local2]) == "string") && (!caurina.transitions.AuxFunctions.isInArray(arguments[_local2], _local3))) {
_local3.push(arguments[_local2]);
}
_local2++;
}
return(affectTweens(removeTweenByIndex, p_scope, _local3));
}
static function removeAllTweens() {
var _local2 = false;
var _local1;
_local1 = 0;
while (_local1 < _tweenList.length) {
removeTweenByIndex(_local1);
_local2 = true;
_local1++;
}
return(_local2);
}
static function pauseTweens(p_scope) {
var _local3 = new Array();
var _local2;
_local2 = 1;
while (_local2 < arguments.length) {
if ((typeof(arguments[_local2]) == "string") && (!caurina.transitions.AuxFunctions.isInArray(arguments[_local2], _local3))) {
_local3.push(arguments[_local2]);
}
_local2++;
}
return(affectTweens(pauseTweenByIndex, p_scope, _local3));
}
static function pauseAllTweens() {
var _local2 = false;
var _local1;
_local1 = 0;
while (_local1 < _tweenList.length) {
pauseTweenByIndex(_local1);
_local2 = true;
_local1++;
}
return(_local2);
}
static function resumeTweens(p_scope) {
var _local3 = new Array();
var _local2;
_local2 = 1;
while (_local2 < arguments.length) {
if ((typeof(arguments[_local2]) == "string") && (!caurina.transitions.AuxFunctions.isInArray(arguments[_local2], _local3))) {
_local3.push(arguments[_local2]);
}
_local2++;
}
return(affectTweens(resumeTweenByIndex, p_scope, _local3));
}
static function resumeAllTweens() {
var _local2 = false;
var _local1;
_local1 = 0;
while (_local1 < _tweenList.length) {
resumeTweenByIndex(_local1);
_local2 = true;
_local1++;
}
return(_local2);
}
static function affectTweens(p_affectFunction, p_scope, p_properties) {
var _local5 = false;
var _local2;
if (!_tweenList) {
return(false);
}
_local2 = 0;
while (_local2 < _tweenList.length) {
if (_tweenList[_local2].scope == p_scope) {
if (p_properties.length == 0) {
p_affectFunction(_local2);
_local5 = true;
} else {
var _local4 = new Array();
var _local1;
_local1 = 0;
while (_local1 < p_properties.length) {
if (_tweenList[_local2].properties[p_properties[_local1]] != undefined) {
_local4.push(p_properties[_local1]);
}
_local1++;
}
if (_local4.length > 0) {
var _local7 = caurina.transitions.AuxFunctions.getObjectLength(_tweenList[_local2].properties);
if (_local7 == _local4.length) {
p_affectFunction(_local2);
_local5 = true;
} else {
var _local8 = splitTweens(_local2, _local4);
p_affectFunction(_local8);
_local5 = true;
}
}
}
}
_local2++;
}
return(_local5);
}
static function splitTweens(p_tween, p_properties) {
var _local6 = _tweenList[p_tween];
var _local5 = _local6.clone(false);
var _local1;
var _local2;
_local1 = 0;
while (_local1 < p_properties.length) {
_local2 = p_properties[_local1];
if (_local6.properties[_local2] != undefined) {
_local6.properties[_local2] = undefined;
delete _local6.properties[_local2];
}
_local1++;
}
var _local4;
for (_local2 in _local5.properties) {
_local4 = false;
_local1 = 0;
while (_local1 < p_properties.length) {
if (p_properties[_local1] == _local2) {
_local4 = true;
break;
}
_local1++;
}
if (!_local4) {
_local5.properties[_local2] = undefined;
delete _local5.properties[_local2];
}
}
_tweenList.push(_local5);
return(_tweenList.length - 1);
}
static function updateTweens() {
if (_tweenList.length == 0) {
return(false);
}
var _local1;
_local1 = 0;
while (_local1 < _tweenList.length) {
if (!_tweenList[_local1].isPaused) {
if (!updateTweenByIndex(_local1)) {
removeTweenByIndex(_local1);
}
if (_tweenList[_local1] == null) {
removeTweenByIndex(_local1, true);
_local1--;
}
}
_local1++;
}
return(true);
}
static function removeTweenByIndex(p_tween, p_finalRemoval) {
_tweenList[p_tween] = null;
if (p_finalRemoval) {
_tweenList.splice(p_tween, 1);
}
return(true);
}
static function pauseTweenByIndex(p_tween) {
var _local1 = _tweenList[p_tween];
if ((_local1 == null) || (_local1.isPaused)) {
return(false);
}
_local1.timePaused = _currentTime;
_local1.isPaused = true;
return(true);
}
static function resumeTweenByIndex(p_tween) {
var _local1 = _tweenList[p_tween];
if ((_local1 == null) || (!_local1.isPaused)) {
return(false);
}
_local1.timeStart = _local1.timeStart + (_currentTime - _local1.timePaused);
_local1.timeComplete = _local1.timeComplete + (_currentTime - _local1.timePaused);
_local1.timePaused = undefined;
_local1.isPaused = false;
return(true);
}
static function updateTweenByIndex(i) {
var _local1 = _tweenList[i];
if ((_local1 == null) || (!_local1.scope)) {
return(false);
}
var _local11 = false;
var _local12;
var _local2;
var _local6;
var _local8;
var _local7;
var _local5;
var _local4;
var _local10;
var _local3;
if (_currentTime >= _local1.timeStart) {
_local10 = _local1.scope;
if (_local1.isCaller) {
do {
_local6 = ((_local1.timeComplete - _local1.timeStart) / _local1.count) * (_local1.timesCalled + 1);
_local8 = _local1.timeStart;
_local7 = _local1.timeComplete - _local1.timeStart;
_local5 = _local1.timeComplete - _local1.timeStart;
_local2 = _local1.transition(_local6, _local8, _local7, _local5);
if (_currentTime >= _local2) {
if (_local1.onUpdate != undefined) {
try {
_local1.onUpdate.apply(_local10, _local1.onUpdateParams);
} catch(e:Error) {
}
}
_local1.timesCalled++;
if (_local1.timesCalled >= _local1.count) {
_local11 = true;
break;
}
if (_local1.waitFrames) {
break;
}
}
} while (_currentTime >= _local2);
} else {
_local12 = ((_local1.skipUpdates < 1) || (_local1.skipUpdates == undefined)) || (_local1.updatesSkipped >= _local1.skipUpdates);
if (_currentTime >= _local1.timeComplete) {
_local11 = true;
_local12 = true;
}
if (!_local1.hasStarted) {
if (_local1.onStart != undefined) {
try {
_local1.onStart.apply(_local10, _local1.onStartParams);
} catch(e:Error) {
}
}
for (_local4 in _local1.properties) {
var _local9 = getPropertyValue(_local10, _local4);
_local1.properties[_local4].valueStart = (isNaN(_local9) ? (_local1.properties[_local4].valueComplete) : (_local9));
}
_local12 = true;
_local1.hasStarted = true;
}
if (_local12) {
for (_local4 in _local1.properties) {
_local3 = _local1.properties[_local4];
if (_local11) {
_local2 = _local3.valueComplete;
} else if (_local3.hasModifier) {
_local6 = _currentTime - _local1.timeStart;
_local5 = _local1.timeComplete - _local1.timeStart;
_local2 = _local1.transition(_local6, 0, 1, _local5);
_local2 = _local3.modifierFunction(_local3.valueStart, _local3.valueComplete, _local2, _local3.modifierParameters);
} else {
_local6 = _currentTime - _local1.timeStart;
_local8 = _local3.valueStart;
_local7 = _local3.valueComplete - _local3.valueStart;
_local5 = _local1.timeComplete - _local1.timeStart;
_local2 = _local1.transition(_local6, _local8, _local7, _local5);
}
if (_local1.rounded) {
_local2 = Math.round(_local2);
}
setPropertyValue(_local10, _local4, _local2);
}
_local1.updatesSkipped = 0;
if (_local1.onUpdate != undefined) {
try {
_local1.onUpdate.apply(_local10, _local1.onUpdateParams);
} catch(e:Error) {
}
}
} else {
_local1.updatesSkipped++;
}
}
if (_local11 && (_local1.onComplete != undefined)) {
try {
_local1.onComplete.apply(_local10, _local1.onCompleteParams);
} catch(e:Error) {
}
}
return(!_local11);
}
return(true);
}
static function init() {
_inited = true;
_transitionList = new Object();
caurina.transitions.Equations.init();
_specialPropertyList = new Object();
_specialPropertyModifierList = new Object();
_specialPropertySplitterList = new Object();
caurina.transitions.SpecialPropertiesDefault.init();
}
static function registerTransition(p_name, p_function) {
if (!_inited) {
init();
}
_transitionList[p_name] = p_function;
}
static function registerSpecialProperty(p_name, p_getFunction, p_setFunction, p_parameters) {
if (!_inited) {
init();
}
var _local1 = new caurina.transitions.SpecialProperty(p_getFunction, p_setFunction, p_parameters);
_specialPropertyList[p_name] = _local1;
}
static function registerSpecialPropertyModifier(p_name, p_modifyFunction, p_getFunction) {
if (!_inited) {
init();
}
var _local1 = new caurina.transitions.SpecialPropertyModifier(p_modifyFunction, p_getFunction);
_specialPropertyModifierList[p_name] = _local1;
}
static function registerSpecialPropertySplitter(p_name, p_splitFunction) {
if (!_inited) {
init();
}
var _local1 = new caurina.transitions.SpecialPropertySplitter(p_splitFunction);
_specialPropertySplitterList[p_name] = _local1;
}
static function startEngine() {
_engineExists = true;
_tweenList = new Array();
var _local2 = _root.createEmptyMovieClip("__tweener_controller__", 31338);
_local2.onEnterFrame = function () {
caurina.transitions.Tweener.onEnterFrame();
};
updateTime();
}
static function stopEngine() {
_engineExists = false;
_tweenList = null;
_currentTime = 0;
delete _root.__tweener_controller__.onEnterFrame;
_root.__tweener_controller__.removeMovieClip();
}
static function getPropertyValue(p_obj, p_prop) {
if (_specialPropertyList[p_prop] != undefined) {
return(_specialPropertyList[p_prop].getValue(p_obj, _specialPropertyList[p_prop].parameters));
}
return(p_obj[p_prop]);
}
static function setPropertyValue(p_obj, p_prop, p_value) {
if (_specialPropertyList[p_prop] != undefined) {
_specialPropertyList[p_prop].setValue(p_obj, p_value, _specialPropertyList[p_prop].parameters);
} else {
p_obj[p_prop] = p_value;
}
}
static function updateTime() {
_currentTime = getTimer();
}
static function onEnterFrame() {
updateTime();
var _local1 = false;
_local1 = updateTweens();
if (!_local1) {
stopEngine();
}
}
static function setTimeScale(p_time) {
var _local1;
if (isNaN(p_time)) {
p_time = 1;
}
if (p_time < 1E-5) {
p_time = 1E-5;
}
if (p_time != _timeScale) {
_local1 = 0;
while (_local1 < _tweenList.length) {
_tweenList[_local1].timeStart = _currentTime - (((_currentTime - _tweenList[_local1].timeStart) * _timeScale) / p_time);
_tweenList[_local1].timeComplete = _currentTime - (((_currentTime - _tweenList[_local1].timeComplete) * _timeScale) / p_time);
if (_tweenList[_local1].timePaused != undefined) {
_tweenList[_local1].timePaused = _currentTime - (((_currentTime - _tweenList[_local1].timePaused) * _timeScale) / p_time);
}
_local1++;
}
_timeScale = p_time;
}
}
static function isTweening(p_scope) {
var _local1;
_local1 = 0;
while (_local1 < _tweenList.length) {
if (_tweenList[_local1].scope == p_scope) {
return(true);
}
_local1++;
}
return(false);
}
static function getTweens(p_scope) {
var _local1;
var _local2;
var _local3 = new Array();
_local1 = 0;
while (_local1 < _tweenList.length) {
if (_tweenList[_local1].scope == p_scope) {
for (_local2 in _tweenList[_local1].properties) {
_local3.push(_local2);
}
}
_local1++;
}
return(_local3);
}
static function getTweenCount(p_scope) {
var _local1;
var _local2 = 0;
_local1 = 0;
while (_local1 < _tweenList.length) {
if (_tweenList[_local1].scope == p_scope) {
_local2 = _local2 + caurina.transitions.AuxFunctions.getObjectLength(_tweenList[_local1].properties);
}
_local1++;
}
return(_local2);
}
static function getVersion() {
return("AS2 1.25.55");
}
static function debug_getList() {
var _local3 = "";
var _local1;
var _local2;
_local1 = 0;
while (_local1 < _tweenList.length) {
_local3 = _local3 + (("[" + _local1) + "] ::\n");
for (_local2 in _tweenList[_local1].properties) {
_local3 = _local3 + ((((" " + _local2) + " -> ") + _tweenList[_local1].properties[_local2].valueComplete) + newline);
}
_local1++;
}
return(_local3);
}
static var _engineExists = false;
static var _inited = false;
static var _timeScale = 1;
}
Symbol 606 MovieClip [__Packages.caurina.transitions.TweenListObj] Frame 0
class caurina.transitions.TweenListObj
{
var scope, timeStart, timeComplete, useFrames, transition, auxProperties, properties, isPaused, timePaused, isCaller, updatesSkipped, timesCalled, skipUpdates, hasStarted, onStart, onUpdate, onComplete, onOverwrite, onStartParams, onUpdateParams, onCompleteParams, onOverwriteParams, rounded, count, waitFrames;
function TweenListObj (p_scope, p_timeStart, p_timeComplete, p_useFrames, p_transition) {
scope = p_scope;
timeStart = p_timeStart;
timeComplete = p_timeComplete;
useFrames = p_useFrames;
transition = p_transition;
auxProperties = new Object();
properties = new Object();
isPaused = false;
timePaused = undefined;
isCaller = false;
updatesSkipped = 0;
timesCalled = 0;
skipUpdates = 0;
hasStarted = false;
}
function clone(omitEvents) {
var _local2 = new caurina.transitions.TweenListObj(scope, timeStart, timeComplete, useFrames, transition);
_local2.properties = new Object();
for (var _local3 in properties) {
_local2.properties[_local3] = properties[_local3].clone();
}
_local2.skipUpdates = skipUpdates;
_local2.updatesSkipped = updatesSkipped;
if (!omitEvents) {
_local2.onStart = onStart;
_local2.onUpdate = onUpdate;
_local2.onComplete = onComplete;
_local2.onOverwrite = onOverwrite;
_local2.onStartParams = onStartParams;
_local2.onUpdateParams = onUpdateParams;
_local2.onCompleteParams = onCompleteParams;
_local2.onOverwriteParams = onOverwriteParams;
}
_local2.rounded = rounded;
_local2.isPaused = isPaused;
_local2.timePaused = timePaused;
_local2.isCaller = isCaller;
_local2.count = count;
_local2.timesCalled = timesCalled;
_local2.waitFrames = waitFrames;
_local2.hasStarted = hasStarted;
return(_local2);
}
function toString() {
var _local2 = "\n[TweenListObj ";
_local2 = _local2 + ("scope:" + String(scope));
_local2 = _local2 + ", properties:";
var _local3 = true;
for (var _local4 in properties) {
if (!_local3) {
_local2 = _local2 + ",";
}
_local2 = _local2 + ("[name:" + properties[_local4].name);
_local2 = _local2 + (",valueStart:" + properties[_local4].valueStart);
_local2 = _local2 + (",valueComplete:" + properties[_local4].valueComplete);
_local2 = _local2 + "]";
_local3 = false;
}
_local2 = _local2 + (", timeStart:" + String(timeStart));
_local2 = _local2 + (", timeComplete:" + String(timeComplete));
_local2 = _local2 + (", useFrames:" + String(useFrames));
_local2 = _local2 + (", transition:" + String(transition));
if (skipUpdates) {
_local2 = _local2 + (", skipUpdates:" + String(skipUpdates));
}
if (updatesSkipped) {
_local2 = _local2 + (", updatesSkipped:" + String(updatesSkipped));
}
if (onStart) {
_local2 = _local2 + (", onStart:" + String(onStart));
}
if (onUpdate) {
_local2 = _local2 + (", onUpdate:" + String(onUpdate));
}
if (onComplete) {
_local2 = _local2 + (", onComplete:" + String(onComplete));
}
if (onOverwrite) {
_local2 = _local2 + (", onOverwrite:" + String(onOverwrite));
}
if (onStartParams) {
_local2 = _local2 + (", onStartParams:" + String(onStartParams));
}
if (onUpdateParams) {
_local2 = _local2 + (", onUpdateParams:" + String(onUpdateParams));
}
if (onCompleteParams) {
_local2 = _local2 + (", onCompleteParams:" + String(onCompleteParams));
}
if (onOverwriteParams) {
_local2 = _local2 + (", onOverwriteParams:" + String(onOverwriteParams));
}
if (rounded) {
_local2 = _local2 + (", rounded:" + String(rounded));
}
if (isPaused) {
_local2 = _local2 + (", isPaused:" + String(isPaused));
}
if (timePaused) {
_local2 = _local2 + (", timePaused:" + String(timePaused));
}
if (isCaller) {
_local2 = _local2 + (", isCaller:" + String(isCaller));
}
if (count) {
_local2 = _local2 + (", count:" + String(count));
}
if (timesCalled) {
_local2 = _local2 + (", timesCalled:" + String(timesCalled));
}
if (waitFrames) {
_local2 = _local2 + (", waitFrames:" + String(waitFrames));
}
if (hasStarted) {
_local2 = _local2 + (", hasStarted:" + String(hasStarted));
}
_local2 = _local2 + "]\n";
return(_local2);
}
}
Symbol 607 MovieClip [__Packages.caurina.transitions.PropertyInfoObj] Frame 0
class caurina.transitions.PropertyInfoObj
{
var valueStart, valueComplete, hasModifier, modifierFunction, modifierParameters;
function PropertyInfoObj (p_valueStart, p_valueComplete, p_modifierFunction, p_modifierParameters) {
valueStart = p_valueStart;
valueComplete = p_valueComplete;
hasModifier = p_modifierFunction != undefined;
modifierFunction = p_modifierFunction;
modifierParameters = p_modifierParameters;
}
function clone() {
var _local2 = new caurina.transitions.PropertyInfoObj(valueStart, valueComplete, modifierFunction, modifierParameters);
return(_local2);
}
function toString() {
var _local2 = "\n[PropertyInfoObj ";
_local2 = _local2 + ("valueStart:" + String(valueStart));
_local2 = _local2 + ", ";
_local2 = _local2 + ("valueComplete:" + String(valueComplete));
_local2 = _local2 + ", ";
_local2 = _local2 + ("modifierFunction:" + String(modifierFunction));
_local2 = _local2 + ", ";
_local2 = _local2 + ("modifierParameters:" + String(modifierParameters));
_local2 = _local2 + "]\n";
return(_local2);
}
}
Symbol 608 MovieClip [__Packages.caurina.transitions.AuxFunctions] Frame 0
class caurina.transitions.AuxFunctions
{
function AuxFunctions () {
}
static function numberToR(p_num) {
return((p_num & 16711680) >> 16);
}
static function numberToG(p_num) {
return((p_num & 65280) >> 8);
}
static function numberToB(p_num) {
return(p_num & 255);
}
static function isInArray(p_string, p_array) {
var _local2 = p_array.length;
var _local1 = 0;
while (_local1 < _local2) {
if (p_array[_local1] == p_string) {
return(true);
}
_local1++;
}
return(false);
}
static function getObjectLength(p_object) {
var _local1 = 0;
for (var _local2 in p_object) {
_local1++;
}
return(_local1);
}
}
Symbol 609 MovieClip [__Packages.caurina.transitions.Equations] Frame 0
class caurina.transitions.Equations
{
function Equations () {
}
static function init() {
caurina.transitions.Tweener.registerTransition("easenone", easeNone);
caurina.transitions.Tweener.registerTransition("linear", easeNone);
caurina.transitions.Tweener.registerTransition("easeinquad", easeInQuad);
caurina.transitions.Tweener.registerTransition("easeoutquad", easeOutQuad);
caurina.transitions.Tweener.registerTransition("easeinoutquad", easeInOutQuad);
caurina.transitions.Tweener.registerTransition("easeoutinquad", easeOutInQuad);
caurina.transitions.Tweener.registerTransition("easeincubic", easeInCubic);
caurina.transitions.Tweener.registerTransition("easeoutcubic", easeOutCubic);
caurina.transitions.Tweener.registerTransition("easeinoutcubic", easeInOutCubic);
caurina.transitions.Tweener.registerTransition("easeoutincubic", easeOutInCubic);
caurina.transitions.Tweener.registerTransition("easeinquart", easeInQuart);
caurina.transitions.Tweener.registerTransition("easeoutquart", easeOutQuart);
caurina.transitions.Tweener.registerTransition("easeinoutquart", easeInOutQuart);
caurina.transitions.Tweener.registerTransition("easeoutinquart", easeOutInQuart);
caurina.transitions.Tweener.registerTransition("easeinquint", easeInQuint);
caurina.transitions.Tweener.registerTransition("easeoutquint", easeOutQuint);
caurina.transitions.Tweener.registerTransition("easeinoutquint", easeInOutQuint);
caurina.transitions.Tweener.registerTransition("easeoutinquint", easeOutInQuint);
caurina.transitions.Tweener.registerTransition("easeinsine", easeInSine);
caurina.transitions.Tweener.registerTransition("easeoutsine", easeOutSine);
caurina.transitions.Tweener.registerTransition("easeinoutsine", easeInOutSine);
caurina.transitions.Tweener.registerTransition("easeoutinsine", easeOutInSine);
caurina.transitions.Tweener.registerTransition("easeincirc", easeInCirc);
caurina.transitions.Tweener.registerTransition("easeoutcirc", easeOutCirc);
caurina.transitions.Tweener.registerTransition("easeinoutcirc", easeInOutCirc);
caurina.transitions.Tweener.registerTransition("easeoutincirc", easeOutInCirc);
caurina.transitions.Tweener.registerTransition("easeinexpo", easeInExpo);
caurina.transitions.Tweener.registerTransition("easeoutexpo", easeOutExpo);
caurina.transitions.Tweener.registerTransition("easeinoutexpo", easeInOutExpo);
caurina.transitions.Tweener.registerTransition("easeoutinexpo", easeOutInExpo);
caurina.transitions.Tweener.registerTransition("easeinelastic", easeInElastic);
caurina.transitions.Tweener.registerTransition("easeoutelastic", easeOutElastic);
caurina.transitions.Tweener.registerTransition("easeinoutelastic", easeInOutElastic);
caurina.transitions.Tweener.registerTransition("easeoutinelastic", easeOutInElastic);
caurina.transitions.Tweener.registerTransition("easeinback", easeInBack);
caurina.transitions.Tweener.registerTransition("easeoutback", easeOutBack);
caurina.transitions.Tweener.registerTransition("easeinoutback", easeInOutBack);
caurina.transitions.Tweener.registerTransition("easeoutinback", easeOutInBack);
caurina.transitions.Tweener.registerTransition("easeinbounce", easeInBounce);
caurina.transitions.Tweener.registerTransition("easeoutbounce", easeOutBounce);
caurina.transitions.Tweener.registerTransition("easeinoutbounce", easeInOutBounce);
caurina.transitions.Tweener.registerTransition("easeoutinbounce", easeOutInBounce);
}
static function easeNone(t, b, c, d) {
return(((c * t) / d) + b);
}
static function easeInQuad(t, b, c, d) {
t = t / d;
return(((c * t) * t) + b);
}
static function easeOutQuad(t, b, c, d) {
t = t / d;
return((((-c) * t) * (t - 2)) + b);
}
static function easeInOutQuad(t, b, c, d) {
t = t / (d / 2);
if (t < 1) {
return((((c / 2) * t) * t) + b);
}
t--;
return((((-c) / 2) * ((t * (t - 2)) - 1)) + b);
}
static function easeOutInQuad(t, b, c, d) {
if (t < (d / 2)) {
return(easeOutQuad(t * 2, b, c / 2, d));
}
return(easeInQuad((t * 2) - d, b + (c / 2), c / 2, d));
}
static function easeInCubic(t, b, c, d) {
t = t / d;
return((((c * t) * t) * t) + b);
}
static function easeOutCubic(t, b, c, d) {
t = (t / d) - 1;
return((c * (((t * t) * t) + 1)) + b);
}
static function easeInOutCubic(t, b, c, d) {
t = t / (d / 2);
if (t < 1) {
return(((((c / 2) * t) * t) * t) + b);
}
t = t - 2;
return(((c / 2) * (((t * t) * t) + 2)) + b);
}
static function easeOutInCubic(t, b, c, d) {
if (t < (d / 2)) {
return(easeOutCubic(t * 2, b, c / 2, d));
}
return(easeInCubic((t * 2) - d, b + (c / 2), c / 2, d));
}
static function easeInQuart(t, b, c, d) {
t = t / d;
return(((((c * t) * t) * t) * t) + b);
}
static function easeOutQuart(t, b, c, d) {
t = (t / d) - 1;
return(((-c) * ((((t * t) * t) * t) - 1)) + b);
}
static function easeInOutQuart(t, b, c, d) {
t = t / (d / 2);
if (t < 1) {
return((((((c / 2) * t) * t) * t) * t) + b);
}
t = t - 2;
return((((-c) / 2) * ((((t * t) * t) * t) - 2)) + b);
}
static function easeOutInQuart(t, b, c, d) {
if (t < (d / 2)) {
return(easeOutQuart(t * 2, b, c / 2, d));
}
return(easeInQuart((t * 2) - d, b + (c / 2), c / 2, d));
}
static function easeInQuint(t, b, c, d) {
t = t / d;
return((((((c * t) * t) * t) * t) * t) + b);
}
static function easeOutQuint(t, b, c, d) {
t = (t / d) - 1;
return((c * (((((t * t) * t) * t) * t) + 1)) + b);
}
static function easeInOutQuint(t, b, c, d) {
t = t / (d / 2);
if (t < 1) {
return(((((((c / 2) * t) * t) * t) * t) * t) + b);
}
t = t - 2;
return(((c / 2) * (((((t * t) * t) * t) * t) + 2)) + b);
}
static function easeOutInQuint(t, b, c, d) {
if (t < (d / 2)) {
return(easeOutQuint(t * 2, b, c / 2, d));
}
return(easeInQuint((t * 2) - d, b + (c / 2), c / 2, d));
}
static function easeInSine(t, b, c, d) {
return((((-c) * Math.cos((t / d) * (Math.PI/2))) + c) + b);
}
static function easeOutSine(t, b, c, d) {
return((c * Math.sin((t / d) * (Math.PI/2))) + b);
}
static function easeInOutSine(t, b, c, d) {
return((((-c) / 2) * (Math.cos((Math.PI * t) / d) - 1)) + b);
}
static function easeOutInSine(t, b, c, d) {
if (t < (d / 2)) {
return(easeOutSine(t * 2, b, c / 2, d));
}
return(easeInSine((t * 2) - d, b + (c / 2), c / 2, d));
}
static function easeInExpo(t, b, c, d) {
return(((t == 0) ? (b) : ((c * Math.pow(2, 10 * ((t / d) - 1))) + b)));
}
static function easeOutExpo(t, b, c, d) {
return(((t == d) ? (b + c) : ((c * ((-Math.pow(2, (-10 * t) / d)) + 1)) + b)));
}
static function easeInOutExpo(t, b, c, d) {
if (t == 0) {
return(b);
}
if (t == d) {
return(b + c);
}
t = t / (d / 2);
if (t < 1) {
return(((c / 2) * Math.pow(2, 10 * (t - 1))) + b);
}
t--;
return(((c / 2) * ((-Math.pow(2, -10 * t)) + 2)) + b);
}
static function easeOutInExpo(t, b, c, d) {
if (t < (d / 2)) {
return(easeOutExpo(t * 2, b, c / 2, d));
}
return(easeInExpo((t * 2) - d, b + (c / 2), c / 2, d));
}
static function easeInCirc(t, b, c, d) {
t = t / d;
return(((-c) * (Math.sqrt(1 - (t * t)) - 1)) + b);
}
static function easeOutCirc(t, b, c, d) {
t = (t / d) - 1;
return((c * Math.sqrt(1 - (t * t))) + b);
}
static function easeInOutCirc(t, b, c, d) {
t = t / (d / 2);
if (t < 1) {
return((((-c) / 2) * (Math.sqrt(1 - (t * t)) - 1)) + b);
}
t = t - 2;
return(((c / 2) * (Math.sqrt(1 - (t * t)) + 1)) + b);
}
static function easeOutInCirc(t, b, c, d) {
if (t < (d / 2)) {
return(easeOutCirc(t * 2, b, c / 2, d));
}
return(easeInCirc((t * 2) - d, b + (c / 2), c / 2, d));
}
static function easeInElastic(t, b, c, d, a, p) {
var _local5;
if (t == 0) {
return(b);
}
t = t / d;
if (t == 1) {
return(b + c);
}
if (!p) {
p = d * 0.3;
}
if ((!a) || (a < Math.abs(c))) {
a = c;
_local5 = p / 4;
} else {
_local5 = (p / (Math.PI*2)) * Math.asin(c / a);
}
t = t - 1;
return((-((a * Math.pow(2, 10 * t)) * Math.sin((((t * d) - _local5) * (Math.PI*2)) / p))) + b);
}
static function easeOutElastic(t, b, c, d, a, p) {
var _local5;
if (t == 0) {
return(b);
}
t = t / d;
if (t == 1) {
return(b + c);
}
if (!p) {
p = d * 0.3;
}
if ((!a) || (a < Math.abs(c))) {
a = c;
_local5 = p / 4;
} else {
_local5 = (p / (Math.PI*2)) * Math.asin(c / a);
}
return((((a * Math.pow(2, -10 * t)) * Math.sin((((t * d) - _local5) * (Math.PI*2)) / p)) + c) + b);
}
static function easeInOutElastic(t, b, c, d, a, p) {
var _local5;
if (t == 0) {
return(b);
}
t = t / (d / 2);
if (t == 2) {
return(b + c);
}
if (!p) {
p = d * 0.45;
}
if ((!a) || (a < Math.abs(c))) {
a = c;
_local5 = p / 4;
} else {
_local5 = (p / (Math.PI*2)) * Math.asin(c / a);
}
if (t < 1) {
t = t - 1;
return((-0.5 * ((a * Math.pow(2, 10 * t)) * Math.sin((((t * d) - _local5) * (Math.PI*2)) / p))) + b);
}
t = t - 1;
return(((((a * Math.pow(2, -10 * t)) * Math.sin((((t * d) - _local5) * (Math.PI*2)) / p)) * 0.5) + c) + b);
}
static function easeOutInElastic(t, b, c, d, a, p) {
if (t < (d / 2)) {
return(easeOutElastic(t * 2, b, c / 2, d, a, p));
}
return(easeInElastic((t * 2) - d, b + (c / 2), c / 2, d, a, p));
}
static function easeInBack(t, b, c, d, s) {
if (s == undefined) {
s = 1.70158;
}
t = t / d;
return((((c * t) * t) * (((s + 1) * t) - s)) + b);
}
static function easeOutBack(t, b, c, d, s) {
if (s == undefined) {
s = 1.70158;
}
t = (t / d) - 1;
return((c * (((t * t) * (((s + 1) * t) + s)) + 1)) + b);
}
static function easeInOutBack(t, b, c, d, s) {
if (s == undefined) {
s = 1.70158;
}
t = t / (d / 2);
if (t < 1) {
s = s * 1.525;
return(((c / 2) * ((t * t) * (((s + 1) * t) - s))) + b);
}
t = t - 2;
s = s * 1.525;
return(((c / 2) * (((t * t) * (((s + 1) * t) + s)) + 2)) + b);
}
static function easeOutInBack(t, b, c, d, s) {
if (t < (d / 2)) {
return(easeOutBack(t * 2, b, c / 2, d, s));
}
return(easeInBack((t * 2) - d, b + (c / 2), c / 2, d, s));
}
static function easeInBounce(t, b, c, d) {
return((c - easeOutBounce(d - t, 0, c, d)) + b);
}
static function easeOutBounce(t, b, c, d) {
t = t / d;
if (t < 0.363636363636364) {
return((c * ((7.5625 * t) * t)) + b);
}
if (t < 0.727272727272727) {
t = t - 0.545454545454545;
return((c * (((7.5625 * t) * t) + 0.75)) + b);
}
if (t < 0.909090909090909) {
t = t - 0.818181818181818;
return((c * (((7.5625 * t) * t) + 0.9375)) + b);
}
t = t - 0.954545454545455;
return((c * (((7.5625 * t) * t) + 0.984375)) + b);
}
static function easeInOutBounce(t, b, c, d) {
if (t < (d / 2)) {
return((easeInBounce(t * 2, 0, c, d) * 0.5) + b);
}
return(((easeOutBounce((t * 2) - d, 0, c, d) * 0.5) + (c * 0.5)) + b);
}
static function easeOutInBounce(t, b, c, d) {
if (t < (d / 2)) {
return(easeOutBounce(t * 2, b, c / 2, d));
}
return(easeInBounce((t * 2) - d, b + (c / 2), c / 2, d));
}
}
Symbol 610 MovieClip [__Packages.caurina.transitions.SpecialPropertiesDefault] Frame 0
class caurina.transitions.SpecialPropertiesDefault
{
function SpecialPropertiesDefault () {
}
static function init() {
caurina.transitions.Tweener.registerSpecialProperty("_frame", _frame_get, _frame_set);
caurina.transitions.Tweener.registerSpecialProperty("_sound_volume", _sound_volume_get, _sound_volume_set);
caurina.transitions.Tweener.registerSpecialProperty("_sound_pan", _sound_pan_get, _sound_pan_set);
caurina.transitions.Tweener.registerSpecialProperty("_color_ra", _color_property_get, _color_property_set, ["ra"]);
caurina.transitions.Tweener.registerSpecialProperty("_color_rb", _color_property_get, _color_property_set, ["rb"]);
caurina.transitions.Tweener.registerSpecialProperty("_color_ga", _color_property_get, _color_property_set, ["ga"]);
caurina.transitions.Tweener.registerSpecialProperty("_color_gb", _color_property_get, _color_property_set, ["gb"]);
caurina.transitions.Tweener.registerSpecialProperty("_color_ba", _color_property_get, _color_property_set, ["ba"]);
caurina.transitions.Tweener.registerSpecialProperty("_color_bb", _color_property_get, _color_property_set, ["bb"]);
caurina.transitions.Tweener.registerSpecialProperty("_color_aa", _color_property_get, _color_property_set, ["aa"]);
caurina.transitions.Tweener.registerSpecialProperty("_color_ab", _color_property_get, _color_property_set, ["ab"]);
caurina.transitions.Tweener.registerSpecialProperty("_autoAlpha", _autoAlpha_get, _autoAlpha_set);
caurina.transitions.Tweener.registerSpecialPropertySplitter("_color", _color_splitter);
caurina.transitions.Tweener.registerSpecialPropertySplitter("_colorTransform", _colorTransform_splitter);
caurina.transitions.Tweener.registerSpecialPropertySplitter("_scale", _scale_splitter);
caurina.transitions.Tweener.registerSpecialProperty("_blur_blurX", _filter_property_get, _filter_property_set, [flash.filters.BlurFilter, "blurX"]);
caurina.transitions.Tweener.registerSpecialProperty("_blur_blurY", _filter_property_get, _filter_property_set, [flash.filters.BlurFilter, "blurY"]);
caurina.transitions.Tweener.registerSpecialProperty("_blur_quality", _filter_property_get, _filter_property_set, [flash.filters.BlurFilter, "quality"]);
caurina.transitions.Tweener.registerSpecialPropertySplitter("_filter", _filter_splitter);
caurina.transitions.Tweener.registerSpecialPropertyModifier("_bezier", _bezier_modifier, _bezier_get);
}
static function _color_splitter(p_value) {
var _local1 = new Array();
if (p_value == null) {
_local1.push({name:"_color_ra", value:100});
_local1.push({name:"_color_rb", value:0});
_local1.push({name:"_color_ga", value:100});
_local1.push({name:"_color_gb", value:0});
_local1.push({name:"_color_ba", value:100});
_local1.push({name:"_color_bb", value:0});
} else {
_local1.push({name:"_color_ra", value:0});
_local1.push({name:"_color_rb", value:caurina.transitions.AuxFunctions.numberToR(p_value)});
_local1.push({name:"_color_ga", value:0});
_local1.push({name:"_color_gb", value:caurina.transitions.AuxFunctions.numberToG(p_value)});
_local1.push({name:"_color_ba", value:0});
_local1.push({name:"_color_bb", value:caurina.transitions.AuxFunctions.numberToB(p_value)});
}
return(_local1);
}
static function _colorTransform_splitter(p_value) {
var _local2 = new Array();
if (p_value == null) {
_local2.push({name:"_color_ra", value:100});
_local2.push({name:"_color_rb", value:0});
_local2.push({name:"_color_ga", value:100});
_local2.push({name:"_color_gb", value:0});
_local2.push({name:"_color_ba", value:100});
_local2.push({name:"_color_bb", value:0});
} else {
if (p_value.ra != undefined) {
_local2.push({name:"_color_ra", value:p_value.ra});
}
if (p_value.rb != undefined) {
_local2.push({name:"_color_rb", value:p_value.rb});
}
if (p_value.ga != undefined) {
_local2.push({name:"_color_ba", value:p_value.ba});
}
if (p_value.gb != undefined) {
_local2.push({name:"_color_bb", value:p_value.bb});
}
if (p_value.ba != undefined) {
_local2.push({name:"_color_ga", value:p_value.ga});
}
if (p_value.bb != undefined) {
_local2.push({name:"_color_gb", value:p_value.gb});
}
if (p_value.aa != undefined) {
_local2.push({name:"_color_aa", value:p_value.aa});
}
if (p_value.ab != undefined) {
_local2.push({name:"_color_ab", value:p_value.ab});
}
}
return(_local2);
}
static function _scale_splitter(p_value) {
var _local1 = new Array();
_local1.push({name:"_xscale", value:p_value});
_local1.push({name:"_yscale", value:p_value});
return(_local1);
}
static function _filter_splitter(p_value) {
var _local1 = new Array();
if (p_value instanceof flash.filters.BlurFilter) {
_local1.push({name:"_blur_blurX", value:flash.filters.BlurFilter(p_value).blurX});
_local1.push({name:"_blur_blurY", value:flash.filters.BlurFilter(p_value).blurY});
_local1.push({name:"_blur_quality", value:flash.filters.BlurFilter(p_value).quality});
}
return(_local1);
}
static function _frame_get(p_obj) {
return(p_obj._currentFrame);
}
static function _frame_set(p_obj, p_value) {
p_obj.gotoAndStop(Math.round(p_value));
}
static function _sound_volume_get(p_obj) {
return(p_obj.getVolume());
}
static function _sound_volume_set(p_obj, p_value) {
p_obj.setVolume(p_value);
}
static function _sound_pan_get(p_obj) {
return(p_obj.getPan());
}
static function _sound_pan_set(p_obj, p_value) {
p_obj.setPan(p_value);
}
static function _color_property_get(p_obj, p_parameters) {
return(new Color(p_obj).getTransform()[p_parameters[0]]);
}
static function _color_property_set(p_obj, p_value, p_parameters) {
var _local1 = new Object();
_local1[p_parameters[0]] = Math.round(p_value);
new Color(p_obj).setTransform(_local1);
}
static function _autoAlpha_get(p_obj) {
return(p_obj._alpha);
}
static function _autoAlpha_set(p_obj, p_value) {
p_obj._alpha = p_value;
p_obj._visible = p_value > 0;
}
static function _filter_property_get(p_obj, p_parameters) {
var _local2 = p_obj.filters;
var _local1;
var _local4 = p_parameters[0];
var _local3 = p_parameters[1];
_local1 = 0;
while (_local1 < _local2.length) {
if (_local2[_local1] instanceof _local4) {
return(_local2[_local1][_local3]);
}
_local1++;
}
var _local5;
if (!(_local4 === flash.filters.BlurFilter)) {
} else {
_local5 = {blurX:0, blurY:0, quality:NaN};
}
return(_local5[_local3]);
}
static function _filter_property_set(p_obj, p_value, p_parameters) {
var _local2 = p_obj.filters;
var _local1;
var _local4 = p_parameters[0];
var _local3 = p_parameters[1];
_local1 = 0;
while (_local1 < _local2.length) {
if (_local2[_local1] instanceof _local4) {
_local2[_local1][_local3] = p_value;
p_obj.filters = _local2;
return(undefined);
}
_local1++;
}
if (_local2 == undefined) {
_local2 = new Array();
}
var _local7;
if (!(_local4 === flash.filters.BlurFilter)) {
} else {
_local7 = new flash.filters.BlurFilter(0, 0);
}
_local7[_local3] = p_value;
_local2.push(_local7);
p_obj.filters = _local2;
}
static function _bezier_modifier(p_obj) {
var _local7 = [];
var _local4;
if (p_obj instanceof Array) {
_local4 = p_obj;
} else {
_local4 = [p_obj];
}
var _local3;
var _local1;
var _local2 = {};
_local3 = 0;
while (_local3 < _local4.length) {
for (_local1 in _local4[_local3]) {
if (_local2[_local1] == undefined) {
_local2[_local1] = [];
}
_local2[_local1].push(_local4[_local3][_local1]);
}
_local3++;
}
for (_local1 in _local2) {
_local7.push({name:_local1, parameters:_local2[_local1]});
}
return(_local7);
}
static function _bezier_get(b, e, t, p) {
if (p.length == 1) {
return(b + (t * (((2 * (1 - t)) * (p[0] - b)) + (t * (e - b)))));
}
var _local2 = Math.floor(t * p.length);
var _local5 = (t - (_local2 * (1 / p.length))) * p.length;
var _local3;
var _local6;
if (_local2 == 0) {
_local3 = b;
_local6 = (p[0] + p[1]) / 2;
} else if (_local2 == (p.length - 1)) {
_local3 = (p[_local2 - 1] + p[_local2]) / 2;
_local6 = e;
} else {
_local3 = (p[_local2 - 1] + p[_local2]) / 2;
_local6 = (p[_local2] + p[_local2 + 1]) / 2;
}
return(_local3 + (_local5 * (((2 * (1 - _local5)) * (p[_local2] - _local3)) + (_local5 * (_local6 - _local3)))));
}
}
Symbol 611 MovieClip [__Packages.caurina.transitions.SpecialProperty] Frame 0
class caurina.transitions.SpecialProperty
{
var parameters;
function SpecialProperty (p_getFunction, p_setFunction, p_parameters) {
getValue = p_getFunction;
setValue = p_setFunction;
parameters = p_parameters;
}
function getValue(p_obj, p_parameters) {
return(null);
}
function setValue(p_obj, p_value, p_parameters) {
}
function toString() {
var _local2 = "";
_local2 = _local2 + "[SpecialProperty ";
_local2 = _local2 + ("getValue:" + getValue.toString());
_local2 = _local2 + ", ";
_local2 = _local2 + ("setValue:" + setValue.toString());
_local2 = _local2 + ", ";
_local2 = _local2 + ("parameters:" + parameters.toString());
_local2 = _local2 + "]";
return(_local2);
}
}
Symbol 612 MovieClip [__Packages.caurina.transitions.SpecialPropertyModifier] Frame 0
class caurina.transitions.SpecialPropertyModifier
{
var modifyValues, getValue;
function SpecialPropertyModifier (p_modifyFunction, p_getFunction) {
modifyValues = p_modifyFunction;
getValue = p_getFunction;
}
function toString() {
var _local2 = "";
_local2 = _local2 + "[SpecialPropertyModifier ";
_local2 = _local2 + ("modifyValues:" + modifyValues.toString());
_local2 = _local2 + ", ";
_local2 = _local2 + ("getValue:" + getValue.toString());
_local2 = _local2 + "]";
return(_local2);
}
}
Symbol 613 MovieClip [__Packages.caurina.transitions.SpecialPropertySplitter] Frame 0
class caurina.transitions.SpecialPropertySplitter
{
function SpecialPropertySplitter (p_splitFunction) {
splitValues = p_splitFunction;
}
function splitValues(p_value) {
return([]);
}
function toString() {
var _local2 = "";
_local2 = _local2 + "[SpecialPropertySplitter ";
_local2 = _local2 + ("splitValues:" + splitValues.toString());
_local2 = _local2 + "]";
return(_local2);
}
}
Symbol 614 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_sSoundName, m_bSoundPlayed, m_bFreezed, m_freezeTime, m_mcTarget, m_mcEnemy, m_sndSwing;
function Enemy (x, y, left, right, refScene, refHero, sId, sSoundName) {
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_sSoundName = sSoundName;
m_bSoundPlayed = false;
m_bFreezed = false;
m_freezeTime = FREEZE_TIME;
m_mcTarget = m_scene.m_mcObjects0.mc;
var _local2 = m_mcTarget.getNextHighestDepth();
m_mcEnemy = m_mcTarget.attachMovie(sId, "enemy" + _local2, _local2);
draw();
}
function remove(Void) {
m_sndSwing.stop();
delete m_sndSwing;
broadcastMessage("removeActiveObj", this);
m_mcEnemy.removeMovieClip();
}
function addListener() {
}
function removeListener() {
}
function broadcastMessage(sMsg) {
}
function step(Void) {
if (m_bFreezed) {
if ((m_freezeTime--) < 0) {
m_mcEnemy.gotoAndStop("normal");
m_bFreezed = false;
} else if (m_freezeTime == 20) {
Sounds.playSound("sndPowerUp");
}
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 < 4000) && (m_mcEnemy.hitTest(m_hero.m_mcHitArea))) {
if (!m_hero.isProtected()) {
var _local3;
if (_local2 < 3) {
_local3 = "bottom";
} else {
_local3 = "top";
}
broadcastMessage("onGetHurt", _local3);
}
}
if (m_mcEnemy.mcAnim._currentframe == 1) {
m_sndSwing = Sounds.playSound(m_sSoundName);
}
}
}
function draw(Void) {
m_mcEnemy._x = m_x;
m_mcEnemy._y = m_y;
}
function freeze(Void) {
if (!m_bFreezed) {
m_bFreezed = true;
m_freezeTime = FREEZE_TIME;
m_mcEnemy.gotoAndStop("freezed");
Sounds.playSound("sndPowerDown");
m_bSoundPlayed = false;
Sounds.stopSound(m_sSoundName);
}
}
static var FREEZE_TIME = 90;
}
Symbol 615 MovieClip [__Packages.Laser] Frame 0
class Laser
{
var m_sSoundName, m_bIsPlaying, m_mcTarget, m_scene, m_hero, m_sType, m_gridX, m_gridY, m_x, m_y, m_mcClip, m_aHP, m_sndSwing;
function Laser (x, y, sType, refScene, refHero, sSoundName) {
AsBroadcaster.initialize(this);
m_sSoundName = sSoundName;
m_bIsPlaying = false;
m_mcTarget = ((sType == "laserRot") ? (refScene.m_mcObjects1.mc) : (refScene.m_mcObjects0.mc));
m_scene = refScene;
m_hero = refHero;
m_sType = sType;
m_gridX = x;
m_gridY = y;
m_x = (x + 0.5) * Game.TILE_SIZE;
m_y = (y + 0.5) * Game.TILE_SIZE;
var _local4 = m_mcTarget.getNextHighestDepth();
m_mcClip = m_mcTarget.attachMovie(sType, "laser" + _local4, _local4, {_x:m_x, _y:m_y});
m_aHP = new Array();
if (m_sType == "laserRot") {
var _local2 = 0;
while (_local2 < 10) {
m_aHP.push(m_mcClip.mcLaser.mcBeam["p" + _local2]);
_local2++;
}
} else {
m_aHP.push(m_mcClip.p0);
m_aHP.push(m_mcClip.p1);
m_aHP.push(m_mcClip.p2);
_local4 = refScene.m_mcObjects1.mc.getNextHighestDepth();
refScene.m_mcObjects1.mc.attachMovie("laserFront", "laserFront" + _local4, _local4, {_x:m_x, _y:m_y});
}
}
function remove(Void) {
broadcastMessage("removeActiveObj", this);
m_mcClip.removeMovieClip();
}
function addListener() {
}
function removeListener() {
}
function broadcastMessage(sMsg) {
}
function step(Void) {
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)) {
if (m_sType != "laserRot") {
var _local6 = m_mcClip._currentframe;
if (((_local6 >= 1) && (_local6 <= 30)) && (!m_bIsPlaying)) {
m_bIsPlaying = true;
m_sndSwing = Sounds.playSound(m_sSoundName);
} else if (_local6 > 30) {
m_bIsPlaying = false;
}
}
}
var _local5 = m_aHP.length;
var _local3 = new flash.geom.Point(m_aHP[0]._x, m_aHP[0]._y);
m_aHP[0]._parent.localToGlobal(_local3);
m_mcTarget.globalToLocal(_local3);
var _local4 = new flash.geom.Point(m_aHP[_local5 - 1]._x, m_aHP[_local5 - 1]._y);
m_aHP[_local5 - 1]._parent.localToGlobal(_local4);
m_mcTarget.globalToLocal(_local4);
var _local10 = Math.floor(_local3.x / Game.TILE_SIZE);
var _local8 = Math.floor(_local3.y / Game.TILE_SIZE);
var _local9 = Math.floor(_local4.x / Game.TILE_SIZE);
var _local7 = Math.floor(_local4.y / Game.TILE_SIZE);
if (((((_local10 >= m_scene.m_gridLeft) && (_local10 < (m_scene.m_gridRight + 1))) && (_local8 >= m_scene.m_gridTop)) && (_local8 < (m_scene.m_gridBottom + 1))) || ((((_local9 >= m_scene.m_gridLeft) && (_local9 < (m_scene.m_gridRight + 1))) && (_local7 >= m_scene.m_gridTop)) && (_local7 < (m_scene.m_gridBottom + 1)))) {
if (m_hero.isProtected() || (m_hero.m_bExit)) {
return(undefined);
}
var _local2 = 0;
for ( ; _local2 < _local5 ; _local2++) {
_local3 = new flash.geom.Point(m_aHP[_local2]._x, m_aHP[_local2]._y);
if (m_sType == "laserRot") {
_local4.y = _local3.y + m_aHP[0]._parent._y;
if (_local4.y > 170) {
continue;
}
} else {
m_aHP[_local2]._parent.localToGlobal(_local3);
if (m_hero.m_mcAnims.hitTest(_local3.x, _local3.y, true)) {
broadcastMessage("onGetHurt", "bottom");
break;
}
}
}
}
}
function draw(Void) {
if (m_mcClip._currentframe == m_mcClip._totalframes) {
m_mcClip.gotoAndStop(1);
} else {
m_mcClip.nextFrame();
}
if (m_sType == "laserRot") {
if (m_mcClip.mcLaser._currentframe == m_mcClip.mcLaser._totalframes) {
m_mcClip.mcLaser.gotoAndStop(1);
} else {
m_mcClip.mcLaser.nextFrame();
}
}
}
function getGridPos() {
return({x:m_gridX, y:m_gridY});
}
}
Symbol 616 MovieClip [__Packages.Exit] Frame 0
class Exit
{
var m_mcTarget, m_scene, m_gridX, m_gridY, m_x, m_y, m_bOpened, m_hero, m_mcClip;
function Exit (x, y, refScene, hero) {
AsBroadcaster.initialize(this);
m_mcTarget = refScene.m_mcObjects0.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_bOpened = false;
m_hero = hero;
var _local2 = m_mcTarget.getNextHighestDepth();
m_mcClip = m_mcTarget.attachMovie("exit", "exit" + _local2, _local2, {_x:m_x, _y:m_y - 36});
m_mcClip.gotoAndStop(1);
m_mcClip.onOpen = EventDelegate.create(this, onOpen);
m_mcClip.onClose = EventDelegate.create(this, onClose);
m_mcClip.onEnd = EventDelegate.create(this, onEnd);
}
function addListener() {
}
function removeListener() {
}
function broadcastMessage(sMsg) {
}
function step(Void) {
if (!Game.s_instance.m_bToExit) {
return(undefined);
}
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))) {
var _local2 = m_hero.getPos();
var _local4 = _local2.x - m_x;
var _local3 = _local2.y - m_y;
if (((Math.abs(_local4) < 15) && (Math.abs(_local3) < 1)) && (!m_bOpened)) {
m_bOpened = true;
m_mcClip.gotoAndPlay("open");
m_hero.disableKeys();
m_hero.m_bExit = true;
m_hero.m_vel = 0;
m_hero.m_velX = 0;
m_hero.m_velY = 0;
}
}
}
function draw(Void) {
}
function onOpen(Void) {
var _local3 = m_hero.getPos();
var _local2 = _local3.x - m_x;
m_hero.createCopy(m_mcClip.mcHero, _local2, 36);
}
function onClose() {
m_hero.__set__bGoIntoHole(true);
}
function onEnd(Void) {
broadcastMessage("onLevelComplete");
}
}
Symbol 617 MovieClip [__Packages.Item] Frame 0
class Item
{
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_mcItem;
function Item (sType, x, y, scene, hero) {
AsBroadcaster.initialize(this);
m_sType = sType;
m_scene = scene;
m_mcTarget = m_scene.m_mcObjects0.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;
var _local2 = m_mcTarget.getNextHighestDepth();
m_mcItem = m_mcTarget.attachMovie(m_sType, "item" + _local2, _local2, {_x:m_x, _y:m_y});
}
function remove(Void) {
broadcastMessage("removeActiveObj", this);
m_mcItem.removeMovieClip();
}
function addListener() {
}
function removeListener() {
}
function broadcastMessage(sMsg) {
}
function step(Void) {
var _local2 = new flash.geom.Point(m_x, m_y);
m_mcTarget.localToGlobal(_local2);
if (m_hero.m_mcHero.hitTest(_local2.x, _local2.y, false)) {
broadcastMessage("onCollectItem", this, m_gridX, m_gridY);
}
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();
}
}
function draw(Void) {
m_mcItem._x = m_x;
m_mcItem._y = m_y;
}
function getGridPos() {
return({x:m_gridX, y:m_gridY});
}
static var LIFE_TIME = 200;
}
Symbol 618 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 619 MovieClip [__Packages.Shot] Frame 0
class Shot
{
var m_x, m_y, m_dir, m_scene, m_aEnemies, m_bToRemove, m_mcTarget, m_bmpGround, m_mcClip;
function Shot (x, y, dir, scene, aEnemies) {
AsBroadcaster.initialize(this);
m_x = x;
m_y = y;
m_dir = dir;
m_scene = scene;
m_aEnemies = aEnemies;
m_bToRemove = false;
m_mcTarget = m_scene.m_mcObjects1.mc;
m_bmpGround = m_scene.m_bmpBuffer1;
var _local2 = m_mcTarget.getNextHighestDepth();
m_mcClip = m_mcTarget.attachMovie("shot", "shot" + _local2, _local2, {_x:m_x, _y:m_y, _xscale:100 * dir});
}
function remove(Void) {
broadcastMessage("removeActiveObj", this);
m_mcClip.removeMovieClip();
}
function addListener() {
}
function removeListener() {
}
function broadcastMessage(sMsg) {
}
function step(Void) {
if (m_bToRemove) {
remove();
}
m_x = m_x + (m_dir * VEL);
var _local6 = Math.floor(m_x / Game.TILE_SIZE);
if ((_local6 < m_scene.m_gridLeft) || (_local6 > m_scene.m_gridRight)) {
remove();
}
var _local4 = new flash.geom.Point(m_x, m_y);
m_mcTarget.localToGlobal(_local4);
var _local5 = m_aEnemies.length;
var _local2 = 0;
while (_local2 < _local5) {
var _local3 = Enemy(m_aEnemies[_local2]);
if (_local3.m_mcEnemy.hitTest(_local4.x, _local4.y, false)) {
_local3.freeze();
remove();
}
_local2++;
}
_local4.x = _local4.x + m_scene.m_dx;
_local4.y = _local4.y + m_scene.m_dy;
if (m_bmpGround.hitTest(new flash.geom.Point(0, 0), 50, _local4)) {
remove();
m_bToRemove = true;
}
}
function draw(Void) {
m_mcClip._x = m_x;
}
static var VEL = 20;
}
Symbol 620 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_mcObjects1.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) {
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 {
broadcastMessage("removeActiveObj", this);
}
}
function draw(Void) {
}
function getGridPos() {
return({x:m_gridX, y:m_gridY});
}
}
Symbol 621 MovieClip [__Packages.Thumper] Frame 0
class Thumper
{
var m_mcTarget, m_scene, m_hero, m_gridX, m_gridY, m_x, m_y, m_mcClip, m_mcHP, m_sSoundName, m_bSoundPlayed;
function Thumper (x, y, refScene, refHero) {
AsBroadcaster.initialize(this);
m_mcTarget = refScene.m_mcObjects1.mc;
m_scene = refScene;
m_hero = refHero;
m_gridX = x;
m_gridY = y;
m_x = (x + 0.5) * Game.TILE_SIZE;
m_y = (y + 0.5) * Game.TILE_SIZE;
var _local2 = m_mcTarget.getNextHighestDepth();
m_mcClip = m_mcTarget.attachMovie("thumper", "thumper" + _local2, _local2, {_x:m_x, _y:m_y});
m_mcHP = m_mcClip.mcSpikes.mcHP;
m_sSoundName = "sndSpring";
m_bSoundPlayed = false;
}
function remove(Void) {
m_mcClip.removeMovieClip();
}
function addListener() {
}
function removeListener() {
}
function broadcastMessage(sMsg) {
}
function step(Void) {
if ((((m_gridX >= m_scene.m_gridLeft) && (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 _local2 = new flash.geom.Point(m_mcHP._x, m_mcHP._y);
m_mcClip.mcSpikes.localToGlobal(_local2);
m_mcTarget.globalToLocal(_local2);
var _local5 = m_hero.getPos();
var _local4 = _local5.x - _local2.x;
var _local3 = _local5.y - (_local2.y + 30);
var _local6 = (_local4 * _local4) + (_local3 * _local3);
if (_local6 < 1000) {
broadcastMessage("onGetHurt", "bottom");
}
} else {
broadcastMessage("removeActiveObj", this);
}
}
function draw(Void) {
if (m_mcClip._currentframe == m_mcClip._totalframes) {
m_mcClip.gotoAndStop(1);
} else {
m_mcClip.nextFrame();
}
}
function getGridPos() {
return({x:m_gridX, y:m_gridY});
}
}
Symbol 622 MovieClip [__Packages.Front] Frame 0
class Front
{
var m_mcFront, m_keyListener;
function Front (mcFront, bNoAnim) {
m_mcFront = mcFront;
m_mcFront.initFront = EventDelegate.create(this, initFront);
m_mcFront.initMission = EventDelegate.create(this, initMission);
m_mcFront.initInstr = EventDelegate.create(this, initInstructions);
m_mcFront.playGame = EventDelegate.create(this, playGame);
Sounds.setVolume("sndMusic", 100);
Sounds.playSound("sndMusic", 99999);
}
function initFront(Void) {
m_mcFront.btnPlay.onRelease = EventDelegate.create(this, onReleasePlayFront);
m_mcFront.btnInstructions.onRelease = EventDelegate.create(this, onReleaseInstructions);
m_mcFront.btnPlay.onPress = EventDelegate.create(Sounds, Sounds.playSound, "sndButton");
m_mcFront.btnInstructions.onPress = EventDelegate.create(Sounds, Sounds.playSound, "sndButton");
m_keyListener = new Object();
m_keyListener.onKeyDown = EventDelegate.create(this, onKeyDownFront);
Key.addListener(m_keyListener);
Sounds.initButton(m_mcFront.mcSoundBtn);
}
function initMission() {
m_mcFront.btnPlay.onRelease = EventDelegate.create(this, onReleasePlayMission);
m_mcFront.btnPlay.onPress = null;
m_mcFront.btnPlay.onPress = EventDelegate.create(Sounds, Sounds.playSound, "sndButton");
m_keyListener = new Object();
m_keyListener.onKeyDown = EventDelegate.create(this, onKeyDownMission);
Key.addListener(m_keyListener);
}
function initInstructions(page) {
var _local3 = this;
if (page == 0) {
m_mcFront.btnNext.onRelease = EventDelegate.create(this, onReleaseNextInstr);
m_mcFront.btnNext.onPress = EventDelegate.create(Sounds, Sounds.playSound, "sndButton");
} else if (page == 1) {
m_mcFront.btnBack.onRelease = EventDelegate.create(this, onReleaseBackInstr);
m_mcFront.btnBack.onPress = EventDelegate.create(Sounds, Sounds.playSound, "sndButton");
}
m_mcFront.btnPlay.onRelease = EventDelegate.create(this, onReleasePlayInstr);
m_mcFront.btnPlay.onPress = EventDelegate.create(Sounds, Sounds.playSound, "sndButton");
m_keyListener = new Object();
m_keyListener.onKeyDown = EventDelegate.create(this, onKeyDownInstr);
Key.addListener(m_keyListener);
}
function onReleaseNextInstr() {
Key.removeListener(m_keyListener);
m_mcFront.gotoAndStop("instructions1");
}
function onReleaseBackInstr() {
Key.removeListener(m_keyListener);
m_mcFront.gotoAndStop("instructions");
}
function playGame(Void) {
Panik.s_instance.startGame();
}
function onReleasePlayFront(Void) {
Key.removeListener(m_keyListener);
m_mcFront.gotoAndStop("mission");
}
function onReleasePlayMission(Void) {
Key.removeListener(m_keyListener);
m_mcFront.gotoAndPlay("out");
}
function onReleasePlayInstr(Void) {
Key.removeListener(m_keyListener);
playGame();
}
function onReleaseInstructions(Void) {
m_mcFront.gotoAndStop("instructions");
}
function onKeyDownFront(Void) {
if (Key.isDown(32)) {
onReleasePlayFront();
}
}
function onKeyDownMission(Void) {
if (Key.isDown(32)) {
onReleasePlayMission();
}
}
function onKeyDownInstr(Void) {
if (Key.isDown(32)) {
onReleasePlayInstr();
}
}
}
Symbol 90 MovieClip Frame 21
stop();
Symbol 141 MovieClip Frame 8
stop();
Symbol 141 MovieClip Frame 15
stop();
Symbol 149 MovieClip Frame 15
onShotAnimEnd();
Symbol 149 MovieClip Frame 16
gotoAndPlay (1);
Symbol 161 MovieClip Frame 11
onShotAnimEnd();
Symbol 168 MovieClip Frame 8
onShotAnimEnd();
Symbol 181 MovieClip Frame 10
stop();
onShotAnimEnd();
Symbol 181 MovieClip Frame 20
stop();
onShotAnimEnd();
Symbol 189 MovieClip Frame 5
stop();
Symbol 194 MovieClip Frame 1
stop();
Symbol 207 MovieClip [enemy0] Frame 1
stop();
Symbol 220 MovieClip [platform00] Frame 1
stop();
setState(true);
Symbol 220 MovieClip [platform00] Frame 21
setState(false);
Symbol 221 MovieClip [platform20] Frame 1
stop();
setState(true);
Symbol 221 MovieClip [platform20] Frame 21
setState(false);
Symbol 223 MovieClip [platform10] Frame 1
stop();
setState(true);
Symbol 223 MovieClip [platform10] Frame 21
setState(false);
Symbol 249 MovieClip [laser] Frame 1
stop();
Symbol 258 MovieClip Frame 1
stop();
Symbol 259 MovieClip [laserRot] Frame 1
stop();
Symbol 315 MovieClip [exit] Frame 11
onOpen();
Symbol 315 MovieClip [exit] Frame 37
onClose();
Symbol 315 MovieClip [exit] Frame 70
stop();
onEnd();
Symbol 346 MovieClip [enemy1] Frame 1
stop();
Symbol 402 Button
on (release) {
getURL ("http://uc.tv", "_blank");
_root.kvClick(349);
}
Symbol 412 MovieClip Frame 1
stop();
Symbol 475 MovieClip Frame 1
stop();
initFront();
Symbol 475 MovieClip Frame 30
initMission();
Symbol 475 MovieClip Frame 50
playGame();
Symbol 475 MovieClip Frame 59
initInstr(0);
Symbol 475 MovieClip Frame 69
initInstr(1);
Symbol 493 MovieClip Frame 1
stop();
Symbol 507 MovieClip Frame 1
stop();
Symbol 508 MovieClip Frame 1
stop();
Symbol 520 MovieClip Frame 1
stop();
Symbol 521 MovieClip Frame 1
stop();
Symbol 582 MovieClip Frame 98
stop();
Symbol 589 MovieClip Frame 1
stop();
Symbol 592 MovieClip Frame 2
stop();