Frame 5
_quality = "high";
Stage.showMenu = false;
Stage.scaleMode = "noScale";
fscommand ("trapallkeys", "true");
System.security.loadPolicyFile("http://www.gimme5games.com/crossdomain.xml");
Frame 6
Instance of Symbol 13 MovieClip "container" in Frame 6
onClipEvent (load) {
function createHeart() {
var _local3 = this.getNextHighestDepth();
var _local2 = this.attachMovie("flyingHeart", "flyingHeart" + _local3, _local3);
_local2._x = int(Math.random() * 600) - 40;
_local2._y = int(Math.random() * 560);
_local2.speed = int(Math.random() * 4) + 2;
activeHearts.push(_local2);
}
function init() {
var _local2 = -1;
while (_local2++ , _local2 != 10) {
createHeart();
}
this.onEnterFrame = handleHearts;
}
function handleHearts() {
var _local2 = -1;
var _local3 = activeHearts.length;
var _local1;
while (_local2++ , _local2 != _local3) {
_local1 = activeHearts[_local2];
_local1._y = _local1._y - _local1.speed;
if (_local1._y < (-_local1._height)) {
_local1._x = int(Math.random() * 600) - 40;
_local1._y = 560;
_local1.speed = int(Math.random() * 4) + 2;
}
}
}
var activeHearts = new Array();
init();
}
Frame 8
MochiAd.showPreGameAd({id:"74c536f3ca5e34d1", res:"640x480", background:16777215, color:16697280, outline:16603720, no_bg:true});
Frame 9
function __com_mochibot__(swfid, mc, lv, trk) {
var x;
var g;
var s;
var fv;
var sb;
var u;
var res;
var mb;
var mbc;
mb = "__mochibot__";
mbc = "mochibot.com";
g = (_global ? (_global) : (_level0._root));
if (g[mb + swfid]) {
return(g[mb + swfid]);
}
s = System.security;
x = mc._root.getSWFVersion;
fv = (x ? (mc.getSWFVersion()) : ((_global ? 6 : 5)));
if (!s) {
s = {};
}
sb = s.sandboxType;
if (sb == "localWithFile") {
return(null);
}
x = s.allowDomain;
if (x) {
s.allowDomain(mbc);
}
x = s.allowInsecureDomain;
if (x) {
s.allowInsecureDomain(mbc);
}
u = (((((((((((("http://" + mbc) + "/my/core.swf?mv=7&fv=") + fv) + "&v=") + escape(getVersion())) + "&swfid=") + escape(swfid)) + "&l=") + lv) + "&f=") + mc) + (sb ? ("&sb=" + sb) : "")) + (trk ? "&t=1" : "");
lv = ((fv > 6) ? (mc.getNextHighestDepth()) : ((g[mb + "level"] ? (g[mb + "level"] + 1) : (lv))));
g[mb + "level"] = lv;
if (fv == 5) {
res = "_level" + lv;
if (!eval (res)) {
loadMovieNum (u, lv);
}
} else {
res = mc.createEmptyMovieClip(mb + swfid, lv);
res.loadMovie(u);
}
return(res);
}
__com_mochibot__("689ab646", this, 10301, true);
Instance of Symbol 615 MovieClip in Frame 9
onClipEvent (load) {
_visible = false;
}
Frame 11
if (loadingbar.percent >= 100) {
gotoAndPlay(this._currentframe + 1);
} else {
gotoAndPlay(this._currentframe - 1);
}
Frame 12
stop();
Instance of Symbol 639 MovieClip [Splash] in Frame 12
//component parameters
onClipEvent (construct) {
frameAfterCompletion = 13;
enabled = true;
visible = true;
minHeight = 0;
minWidth = 0;
}
Frame 13
_quality = "low";
Stage.scaleMode = "noScale";
stop();
var game = new Main();
game.startViaFlash(this);
Instance of Symbol 30 MovieClip "coverAll" in Frame 13
onClipEvent (load) {
this.useHandCursor = false;
this.onPress = function () {
};
}
Instance of Symbol 645 MovieClip "loadingText" in Frame 13
onClipEvent (load) {
_visible = false;
}
Instance of Symbol 665 MovieClip "pauseCover" in Frame 13
onClipEvent (load) {
_visible = false;
}
Instance of Symbol 30 MovieClip "hitAreaMC" in Frame 13
onClipEvent (load) {
_visible = false;
}
Symbol 850 MovieClip [__Packages.MochiAd] Frame 0
class MochiAd
{
function MochiAd () {
}
static function getVersion() {
return("2.1");
}
static function showPreGameAd(options) {
var _local27 = {clip:_root, ad_timeout:3000, fadeout_time:250, regpt:"o", method:"showPreloaderAd", color:16747008, background:16777161, outline:13994812, ad_started:function () {
this.clip.stop();
}, ad_finished:function () {
this.clip.play();
}};
options = _parseOptions(options, _local27);
var clip = options.clip;
var _local23 = 11000;
var _local26 = options.ad_timeout;
delete options.ad_timeout;
var fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!load(options)) {
options.ad_finished();
return(undefined);
}
options.ad_started();
var mc = clip._mochiad;
mc.onUnload = function () {
options.ad_finished();
};
var _local14 = _getRes(options);
var _local4 = _local14[0];
var _local13 = _local14[1];
mc._x = _local4 * 0.5;
mc._y = _local13 * 0.5;
var chk = mc.createEmptyMovieClip("_mochiad_wait", 3);
chk._x = _local4 * -0.5;
chk._y = _local13 * -0.5;
var _local7 = chk.createEmptyMovieClip("_mochiad_bar", 4);
_local7._x = 10;
_local7._y = _local13 - 20;
var _local22 = options.color;
delete options.color;
var _local19 = options.background;
delete options.background;
var _local24 = options.outline;
delete options.outline;
var _local5 = _local7.createEmptyMovieClip("_outline", 1);
_local5.beginFill(_local19);
_local5.moveTo(0, 0);
_local5.lineTo(_local4 - 20, 0);
_local5.lineTo(_local4 - 20, 10);
_local5.lineTo(0, 10);
_local5.lineTo(0, 0);
_local5.endFill();
var _local3 = _local7.createEmptyMovieClip("_inside", 2);
_local3.beginFill(_local22);
_local3.moveTo(0, 0);
_local3.lineTo(_local4 - 20, 0);
_local3.lineTo(_local4 - 20, 10);
_local3.lineTo(0, 10);
_local3.lineTo(0, 0);
_local3.endFill();
_local3._xscale = 0;
var _local6 = _local7.createEmptyMovieClip("_outline", 3);
_local6.lineStyle(0, _local24, 100);
_local6.moveTo(0, 0);
_local6.lineTo(_local4 - 20, 0);
_local6.lineTo(_local4 - 20, 10);
_local6.lineTo(0, 10);
_local6.lineTo(0, 0);
chk.ad_msec = _local23;
chk.ad_timeout = _local26;
chk.started = getTimer();
chk.showing = false;
chk.last_pcnt = 0;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function () {
var _local2 = 100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time));
if (_local2 > 0) {
this._parent._alpha = _local2;
} else {
var _local3 = this._parent._parent;
MochiAd.unload(_local3);
delete this.onEnterFrame;
}
};
mc.lc.adLoaded = function (width, height) {
};
mc.lc.adjustProgress = function (msec) {
var _local2 = this.mc._mochiad_wait;
_local2.server_control = true;
_local2.started = getTimer();
_local2.ad_msec = msec;
};
chk.onEnterFrame = function () {
var _local6 = this._parent._parent;
var _local12 = this._parent._mochiad_ctr;
var _local5 = getTimer() - this.started;
var _local3 = false;
var _local4 = _local6.getBytesTotal();
var _local8 = _local6.getBytesLoaded();
var _local10 = (100 * _local8) / _local4;
var _local11 = (100 * _local5) / chk.ad_msec;
var _local9 = this._mochiad_bar._inside;
var _local2 = Math.min(100, Math.min(_local10 || 0, _local11));
_local2 = Math.max(this.last_pcnt, _local2);
this.last_pcnt = _local2;
_local9._xscale = _local2;
if (!chk.showing) {
var _local7 = _local12.getBytesTotal();
if ((_local7 > 0) || (typeof(_local7) == "undefined")) {
chk.showing = true;
chk.started = getTimer();
} else if (_local5 > chk.ad_timeout) {
_local3 = true;
}
}
if (_local5 > chk.ad_msec) {
_local3 = true;
}
if (((_local4 > 0) && (_local8 >= _local4)) && (_local3)) {
if (this.server_control) {
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = chk.fadeFunction;
}
}
};
}
static function showInterLevelAd(options) {
var _local13 = {clip:_root, ad_timeout:2000, fadeout_time:250, regpt:"o", method:"showTimedAd", ad_started:function () {
this.clip.stop();
}, ad_finished:function () {
this.clip.play();
}};
options = _parseOptions(options, _local13);
var clip = options.clip;
var _local10 = 11000;
var _local12 = options.ad_timeout;
delete options.ad_timeout;
var fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!load(options)) {
options.ad_finished();
return(undefined);
}
options.ad_started();
var mc = clip._mochiad;
mc.onUnload = function () {
options.ad_finished();
};
var _local5 = _getRes(options);
var _local14 = _local5[0];
var _local11 = _local5[1];
mc._x = _local14 * 0.5;
mc._y = _local11 * 0.5;
var chk = mc.createEmptyMovieClip("_mochiad_wait", 3);
chk.ad_msec = _local10;
chk.ad_timeout = _local12;
chk.started = getTimer();
chk.showing = false;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function () {
var _local2 = 100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time));
if (_local2 > 0) {
this._parent._alpha = _local2;
} else {
var _local3 = this._parent._parent;
MochiAd.unload(_local3);
delete this.onEnterFrame;
}
};
mc.lc.adLoaded = function (width, height) {
};
mc.lc.adjustProgress = function (msec) {
var _local2 = this.mc._mochiad_wait;
_local2.server_control = true;
_local2.started = getTimer();
_local2.ad_msec = msec - 250;
};
chk.onEnterFrame = function () {
var _local5 = this._parent._mochiad_ctr;
var _local4 = getTimer() - this.started;
var _local2 = false;
if (!chk.showing) {
var _local3 = _local5.getBytesTotal();
if ((_local3 > 0) || (typeof(_local3) == "undefined")) {
chk.showing = true;
chk.started = getTimer();
} else if (_local4 > chk.ad_timeout) {
_local2 = true;
}
}
if (_local4 > chk.ad_msec) {
_local2 = true;
}
if (_local2) {
if (this.server_control) {
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = this.fadeFunction;
}
}
};
}
static function showTimedAd(options) {
showInterLevelAd(options);
}
static function showPreloaderAd(options) {
showPreGameAd(options);
}
static function _allowDomains(server) {
var _local1 = server.split("/")[2].split(":")[0];
if (System.security) {
if (System.security.allowDomain) {
System.security.allowDomain("*");
System.security.allowDomain(_local1);
}
if (System.security.allowInsecureDomain) {
System.security.allowInsecureDomain("*");
System.security.allowInsecureDomain(_local1);
}
}
return(_local1);
}
static function _loadCommunicator(options) {
var _local26 = {clip:_root, com_server:"http://x.mochiads.com/com/1/", method:"loadCommunicator", depth:10337, id:"_UNKNOWN_"};
options = _parseOptions(options, _local26);
options.swfv = options.clip.getSWFVersion() || 6;
options.mav = getVersion();
var _local18 = options.clip;
var _local20 = "_mochiad_com_" + options.id;
if (!_isNetworkAvailable()) {
return(null);
}
if (_local18[_local20]) {
return(_local18[_local20].lc);
}
var _local21 = options.com_server + options.id;
_allowDomains(_local21);
delete options.id;
delete options.com_server;
var _local25 = options.depth;
delete options.depth;
var _local17 = _local18.createEmptyMovieClip(_local20, _local25);
var _local11 = _local17.createEmptyMovieClip("_mochiad_com", 1);
for (var _local15 in options) {
_local11[_local15] = options[_local15];
}
var _local6 = new LocalConnection();
var _local16 = ["", Math.floor(new Date().getTime()), random(999999)].join("_");
_local6.mc = _local17;
_local6.name = _local16;
_local6.allowDomain = function (d) {
return(true);
};
_local6.allowInsecureDomain = _local6.allowDomain;
_local6.connect(_local16);
_local17.lc = _local6;
_local11.lc = _local16;
_local6._id = 0;
_local6._queue = [];
_local6.rpcResult = function (cb_arg) {
var _local8 = parseInt(cb_arg);
var _local4 = this._callbacks[_local8];
if (!_local4) {
return(undefined);
}
delete this._callbacks[_local8];
var _local5 = [];
var _local3 = 2;
while (_local3 < _local4.length) {
_local5.push(_local4[_local3]);
_local3++;
}
_local3 = 1;
while (_local3 < arguments.length) {
_local5.push(arguments[_local3]);
_local3++;
}
var _local6 = _local4[1];
var _local7 = _local4[0];
if (_local7 && (typeof(_local6) == "string")) {
_local6 = _local7[_local6];
}
if (_local6) {
_local6.apply(_local7, _local5);
}
};
_local6._didConnect = function (endpoint) {
this._endpoint = endpoint;
var _local4 = this._queue;
delete this._queue;
var _local5 = this.doSend;
var _local2 = 0;
while (_local2 < _local4.length) {
var _local3 = _local4[_local2];
_local5.apply(this, _local3);
_local2++;
}
};
_local6.doSend = function (args, cbobj, cbfn) {
if (this._endpoint == null) {
var _local4 = [];
var _local3 = 0;
while (_local3 < arguments.length) {
_local4.push(arguments[_local3]);
_local3++;
}
this._queue.push(_local4);
return(undefined);
}
this._id = this._id + 1;
var _local5 = this._id;
if ((cbfn === undefined) || (cbfn === null)) {
cbfn = cbobj;
}
this._callbacks[_local5] = [cbobj, cbfn];
var _local7 = new LocalConnection();
var _local9 = _local7.send(this._endpoint, "rpc", _local5, args);
};
_local6._callbacks = {};
_local6._callbacks[0] = [_local6, "_didConnect"];
_local11.st = getTimer();
_local11.loadMovie(_local21 + ".swf", "POST");
return(_local6);
}
static function fetchHighScores(options, callbackObj, callbackMethod) {
var _local1 = _loadCommunicator({id:options.id});
if (!_local1) {
return(false);
}
var _local4 = ["fetchHighScores", options];
_local1.doSend(["fetchHighScores", options], callbackObj, callbackMethod);
return(true);
}
static function sendHighScore(options, callbackObj, callbackMethod) {
var _local1 = _loadCommunicator({id:options.id});
if (!_local1) {
return(false);
}
var _local4 = ["sendHighScore", options];
_local1.doSend(["sendHighScore", options], callbackObj, callbackMethod);
return(true);
}
static function load(options) {
var _local13 = {clip:_root, server:"http://x.mochiads.com/srv/1/", method:"load", depth:10333, id:"_UNKNOWN_"};
options = _parseOptions(options, _local13);
options.swfv = options.clip.getSWFVersion() || 6;
options.mav = getVersion();
var _local9 = options.clip;
if (!_isNetworkAvailable()) {
return(null);
}
if (_local9._mochiad_loaded) {
return(null);
}
var _local12 = options.depth;
delete options.depth;
var _local6 = _local9.createEmptyMovieClip("_mochiad", _local12);
var _local11 = _getRes(options);
options.res = (_local11[0] + "x") + _local11[1];
options.server = options.server + options.id;
delete options.id;
_local9._mochiad_loaded = true;
var _local4 = _local6.createEmptyMovieClip("_mochiad_ctr", 1);
for (var _local7 in options) {
_local4[_local7] = options[_local7];
}
var _local10 = _local4.server;
delete _local4.server;
var _local14 = _allowDomains(_local10);
_local6.onEnterFrame = function () {
if (this._mochiad_ctr._url != this._url) {
this.onEnterFrame = function () {
if (!this._mochiad_ctr) {
delete this.onEnterFrame;
MochiAd.unload(this._parent);
}
};
}
};
var _local5 = new LocalConnection();
var _local8 = ["", Math.floor(new Date().getTime()), random(999999)].join("_");
_local5.mc = _local6;
_local5.name = _local8;
_local5.hostname = _local14;
_local5.allowDomain = function (d) {
return(true);
};
_local5.allowInsecureDomain = _local5.allowDomain;
_local5.connect(_local8);
_local6.lc = _local5;
_local4.lc = _local8;
_local4.st = getTimer();
_local4.loadMovie(_local10 + ".swf", "POST");
return(_local6);
}
static function unload(clip) {
if (typeof(clip) == "undefined") {
clip = _root;
}
if (clip.clip && (clip.clip._mochiad)) {
clip = clip.clip;
}
if (!clip._mochiad) {
return(false);
}
clip._mochiad.removeMovieClip();
delete clip._mochiad_loaded;
delete clip._mochiad;
return(true);
}
static function _isNetworkAvailable() {
if (System.security) {
var _local1 = System.security;
if (_local1.sandboxType == "localWithFile") {
return(false);
}
}
return(true);
}
static function _getRes(options) {
var _local3 = options.clip.getBounds();
var _local2 = 0;
var _local1 = 0;
if (typeof(options.res) != "undefined") {
var _local4 = options.res.split("x");
_local2 = parseFloat(_local4[0]);
_local1 = parseFloat(_local4[1]);
} else {
_local2 = _local3.xMax - _local3.xMin;
_local1 = _local3.yMax - _local3.yMin;
}
if ((_local2 == 0) || (_local1 == 0)) {
_local2 = Stage.width;
_local1 = Stage.height;
}
return([_local2, _local1]);
}
static function _parseOptions(options, defaults) {
var _local4 = {};
for (var _local8 in defaults) {
_local4[_local8] = defaults[_local8];
}
if (options) {
for (var _local8 in options) {
_local4[_local8] = options[_local8];
}
}
if (_root.mochiad_options) {
var _local5 = _root.mochiad_options.split("&");
var _local2 = 0;
while (_local2 < _local5.length) {
var _local3 = _local5[_local2].split("=");
_local4[unescape(_local3[0])] = unescape(_local3[1]);
_local2++;
}
}
return(_local4);
}
}
Symbol 851 MovieClip [__Packages.Main] Frame 0
class Main
{
static var __parent, _instance, initObj;
function Main (mc) {
__parent = mc;
mc.tabEnabled = false;
}
static function main(mc) {
if (_instance == undefined) {
_instance = new Main(mc);
}
initObj = new LoveJuice.Init();
return(_instance);
}
function startViaFlash(mc) {
return(mainGo(mc));
}
static function mainGo(mc) {
if (_instance == undefined) {
_instance = new Main(mc);
}
initObj = new LoveJuice.Init();
return(_instance);
}
function toString() {
return("Main");
}
static function getInstance() {
return(_instance);
}
function getInitInstance() {
return(initObj);
}
function getMainMovie() {
return(__parent);
}
}
Symbol 852 MovieClip [__Packages.LoveJuice.Init] Frame 0
class LoveJuice.Init
{
var main, mainMovie, eventHandler, gameController, attractObj, levelHandler, soundHandler, transition;
function Init () {
main = Main.getInstance();
mainMovie = main.getMainMovie();
eventHandler = new gamingyourway.common.EventBroadcaster();
gameController = new LoveJuice.GameController();
attractObj = new LoveJuice.Attract();
levelHandler = new LoveJuice.LevelHandler();
soundHandler = new gamingyourway.common.SoundHandler();
mainMovie.onEnterFrame = gamingyourway.common.Delegate.create(this, oneFramePause);
}
function toString() {
return("Init");
}
function oneShot() {
transition = new LoveJuice.Transition();
gameController.oneShot();
attractObj.oneShot();
levelHandler.oneShot();
}
function getLevelHandler() {
return(levelHandler);
}
function getEventHandler() {
return(eventHandler);
}
function getGameController() {
return(gameController);
}
function getAttractObj() {
return(attractObj);
}
function getTransition() {
return(transition);
}
function getSoundHandler() {
return(soundHandler);
}
function oneFramePause() {
delete mainMovie.onEnterFrame;
oneShot();
}
}
Symbol 853 MovieClip [__Packages.LoveJuice.GameController] Frame 0
class LoveJuice.GameController
{
var main, mainMovie, eventHandler, transition, scroller, hud, player, baddieHandler, levelHandler, master, level, score, lives, livesOffset;
function GameController () {
}
function toString() {
return("GameController");
}
function oneShot() {
main = Main.getInstance();
mainMovie = main.getMainMovie();
eventHandler = main.getInitInstance().getEventHandler();
eventHandler.subscribeToEvent(this);
transition = main.getInitInstance().getTransition();
scroller = new gamingyourway.scrollerEngine.Joseph();
hud = new LoveJuice.Info.HUD();
player = new LoveJuice.Player();
baddieHandler = new LoveJuice.Baddies.BaddieHandler();
baddieHandler.oneShot();
levelHandler = main.getInitInstance().getLevelHandler();
master = new LoveJuice.Master();
}
function loadLevel() {
level = 1;
levelHandler.loadTiles(level);
}
function startGame() {
score = 0;
hud.updateScore(score);
lives = 3;
hud.updateLives(lives);
livesOffset = 0;
xtraLifeArray = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0);
player.resetNewGame();
continueGame();
}
function continueGame() {
levelHandler.plotLevel(level);
player.init(level);
baddieHandler.init();
main.getInitInstance().getAttractObj().killAttractMode();
hud.displayLevelText(level);
master.mainLoopInit();
}
function continueGameAfterLifeLost() {
levelHandler.plotLevel(level);
player.init(level);
baddieHandler.init();
transition.wipeOutInit();
hud.displayLevelText(level);
master.mainLoopInit();
}
function reduceNumberOfLives() {
lives--;
hud.updateLives(lives);
}
function lifeLost() {
transition.grabScreen();
houseKeeping();
xtraLifeArray[livesOffset] = 0;
if (lives == 0) {
player.clearCheckPoint();
main.getInitInstance().getAttractObj().gameOverInit();
return(undefined);
}
continueGameAfterLifeLost();
}
function levelComplete() {
transition.grabScreen();
houseKeeping();
level++;
if (level == (maxLevel + 1)) {
main.getInitInstance().getAttractObj().gameCompleteInit();
return(undefined);
}
main.getInitInstance().getAttractObj().displayLoadingScreen();
player.clearCheckPoint();
player.resetNewLevel();
levelHandler.loadExternalData(level);
}
function pause() {
mainMovie.pauseCover._visible = true;
}
function resume() {
mainMovie.pauseCover._visible = false;
}
function quit() {
mainMovie.pauseCover._visible = false;
houseKeeping();
player.clearCheckPoint();
main.getInitInstance().getAttractObj().init();
transition.wipeOutInit();
}
function houseKeeping() {
master.houseKeeping();
player.houseKeeping();
baddieHandler.houseKeeping();
mainMovie.toxieHead.removeMovieClip();
}
function incScore(amount) {
score = score + amount;
hud.updateScore(score);
livesOffset = int(score / 50000);
if (livesOffset > 0) {
if (lives < 9) {
if (xtraLifeArray[livesOffset - 1] == 0) {
xtraLifeArray[livesOffset - 1] = 1;
lives++;
player.playItemCollectedSFX();
hud.updateLives(lives);
}
}
}
}
function getScroller() {
return(scroller);
}
function getPlayer() {
return(player);
}
function getBaddieHandler() {
return(baddieHandler);
}
function getLevel() {
return(level);
}
function getScore() {
return(score);
}
function getHUD() {
return(hud);
}
var maxLevel = 8;
var xtraLifeArray = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0);
}
Symbol 854 MovieClip [__Packages.gamingyourway.scrollerEngine.Joseph] Frame 0
class gamingyourway.scrollerEngine.Joseph
{
var tilesAlreadyCut, startXPos, startYPos, mapXPos, mapYPos, actualMapXPos, visAreaX, actualMapYPos, visAreaY, xdiff, ydiff, tileWidth, containerOriginalPos, container, tileHeight, tileBitmapStorage, tileSheetBitMap, speed, windowHeight, windowWidth, baseDepth, map, mapWidth, mapHeight;
function Joseph () {
tilesAlreadyCut = false;
}
function toString() {
return("Joseph");
}
function init() {
if (startXPos == undefined) {
startXPos = (startYPos = (mapXPos = (mapYPos = 0)));
}
actualMapXPos = startXPos + (visAreaX + 1);
actualMapYPos = startYPos + (visAreaY + 1);
xdiff = (ydiff = 0);
if (tilesAlreadyCut == false) {
tilesAlreadyCut = true;
cutUpTiles();
disposeTileSheetBitmap();
}
cls();
mapPlotter(new flash.geom.Point(startXPos, startYPos));
}
function reset() {
container._x = containerOriginalPos.x - (startXPos * tileWidth);
container._y = containerOriginalPos.y - (startYPos * tileHeight);
actualMapXPos = startXPos + (visAreaX + 1);
actualMapYPos = startYPos + (visAreaY + 1);
xdiff = (ydiff = 0);
mapXPos = startXPos;
mapYPos = startYPos;
}
function reposition(destPos) {
mapXPos = destPos.x;
mapYPos = destPos.y;
actualMapXPos = mapXPos + (visAreaX + 1);
actualMapYPos = mapYPos + (visAreaY + 1);
container._x = containerOriginalPos.x - (mapXPos * tileWidth);
container._y = containerOriginalPos.y - (mapYPos * tileHeight);
xdiff = (ydiff = 0);
cls();
mapPlotter(destPos);
}
function cutUpTiles() {
if (tilesAlreadyCut == false) {
tilesAlreadyCut = true;
} else {
return(undefined);
}
tileBitmapStorage = new Array();
var _local2 = -tileWidth;
var _local4 = -tileHeight;
var _local7 = tileSheetBitMap.height - tileHeight;
var _local6 = tileSheetBitMap.width - tileWidth;
var _local3;
var _local5 = new flash.geom.Point(0, 0);
while (_local4 != _local7) {
_local4 = _local4 + tileHeight;
_local2 = -tileWidth;
while (_local2 != _local6) {
_local2 = _local2 + tileWidth;
_local3 = new flash.display.BitmapData(tileWidth, tileHeight, true, 0);
_local3.copyPixels(tileSheetBitMap, new flash.geom.Rectangle(_local2, _local4, tileWidth, tileHeight), _local5);
tileBitmapStorage.push(_local3);
}
}
}
function disposeTileSheetBitmap() {
tileSheetBitMap.dispose();
}
function alterTile(tileNumber, pos) {
var _local2 = (("t_" + pos.x) + "_") + pos.y;
if (tileNumber == -1) {
container[_local2]._visible = false;
} else {
container[_local2]._visible = true;
container[_local2].attachBitmap(tileBitmapStorage[tileNumber], 1);
}
}
function getSpeed() {
return(speed);
}
function getTileSheet() {
return(tileSheetBitMap);
}
function getMapTopLeftXPos() {
return(mapXPos - (visAreaX + 1));
}
function getMapTopLeftYPos() {
return(mapYPos - (visAreaY + 1));
}
function getMapXPos() {
return(mapXPos);
}
function getMapYPos() {
return(mapYPos);
}
function getScrollWindow() {
return(new flash.geom.Rectangle(getMapTopLeftXPos(), getMapTopLeftYPos(), mapXPos - 1, mapYPos - 1));
}
function setAll(setUp) {
setTileHeight(setUp.tileHeight);
setTileWidth(setUp.tileWidth);
setVisAreaX(setUp.visAreaX);
setVisAreaY(setUp.visAreaY);
setContainer(setUp.container);
setSpeed(setUp.speed);
setMap(setUp.mapData);
setStartPositon(setUp.startPos);
setTileSheet(setUp.tileSheet);
}
function setStartPositon(pos) {
if (pos == undefined) {
startXPos = (startYPos = (mapXPos = (mapYPos = 0)));
} else {
startXPos = (mapXPos = pos.x);
startYPos = (mapYPos = pos.y);
if (container != undefined) {
if (tileWidth != undefined) {
container._x = containerOriginalPos.x - (startXPos * tileWidth);
container._y = containerOriginalPos.y - (startYPos * tileHeight);
}
}
}
}
function setTileSheet(bitmap) {
tileSheetBitMap = bitmap;
}
function setTileHeight(tHeight) {
tileHeight = tHeight;
if (visAreaY != null) {
windowHeight = visAreaY * tileHeight;
}
}
function setTileWidth(tWidth) {
tileWidth = tWidth;
if (visAreaX != null) {
windowWidth = visAreaX * tileWidth;
}
}
function setVisAreaX(vX) {
visAreaX = vX;
if (tileWidth != null) {
windowWidth = visAreaX * tileWidth;
}
}
function setVisAreaY(vY) {
visAreaY = vY;
}
function setContainer(mc) {
container = mc;
baseDepth = container.getNextHighestDepth();
if (containerOriginalPos == undefined) {
containerOriginalPos = new flash.geom.Point(mc._x, mc._y);
}
}
function setSpeed(spd) {
speed = spd;
}
function setMap(mapData) {
map = mapData;
mapWidth = map[0].length;
mapHeight = map.length;
}
function scrollRight(speedArg) {
if (speedArg == undefined) {
speedArg = speed;
}
container._x = container._x - speedArg;
xdiff = xdiff - (-speedArg);
if (xdiff >= tileWidth) {
var _local10 = (mapXPos - visAreaX) - 1;
var _local3 = (mapYPos - visAreaY) - 1;
var _local6 = mapXPos * tileWidth;
var _local5 = ("t_" + mapXPos) + "_";
var _local8 = ("t_" + _local10) + "_";
var _local2;
var _local4;
var _local7 = visAreaY + 1;
while (_local7--) {
_local2 = container[_local8 + _local3];
_local2._x = _local6;
_local2._name = _local5 + _local3;
_local4 = map[_local3++][mapXPos][0] - 1;
if (_local4 == -1) {
_local2._visible = false;
} else {
_local2._visible = true;
_local2.attachBitmap(tileBitmapStorage[_local4], 1);
}
}
mapXPos++;
xdiff = xdiff - tileWidth;
}
}
function scrollLeft(speedArg) {
if (speedArg == undefined) {
speedArg = speed;
}
container._x = container._x - (-speedArg);
xdiff = xdiff - speedArg;
if (xdiff <= 0) {
mapXPos--;
var _local5 = (mapXPos - visAreaX) - 1;
var _local3 = (mapYPos - visAreaY) - 1;
var _local7 = _local5 * tileWidth;
var _local6 = ("t_" + _local5) + "_";
var _local9 = ("t_" + mapXPos) + "_";
var _local2;
var _local4;
var _local8 = visAreaY + 1;
while (_local8--) {
_local2 = container[_local9 + _local3];
_local2._x = _local7;
_local2._name = _local6 + _local3;
_local4 = map[_local3++][_local5][0] - 1;
if (_local4 == -1) {
_local2._visible = false;
} else {
_local2._visible = true;
_local2.attachBitmap(tileBitmapStorage[_local4], 1);
}
}
xdiff = xdiff + tileWidth;
}
}
function scrollDown(speedArg) {
if (speedArg == undefined) {
speedArg = speed;
}
container._y = container._y - speedArg;
ydiff = ydiff - (-speedArg);
if (ydiff >= tileHeight) {
var _local3 = (mapXPos - visAreaX) - 1;
var _local10 = (mapYPos - visAreaY) - 1;
var _local6 = mapYPos * tileWidth;
var _local5 = "_" + mapYPos;
var _local8 = "_" + _local10;
var _local2;
var _local4;
var _local7 = visAreaX + 1;
while (_local7--) {
_local2 = container[("t_" + _local3) + _local8];
_local2._y = _local6;
_local2._name = ("t_" + _local3) + _local5;
_local4 = map[mapYPos][_local3++][0] - 1;
if (_local4 == -1) {
_local2._visible = false;
} else {
_local2._visible = true;
_local2.attachBitmap(tileBitmapStorage[_local4], 1);
}
}
mapYPos++;
ydiff = ydiff - tileHeight;
}
}
function scrollUp(speedArg) {
if (speedArg == undefined) {
speedArg = speed;
}
container._y = container._y - (-speedArg);
ydiff = ydiff - speedArg;
if (ydiff <= 0) {
mapYPos--;
var _local3 = (mapXPos - visAreaX) - 1;
var _local5 = (mapYPos - visAreaY) - 1;
var _local7 = _local5 * tileWidth;
var _local6 = "_" + _local5;
var _local9 = "_" + mapYPos;
var _local2;
var _local4;
var _local8 = visAreaX + 1;
while (_local8--) {
_local2 = container[("t_" + _local3) + _local9];
_local2._y = _local7;
_local2._name = ("t_" + _local3) + _local6;
_local4 = map[_local5][_local3++][0] - 1;
if (_local4 == -1) {
_local2._visible = false;
} else {
_local2._visible = true;
_local2.attachBitmap(tileBitmapStorage[_local4], 1);
}
}
ydiff = ydiff + tileHeight;
}
}
function mapPlotter(destPos) {
var _local4 = positionMap(destPos.x, mapWidth, visAreaX, 0);
var _local6 = positionMap(destPos.y, mapHeight, visAreaY, 1);
var _local5 = baseDepth;
var _local2;
var _local3;
mapYPos = _local6;
while (mapYPos < ((_local6 + visAreaY) + 1)) {
mapXPos = _local4;
while (mapXPos < ((_local4 + visAreaX) + 1)) {
_local2 = container.createEmptyMovieClip((("t_" + mapXPos) + "_") + mapYPos, _local5++);
_local2._x = mapXPos * tileWidth;
_local2._y = mapYPos * tileHeight;
_local2.tileFlag = true;
_local3 = map[mapYPos][mapXPos][0] - 1;
if (_local3 == -1) {
_local2._visible = false;
} else {
_local2._visible = true;
_local2.attachBitmap(tileBitmapStorage[_local3], 1);
}
mapXPos++;
}
mapYPos++;
}
}
function positionMap(buildFrom, mapSize, visibleArea, arrayPos) {
if (mapSize <= visibleArea) {
return(0);
}
var _local1 = buildFrom + visibleArea;
while (_local1 > mapSize) {
_local1--;
}
return(_local1 - visibleArea);
}
function cls() {
var _local2;
var _local3;
for (_local3 in container) {
if (typeof(container[_local3]) == "movieclip") {
_local2 = container[_local3];
if (_local2.tileFlag == true) {
_local2.removeMovieClip();
}
}
}
}
}
Symbol 855 MovieClip [__Packages.gamingyourway.common.EventBroadcaster] Frame 0
class gamingyourway.common.EventBroadcaster
{
var broadcasterObject;
function EventBroadcaster () {
broadcasterObject = new Object();
AsBroadcaster.initialize(broadcasterObject);
}
function toString() {
return("EventBroadcaster");
}
function sendEvent(event, arg) {
var _local2 = broadcasterObject.broadcastMessage(event, arg);
}
function subscribeToEvent(obj) {
broadcasterObject.addListener(obj);
}
function unsubscribeToEvent(obj) {
broadcasterObject.removeListener(obj);
}
}
Symbol 856 MovieClip [__Packages.LoveJuice.LevelHandler] Frame 0
class LoveJuice.LevelHandler
{
var tileStorage, objectStorage, alreadyCutFlag, main, mainMovie, mapLoader, gameController, scroller, eventHandler, loadingFlag, level;
function LevelHandler () {
tileStorage = new Array();
objectStorage = new Array();
alreadyCutFlag = false;
}
function toString() {
return("LevelHandler");
}
function oneShot() {
main = Main.getInstance();
mainMovie = main.getMainMovie();
mapLoader = new LoveJuice.IO.MapLoader();
gameController = main.getInitInstance().getGameController();
scroller = gameController.getScroller();
eventHandler = main.getInitInstance().getEventHandler();
loadingFlag = false;
loadTiles(1);
}
function loadTiles(levelArg) {
if (loadingFlag == true) {
return(undefined);
}
mainMovie.debug.text = mainMovie.debug.text + "Loading tiles\n";
level = levelArg;
if (objectStorage[level - 1] != undefined) {
eventHandler.sendEvent("loadingComplete");
} else {
loadingFlag = true;
mapLoader.setCallBack(gamingyourway.common.Delegate.create(this, tilesLoaded));
mapLoader.tileLoader("tiles" + level);
loadingTextInit();
}
}
function loadExternalData(levelArg) {
if (loadingFlag == true) {
return(undefined);
}
level = levelArg;
if (objectStorage[level - 1] != undefined) {
eventHandler.sendEvent("loadingComplete");
} else {
var _local2 = new Object();
tileStorage[level - 1] = _local2;
loadingFlag = true;
loadMap();
}
}
function loadMap() {
mapLoader.setCallBack(gamingyourway.common.Delegate.create(this, mapLoaded));
mapLoader.loadMap("level" + level);
}
function loadObjects() {
mapLoader.setCallBack(gamingyourway.common.Delegate.create(this, objectsLoaded));
mapLoader.loadMap("objects" + level);
}
function plotLevel(levelArg) {
var _local3 = tileStorage[levelArg - 1];
var _local2 = main.getInitInstance().getGameController().getPlayer().getCheckPoint();
if (_local2 == undefined) {
_local2 = new flash.geom.Point(0, _local3.mapData.length - 14);
} else {
_local2.x = _local2.x - 2;
if (_local2.x != 0) {
_local2.x = _local2.x - 4;
}
_local2.y = _local2.y - 12;
}
var _local4 = {mapData:_local3.mapData, speed:4, tileHeight:32, tileWidth:32, visAreaX:13, visAreaY:14, container:mainMovie.playField, startPos:_local2, tileSheet:tileStorage[0].Tiles};
scroller.setAll(_local4);
mainMovie.debug.text = mainMovie.debug.text + "tiles cut up\n";
scroller.cutUpTiles();
scroller.init();
}
function getMapSize(levelArg) {
var _local2 = tileStorage[levelArg - 1];
return(_local2.mapSize);
}
function getMapData(levelArg) {
var _local2 = tileStorage[levelArg - 1];
return(_local2.mapData);
}
function getObjectData(levelArg) {
var _local2 = objectStorage[levelArg - 1];
return(_local2.mapData);
}
function getObjectSize(levelArg) {
var _local2 = objectStorage[levelArg - 1];
return(_local2.mapSize);
}
function getMapLoadedFlag(levelArg) {
if (objectStorage[level - 1] != undefined) {
return(true);
}
return(false);
}
function tilesLoaded(tilesHolderMC) {
var _local2 = new flash.display.BitmapData(tilesHolderMC._width, tilesHolderMC._height, true, 0);
_local2.draw(tilesHolderMC, new flash.geom.Matrix(), null);
tilesHolderMC.removeMovieClip();
mainMovie.debug.text = mainMovie.debug.text + "tiles messed with\n";
var _local4 = {Tiles:_local2};
tileStorage[level - 1] = _local4;
loadMap();
}
function mapLoaded(rawMap) {
if (rawMap == undefined) {
trace("load error:Map failed to load");
return(undefined);
}
var _local6 = rawMap.split("|");
var _local2;
_local6.shift();
var _local7 = Number(_local6[0]);
var _local8 = Number(_local6[1]);
var _local13 = new flash.geom.Point(_local7, _local8);
_local6.splice(0, 2);
var _local12 = -1;
var _local9 = 0;
var _local10 = 0;
var _local3 = -1;
var _local11 = new Array();
var _local5 = new Array();
while (_local12++ , _local12 != _local8) {
_local3 = -1;
_local5 = new Array();
while (_local3++ , _local3 < _local7) {
_local2 = _local6[_local9++].split(",");
_local5[_local3] = [Number(_local2[0]), Number(_local2[1])];
}
_local11[_local10] = _local5;
_local10++;
if (_local10 >= _local8) {
var _local4 = tileStorage[level - 1];
_local4.mapData = _local11;
_local4.mapSize = _local13;
tileStorage[level - 1] = _local4;
break;
}
}
loadObjects();
}
function objectsLoaded(rawMap) {
if (rawMap == undefined) {
trace("load error:Objects failed to load");
return(undefined);
}
var _local6 = rawMap.split("|");
var _local2;
_local6.shift();
var _local7 = _local6[0];
var _local8 = _local6[1];
var _local13 = new flash.geom.Point(Number(_local7), Number(_local8));
_local6.splice(0, 2);
var _local5 = new Object();
var _local12 = -1;
var _local9 = 0;
var _local10 = 0;
var _local3 = -1;
var _local11 = new Array();
var _local4 = new Array();
while (_local12++ , _local12 != _local8) {
_local3 = -1;
_local4 = new Array();
while (_local3++ , _local3 < _local7) {
_local2 = _local6[_local9++].split(",");
_local4[_local3] = [_local2[0], _local2[1]];
}
_local11[_local10] = _local4;
_local10++;
if (_local10 >= _local8) {
_local5.mapData = _local11;
_local5.mapSize = _local13;
objectStorage[level - 1] = _local5;
break;
}
}
loadingFlag = false;
eventHandler.sendEvent("loadingComplete");
loadingTextKill();
}
function loadingTextInit() {
mainMovie.loadingText._visible = true;
mainMovie.loadingText.onEnterFrame = gamingyourway.common.Delegate.create(this, spinner);
}
function loadingTextKill() {
mainMovie.loadingText._visible = false;
delete mainMovie.loadingText.onEnterFrame;
}
function spinner() {
mainMovie.loadingText.spinner._rotation = mainMovie.loadingText.spinner._rotation + 25;
}
}
Symbol 857 MovieClip [__Packages.LoveJuice.IO.MapLoader] Frame 0
class LoveJuice.IO.MapLoader
{
var main, mainMovie, eventHandler, varReciever, varSender, tileSheetHolder, mcLoader, mclistener, tempMapSrc, callBack;
function MapLoader () {
main = Main.getInstance();
mainMovie = main.getMainMovie();
eventHandler = main.getInitInstance().getEventHandler();
}
function toString() {
return("MapLoader");
}
function loadMap(filename) {
varReciever = new LoadVars();
varReciever.onData = gamingyourway.common.Delegate.create(this, onMapLoaded);
varSender = new LoadVars();
varSender.sendAndLoad(("http://www.gimme5games.com/lovedup/res/_maps/" + filename) + ".txt", varReciever, "POST");
}
function tileLoader(filename) {
tileSheetHolder = mainMovie.createEmptyMovieClip("tileSheetHolder" + mainMovie.getNextHighestDepth(), mainMovie.getNextHighestDepth());
mcLoader = new MovieClipLoader();
mclistener = new Object();
mclistener.onLoadStart = function (target_mc) {
target_mc._visible = false;
};
mclistener.onLoadInit = gamingyourway.common.Delegate.create(this, tilesLoaded);
mcLoader.addListener(mclistener);
mcLoader.loadClip(((("http://www.gimme5games.com/lovedup/res/_images/" + filename) + ".png?cK=") + random(999999)) + 1, tileSheetHolder);
}
function getLoadedMap() {
return(tempMapSrc);
}
function getTileSheetHolder() {
return(tileSheetHolder);
}
function setCallBack(arg) {
callBack = arg;
}
function setRemoveMC(arg) {
arg.removeMovieClip();
}
function onMapLoaded(src) {
progressBarEnterFrameKill();
callBack(src);
}
function tilesLoaded() {
mcLoader.removeListener(mclistener);
delete mcLoader;
mainMovie.debug.text = mainMovie.debug.text + "tiles Loaded\n";
callBack(tileSheetHolder);
}
function progressBarEnterFrameInit() {
mainMovie.loadingbar._width = 1;
mainMovie.loadingbar._visible = true;
mainMovie.loadingbar.onEnterFrame = gamingyourway.common.Delegate.create(this, progressBarUpdateLoadVars);
}
function progressBarEnterFrameKill() {
mainMovie.loadingbar._visible = false;
delete mainMovie.loadingbar.onEnterFrame;
}
function progressBarUpdateLoadVars() {
var _local2 = varReciever.getBytesLoaded();
var _local3 = varReciever.getBytesTotal();
var _local4 = Math.floor((_local2 / _local3) * 100);
if (_local2 == undefined) {
return(undefined);
}
mainMovie.loadingbar._width = _local4;
}
function progressBarUpdate(target, loadedBytes, totalBytes) {
var _local1 = Math.floor((loadedBytes / totalBytes) * 100);
}
var tilesLoading = false;
}
Symbol 858 MovieClip [__Packages.gamingyourway.common.Delegate] Frame 0
class gamingyourway.common.Delegate
{
function Delegate () {
}
static function create(target, handler) {
var _local4 = arguments.slice(2);
var _local3 = function () {
var _local2 = arguments.callee;
var _local3 = arguments.concat(_local2.extraArgs, [_local2]);
return(_local2.handler.apply(_local2.target, _local3));
};
_local3.extraArgs = _local4;
_local3.handler = handler;
_local3.target = target;
return(_local3);
}
}
Symbol 859 MovieClip [__Packages.LoveJuice.Player] Frame 0
class LoveJuice.Player
{
var main, mainMovie, playField, playField2, gameController, scroller, eventHandler, colourHandler, hud, soundHandler, sprite, colour, landingSFX, landingQuietSFX, itemCollectedSFX, jumpHuhSFX, oofSFX, profOnFireScreamSFX, profAhHahSFX, profOomphSFX, bounceSFX, jumpSinusLen, hitJumpSinusLen, doubleJumpSinusLen, startPositions, circleCollisionAreas, finePos, parallaxScrollRect, bulletHandler, checkPoint, levelAlreadyStartedFlag, level, mapPos, currentDir, prevDir, fineX, fineY, speed, inertiaCnt, inputFunc, panningFunc, jumpFunc, jumpKeyHeld, jumpStatus, animatingFlag, animFrame, standingCnt, standingFlag, map, mapWidth, mapHeight, rightScrollBoundary, maxFineRight, maxFineLeft, horizontalAttribute, tileAttributes, vpanningFunc, vpanningSpeed, vpanFlag, beingHitFlag, levelCompleteFlag, jumpingPossible, invunrableCnt, invunrableFunc, shootHeldFlag, shootHeldCnt, jumpSinusOffset, baddieType, baddie, bounceDirection, levelCompleteCnt, numberOfCollectedCoins, numberOfCollectedNotes, colourFlashCnt, colourValue, scrollFlag, currentYOffset, fallDistance, currentAttribute, killedDelayCnt;
function Player () {
main = Main.getInstance();
mainMovie = main.getMainMovie();
playField = mainMovie.playField;
playField2 = mainMovie.playField2;
gameController = main.getInitInstance().getGameController();
scroller = gameController.getScroller();
eventHandler = main.getInitInstance().getEventHandler();
eventHandler.subscribeToEvent(this);
colourHandler = new gamingyourway.common.ColourHandler();
hud = gameController.getHUD();
soundHandler = main.getInitInstance().getSoundHandler();
sprite = playField.attachMovie("player", "player", playField.getNextHighestDepth());
sprite._visible = false;
colour = new Color(sprite);
landingSFX = soundHandler.createSound(sprite, "landingSFX");
landingQuietSFX = soundHandler.createSound(sprite, "landingQuietSFX");
itemCollectedSFX = soundHandler.createSound(sprite, "itemCollectedSFX");
jumpHuhSFX = soundHandler.createSound(sprite, "jumpHuhSFX");
oofSFX = soundHandler.createSound(sprite, "oofSFX");
profOnFireScreamSFX = soundHandler.createSound(sprite, "profOnFireScreamSFX");
profAhHahSFX = soundHandler.createSound(sprite, "profAhHahSFX");
profOomphSFX = soundHandler.createSound(sprite, "profOomphSFX");
bounceSFX = soundHandler.createSound(sprite, "bounceSFX");
jumpSinusLen = jumpSinus.length;
hitJumpSinusLen = hitJumpSinus.length;
doubleJumpSinusLen = doubleJumpSinus.length;
startPositions = new Array(new flash.geom.Point(2, 108), new flash.geom.Point(2, 108), new flash.geom.Point(2, 108), new flash.geom.Point(2, 108), new flash.geom.Point(2, 108), new flash.geom.Point(2, 108), new flash.geom.Point(2, 108), new flash.geom.Point(2, 108), new flash.geom.Point(2, 108), new flash.geom.Point(2, 108));
circleCollisionAreas = new Array([24, new flash.geom.Point(-8, -56)], [24, new flash.geom.Point(-11, -55)], [24, new flash.geom.Point(-8, -51)], [24, new flash.geom.Point(-13, -50)], [24, new flash.geom.Point(-8, -50)], [24, new flash.geom.Point(-12, -50)], [26, new flash.geom.Point(-5, -56)], [26, new flash.geom.Point(-18, -56)]);
finePos = new flash.geom.Point(0, 0);
parallaxScrollRect = new flash.geom.Rectangle(0, -166, 480, 480);
playField2.scrollRect = parallaxScrollRect;
bulletHandler = new LoveJuice.BulletHandler();
}
function toString() {
return("Player");
}
function resetNewGame() {
var _local2 = soundHandler.getMasterVolume();
soundHandler.setDefaultVolume(landingSFX, _local2);
soundHandler.setDefaultVolume(landingQuietSFX, _local2);
checkPoint = undefined;
resetNewLevel();
}
function resetNewLevel() {
levelAlreadyStartedFlag = false;
}
function init(levelArg) {
level = levelArg;
if (checkPoint == undefined) {
var _local4 = startPositions[level - 1];
mapPos = _local4.clone();
checkPoint = mapPos.clone();
} else {
mapPos = checkPoint.clone();
}
sprite.swapDepths(playField.getNextHighestDepth());
sprite._x = mapPos.x * 32;
sprite._y = mapPos.y * 32;
sprite._visible = true;
colour.setTransform(colourHandler.restoreColour());
currentDir = (prevDir = "Right");
fineX = (fineY = 0);
finePos.x = sprite._x + 16;
finePos.y = sprite._y;
playField.sprite.localToGlobal(finePos);
speed = 1;
inertiaCnt = 0;
inputFunc = playerInput;
panningFunc = (jumpFunc = null);
jumpKeyHeld = false;
jumpStatus = null;
animatingFlag = false;
animFrame = anim_walkRight;
sprite.gotoAndStop(animFrame);
sprite.anim.gotoAndStop(1);
standingCnt = 0;
standingFlag = false;
var _local2 = main.getInitInstance().getLevelHandler();
map = _local2.getMapData(level);
var _local3 = _local2.getMapSize(level);
mapWidth = _local3.x;
mapHeight = _local3.y;
rightScrollBoundary = mapWidth - 9;
maxFineRight = (mapWidth - 2) * 32;
maxFineLeft = 8;
horizontalAttribute = map[mapPos.y][mapPos.x][1];
tileAttributes = LoveJuice.TileDefs.getCoords(horizontalAttribute);
parallaxScrollRect.x = 0;
parallaxScrollRect.y = -166;
playField2.scrollRect = parallaxScrollRect;
playField2.gotoAndStop(level);
mainMovie.backgroundMC.gotoAndStop(level);
vpanningFunc = null;
vpanningSpeed = 0;
vpanFlag = false;
beingHitFlag = (levelCompleteFlag = false);
jumpingPossible = true;
invunrableCnt = 0;
invunrableFunc = null;
shootHeldFlag = false;
shootHeldCnt = 0;
hud.setShotPower(1);
bulletHandler.init();
}
function mainloop() {
finePos.x = sprite._x + 16;
finePos.y = sprite._y;
playField.sprite.localToGlobal(finePos);
inputFunc();
jumpFunc();
verticalScrollHandler();
invunrableFunc();
bulletHandler.mainloop();
}
function houseKeeping() {
sprite._visible = false;
sprite.anim.gotoAndStop(1);
bulletHandler.houseKeeping();
}
function playItemCollectedSFX() {
soundHandler.playSound(itemCollectedSFX);
}
function hiJump() {
if (beingHitFlag == true) {
return(undefined);
}
jumpSinusOffset = 0;
jumpFunc = hiJumpingUp;
tileAttributes = LoveJuice.TileDefs.getCoords(1);
jumpStatus = "hiJumpingUp";
if (currentDir == "Right") {
animFrame = anim_jumpInitRight;
} else {
animFrame = anim_jumpInitLeft;
}
sprite.gotoAndStop(animFrame);
soundHandler.playSound(bounceSFX);
triggerParticles(5, new flash.geom.Point(sprite._x, sprite._y + 48));
}
function baddieCollision(baddieObject) {
if ((beingHitFlag == true) || (invunrableCnt > 0)) {
return(undefined);
}
beingHitFlag = true;
baddieType = baddieObject.toString();
baddie = baddieObject.getSprite();
if ((baddie._x + (baddie._width / 2)) > (sprite._x + (sprite._width / 2))) {
bounceDirection = "Left";
} else {
bounceDirection = "Right";
}
bounceFromBaddieInit();
}
function triggerGoal() {
if (levelCompleteFlag == true) {
return(undefined);
}
levelCompleteFlag = true;
hud.displayGoalPoint();
levelCompleteCnt = 0;
invunrableFunc = goalCompletePause;
}
function getMapPos() {
return(mapPos);
}
function getPlayerSprite() {
return(sprite);
}
function getCheckPoint() {
var _local2 = checkPoint.clone();
return(_local2);
}
function getStats() {
var _local2 = {numberOfCollectedNotes:numberOfCollectedNotes, numberOfCollectedCoins:numberOfCollectedCoins};
return(_local2);
}
function getBulletHandler() {
return(bulletHandler);
}
function getCollisionCircle() {
return(circleCollisionAreas[sprite._currentframe - 1]);
}
function clearCheckPoint() {
checkPoint = undefined;
}
function handleInvunrability() {
if ((--invunrableCnt) <= 0) {
colour.setTransform(colourHandler.restoreColour());
colourFlashCnt = 0;
colourValue = "Normal";
invunrableFunc = null;
}
flashPlayerRed();
}
function playerInput() {
var _local2 = false;
finePos.x = sprite._x + 16;
finePos.y = sprite._y;
playField.localToGlobal(finePos);
if (inkey(key_left)) {
_local2 = true;
if (!inkey(key_right)) {
moveLeft();
}
} else if (inkey(key_right)) {
_local2 = true;
if (!inkey(key_left)) {
moveRight();
}
}
if (_local2 == false) {
if (inertiaCnt < 0) {
inertiaCnt++;
} else if (inertiaCnt > 0) {
inertiaCnt--;
} else {
speed = 2;
}
}
if (jumpingPossible == true) {
if (inkey(key_up)) {
if (jumpKeyHeld == false) {
jumpKeyHeld = true;
jump();
speed = 4;
inertiaCnt = 0;
_local2 = true;
}
} else {
jumpKeyHeld = false;
}
}
if (inkey(key_action)) {
_local2 = true;
shootHeldFlag = _local2;
shootHeldCnt = shootHeldCnt + 10;
if (shootHeldCnt > 100) {
shootHeldCnt = 100;
}
hud.setShotPower(shootHeldCnt / 2);
if (standingFlag == true) {
if (currentDir == "Right") {
sprite.gotoAndStop(anim_walkRight);
} else {
sprite.gotoAndStop(anim_walkLeft);
}
sprite.anim.gotoAndStop(1);
}
} else if (shootHeldFlag == true) {
shootHeldFlag = false;
shoot(shootHeldCnt);
shootHeldCnt = 0;
hud.setShotPower(1);
}
if (_local2 == false) {
scrollFlag = false;
if ((++standingCnt) >= 93) {
standingCnt = 0;
if (standingFlag == false) {
if (jumpStatus == null) {
standingFlag = true;
animatingFlag = false;
inertiaCnt = 0;
speed = 2;
if (currentDir == "Right") {
sprite.gotoAndStop(anim_standRight);
} else {
sprite.gotoAndStop(anim_standLeft);
}
}
return(undefined);
}
}
if (animatingFlag == true) {
if (standingFlag == false) {
animatingFlag = false;
sprite.anim.gotoAndStop(1);
}
}
} else {
standingCnt = 0;
standingFlag = false;
}
}
function shoot(powerArg) {
var _local2 = new flash.geom.Point(sprite._x, sprite._y);
var _local3 = (powerArg / 100) * 6;
bulletHandler.shoot(_local2, currentDir, Math.round(_local3));
}
function moveLeft() {
if (currentDir == "Right") {
currentDir = "Left";
if (beingHitFlag != true) {
if (jumpFunc == null) {
animatingFlag = (standingFlag = false);
animFrame = anim_walkLeft;
sprite.gotoAndStop(animFrame);
sprite.anim.gotoAndStop(1);
speed = 2;
return(undefined);
}
var _local6 = sprite.anim._currentframe;
animFrame = anim_jumpLeft;
sprite.gotoAndStop(animFrame);
sprite.anim.gotoAndStop(_local6);
speed = 4;
}
inertiaCnt = 0;
} else if (beingHitFlag != true) {
if (animatingFlag != true) {
if (jumpFunc == null) {
if (animFrame != anim_walkLeft) {
animatingFlag = false;
animFrame = anim_walkLeft;
sprite.gotoAndStop(animFrame);
sprite.anim.gotoAndStop(1);
speed = 2;
}
}
}
}
if (beingHitFlag != true) {
if (standingFlag == true) {
animatingFlag = (standingFlag = false);
animFrame = anim_walkLeft;
sprite.gotoAndStop(animFrame);
sprite.anim.gotoAndStop(1);
speed = 0;
} else if (animatingFlag == false) {
animatingFlag = true;
sprite.anim.gotoAndPlay(2);
}
}
if ((++speed) > 4) {
speed = 4;
}
var _local2 = Math.round((sprite._x - 36) / 32);
var _local3 = Number(map[mapPos.y][_local2][1]);
if (tileCollisionCheck(_local3) == true) {
return(undefined);
}
_local2 = Math.round(sprite._x / 32);
_local3 = Number(map[mapPos.y][_local2][1]);
if (tileCollisionCheck(_local3) == true) {
sprite._x = sprite._x + speed;
mapPos.x = Math.floor((sprite._x + 16) / 32);
return(undefined);
}
if ((sprite._x - speed) < 480) {
if ((sprite._x - speed) > 160) {
scrollLeft(speed);
} else if (sprite._x <= 16) {
sprite._x = 16;
return(undefined);
}
}
sprite._x = sprite._x - speed;
var _local4 = mapPos.x;
mapPos.x = Math.floor((sprite._x + 16) / 32);
if (mapPos.x != _local4) {
if (jumpFunc == null) {
if (verticalCollisionCheck() == false) {
falling();
}
}
}
if (jumpFunc == null) {
var _local5 = (sprite._x - 16) % 32;
currentYOffset = tileAttributes[_local5 / 4];
if (currentYOffset != undefined) {
sprite._y = mapPos.y * 32;
sprite._y = sprite._y - currentYOffset;
fineY = currentYOffset;
}
}
}
function moveRight() {
if (currentDir == "Left") {
currentDir = "Right";
if (beingHitFlag != true) {
if (jumpFunc == null) {
animatingFlag = (standingFlag = false);
animFrame = anim_walkRight;
sprite.gotoAndStop(animFrame);
sprite.anim.gotoAndStop(1);
speed = 2;
return(undefined);
}
var _local6 = sprite.anim._currentframe;
animFrame = anim_jumpRight;
sprite.gotoAndStop(animFrame);
sprite.anim.gotoAndStop(_local6);
speed = 4;
}
inertiaCnt = 0;
} else if (beingHitFlag != true) {
if (jumpFunc == null) {
if (animatingFlag != true) {
animFrame = anim_walkRight;
sprite.gotoAndStop(animFrame);
sprite.anim.gotoAndStop(1);
animatingFlag = false;
speed = 2;
}
}
}
if (beingHitFlag != true) {
if (standingFlag == true) {
animatingFlag = (standingFlag = false);
animFrame = anim_walkRight;
sprite.gotoAndStop(animFrame);
sprite.anim.gotoAndStop(1);
speed = 0;
} else if (animatingFlag == false) {
animatingFlag = true;
sprite.anim.gotoAndPlay(3);
}
}
if ((++speed) > 4) {
speed = 4;
}
var _local2 = Math.round((sprite._x + 34) / 32);
var _local3 = Number(map[mapPos.y][_local2][1]);
if (tileCollisionCheck(_local3) == true) {
return(undefined);
}
_local2 = Math.round(sprite._x / 32);
_local3 = Number(map[mapPos.y][_local2][1]);
if (tileCollisionCheck(_local3) == true) {
sprite._x = sprite._x - speed;
mapPos.x = Math.floor((sprite._x + 16) / 32);
return(undefined);
}
if ((sprite._x + speed) > 160) {
if ((sprite._x + speed) < 480) {
scrollRight(speed);
} else if (sprite._x >= 588) {
sprite._x = 588;
return(undefined);
}
}
sprite._x = sprite._x + speed;
var _local4 = mapPos.x;
mapPos.x = Math.floor((sprite._x + 16) / 32);
if (mapPos.x != _local4) {
if (jumpFunc == null) {
if (verticalCollisionCheck() == false) {
falling();
}
}
}
if (jumpFunc == null) {
var _local5 = (sprite._x - 16) % 32;
currentYOffset = tileAttributes[_local5 / 4];
if (currentYOffset != undefined) {
sprite._y = mapPos.y * 32;
sprite._y = sprite._y - currentYOffset;
fineY = currentYOffset;
}
}
}
function jump() {
if (jumpFunc != null) {
if (jumpFunc != jumpingDown) {
return(undefined);
}
if (jumpSinusOffset <= (jumpSinusLen - 3)) {
return(undefined);
}
}
jumpSinusOffset = 0;
jumpFunc = jumpingUp;
tileAttributes = LoveJuice.TileDefs.getCoords(1);
jumpStatus = "jumpingUp";
if (currentDir == "Right") {
animFrame = anim_jumpInitRight;
} else {
animFrame = anim_jumpInitLeft;
}
sprite.gotoAndStop(animFrame);
soundHandler.playSound(jumpHuhSFX);
}
function jumpingUp() {
var _local2 = jumpSinus[jumpSinusOffset];
sprite._y = sprite._y - _local2;
fineY = fineY - _local2;
if (fineY <= 0) {
fineY = fineY + 32;
mapPos.y--;
}
if (verticalHeadCollisionCheck() == true) {
fallDistance = 0;
jumpFunc = jumpingDown;
jumpStatus = "jumpingDown";
if (currentDir == "Right") {
if (animFrame != anim_jumpRight) {
animFrame = anim_jumpRight;
sprite.gotoAndStop(animFrame);
}
} else if (animFrame != anim_jumpLeft) {
animFrame = anim_jumpLeft;
sprite.gotoAndStop(animFrame);
}
return(undefined);
}
if ((++jumpSinusOffset) == jumpSinusLen) {
jumpSinusOffset--;
fallDistance = 0;
jumpFunc = jumpingDown;
jumpStatus = "jumpingDown";
if (currentDir == "Right") {
if (animFrame != anim_jumpRight) {
animFrame = anim_jumpRight;
sprite.gotoAndStop(animFrame);
}
} else if (animFrame != anim_jumpLeft) {
animFrame = anim_jumpLeft;
sprite.gotoAndStop(animFrame);
}
return(undefined);
}
}
function hiJumpingUp() {
var _local2 = doubleJumpSinus[jumpSinusOffset];
sprite._y = sprite._y - _local2;
fineY = fineY - _local2;
if (fineY <= 0) {
fineY = fineY + 32;
mapPos.y--;
}
if (verticalHeadCollisionCheck() == true) {
fallDistance = 0;
jumpFunc = jumpingDown;
jumpStatus = "jumpingDown";
if (currentDir == "Right") {
if (animFrame != anim_jumpRight) {
animFrame = anim_jumpRight;
sprite.gotoAndStop(animFrame);
}
} else if (animFrame != anim_jumpLeft) {
animFrame = anim_jumpLeft;
sprite.gotoAndStop(animFrame);
}
return(undefined);
}
if ((++jumpSinusOffset) == doubleJumpSinusLen) {
jumpSinusOffset = jumpSinusLen - 1;
fallDistance = 0;
jumpFunc = jumpingDown;
jumpStatus = "jumpingDown";
if (currentDir == "Right") {
if (animFrame != anim_jumpRight) {
animFrame = anim_jumpRight;
sprite.gotoAndStop(animFrame);
}
} else if (animFrame != anim_jumpLeft) {
animFrame = anim_jumpLeft;
sprite.gotoAndStop(animFrame);
}
return(undefined);
}
}
function jumpingDown() {
var _local2 = jumpSinus[jumpSinusOffset];
var _local5 = sprite._y;
_local5 = _local5 + _local2;
fineY = fineY + _local2;
if (fineY >= 32) {
fineY = fineY - 32;
}
var _local3 = int((_local5 + 32) / 32);
var _local4 = map[_local3][mapPos.x][1];
if ((_local4 > 1) && (_local4 < 32)) {
tileAttributes = LoveJuice.TileDefs.getCoords(_local4);
var _local6 = (sprite._x - 16) % 32;
fineY = (currentYOffset = tileAttributes[_local6 / 4]);
mapPos.y = _local3;
sprite._y = _local3 * 32;
sprite._y = sprite._y - currentYOffset;
jumpFunc = null;
jumpStatus = null;
if (beingHitFlag == true) {
colour.setTransform(colourHandler.restoreColour());
killed();
return(undefined);
}
if (currentDir == "Right") {
animFrame = anim_walkRight;
} else {
animFrame = anim_walkLeft;
}
sprite.gotoAndStop(animFrame);
sprite.anim.gotoAndStop(1);
animatingFlag = false;
if (fallDistance >= 2) {
soundHandler.playSound(landingSFX);
plotSmoke();
} else if (_local2 > 1) {
soundHandler.playSound(landingQuietSFX);
}
return(undefined);
}
if ((_local2 > 3) || (jumpSinusOffset > (jumpSinusLen - 2))) {
if (verticalCollisionCheck() == true) {
sprite._y = Math.round(sprite._y / 32) * 32;
mapPos.y = sprite._y / 32;
fineY = 0;
jumpFunc = null;
jumpStatus = null;
if (beingHitFlag == true) {
colour.setTransform(colourHandler.restoreColour());
killed();
return(undefined);
}
if (currentDir == "Right") {
animFrame = anim_walkRight;
} else {
animFrame = anim_walkLeft;
}
sprite.gotoAndStop(animFrame);
sprite.anim.gotoAndStop(1);
animatingFlag = false;
if (fallDistance >= 2) {
soundHandler.playSound(landingSFX);
plotSmoke();
} else {
soundHandler.playSound(landingQuietSFX);
}
return(undefined);
}
}
if ((--jumpSinusOffset) < 0) {
jumpSinusOffset = 0;
fallDistance++;
}
sprite._y = _local5;
}
function falling() {
fallDistance = 0;
jumpSinusOffset = jumpSinusLen - 1;
jumpStatus = "jumpingDown";
jumpFunc = jumpingDown;
}
function plotSmoke() {
var _local3 = playField.getNextHighestDepth();
var _local2 = playField.attachMovie("smoke", "smoke" + _local3, _local3);
_local2._x = sprite._x + 18;
_local2._y = sprite._y + 38;
_local2._alpha = 60;
_local2.blendMode = 8;
}
function bounceFromBaddieInit() {
if (bounceDirection == "Right") {
inputFunc = moveRight;
} else {
inputFunc = moveLeft;
}
jumpSinusOffset = 8;
tileAttributes = LoveJuice.TileDefs.getCoords(1);
colour.setTransform(colourHandler.restoreColour());
colourFlashCnt = 0;
colourValue = "Normal";
soundHandler.playSound(oofSFX);
jumpFunc = bouncingUpAfterCollision;
}
function bouncingUpAfterCollision() {
var _local2 = jumpSinus[jumpSinusOffset];
sprite._y = sprite._y - _local2;
fineY = fineY - _local2;
if (fineY <= 0) {
fineY = fineY + 32;
mapPos.y--;
}
if ((++jumpSinusOffset) == jumpSinusLen) {
jumpSinusOffset--;
fallDistance = 0;
if (currentDir == "Left") {
animFrame = anim_deadRight;
} else {
animFrame = anim_deadLeft;
}
sprite.gotoAndStop(animFrame);
jumpFunc = jumpingDown;
}
flashPlayerRed();
}
function flashPlayerRed() {
if ((++colourFlashCnt) == 2) {
if (colourValue == "Normal") {
colourFlashCnt = 1;
colourValue = "Red";
colour.setTransform(colourHandler.setTint(255, 0, 0, 50));
} else {
colourFlashCnt = 0;
colourValue = "Normal";
colour.setTransform(colourHandler.restoreColour());
}
}
}
function tileCollisionCheck(attribute) {
if ((attribute == LoveJuice.ItemDefs.tile_barrier) || (attribute == LoveJuice.ItemDefs.tile_barrier2)) {
return(true);
}
}
function goalCompletePause() {
if ((++levelCompleteCnt) >= 403) {
if (jumpFunc == null) {
if (currentDir == "Right") {
sprite.gotoAndStop(anim_standRight);
} else {
sprite.gotoAndStop(anim_standLeft);
}
inputFunc = null;
levelCompleteCnt = 0;
hud.displayLevelCompleteText();
invunrableFunc = goalCompleteEnd;
}
} else if (levelCompleteCnt == 31) {
main.getInitInstance().getGameController().getBaddieHandler().startCandyShower();
}
}
function goalCompleteEnd() {
if ((++levelCompleteCnt) >= 93) {
gameController.levelComplete();
}
}
function scrollRight(speedArg) {
speedArg = Math.round(speedArg);
if ((playField._x - speedArg) <= -18) {
return(undefined);
}
scroller.scrollRight(speedArg);
parallaxScrollRect.x = parallaxScrollRect.x + (speedArg / 4);
playField2.scrollRect = parallaxScrollRect;
}
function scrollLeft(speedArg) {
speedArg = Math.round(speedArg);
if ((playField._x + speedArg) >= 204) {
return(undefined);
}
scroller.scrollLeft(speedArg);
parallaxScrollRect.x = parallaxScrollRect.x - (speedArg / 4);
playField2.scrollRect = parallaxScrollRect;
}
function scrollDown(speedArg) {
var _local3 = -((mapHeight * 32) - 448);
speedArg = Math.round(speedArg);
if ((playField._y - speedArg) < _local3) {
speedArg = playField._y - _local3;
}
scroller.scrollDown(speedArg);
parallaxScrollRect.y = parallaxScrollRect.y + (speedArg / 4);
playField2.scrollRect = parallaxScrollRect;
}
function scrollUp(speedArg) {
if (playField._y > 0) {
return(undefined);
}
speedArg = Math.round(speedArg);
scroller.scrollUp(speedArg);
parallaxScrollRect.y = parallaxScrollRect.y - (speedArg / 4);
playField2.scrollRect = parallaxScrollRect;
}
function verticalScrollHandler() {
if (inputFunc == killedPause) {
return(undefined);
}
if (levelCompleteFlag == true) {
return(undefined);
}
var _local2;
if (finePos.y < 320) {
if (playField._y == 0) {
return(undefined);
}
_local2 = 320 - finePos.y;
if (_local2 > 25) {
_local2 = 25;
}
if ((playField._y + _local2) > 0) {
_local2 = Math.abs(playField._y);
}
var _local3 = finePos.y - 320;
_local3 = _local3 + _local2;
if (_local3 == -16) {
return(undefined);
}
scrollUp(_local2);
} else {
if (finePos.y == 320) {
return(undefined);
}
var _local4 = scroller.getMapYPos();
if ((_local4 - 2) >= mapHeight) {
return(undefined);
}
if (jumpFunc == jumpingUp) {
return(undefined);
}
_local2 = finePos.y - 320;
if (beingHitFlag == false) {
if (_local2 > 16) {
_local2 = 16;
}
} else if (_local2 > 8) {
_local2 = 8;
}
scrollDown(_local2);
}
}
function triggerParticles(amount, pos) {
var _local3 = playField.getNextHighestDepth();
var _local2;
var _local5 = -1;
while (_local5++ , _local5 != amount) {
_local2 = playField.attachMovie("particle", "particle" + _local3, _local3++);
_local2.xposition = (_local2._x = pos.x);
_local2.yposition = (_local2._y = pos.y);
_local2.xvel = int((Math.random() * 10) - 5);
_local2.yvel = int((Math.random() * 10) - 25);
_local2.gravity = 0.7;
_local2.delay = 40;
_local2.onEnterFrame = function () {
this.yposition = this.yposition + this.yvel;
this.yvel = this.yvel + this.gravity;
this.xposition = this.xposition + this.xvel;
this._y = this.yposition;
this._x = this.xposition;
if ((--this.delay) <= 0) {
this._alpha = this._alpha - 10;
if (this._alpha <= 0) {
this.removeMovieClip();
}
}
};
}
}
function verticalCollisionCheck() {
var _local2 = Math.round((sprite._y + 32) / 32);
currentAttribute = map[_local2][mapPos.x][1];
if ((currentAttribute == 1) || (currentAttribute == LoveJuice.ItemDefs.tile_barrier2)) {
return(true);
}
return(false);
}
function verticalHeadCollisionCheck() {
var _local2 = Math.round((sprite._y - 48) / 32);
currentAttribute = map[_local2][mapPos.x][1];
if (currentAttribute == LoveJuice.ItemDefs.tile_barrier) {
return(true);
}
return(false);
}
function verticalSlopeTileCheck() {
var _local2 = Math.round((sprite._y + 32) / 32);
return(map[mapPos.y][mapPos.x][1]);
}
function killed() {
killedDelayCnt = 0;
panningFunc = (jumpFunc = null);
inputFunc = killedPause;
}
function killedPause() {
if ((++killedDelayCnt) == 70) {
inputFunc = null;
gameController.lifeLost();
} else if (killedDelayCnt == 15) {
gameController.reduceNumberOfLives();
}
}
var leftScrollBoundary = 6;
var jumpSinus = new Array(16, 15, 14, 13, 12, 10, 9, 8, 7, 6, 5, 4, 3, 2, 2, 1, 1);
var hitJumpSinus = new Array(8, 8, 7, 7, 6, 6, 5, 5, 4, 4, 3, 3, 3, 2, 2, 2, 1, 1, 1, 1);
var doubleJumpSinus = new Array(25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 10, 9, 8, 7, 6, 5, 4, 3, 2, 2, 1, 1);
var anim_walkRight = 1;
var anim_walkLeft = 2;
var anim_jumpInitRight = 3;
var anim_jumpInitLeft = 4;
var anim_jumpRight = 5;
var anim_jumpLeft = 6;
var anim_standRight = 7;
var anim_standLeft = 8;
var anim_hitRight = 9;
var anim_hitLeft = 10;
var anim_deadRight = 11;
var anim_deadLeft = 12;
var inkey = Key.isDown;
var key_left = 37;
var key_right = 39;
var key_up = 38;
var key_down = 40;
var key_action = 32;
}
Symbol 860 MovieClip [__Packages.LoveJuice.Info.HUD] Frame 0
class LoveJuice.Info.HUD
{
var main, mainMovie, infoBar, soundHandler, readysteadygoSFX, levelTextDelay, goalCheerSFX;
function HUD () {
main = Main.getInstance();
mainMovie = main.getMainMovie();
infoBar = mainMovie.infoBar;
soundHandler = main.getInitInstance().getSoundHandler();
readysteadygoSFX = soundHandler.createSound(mainMovie, "readysteadygoSFX");
}
function toString() {
return("HUD");
}
function updateScore(score) {
infoBar.score.text = score;
}
function updateLives(lives) {
infoBar.lives.text = lives;
}
function displayLevelText(level) {
var _local2 = infoBar.levelNameInfo;
_local2.level.text = "level " + level;
_local2._alpha = 0;
_local2._visible = true;
_local2.onEnterFrame = gamingyourway.common.Delegate.create(this, fadeInLevelText);
soundHandler.setDefaultVolume(readysteadygoSFX, soundHandler.getMasterVolume());
soundHandler.playSound(readysteadygoSFX);
}
function displayGoalPoint() {
var _local2 = infoBar.goalText;
_local2._alpha = 100;
_local2._visible = true;
_local2.gotoAndPlay(1);
levelTextDelay = 0;
_local2.onEnterFrame = gamingyourway.common.Delegate.create(this, goalTextDelayHandler);
goalCheerSFX = soundHandler.createSound(_local2, "goalCheerSFX");
soundHandler.playSound(goalCheerSFX);
}
function displayLevelCompleteText() {
var _local2 = infoBar.goalText;
_local2._alpha = 100;
_local2._visible = true;
_local2.gotoAndPlay("levelCompleteIn");
levelTextDelay = 31;
_local2.onEnterFrame = gamingyourway.common.Delegate.create(this, goalTextDelayHandler);
}
function setShotPower(arg) {
infoBar.shotPower.gotoAndStop(arg);
}
function resetRootVolume() {
soundHandler.setDefaultVolume(readysteadygoSFX, soundHandler.getMasterVolume());
}
function fadeInLevelText() {
var _local2 = infoBar.levelNameInfo;
_local2._alpha = _local2._alpha + 20;
if (_local2._alpha >= 100) {
_local2._alpha = 100;
levelTextDelay = 0;
_local2.onEnterFrame = gamingyourway.common.Delegate.create(this, levelTextDelayHandler);
}
}
function levelTextDelayHandler() {
if ((++levelTextDelay) == 62) {
infoBar.levelNameInfo.onEnterFrame = gamingyourway.common.Delegate.create(this, fadeOutLevelText);
}
}
function fadeOutLevelText() {
var _local2 = infoBar.levelNameInfo;
_local2._alpha = _local2._alpha - 10;
if (_local2._alpha <= 0) {
_local2._alpha = 0;
_local2._visible = false;
delete _local2.onEnterFrame;
}
}
function fadeInCheckPointText() {
var _local2 = infoBar.checkpointText;
_local2._alpha = _local2._alpha + 20;
if (_local2._alpha >= 100) {
_local2._alpha = 100;
levelTextDelay = 0;
_local2.onEnterFrame = gamingyourway.common.Delegate.create(this, checkpointTextDelayHandler);
}
}
function checkpointTextDelayHandler() {
if ((++levelTextDelay) == 62) {
infoBar.checkpointText.onEnterFrame = gamingyourway.common.Delegate.create(this, fadeOutCheckPointText);
}
}
function fadeOutCheckPointText() {
var _local2 = infoBar.checkpointText;
_local2._alpha = _local2._alpha - 10;
if (_local2._alpha <= 0) {
_local2._alpha = 0;
_local2._visible = false;
delete _local2.onEnterFrame;
}
}
function goalTextDelayHandler() {
if ((++levelTextDelay) == 93) {
infoBar.goalText.onEnterFrame = gamingyourway.common.Delegate.create(this, fadeOutGoalText);
}
}
function fadeOutGoalText() {
var _local2 = infoBar.goalText;
_local2._alpha = _local2._alpha - 10;
if (_local2._alpha <= 0) {
_local2._alpha = 0;
_local2._visible = false;
delete _local2.onEnterFrame;
}
}
}
Symbol 861 MovieClip [__Packages.gamingyourway.common.SoundHandler] Frame 0
class gamingyourway.common.SoundHandler
{
var masterVolume;
function SoundHandler (vol) {
if (vol == undefined) {
masterVolume = 100;
} else {
masterVolume = vol;
}
}
function toString() {
return("SoundHandler");
}
function createSound(mc, linkageID) {
mc._sfx = new Sound(mc);
mc._sfx.attachSound(linkageID);
var _local2 = mc._sfx;
setDefaultVolume(_local2);
_local2._object = this;
_local2._MovieClip = mc;
_local2._playing = false;
_local2._linkage = linkageID;
mc._object = this;
return(_local2);
}
function createSoundAndMC(mcHolder, linkageID) {
var _local2 = mcHolder.createEmptyMovieClip("mc_" + linkageID, mcHolder.getNextHighestDepth());
var _local3 = createSound(_local2, linkageID);
return(_local3);
}
function createPlayAndDispose(mcHolder, linkageID) {
if (masterVolume == 0) {
return(undefined);
}
var _local2 = mcHolder.createEmptyMovieClip("mc_" + linkageID, mcHolder.getNextHighestDepth());
var sound = createSound(_local2, linkageID);
sound.start();
sound.setVolume(masterVolume);
sound.onSoundComplete = function () {
sound.stop();
var _local1 = sound._MovieClip;
_local1.removeMovieClip();
};
}
function playSound(sfx) {
if (sfx._playing == true) {
return(undefined);
}
sfx._playing = true;
sfx.start();
sfx.onSoundComplete = function () {
sfx._playing = false;
};
}
function stopSound(sfx) {
delete sfx.onSoundComplete;
sfx._playing = false;
sfx.stop();
}
function loopSound(sfx, offset) {
sfx._playing = true;
var _local1 = sfx._MovieClip;
if (offset != undefined) {
_local1.offset = offset;
} else {
_local1.offset = 0;
}
sfx.start(offset);
sfx.onSoundComplete = function () {
sfx._object.loopSound(sfx, sfx._MovieClip.offset);
};
}
function simpleLoopSound(sfx, offset) {
sfx._playing = true;
if (offset == undefined) {
sfx.start(0, 9999999);
} else {
sfx.start(offset, 9999999);
}
sfx.onSoundComplete = function () {
sfx._object.simpleLoopSound(sfx);
};
}
function chainSounds(sfx, sfx2) {
sfx._playing = true;
sfx._chainedSFX = sfx2;
sfx.start();
sfx.onSoundComplete = function () {
sfx._chainedSFX.start();
};
}
function mute(sfx) {
sfx.setVolume(0);
}
function setDefaultVolume(sfx, vol) {
if (vol == undefined) {
vol = masterVolume;
}
if (vol > masterVolume) {
vol = masterVolume;
}
sfx.setVolume(vol);
var _local2 = sfx._MovieClip;
if (_local2.fadingUp == true) {
if (_local2.endVolume >= vol) {
_local2.endVolume = vol;
}
_local2.fadingUp = false;
delete _local2.onEnterFrame;
}
}
function fadeSoundIn(sfx, speed, endVolume, amount) {
var mc = sfx._MovieClip;
mc.speed = speed;
if (endVolume == undefined) {
mc.endVolume = getMasterVolume();
} else {
if (endVolume > masterVolume) {
endVolume = masterVolume;
}
mc.endVolume = endVolume;
}
if (amount != undefined) {
mc.amount = amount;
} else {
mc.amount = 1;
}
mc.delay = 0;
mc.fadingUp = true;
mc._prevPosition = mc._sfx.position;
mc.onEnterFrame = function () {
if ((++mc.delay) >= mc.speed) {
mc.delay = 0;
var _local1 = mc._sfx.getVolume();
if (_local1 < mc.endVolume) {
_local1 = _local1 + mc.amount;
} else {
_local1 = mc.endVolume;
mc.fadingUp = false;
delete mc.onEnterFrame;
}
mc._sfx.setVolume(_local1);
}
};
}
function fadeSoundOut(sfx, speed, endVolume, amount) {
var mc = sfx._MovieClip;
mc.speed = speed;
if (endVolume == undefined) {
mc.endVolume = 0;
} else {
if (endVolume > masterVolume) {
endVolume = masterVolume;
}
mc.endVolume = endVolume;
}
if (amount != undefined) {
mc.amount = amount;
} else {
mc.amount = 1;
}
mc.delay = 0;
mc.onEnterFrame = function () {
if ((++mc.delay) >= mc.speed) {
mc.delay = 0;
var _local1 = mc._sfx.getVolume();
if (_local1 > mc.endVolume) {
_local1 = _local1 - mc.amount;
} else {
if (_local1 == mc.endVolume) {
if (_local1 == 0) {
mc._object.stopSound(mc._sfx);
}
delete mc.onEnterFrame;
return(undefined);
}
_local1 = mc.endVolume;
}
mc._sfx.setVolume(_local1);
}
};
}
function getMasterVolume() {
return(masterVolume);
}
function getPlayingStatus(sfx) {
return(sfx._playing);
}
function setMasterVolume(arg) {
masterVolume = arg;
}
function setDistancePan(sfx) {
var _local2 = sfx._MovieClip;
sfx.setPan(_local2._x / soundRatio);
}
function toggleVolume() {
trace("SoundHandler.toggleVolume()");
if (masterVolume == 0) {
setMasterVolume(100);
} else {
setMasterVolume(0);
}
}
var soundRatio = Stage.width / 100;
}
Symbol 862 MovieClip [__Packages.gamingyourway.common.ColourHandler] Frame 0
class gamingyourway.common.ColourHandler
{
function ColourHandler () {
}
function setBrightness(bright) {
var _local2 = 0;
if (bright > 0) {
_local2 = 256 * (bright / 100);
}
var _local1 = new Object();
_local1.ra = (_local1.ga = (_local1.ba = 100 - Math.abs(bright)));
_local1.rb = (_local1.gb = (_local1.bb = _local2));
return(_local1);
}
function setTint(r, g, b, amount) {
var _local1 = new Object();
_local1.ra = (_local1.ga = (_local1.ba = 100 - amount));
var _local2 = amount / 100;
_local1.rb = r * _local2;
_local1.gb = g * _local2;
_local1.bb = b * _local2;
return(_local1);
}
function restoreColour() {
var _local1 = {ra:100, ga:100, ba:100, rb:0, gb:0, bb:0};
return(_local1);
}
function greyScaleFilter(r, g, b) {
var _local2;
var _local1;
var _local3;
if (r == undefined) {
_local2 = 0.3086;
} else {
_local2 = r;
}
if (g == undefined) {
_local1 = 0.6094;
} else {
_local1 = g;
}
if (b == undefined) {
_local3 = 0.082;
} else {
_local3 = b;
}
var _local4 = [_local2, _local1, _local3, 0, 0, _local2, _local1, _local3, 0, 1, _local2, _local1, _local3, 0, 0, 0, 0, 0, 1, 0];
var _local5 = new flash.filters.ColorMatrixFilter(_local4);
return(_local5);
}
}
Symbol 863 MovieClip [__Packages.LoveJuice.BulletHandler] Frame 0
class LoveJuice.BulletHandler
{
var main, mainMovie, activeBullets, baddieHandler, soundHandler, shoot1SFX, shoot2SFX, shoot3SFX, shoot4SFX;
function BulletHandler () {
main = Main.getInstance();
mainMovie = main.getMainMovie();
}
function toString() {
return("BulletHandler");
}
function init() {
activeBullets = new Array();
if (baddieHandler == undefined) {
baddieHandler = main.getInitInstance().getGameController().getBaddieHandler();
soundHandler = main.getInitInstance().getSoundHandler();
shoot1SFX = soundHandler.createSoundAndMC(mainMovie, "shoot1SFX");
shoot2SFX = soundHandler.createSoundAndMC(mainMovie, "shoot2SFX");
shoot3SFX = soundHandler.createSoundAndMC(mainMovie, "shoot3SFX");
shoot4SFX = soundHandler.createSoundAndMC(mainMovie, "shoot4SFX");
}
}
function shoot(playerPos, playerDirection, power) {
var _local3 = new LoveJuice.Bullet(playerPos, playerDirection, power);
if (power <= 2) {
soundHandler.playSound(shoot1SFX);
} else if (power <= 4) {
soundHandler.playSound(shoot2SFX);
} else if (power == 5) {
soundHandler.playSound(shoot3SFX);
} else {
soundHandler.playSound(shoot4SFX);
}
activeBullets.push(_local3);
}
function mainloop() {
var _local5 = baddieHandler.getOnscreenBaddies();
var _local3;
var _local2 = -1;
var _local4 = activeBullets.length;
while (_local2++ , _local2 != _local4) {
_local3 = activeBullets[_local2];
if (_local3.mainloop(_local5) == "dead") {
_local3.dispose();
activeBullets.splice(_local2, 1);
_local2--;
if (_local2 == 0) {
break;
}
}
}
}
function houseKeeping() {
var _local3;
var _local2 = -1;
var _local4 = activeBullets.length;
while (_local2++ , _local2 != _local4) {
_local3 = activeBullets[_local2];
_local3.dispose();
}
}
}
Symbol 864 MovieClip [__Packages.LoveJuice.Baddies.BaddieHandler] Frame 0
class LoveJuice.Baddies.BaddieHandler
{
static var main, mainMovie, _this, playField, scroller, player, playerSprite, eventHandler, soundHandler, caughtinbubbleSFX, mutatedSFX, lazerSFX, level, mapData, collectedSFXOffset, scrollWindow, playerPos;
var gameController, levelHandler, collectSFX1, collectSFX2, collectSFX3, collectSFX4, collectSFX5, bonusDyingSquelchSFX, activeBaddies, currentGoal, mainFunc, candyTriggerDelay, candyCnt, numberOfCoins, numberOfCandy, onscreenBaddies, groupNumber;
function BaddieHandler () {
}
function toString() {
return("BaddieHandler");
}
function oneShot() {
main = Main.getInstance();
mainMovie = main.getMainMovie();
_this = this;
if (playField == undefined) {
playField = mainMovie.playField;
gameController = main.getInitInstance().getGameController();
scroller = gameController.getScroller();
player = gameController.getPlayer();
playerSprite = player.getPlayerSprite();
levelHandler = main.getInitInstance().getLevelHandler();
eventHandler = main.getInitInstance().getEventHandler();
}
soundHandler = main.getInitInstance().getSoundHandler();
collectSFX1 = soundHandler.createSoundAndMC(playField, "collectSFX1");
collectSFX2 = soundHandler.createSoundAndMC(playField, "collectSFX2");
collectSFX3 = soundHandler.createSoundAndMC(playField, "collectSFX3");
collectSFX4 = soundHandler.createSoundAndMC(playField, "collectSFX4");
collectSFX5 = soundHandler.createSoundAndMC(playField, "collectSFX5");
bonusDyingSquelchSFX = soundHandler.createSoundAndMC(playField, "bonusDyingSquelchSFX");
caughtinbubbleSFX = soundHandler.createSoundAndMC(playField, "caughtinbubbleSFX");
mutatedSFX = soundHandler.createSoundAndMC(playField, "mutatedSFX");
lazerSFX = soundHandler.createSoundAndMC(playField, "lazerSFX");
activeBaddies = new Array();
}
function init() {
currentGoal.dispose();
var _local3 = gameController.getLevel();
if (level != _local3) {
houseKeeping();
activeBaddies = new Array();
level = _local3;
mapData = levelHandler.getMapData(level);
createLevelObjects();
} else {
restoreObjects();
}
collectedSFXOffset = 0;
var _local2 = soundHandler.getMasterVolume();
soundHandler.setDefaultVolume(collectSFX1, _local2);
soundHandler.setDefaultVolume(collectSFX2, _local2);
soundHandler.setDefaultVolume(collectSFX3, _local2);
soundHandler.setDefaultVolume(collectSFX4, _local2);
soundHandler.setDefaultVolume(collectSFX5, _local2);
soundHandler.setDefaultVolume(bonusDyingSquelchSFX, _local2);
soundHandler.setDefaultVolume(mutatedSFX, _local2);
soundHandler.setDefaultVolume(lazerSFX, _local2);
mainFunc = normalMainLoop;
mainFunc();
}
function startCandyShower() {
houseKeepingWithoutTrees();
candyTriggerDelay = (candyCnt = 0);
var _local2 = -1;
while (_local2++ , _local2 != 8) {
triggerCandy();
}
mainFunc = showerMainLoop;
}
static function playCollectedSFX() {
if ((++collectedSFXOffset) == 5) {
collectedSFXOffset = 1;
}
var _local1 = _this["collectSFX" + collectedSFXOffset];
soundHandler.playSound(_local1);
}
static function playTrappedSFX() {
soundHandler.playSound(caughtinbubbleSFX);
}
static function playMutatedSFX() {
soundHandler.playSound(mutatedSFX);
}
static function playLazerSFX() {
soundHandler.playSound(lazerSFX);
}
function mainloop() {
mainFunc();
}
function houseKeeping() {
var _local3;
var _local2 = -1;
var _local4 = activeBaddies.length;
while (_local2++ , _local2 != _local4) {
_local3 = activeBaddies[_local2];
_local3.dispose();
}
}
function houseKeepingWithoutTrees() {
var _local2;
var _local3 = -1;
var _local4 = activeBaddies.length;
while (_local3++ , _local3 != _local4) {
_local2 = activeBaddies[_local3];
if (_local2.toString() != "Tree") {
_local2.dispose();
}
}
}
function getNumberOfCoins() {
return(numberOfCoins);
}
function getNumberOfCandy() {
return(numberOfCandy);
}
function getOnscreenBaddies() {
return(onscreenBaddies);
}
function normalMainLoop() {
scrollWindow = scroller.getScrollWindow();
playerPos = player.getMapPos();
onscreenBaddies = new Array();
var _local2;
var _local3;
var _local6 = 0;
var _local5 = activeBaddies.length;
var _local4 = -1;
while (_local4++ , _local4 != _local5) {
_local2 = activeBaddies[_local4];
_local3 = _local2.mainloop();
if (_local3 == "notReached") {
_local6++;
if (_local6 == 3) {
break;
}
} else if (_local3 == "running") {
onscreenBaddies.push(_local2);
}
}
}
function showerMainLoop() {
var _local3;
var _local4 = activeBaddies.length;
var _local2 = -1;
while (_local2++ , _local2 != _local4) {
_local3 = activeBaddies[_local2];
if (_local3.mainloop() == "dead") {
_local3.dispose();
activeBaddies.splice(_local2, 1);
_local2--;
}
}
if ((++candyCnt) == 372) {
_local2 = -1;
while (_local2++ , _local2 != _local4) {
_local3 = activeBaddies[_local2];
_local3.destroy();
}
soundHandler.playSound(bonusDyingSquelchSFX);
return(undefined);
}
if (candyCnt >= 403) {
mainFunc = null;
return(undefined);
}
if (candyCnt > 372) {
return(undefined);
}
if ((--candyTriggerDelay) <= 0) {
candyTriggerDelay = int(Math.random() * 20) + 5;
triggerCandy();
}
}
function triggerCandy() {
var _local2 = new flash.geom.Point(int(Math.random() * 19), playerPos.y - 12);
var _local3 = new LoveJuice.Baddies.Candy(_local2);
activeBaddies.push(_local3);
}
function createLevelObjects() {
var _local8 = new Array();
var _local11 = levelHandler.getObjectData(level);
var _local9 = levelHandler.getObjectSize(level);
var _local4 = -1;
var _local2 = -1;
var _local3;
var _local5;
groupNumber = 1;
switchFlag = (invisibleTileFlag = false);
while (_local4++ , _local4 != _local9.y) {
_local2 = -1;
while (_local2++ , _local2 < _local9.x) {
_local3 = _local11[_local4][_local2][1];
if (_local3 > 0) {
_local5 = {type:Number(_local3), pos:new flash.geom.Point(_local2, _local4)};
_local8.push(_local5);
}
}
}
_local8.reverse();
var _local10 = -1;
var _local12 = _local8.length;
while (_local10++ , _local10 != _local12) {
activeBaddies.push(createObject(_local8[_local10]));
if ((switchFlag == true) && (invisibleTileFlag == true)) {
switchFlag = (invisibleTileFlag = false);
groupNumber++;
}
}
}
function createObject(obj) {
var _local2;
mapData = levelHandler.getMapData(level);
var _local4 = levelHandler.getObjectData(level);
switch (obj.type) {
case LoveJuice.ItemDefs.object_coin1 :
_local2 = new LoveJuice.Baddies.Coins(obj.pos);
break;
case LoveJuice.ItemDefs.baddie_panda :
_local2 = new LoveJuice.Baddies.Panda(obj.pos);
break;
case LoveJuice.ItemDefs.baddie_rabbit :
_local2 = new LoveJuice.Baddies.Rabbit(obj.pos);
break;
case LoveJuice.ItemDefs.baddie_loveBird :
_local2 = new LoveJuice.Baddies.LoveBird(obj.pos);
break;
case LoveJuice.ItemDefs.baddie_heartWasp :
_local2 = new LoveJuice.Baddies.HeartWasp(obj.pos);
break;
case LoveJuice.ItemDefs.baddie_fox :
_local2 = new LoveJuice.Baddies.Fox(obj.pos);
break;
case LoveJuice.ItemDefs.baddie_unicorn :
_local2 = new LoveJuice.Baddies.Unicorn(obj.pos);
break;
case LoveJuice.ItemDefs.baddie_dog :
_local2 = new LoveJuice.Baddies.Dog(obj.pos);
break;
case LoveJuice.ItemDefs.object_switch :
switchFlag = true;
_local2 = new LoveJuice.Baddies.Switch(obj.pos, mapData, groupNumber);
break;
case LoveJuice.ItemDefs.object_invisibleTile :
invisibleTileFlag = true;
_local2 = new LoveJuice.Baddies.InvisibleTile(obj.pos, mapData, _local4, groupNumber);
break;
case LoveJuice.ItemDefs.object_tree :
_local2 = new LoveJuice.Baddies.Tree(obj.pos, 1);
break;
case LoveJuice.ItemDefs.object_mushrooms :
_local2 = new LoveJuice.Baddies.Tree(obj.pos, 2);
break;
case LoveJuice.ItemDefs.object_goal :
_local2 = new LoveJuice.Baddies.Goal(obj.pos);
currentGoal = _local2;
}
return(_local2);
}
function restoreObjects() {
var _local3;
var _local2 = -1;
var _local4 = activeBaddies.length;
while (_local2++ , _local2 != _local4) {
_local3 = activeBaddies[_local2];
_local3.restore();
}
}
var switchFlag = false;
var invisibleTileFlag = false;
}
Symbol 865 MovieClip [__Packages.LoveJuice.Baddies.Candy] Frame 0
class LoveJuice.Baddies.Candy extends LoveJuice.Baddies.BaddieHandler
{
var pos, candyBounceSFX, sprite, bonusDyingSquelchSFX, fineY, fineX, acceleration, decayCnt, currentStatus, bounceFlag, xDrift, moveFunc;
function Candy (posArg) {
super();
pos = posArg.clone();
createSprite();
candyBounceSFX = LoveJuice.Baddies.BaddieHandler.soundHandler.createSound(sprite, "landingQuietSFX");
bonusDyingSquelchSFX = LoveJuice.Baddies.BaddieHandler.soundHandler.createSoundAndMC(sprite, "bonusDyingSquelchSFX");
fineY = (fineX = (acceleration = (decayCnt = 0)));
currentStatus = 1;
bounceFlag = false;
xDrift = int(Math.random() * 4) - 2;
moveFunc = moveDown;
}
function toString() {
return("Candy");
}
function mainloop() {
if (currentStatus == 3) {
return("dead");
}
moveFunc();
collisionCheck();
return(null);
}
function dispose() {
LoveJuice.Baddies.BaddieHandler.soundHandler.stopSound(candyBounceSFX);
LoveJuice.Baddies.BaddieHandler.soundHandler.stopSound(bonusDyingSquelchSFX);
sprite.removeMovieClip();
}
function destroy() {
sprite.gotoAndStop(12);
moveFunc = waitingForCollectionToEnd;
}
function getSprite() {
return(sprite);
}
function createSprite() {
var _local2 = LoveJuice.Baddies.BaddieHandler.playField.getNextHighestDepth();
sprite = LoveJuice.Baddies.BaddieHandler.playField.attachMovie("object_candy", "candy" + _local2, _local2);
sprite._x = pos.x * 32;
sprite._y = pos.y * 32;
sprite.gotoAndStop(int(Math.random() * 10) + 1);
}
function moveDown() {
acceleration = acceleration + 0.1;
speed = speed + acceleration;
if (speed > 12) {
speed = 12;
}
sprite._y = sprite._y + speed;
fineY = fineY + speed;
if (fineY > 32) {
fineY = fineY - 32;
pos.y++;
var _local2 = LoveJuice.Baddies.BaddieHandler.mapData[pos.y + 1][pos.x][1];
if (_local2 == 1) {
if (bounceFlag == true) {
if (moveFunc == moveDown) {
moveFunc = decayCheck;
}
return(undefined);
}
acceleration = 0;
speed = 8;
LoveJuice.Baddies.BaddieHandler.soundHandler.playSound(candyBounceSFX);
moveFunc = moveUp;
}
}
sprite._x = sprite._x + xDrift;
fineX = fineX + xDrift;
if (fineX > 32) {
fineX = fineX - 32;
pos.x++;
} else if (fineX < 0) {
fineX = fineX + 32;
pos.x--;
}
}
function moveUp() {
acceleration = acceleration + 0.1;
if (acceleration > 1) {
acceleration = 1;
}
speed = speed - acceleration;
if (speed < 1) {
speed = 1;
acceleration = 0;
bounceFlag = true;
moveFunc = moveDown;
}
sprite._y = sprite._y - speed;
fineY = fineY - speed;
if (fineY < 0) {
fineY = fineY + 32;
pos.y--;
}
sprite._x = sprite._x + xDrift;
fineX = fineX + xDrift;
if (fineX > 32) {
fineX = fineX - 32;
pos.x++;
} else if (fineX < 0) {
fineX = fineX + 32;
pos.x--;
}
}
function decayCheck() {
if ((++decayCnt) >= 124) {
sprite.gotoAndStop(12);
LoveJuice.Baddies.BaddieHandler.soundHandler.playSound(bonusDyingSquelchSFX);
moveFunc = waitingForCollectionToEnd;
}
}
function collisionCheck() {
if (currentStatus != 1) {
return(undefined);
}
if (sprite.hitAreaMC.hitTest(LoveJuice.Baddies.BaddieHandler.playerSprite.hitAreaMC)) {
currentStatus = 2;
LoveJuice.Baddies.BaddieHandler.eventHandler.sendEvent("incScore", 500);
LoveJuice.Baddies.BaddieHandler.playCollectedSFX();
sprite.gotoAndStop(11);
moveFunc = waitingForCollectionToEnd;
}
}
function waitingForCollectionToEnd() {
if (sprite.anim._currentframe == sprite.anim._totalframes) {
sprite._visible = false;
currentStatus = 3;
}
}
var speed = 6;
}
Symbol 866 MovieClip [__Packages.LoveJuice.ItemDefs] Frame 0
class LoveJuice.ItemDefs
{
function ItemDefs () {
}
static var object_goal = 64;
static var object_switch = 65;
static var object_coin1 = 129;
static var object_tree = 134;
static var object_mushrooms = 135;
static var baddie_panda = 180;
static var baddie_rabbit = 181;
static var baddie_loveBird = 182;
static var baddie_heartWasp = 183;
static var baddie_fox = 184;
static var baddie_unicorn = 185;
static var baddie_dog = 186;
static var baddie_crumblingTile = 188;
static var object_invisibleTile = 189;
static var object_invisibleTileChildren = 190;
static var tile_barrier2 = 253;
static var tile_float = 255;
static var tile_barrier = 256;
}
Symbol 867 MovieClip [__Packages.LoveJuice.Baddies.Coins] Frame 0
class LoveJuice.Baddies.Coins extends LoveJuice.Baddies.BaddieHandler
{
var restorePos, pos, currentStatus, offScreenTestCnt, mainFunc, sprite, frame;
function Coins (posArg) {
super();
restorePos = posArg.clone();
restore();
}
function toString() {
return("Coins");
}
function restore() {
pos = restorePos.clone();
createSprite();
currentStatus = 1;
offScreenTestCnt = 0;
mainFunc = null;
}
function mainloop() {
if (currentStatus == 3) {
return(null);
}
if (sprite._visible == true) {
if ((--offScreenTestCnt) <= 0) {
offScreenTestCnt = 31;
}
} else {
if ((pos.y + 3) < LoveJuice.Baddies.BaddieHandler.scrollWindow.y) {
return("notReached");
}
sprite._visible = true;
sprite.gotoAndStop(frame);
offScreenTestCnt = 31;
mainFunc = collisionCheck;
}
mainFunc();
}
function dispose() {
sprite.removeMovieClip();
}
function createSprite() {
var _local2 = LoveJuice.Baddies.BaddieHandler.playField.getNextHighestDepth();
sprite = LoveJuice.Baddies.BaddieHandler.playField.attachMovie("coin1", "coin1_" + _local2, _local2);
sprite._x = pos.x * 32;
sprite._y = pos.y * 32;
frame = int(Math.random() * 8) + 1;
hideSprite();
}
function hideSprite() {
sprite._visible = false;
sprite.gotoAndStop(10);
mainFunc = null;
if (currentStatus == 2) {
currentStatus = 3;
}
}
function collisionCheck() {
if (sprite.hitAreaMC.hitTest(LoveJuice.Baddies.BaddieHandler.playerSprite.hitAreaMC)) {
currentStatus = 2;
LoveJuice.Baddies.BaddieHandler.eventHandler.sendEvent("incScore", 500);
LoveJuice.Baddies.BaddieHandler.playCollectedSFX();
sprite.gotoAndStop(9);
mainFunc = waitingForCollectionToEnd;
}
}
function waitingForCollectionToEnd() {
if (sprite.anim._currentframe == sprite.anim._totalframes) {
hideSprite();
currentStatus = 3;
}
}
}
Symbol 868 MovieClip [__Packages.LoveJuice.Baddies.Panda] Frame 0
class LoveJuice.Baddies.Panda extends LoveJuice.Baddies.BaddieHandler
{
var colourHandler, restorePos, pos, colour, fineX, stunnedCnt, pushSpeed, offScreenTestCnt, currentStatus, pointsDelay, direction, mutatedFlag, sprite, oldMoveFunc, collisionFunc, moveFunc, walkerSlimeSFX, colourFlashCnt, colourValue, trappedVerticalDirection, trappedVerticalSpeed, trappedVerticalMidPointFlag, maxLeft, maxRight, circle1Radius, circle2Radius, circle1x, circle2x, circle1y, circle2y;
function Panda (posArg) {
super();
colourHandler = new gamingyourway.common.ColourHandler();
restorePos = posArg.clone();
restore();
}
function toString() {
return("Panda");
}
function restore() {
pos = restorePos.clone();
createSprite();
colour.setTransform(colourHandler.restoreColour());
fineX = (stunnedCnt = (pushSpeed = (offScreenTestCnt = (currentStatus = (pointsDelay = 0)))));
direction = "Left";
mutatedFlag = false;
speed = 2;
sprite.gotoAndStop(anim_walkLeft);
oldMoveFunc = null;
collisionFunc = collisionCheck;
moveFunc = moveLeft;
}
function mainloop() {
if (sprite._visible == true) {
if ((--offScreenTestCnt) <= 0) {
if (!LoveJuice.Baddies.BaddieHandler.mainMovie.hitAreaMC.hitTest(sprite)) {
hideSprite();
return(null);
}
offScreenTestCnt = 31;
}
} else {
if ((pos.y + 3) < LoveJuice.Baddies.BaddieHandler.scrollWindow.y) {
return("notReached");
}
if (!LoveJuice.Baddies.BaddieHandler.mainMovie.hitAreaMC.hitTest(sprite)) {
return(null);
}
sprite._visible = true;
offScreenTestCnt = 31;
if (currentStatus < 2) {
currentStatus = 1;
if (mutatedFlag == true) {
if (direction == "Left") {
sprite.gotoAndStop(anim_mutatedLeft);
} else {
sprite.gotoAndStop(anim_mutatedRight);
}
} else if (direction == "Left") {
sprite.gotoAndStop(anim_walkLeft);
} else {
sprite.gotoAndStop(anim_walkRight);
}
sprite.anim.gotoAndPlay(1);
} else if (currentStatus == 2) {
if (direction == "Left") {
sprite.gotoAndStop(anim_trappedLeft);
} else {
sprite.gotoAndStop(anim_trappedRight);
}
sprite.anim.gotoAndStop(1);
sprite.anim.heartAnim.gotoAndStop(sprite.anim.heartAnim._totalframes);
}
}
moveFunc();
collisionFunc();
return("running");
}
function dispose() {
LoveJuice.Baddies.BaddieHandler.soundHandler.stopSound(walkerSlimeSFX);
sprite.removeMovieClip();
}
function hit(shotPower) {
if (currentStatus == 2) {
pushSpeed = shotPower;
if ((sprite._x + (sprite._width / 2)) > LoveJuice.Baddies.BaddieHandler.playerSprite._x) {
moveFunc = pushedRight;
} else {
moveFunc = pushedLeft;
}
return(undefined);
}
if (shotPower == 6) {
LoveJuice.Baddies.BaddieHandler.eventHandler.sendEvent("incScore", 500);
trapHim();
return(undefined);
}
stunnedCnt = stunnedCnt + (shotPower * 5);
if (stunnedCnt > 31) {
stunnedCnt = 31;
}
if (power <= 0) {
if (mutatedFlag == false) {
mutatedFlag = true;
LoveJuice.Baddies.BaddieHandler.playMutatedSFX();
speed = 4;
var _local3 = sprite.anim._currentframe;
if (direction == "Left") {
sprite.gotoAndStop(anim_mutatedLeft);
} else {
sprite.gotoAndStop(anim_mutatedRight);
}
sprite.anim.gotoAndStop(_local3);
} else {
LoveJuice.Baddies.BaddieHandler.eventHandler.sendEvent("incScore", 20);
plotPoints(20);
}
} else {
power = power - shotPower;
LoveJuice.Baddies.BaddieHandler.eventHandler.sendEvent("incScore", 10);
plotPoints(10);
}
if (oldMoveFunc == null) {
sprite.anim.gotoAndStop(sprite.anim._currentframe);
oldMoveFunc = moveFunc;
colourFlashCnt = 0;
colourValue = "Normal";
colour.setTransform(colourHandler.restoreColour());
trappedVerticalDirection = "up";
trappedVerticalSpeed = 1;
trappedVerticalMidPointFlag = false;
}
moveFunc = stunned;
}
function getSprite() {
return(sprite);
}
function createSprite() {
var _local2 = LoveJuice.Baddies.BaddieHandler.playField.getNextHighestDepth();
sprite = LoveJuice.Baddies.BaddieHandler.playField.attachMovie("baddie_panda", "panda" + _local2, _local2);
sprite._x = pos.x * 32;
sprite._y = pos.y * 32;
colour = new Color(sprite);
hideSprite();
}
function hideSprite() {
sprite._visible = false;
sprite.anim.gotoAndStop(1);
colourValue = "Normal";
colour.setTransform(colourHandler.restoreColour());
LoveJuice.Baddies.BaddieHandler.soundHandler.stopSound(walkerSlimeSFX);
}
function moveLeft() {
sprite._x = sprite._x - speed;
fineX = fineX - speed;
if (fineX < 0) {
fineX = fineX + 32;
pos.x--;
var _local2 = LoveJuice.Baddies.BaddieHandler.mapData[pos.y][pos.x][1];
if (_local2 != 0) {
maxLeft = pos.x;
direction = "Right";
if (mutatedFlag == false) {
sprite.gotoAndStop(anim_walkRight);
} else {
sprite.gotoAndStop(anim_mutatedRight);
}
moveFunc = moveRight;
} else {
_local2 = LoveJuice.Baddies.BaddieHandler.mapData[pos.y + 1][pos.x][1];
if (_local2 != 1) {
maxLeft = pos.x;
direction = "Right";
sprite.gotoAndStop(2);
moveFunc = moveRight;
}
}
}
}
function moveRight() {
sprite._x = sprite._x + speed;
fineX = fineX + speed;
if (fineX > 32) {
fineX = fineX - 32;
pos.x++;
var _local2 = LoveJuice.Baddies.BaddieHandler.mapData[pos.y][pos.x + 1][1];
if (_local2 != 0) {
maxRight = pos.x;
direction = "Left";
if (mutatedFlag == false) {
sprite.gotoAndStop(anim_walkLeft);
} else {
sprite.gotoAndStop(anim_mutatedLeft);
}
moveFunc = dumbMoveLeft;
} else {
_local2 = LoveJuice.Baddies.BaddieHandler.mapData[pos.y + 1][pos.x + 1][1];
if (_local2 != 1) {
maxRight = pos.x;
direction = "Left";
sprite.gotoAndStop(1);
moveFunc = dumbMoveLeft;
}
}
}
}
function dumbMoveLeft() {
sprite._x = sprite._x - speed;
fineX = fineX - speed;
if (fineX < 0) {
fineX = fineX + 32;
pos.x--;
if (pos.x == maxLeft) {
direction = "Right";
if (mutatedFlag == false) {
sprite.gotoAndStop(anim_walkRight);
} else {
sprite.gotoAndStop(anim_mutatedRight);
}
moveFunc = dumbMoveRight;
}
}
}
function dumbMoveRight() {
sprite._x = sprite._x + speed;
fineX = fineX + speed;
if (fineX > 32) {
fineX = fineX - 32;
pos.x++;
if (pos.x == maxRight) {
direction = "Left";
if (mutatedFlag == false) {
sprite.gotoAndStop(anim_walkLeft);
} else {
sprite.gotoAndStop(anim_mutatedLeft);
}
moveFunc = dumbMoveLeft;
}
}
}
function collisionCheck() {
var _local2 = Math.abs(LoveJuice.Baddies.BaddieHandler.playerPos.y - pos.y);
if (_local2 >= 2) {
return(undefined);
}
_local2 = Math.abs(LoveJuice.Baddies.BaddieHandler.playerPos.x - pos.x);
if (_local2 >= 2) {
return(undefined);
}
if (sprite.hitAreaMC.hitTest(LoveJuice.Baddies.BaddieHandler.playerSprite.hitAreaMC)) {
LoveJuice.Baddies.BaddieHandler.eventHandler.sendEvent("baddieCollision", this);
collisionFunc = null;
}
}
function stunned() {
if ((--stunnedCnt) <= 0) {
sprite.anim.gotoAndPlay(sprite.anim._currentframe);
colour.setTransform(colourHandler.restoreColour());
moveFunc = oldMoveFunc;
oldMoveFunc = null;
return(null);
}
if ((++colourFlashCnt) == 4) {
if (colourValue == "Normal") {
colourFlashCnt = 0;
colourValue = "Red";
colour.setTransform(colourHandler.setTint(255, 0, 0, 80));
} else {
colourFlashCnt = 2;
colourValue = "Normal";
colour.setTransform(colourHandler.restoreColour());
}
}
return(null);
}
function trapHim() {
var _local2 = sprite.anim._currentframe;
if (direction == "Left") {
sprite.gotoAndStop(anim_trappedLeft);
} else {
sprite.gotoAndStop(anim_trappedRight);
}
sprite.anim.gotoAndStop(_local2);
currentStatus = 2;
collisionFunc = trappedCollisionChecks;
colour.setTransform(colourHandler.restoreColour());
moveFunc = null;
circle1Radius = 39;
circle2Radius = 27;
if (direction == "Left") {
circle1x = -32;
circle2x = 38;
} else {
circle1x = -5;
circle2x = -49;
}
circle1y = -54;
circle2y = -44;
circle1x = circle1x + circle1Radius;
circle1y = circle1y + circle1Radius;
circle2x = circle2x + circle2Radius;
circle2y = circle2y + circle2Radius;
if (sprite._x >= 550) {
var _local3 = 550 - sprite._x;
sprite._x = sprite._x + _local3;
pushSpeed = 8;
moveFunc = pushedLeft;
return(undefined);
}
if (sprite._x < 20) {
var _local3 = 20 - sprite._x;
sprite._x = sprite._x - _local3;
pushSpeed = 8;
moveFunc = pushedRight;
return(undefined);
}
sprite.swapDepths(LoveJuice.Baddies.BaddieHandler.playField.getNextHighestDepth());
LoveJuice.Baddies.BaddieHandler.playTrappedSFX();
}
function trappedCollisionChecks() {
trappedVerticalMove();
if (!LoveJuice.Baddies.BaddieHandler.playerSprite.hitTest(sprite)) {
return(undefined);
}
var _local2;
var _local6;
var _local5;
var _local4;
var _local3;
if (LoveJuice.Baddies.BaddieHandler.player.jumpStatus == "jumpingDown") {
_local2 = 10;
_local6 = LoveJuice.Baddies.BaddieHandler.playerSprite._x + (9 + _local2);
_local5 = LoveJuice.Baddies.BaddieHandler.playerSprite._y + (18 + _local2);
_local4 = _local6 - (sprite._x + circle1x);
_local3 = _local5 - (sprite._y + circle1y);
if (((_local4 * _local4) + (_local3 * _local3)) <= ((_local2 + circle1Radius) * (_local2 + circle1Radius))) {
LoveJuice.Baddies.BaddieHandler.player.hiJump();
return(undefined);
}
_local4 = _local6 - (sprite._x + circle2x);
_local3 = _local5 - (sprite._y + circle2y);
if (((_local4 * _local4) + (_local3 * _local3)) <= ((_local2 + circle2Radius) * (_local2 + circle2Radius))) {
LoveJuice.Baddies.BaddieHandler.player.hiJump();
return(undefined);
}
}
var _local7 = LoveJuice.Baddies.BaddieHandler.player.getCollisionCircle();
_local2 = _local7[0];
_local6 = LoveJuice.Baddies.BaddieHandler.playerSprite._x + (_local7[1].x + _local2);
_local5 = LoveJuice.Baddies.BaddieHandler.playerSprite._y + (_local7[1].y + _local2);
_local4 = _local6 - (sprite._x + circle1x);
_local3 = _local5 - (sprite._y + circle1y);
if (((_local4 * _local4) + (_local3 * _local3)) <= ((_local2 + circle1Radius) * (_local2 + circle1Radius))) {
pushSpeed = 8;
if (direction == "Left") {
moveFunc = pushedRight;
} else {
moveFunc = pushedLeft;
}
return(undefined);
}
_local4 = _local6 - (sprite._x + circle2x);
_local3 = _local5 - (sprite._y + circle2y);
if (((_local4 * _local4) + (_local3 * _local3)) <= ((_local2 + circle2Radius) * (_local2 + circle2Radius))) {
pushSpeed = 8;
if (direction == "Left") {
moveFunc = pushedLeft;
} else {
moveFunc = pushedRight;
}
return(undefined);
}
}
function pushedRight() {
if ((sprite._x + pushSpeed) > 550) {
var _local2 = 550 - sprite._x;
sprite._x = sprite._x + _local2;
pushSpeed = pushSpeed * 0.84;
moveFunc = pushedLeft;
return(undefined);
}
sprite._x = sprite._x + pushSpeed;
pushSpeed = pushSpeed * 0.84;
if (pushSpeed < 0.5) {
moveFunc = null;
}
}
function pushedLeft() {
if ((sprite._x - pushSpeed) < 20) {
var _local2 = 20 - sprite._x;
sprite._x = sprite._x - _local2;
pushSpeed = pushSpeed * 0.84;
moveFunc = pushedRight;
return(undefined);
}
sprite._x = sprite._x - pushSpeed;
pushSpeed = pushSpeed * 0.84;
if (pushSpeed < 0.5) {
moveFunc = null;
}
}
function trappedVerticalMove() {
if (trappedVerticalDirection == "up") {
sprite._y = sprite._y - trappedVerticalSpeed;
if (trappedVerticalMidPointFlag == false) {
var _local2 = trappedVerticalSpeed;
_local2 = _local2 * 0.22;
trappedVerticalSpeed = trappedVerticalSpeed + _local2;
if (trappedVerticalSpeed >= 1.9) {
trappedVerticalMidPointFlag = true;
}
} else {
trappedVerticalSpeed = trappedVerticalSpeed * 0.78;
if (trappedVerticalSpeed <= 0.2) {
trappedVerticalDirection = "down";
trappedVerticalSpeed = 0.2;
trappedVerticalMidPointFlag = false;
}
}
} else {
sprite._y = sprite._y + trappedVerticalSpeed;
if (trappedVerticalMidPointFlag == false) {
var _local3 = trappedVerticalSpeed;
_local3 = _local3 * 0.22;
trappedVerticalSpeed = trappedVerticalSpeed + _local3;
if (trappedVerticalSpeed >= 1.9) {
trappedVerticalMidPointFlag = true;
}
} else {
trappedVerticalSpeed = trappedVerticalSpeed * 0.78;
if (trappedVerticalSpeed <= 0.2) {
trappedVerticalDirection = "up";
trappedVerticalSpeed = 0.2;
trappedVerticalMidPointFlag = false;
}
}
}
}
function plotPoints(amount) {
if ((--pointsDelay) > 0) {
return(undefined);
}
pointsDelay = 5;
var _local2 = LoveJuice.Baddies.BaddieHandler.playField.getNextHighestDepth();
var _local4 = "tenPointsAnim";
if (amount == 20) {
_local4 = "twentyPointsAnim";
}
var _local3 = LoveJuice.Baddies.BaddieHandler.playField.attachMovie(_local4, "points" + _local2, _local2);
_local3._x = sprite._x;
_local3._y = sprite._y;
}
var speed = 2;
var power = 8;
var anim_walkLeft = 1;
var anim_walkRight = 2;
var anim_trappedLeft = 3;
var anim_trappedRight = 4;
var anim_mutatedLeft = 5;
var anim_mutatedRight = 6;
}
Symbol 869 MovieClip [__Packages.LoveJuice.Baddies.Rabbit] Frame 0
class LoveJuice.Baddies.Rabbit extends LoveJuice.Baddies.BaddieHandler
{
var colourHandler, activeLazers, restorePos, pos, colour, fineX, stunnedCnt, pushSpeed, offScreenTestCnt, currentStatus, direction, mutatedFlag, sprite, oldMoveFunc, collisionFunc, moveFunc, walkerSlimeSFX, reloadCnt, colourFlashCnt, colourValue, trappedVerticalDirection, trappedVerticalSpeed, trappedVerticalMidPointFlag, maxLeft, maxRight, circle1Radius, circle2Radius, circle1x, circle2x, circle1y, circle2y, pointsDelay;
function Rabbit (posArg) {
super();
colourHandler = new gamingyourway.common.ColourHandler();
activeLazers = new Array();
restorePos = posArg.clone();
restore();
}
function toString() {
return("Rabbit");
}
function restore() {
pos = restorePos.clone();
createSprite();
colour.setTransform(colourHandler.restoreColour());
fineX = (stunnedCnt = (pushSpeed = (offScreenTestCnt = (currentStatus = 0))));
direction = "Left";
mutatedFlag = false;
sprite.gotoAndStop(anim_walkLeft);
oldMoveFunc = null;
collisionFunc = collisionCheck;
moveFunc = moveLeft;
}
function mainloop() {
if (sprite._visible == true) {
if ((--offScreenTestCnt) <= 0) {
if (!LoveJuice.Baddies.BaddieHandler.mainMovie.hitAreaMC.hitTest(sprite)) {
hideSprite();
return(null);
}
offScreenTestCnt = 31;
}
} else {
if ((pos.y + 3) < LoveJuice.Baddies.BaddieHandler.scrollWindow.y) {
return("notReached");
}
if (!LoveJuice.Baddies.BaddieHandler.mainMovie.hitAreaMC.hitTest(sprite)) {
return(null);
}
sprite._visible = true;
offScreenTestCnt = 31;
if (currentStatus < 2) {
currentStatus = 1;
if (mutatedFlag == true) {
if (direction == "Left") {
sprite.gotoAndStop(anim_mutatedLeft);
} else {
sprite.gotoAndStop(anim_mutatedRight);
}
} else if (direction == "Left") {
sprite.gotoAndStop(anim_walkLeft);
} else {
sprite.gotoAndStop(anim_walkRight);
}
sprite.anim.gotoAndPlay(1);
} else if (currentStatus == 2) {
if (direction == "Left") {
sprite.gotoAndStop(anim_trappedLeft);
} else {
sprite.gotoAndStop(anim_trappedRight);
}
sprite.anim.gotoAndStop(1);
sprite.anim.heartAnim.gotoAndStop(sprite.anim.heartAnim._totalframes);
}
}
moveFunc();
collisionFunc();
if (mutatedFlag == true) {
handleBullets();
}
return("running");
}
function dispose() {
LoveJuice.Baddies.BaddieHandler.soundHandler.stopSound(walkerSlimeSFX);
sprite.removeMovieClip();
bulletDispose();
}
function hit(shotPower) {
if (currentStatus == 2) {
pushSpeed = shotPower;
if ((sprite._x + (sprite._width / 2)) > LoveJuice.Baddies.BaddieHandler.playerSprite._x) {
moveFunc = pushedRight;
} else {
moveFunc = pushedLeft;
}
return(undefined);
}
if (shotPower == 6) {
LoveJuice.Baddies.BaddieHandler.eventHandler.sendEvent("incScore", 500);
trapHim();
return(undefined);
}
stunnedCnt = stunnedCnt + (shotPower * 5);
if (stunnedCnt > 31) {
stunnedCnt = 31;
}
if (power <= 0) {
if (mutatedFlag == false) {
mutatedFlag = true;
LoveJuice.Baddies.BaddieHandler.playMutatedSFX();
reloadCnt = 0;
speed = 4;
var _local3 = sprite.anim._currentframe;
if (direction == "Left") {
sprite.gotoAndStop(anim_mutatedLeft);
} else {
sprite.gotoAndStop(anim_mutatedRight);
}
sprite.anim.gotoAndStop(_local3);
} else {
LoveJuice.Baddies.BaddieHandler.eventHandler.sendEvent("incScore", 20);
plotPoints(20);
}
} else {
power = power - shotPower;
LoveJuice.Baddies.BaddieHandler.eventHandler.sendEvent("incScore", 10);
plotPoints(10);
}
if (oldMoveFunc == null) {
sprite.anim.gotoAndStop(sprite.anim._currentframe);
oldMoveFunc = moveFunc;
colourFlashCnt = 0;
colourValue = "Normal";
colour.setTransform(colourHandler.restoreColour());
trappedVerticalDirection = "up";
trappedVerticalSpeed = 1;
trappedVerticalMidPointFlag = false;
}
moveFunc = stunned;
}
function getSprite() {
return(sprite);
}
function createSprite() {
var _local2 = LoveJuice.Baddies.BaddieHandler.playField.getNextHighestDepth();
sprite = LoveJuice.Baddies.BaddieHandler.playField.attachMovie("baddie_rabbit", "rabbit" + _local2, _local2);
sprite._x = pos.x * 32;
sprite._y = pos.y * 32;
colour = new Color(sprite);
hideSprite();
}
function hideSprite() {
sprite._visible = false;
sprite.anim.gotoAndStop(1);
colourValue = "Normal";
colour.setTransform(colourHandler.restoreColour());
LoveJuice.Baddies.BaddieHandler.soundHandler.stopSound(walkerSlimeSFX);
}
function moveLeft() {
sprite._x = sprite._x - speed;
fineX = fineX - speed;
if (fineX < 0) {
fineX = fineX + 32;
pos.x--;
var _local2 = LoveJuice.Baddies.BaddieHandler.mapData[pos.y][pos.x][1];
if (_local2 != 0) {
maxLeft = pos.x;
direction = "Right";
if (mutatedFlag == false) {
sprite.gotoAndStop(anim_walkRight);
} else {
sprite.gotoAndStop(anim_mutatedRight);
}
moveFunc = moveRight;
} else {
_local2 = LoveJuice.Baddies.BaddieHandler.mapData[pos.y + 1][pos.x][1];
if (_local2 != 1) {
maxLeft = pos.x;
direction = "Right";
sprite.gotoAndStop(2);
moveFunc = moveRight;
}
}
}
}
function moveRight() {
sprite._x = sprite._x + speed;
fineX = fineX + speed;
if (fineX > 32) {
fineX = fineX - 32;
pos.x++;
var _local2 = LoveJuice.Baddies.BaddieHandler.mapData[pos.y][pos.x + 1][1];
if (_local2 != 0) {
maxRight = pos.x;
direction = "Left";
if (mutatedFlag == false) {
sprite.gotoAndStop(anim_walkLeft);
} else {
sprite.gotoAndStop(anim_mutatedLeft);
}
moveFunc = dumbMoveLeft;
} else {
_local2 = LoveJuice.Baddies.BaddieHandler.mapData[pos.y + 1][pos.x + 1][1];
if (_local2 != 1) {
maxRight = pos.x;
direction = "Left";
sprite.gotoAndStop(1);
moveFunc = dumbMoveLeft;
}
}
}
}
function dumbMoveLeft() {
sprite._x = sprite._x - speed;
fineX = fineX - speed;
if (fineX < 0) {
fineX = fineX + 32;
pos.x--;
if (pos.x == maxLeft) {
direction = "Right";
if (mutatedFlag == false) {
sprite.gotoAndStop(anim_walkRight);
} else {
sprite.gotoAndStop(anim_mutatedRight);
}
moveFunc = dumbMoveRight;
}
}
}
function dumbMoveRight() {
sprite._x = sprite._x + speed;
fineX = fineX + speed;
if (fineX > 32) {
fineX = fineX - 32;
pos.x++;
if (pos.x == maxRight) {
direction = "Left";
if (mutatedFlag == false) {
sprite.gotoAndStop(anim_walkLeft);
} else {
sprite.gotoAndStop(anim_mutatedLeft);
}
moveFunc = dumbMoveLeft;
}
}
}
function collisionCheck() {
var _local2 = Math.abs(LoveJuice.Baddies.BaddieHandler.playerPos.y - pos.y);
if (_local2 >= 2) {
return(undefined);
}
_local2 = Math.abs(LoveJuice.Baddies.BaddieHandler.playerPos.x - pos.x);
if (_local2 >= 2) {
return(undefined);
}
if (sprite.hitAreaMC.hitTest(LoveJuice.Baddies.BaddieHandler.playerSprite.hitAreaMC)) {
LoveJuice.Baddies.BaddieHandler.eventHandler.sendEvent("baddieCollision", this);
collisionFunc = null;
}
}
function stunned() {
if ((--stunnedCnt) <= 0) {
sprite.anim.gotoAndPlay(sprite.anim._currentframe);
colour.setTransform(colourHandler.restoreColour());
moveFunc = oldMoveFunc;
oldMoveFunc = null;
return(null);
}
if ((++colourFlashCnt) == 4) {
if (colourValue == "Normal") {
colourFlashCnt = 0;
colourValue = "Red";
colour.setTransform(colourHandler.setTint(255, 0, 0, 80));
} else {
colourFlashCnt = 2;
colourValue = "Normal";
colour.setTransform(colourHandler.restoreColour());
}
}
return(null);
}
function trapHim() {
var _local2 = sprite.anim._currentframe;
if (direction == "Left") {
sprite.gotoAndStop(anim_trappedLeft);
} else {
sprite.gotoAndStop(anim_trappedRight);
}
mutatedFlag = false;
bulletDispose();
sprite.anim.gotoAndStop(_local2);
currentStatus = 2;
collisionFunc = trappedCollisionChecks;
moveFunc = null;
circle1Radius = 39;
circle2Radius = 27;
if (direction == "Left") {
circle1x = -32;
circle2x = 38;
} else {
circle1x = -5;
circle2x = -49;
}
circle1y = -54;
circle2y = -44;
circle1x = circle1x + circle1Radius;
circle1y = circle1y + circle1Radius;
circle2x = circle2x + circle2Radius;
circle2y = circle2y + circle2Radius;
if (sprite._x >= 550) {
var _local3 = 550 - sprite._x;
sprite._x = sprite._x + _local3;
pushSpeed = 8;
moveFunc = pushedLeft;
return(undefined);
}
if (sprite._x < 20) {
var _local3 = 20 - sprite._x;
sprite._x = sprite._x - _local3;
pushSpeed = 8;
moveFunc = pushedRight;
return(undefined);
}
sprite.swapDepths(LoveJuice.Baddies.BaddieHandler.playField.getNextHighestDepth());
}
function trappedCollisionChecks() {
trappedVerticalMove();
if (!LoveJuice.Baddies.BaddieHandler.playerSprite.hitTest(sprite)) {
return(undefined);
}
var _local2;
var _local6;
var _local5;
var _local4;
var _local3;
if (LoveJuice.Baddies.BaddieHandler.player.jumpStatus == "jumpingDown") {
_local2 = 10;
_local6 = LoveJuice.Baddies.BaddieHandler.playerSprite._x + (9 + _local2);
_local5 = LoveJuice.Baddies.BaddieHandler.playerSprite._y + (18 + _local2);
_local4 = _local6 - (sprite._x + circle1x);
_local3 = _local5 - (sprite._y + circle1y);
if (((_local4 * _local4) + (_local3 * _local3)) <= ((_local2 + circle1Radius) * (_local2 + circle1Radius))) {
LoveJuice.Baddies.BaddieHandler.player.hiJump();
return(undefined);
}
_local4 = _local6 - (sprite._x + circle2x);
_local3 = _local5 - (sprite._y + circle2y);
if (((_local4 * _local4) + (_local3 * _local3)) <= ((_local2 + circle2Radius) * (_local2 + circle2Radius))) {
LoveJuice.Baddies.BaddieHandler.player.hiJump();
return(undefined);
}
}
var _local7 = LoveJuice.Baddies.BaddieHandler.player.getCollisionCircle();
_local2 = _local7[0];
_local6 = LoveJuice.Baddies.BaddieHandler.playerSprite._x + (_local7[1].x + _local2);
_local5 = LoveJuice.Baddies.BaddieHandler.playerSprite._y + (_local7[1].y + _local2);
_local4 = _local6 - (sprite._x + circle1x);
_local3 = _local5 - (sprite._y + circle1y);
if (((_local4 * _local4) + (_local3 * _local3)) <= ((_local2 + circle1Radius) * (_local2 + circle1Radius))) {
pushSpeed = 8;
if (direction == "Left") {
moveFunc = pushedRight;
} else {
moveFunc = pushedLeft;
}
return(undefined);
}
_local4 = _local6 - (sprite._x + circle2x);
_local3 = _local5 - (sprite._y + circle2y);
if (((_local4 * _local4) + (_local3 * _local3)) <= ((_local2 + circle2Radius) * (_local2 + circle2Radius))) {
pushSpeed = 8;
if (direction == "Left") {
moveFunc = pushedLeft;
} else {
moveFunc = pushedRight;
}
return(undefined);
}
}
function pushedRight() {
if ((sprite._x + pushSpeed) > 550) {
var _local2 = 550 - sprite._x;
sprite._x = sprite._x + _local2;
pushSpeed = pushSpeed * 0.84;
moveFunc = pushedLeft;
return(undefined);
}
sprite._x = sprite._x + pushSpeed;
pushSpeed = pushSpeed * 0.84;
if (pushSpeed < 0.5) {
moveFunc = null;
}
}
function pushedLeft() {
if ((sprite._x - pushSpeed) < 20) {
var _local2 = 20 - sprite._x;
sprite._x = sprite._x - _local2;
pushSpeed = pushSpeed * 0.84;
moveFunc = pushedRight;
return(undefined);
}
sprite._x = sprite._x - pushSpeed;
pushSpeed = pushSpeed * 0.84;
if (pushSpeed < 0.5) {
moveFunc = null;
}
}
function trappedVerticalMove() {
if (trappedVerticalDirection == "up") {
sprite._y = sprite._y - trappedVerticalSpeed;
if (trappedVerticalMidPointFlag == false) {
var _local2 = trappedVerticalSpeed;
_local2 = _local2 * 0.22;
trappedVerticalSpeed = trappedVerticalSpeed + _local2;
if (trappedVerticalSpeed >= 1.9) {
trappedVerticalMidPointFlag = true;
}
} else {
trappedVerticalSpeed = trappedVerticalSpeed * 0.78;
if (trappedVerticalSpeed <= 0.2) {
trappedVerticalDirection = "down";
trappedVerticalSpeed = 0.2;
trappedVerticalMidPointFlag = false;
}
}
} else {
sprite._y = sprite._y + trappedVerticalSpeed;
if (trappedVerticalMidPointFlag == false) {
var _local3 = trappedVerticalSpeed;
_local3 = _local3 * 0.22;
trappedVerticalSpeed = trappedVerticalSpeed + _local3;
if (trappedVerticalSpeed >= 1.9) {
trappedVerticalMidPointFlag = true;
}
} else {
trappedVerticalSpeed = trappedVerticalSpeed * 0.78;
if (trappedVerticalSpeed <= 0.2) {
trappedVerticalDirection = "up";
trappedVerticalSpeed = 0.2;
trappedVerticalMidPointFlag = false;
}
}
}
}
function handleBullets() {
if ((++reloadCnt) == 62) {
reloadCnt = 0;
LoveJuice.Baddies.BaddieHandler.playLazerSFX();
shoot();
}
var _local3;
var _local2 = -1;
var _local4 = activeLazers.length;
while (_local2++ , _local2 != _local4) {
_local3 = activeLazers[_local2];
if (_local3.mainloop() == "dead") {
_local3.dispose();
activeLazers.splice(_local2, 1);
_local2--;
if (_local2 >= _local4) {
break;
}
}
}
}
function shoot() {
var _local2 = new flash.geom.Point(sprite._x, sprite._y - 13);
if (direction == "Right") {
_local2.x = _local2.x + 30;
} else {
_local2.x = _local2.x - 12;
}
var _local3 = new LoveJuice.Baddies.RabbitLazers(_local2, direction);
activeLazers.push(_local3);
}
function bulletDispose() {
var _local3;
var _local2 = -1;
var _local4 = activeLazers.length;
while (_local2++ , _local2 != _local4) {
_local3 = activeLazers[_local2];
_local3.dispose();
}
}
function plotPoints(amount) {
if ((--pointsDelay) > 0) {
return(undefined);
}
pointsDelay = 5;
var _local2 = LoveJuice.Baddies.BaddieHandler.playField.getNextHighestDepth();
var _local4 = "tenPointsAnim";
if (amount == 20) {
_local4 = "twentyPointsAnim";
}
var _local3 = LoveJuice.Baddies.BaddieHandler.playField.attachMovie(_local4, "points" + _local2, _local2);
_local3._x = sprite._x;
_local3._y = sprite._y;
}
var speed = 4;
var power = 5;
var anim_walkLeft = 1;
var anim_walkRight = 2;
var anim_trappedLeft = 3;
var anim_trappedRight = 4;
var anim_mutatedLeft = 5;
var anim_mutatedRight = 6;
}
Symbol 870 MovieClip [__Packages.LoveJuice.Baddies.RabbitLazers] Frame 0
class LoveJuice.Baddies.RabbitLazers extends LoveJuice.Baddies.Rabbit
{
var pos, direction, moveFunc, lazerSprite;
function RabbitLazers (posArg, dir) {
super();
pos = posArg;
direction = dir;
createSprite();
if (direction == "Right") {
moveFunc = moveRight;
} else {
moveFunc = moveLeft;
}
}
function toString() {
return("RabbitLazers");
}
function mainloop() {
return(moveFunc());
}
function dispose() {
lazerSprite.removeMovieClip();
}
function createSprite() {
var _local2 = LoveJuice.Baddies.BaddieHandler.playField.getNextHighestDepth();
var _local3 = "rabbitLazerRight";
if (direction == "Left") {
_local3 = "rabbitLazerLeft";
}
lazerSprite = LoveJuice.Baddies.BaddieHandler.playField.attachMovie(_local3, "rLazer" + _local2, _local2);
lazerSprite._x = pos.x;
lazerSprite._y = pos.y;
}
function moveRight() {
lazerSprite._x = lazerSprite._x + 8;
if (lazerSprite._x > 640) {
return("dead");
}
return(collisionCheck());
}
function moveLeft() {
lazerSprite._x = lazerSprite._x - 8;
if (lazerSprite._x < 0) {
return("dead");
}
return(collisionCheck());
}
function collisionCheck() {
if (lazerSprite.hitTest(LoveJuice.Baddies.BaddieHandler.playerSprite.hitAreaMC)) {
LoveJuice.Baddies.BaddieHandler.eventHandler.sendEvent("baddieCollision", this);
return("dead");
}
return(null);
}
}
Symbol 871 MovieClip [__Packages.LoveJuice.Baddies.LoveBird] Frame 0
class LoveJuice.Baddies.LoveBird extends LoveJuice.Baddies.BaddieHandler
{
var colourHandler, activeStones, restorePos, pos, colour, fineX, stunnedCnt, pushSpeed, offScreenTestCnt, currentStatus, reloadCnt, reloadSpeed, direction, mutatedFlag, stoneVisibleFlag, sprite, oldMoveFunc, collisionFunc, moveFunc, walkerSlimeSFX, colourFlashCnt, colourValue, trappedVerticalDirection, trappedVerticalSpeed, trappedVerticalMidPointFlag, maxLeft, maxRight, circle1Radius, circle2Radius, circle1x, circle2x, circle1y, circle2y, pointsDelay;
function LoveBird (posArg) {
super();
colourHandler = new gamingyourway.common.ColourHandler();
activeStones = new Array();
restorePos = posArg.clone();
restore();
}
function toString() {
return("LoveBird");
}
function restore() {
pos = restorePos.clone();
createSprite();
colour.setTransform(colourHandler.restoreColour());
fineX = (stunnedCnt = (pushSpeed = (offScreenTestCnt = (currentStatus = (reloadCnt = 0)))));
reloadSpeed = 155;
direction = "Left";
mutatedFlag = false;
stoneVisibleFlag = true;
sprite.gotoAndStop(anim_walkLeft);
oldMoveFunc = null;
collisionFunc = collisionCheck;
moveFunc = moveLeft;
}
function mainloop() {
if (sprite._visible == true) {
if ((--offScreenTestCnt) <= 0) {
if (!LoveJuice.Baddies.BaddieHandler.mainMovie.hitAreaMC.hitTest(sprite)) {
hideSprite();
updateBullets();
return(null);
}
offScreenTestCnt = 31;
}
} else {
if ((pos.y + 3) < LoveJuice.Baddies.BaddieHandler.scrollWindow.y) {
updateBullets();
return("notReached");
}
if (!LoveJuice.Baddies.BaddieHandler.mainMovie.hitAreaMC.hitTest(sprite)) {
updateBullets();
return(null);
}
sprite._visible = true;
offScreenTestCnt = 31;
if (currentStatus < 2) {
currentStatus = 1;
if (mutatedFlag == true) {
if (direction == "Left") {
sprite.gotoAndStop(anim_mutatedLeft);
} else {
sprite.gotoAndStop(anim_mutatedRight);
}
} else if (direction == "Left") {
sprite.gotoAndStop(anim_walkLeft);
} else {
sprite.gotoAndStop(anim_walkRight);
}
sprite.anim.gotoAndPlay(1);
} else if (currentStatus == 2) {
if (direction == "Left") {
sprite.gotoAndStop(anim_trappedLeft);
} else {
sprite.gotoAndStop(anim_trappedRight);
}
sprite.anim.gotoAndStop(1);
sprite.anim.heartAnim.gotoAndStop(sprite.anim.heartAnim._totalframes);
}
}
moveFunc();
collisionFunc();
sprite.anim.stone._visible = stoneVisibleFlag;
handleBullets();
return("running");
}
function dispose() {
LoveJuice.Baddies.BaddieHandler.soundHandler.stopSound(walkerSlimeSFX);
sprite.removeMovieClip();
bulletDispose();
}
function hit(shotPower) {
if (currentStatus == 2) {
pushSpeed = shotPower;
if ((sprite._x + (sprite._width / 2)) > LoveJuice.Baddies.BaddieHandler.playerSprite._x) {
moveFunc = pushedRight;
} else {
moveFunc = pushedLeft;
}
return(undefined);
}
if (shotPower == 6) {
LoveJuice.Baddies.BaddieHandler.eventHandler.sendEvent("incScore", 500);
trapHim();
return(undefined);
}
stunnedCnt = stunnedCnt + (shotPower * 5);
if (stunnedCnt > 31) {
stunnedCnt = 31;
}
if (power <= 0) {
if (mutatedFlag == false) {
mutatedFlag = true;
LoveJuice.Baddies.BaddieHandler.playMutatedSFX();
reloadCnt = 0;
reloadSpeed = 62;
speed = 4;
var _local3 = sprite.anim._currentframe;
if (direction == "Left") {
sprite.gotoAndStop(anim_mutatedLeft);
} else {
sprite.gotoAndStop(anim_mutatedRight);
}
sprite.anim.gotoAndStop(_local3);
} else {
LoveJuice.Baddies.BaddieHandler.eventHandler.sendEvent("incScore", 20);
plotPoints(20);
}
} else {
power = power - shotPower;
LoveJuice.Baddies.BaddieHandler.eventHandler.sendEvent("incScore", 10);
plotPoints(10);
}
if (oldMoveFunc == null) {
sprite.anim.gotoAndStop(sprite.anim._currentframe);
oldMoveFunc = moveFunc;
colourFlashCnt = 0;
colourValue = "Normal";
colour.setTransform(colourHandler.restoreColour());
trappedVerticalDirection = "up";
trappedVerticalSpeed = 1;
trappedVerticalMidPointFlag = false;
}
moveFunc = stunned;
}
function getSprite() {
return(sprite);
}
function createSprite() {
var _local2 = LoveJuice.Baddies.BaddieHandler.playField.getNextHighestDepth();
sprite = LoveJuice.Baddies.BaddieHandler.playField.attachMovie("baddie_loveBird", "bird" + _local2, _local2);
sprite._x = pos.x * 32;
sprite._y = pos.y * 32;
colour = new Color(sprite);
hideSprite();
}
function hideSprite() {
sprite._visible = false;
sprite.anim.gotoAndStop(1);
colourValue = "Normal";
colour.setTransform(colourHandler.restoreColour());
LoveJuice.Baddies.BaddieHandler.soundHandler.stopSound(walkerSlimeSFX);
}
function moveLeft() {
sprite._x = sprite._x - speed;
fineX = fineX - speed;
if (fineX < 0) {
fineX = fineX + 32;
pos.x--;
var _local2 = LoveJuice.Baddies.BaddieHandler.mapData[pos.y][pos.x][1];
if (_local2 != 0) {
maxLeft = pos.x;
direction = "Right";
if (mutatedFlag == false) {
sprite.gotoAndStop(anim_walkRight);
} else {
sprite.gotoAndStop(anim_mutatedRight);
}
moveFunc = moveRight;
}
}
}
function moveRight() {
sprite._x = sprite._x + speed;
fineX = fineX + speed;
if (fineX > 32) {
fineX = fineX - 32;
pos.x++;
var _local2 = LoveJuice.Baddies.BaddieHandler.mapData[pos.y][pos.x + 2][1];
if (_local2 != 0) {
maxRight = pos.x;
direction = "Left";
if (mutatedFlag == false) {
sprite.gotoAndStop(anim_walkLeft);
} else {
sprite.gotoAndStop(anim_mutatedLeft);
}
moveFunc = dumbMoveLeft;
}
}
}
function dumbMoveLeft() {
sprite._x = sprite._x - speed;
fineX = fineX - speed;
if (fineX < 0) {
fineX = fineX + 32;
pos.x--;
if (pos.x == maxLeft) {
direction = "Right";
if (mutatedFlag == false) {
sprite.gotoAndStop(anim_walkRight);
} else {
sprite.gotoAndStop(anim_mutatedRight);
}
moveFunc = dumbMoveRight;
}
}
}
function dumbMoveRight() {
sprite._x = sprite._x + speed;
fineX = fineX + speed;
if (fineX > 32) {
fineX = fineX - 32;
pos.x++;
if (pos.x == maxRight) {
direction = "Left";
if (mutatedFlag == false) {
sprite.gotoAndStop(anim_walkLeft);
} else {
sprite.gotoAndStop(anim_mutatedLeft);
}
moveFunc = dumbMoveLeft;
}
}
}
function collisionCheck() {
var _local2 = Math.abs(LoveJuice.Baddies.BaddieHandler.playerPos.y - pos.y);
if (_local2 >= 2) {
return(undefined);
}
_local2 = Math.abs(LoveJuice.Baddies.BaddieHandler.playerPos.x - pos.x);
if (_local2 >= 2) {
return(undefined);
}
if (sprite.hitAreaMC.hitTest(LoveJuice.Baddies.BaddieHandler.playerSprite.hitAreaMC)) {
LoveJuice.Baddies.BaddieHandler.eventHandler.sendEvent("baddieCollision", this);
collisionFunc = null;
}
}
function stunned() {
if ((--stunnedCnt) <= 0) {
sprite.anim.gotoAndPlay(sprite.anim._currentframe);
colour.setTransform(colourHandler.restoreColour());
moveFunc = oldMoveFunc;
oldMoveFunc = null;
return(null);
}
if ((++colourFlashCnt) == 4) {
if (colourValue == "Normal") {
colourFlashCnt = 0;
colourValue = "Red";
colour.setTransform(colourHandler.setTint(255, 0, 0, 80));
} else {
colourFlashCnt = 2;
colourValue = "Normal";
colour.setTransform(colourHandler.restoreColour());
}
}
return(null);
}
function trapHim() {
var _local2 = sprite.anim._currentframe;
if (direction == "Left") {
sprite.gotoAndStop(anim_trappedLeft);
} else {
sprite.gotoAndStop(anim_trappedRight);
}
mutatedFlag = false;
bulletDispose();
sprite.anim.gotoAndStop(_local2);
currentStatus = 2;
collisionFunc = trappedCollisionChecks;
moveFunc = null;
circle1Radius = 39;
circle2Radius = 27;
if (direction == "Left") {
circle1x = -32;
circle2x = 38;
} else {
circle1x = -5;
circle2x = -49;
}
circle1y = -54;
circle2y = -44;
circle1x = circle1x + circle1Radius;
circle1y = circle1y + circle1Radius;
circle2x = circle2x + circle2Radius;
circle2y = circle2y + circle2Radius;
if (sprite._x >= 550) {
var _local3 = 550 - sprite._x;
sprite._x = sprite._x + _local3;
pushSpeed = 8;
moveFunc = pushedLeft;
return(undefined);
}
if (sprite._x < 20) {
var _local3 = 20 - sprite._x;
sprite._x = sprite._x - _local3;
pushSpeed = 8;
moveFunc = pushedRight;
return(undefined);
}
sprite.swapDepths(LoveJuice.Baddies.BaddieHandler.playField.getNextHighestDepth());
}
function trappedCollisionChecks() {
trappedVerticalMove();
if (!LoveJuice.Baddies.BaddieHandler.playerSprite.hitTest(sprite)) {
return(undefined);
}
var _local2;
var _local6;
var _local5;
var _local4;
var _local3;
if (LoveJuice.Baddies.BaddieHandler.player.jumpStatus == "jumpingDown") {
_local2 = 10;
_local6 = LoveJuice.Baddies.BaddieHandler.playerSprite._x + (9 + _local2);
_local5 = LoveJuice.Baddies.BaddieHandler.playerSprite._y + (18 + _local2);
_local4 = _local6 - (sprite._x + circle1x);
_local3 = _local5 - (sprite._y + circle1y);
if (((_local4 * _local4) + (_local3 * _local3)) <= ((_local2 + circle1Radius) * (_local2 + circle1Radius))) {
LoveJuice.Baddies.BaddieHandler.player.hiJump();
return(undefined);
}
_local4 = _local6 - (sprite._x + circle2x);
_local3 = _local5 - (sprite._y + circle2y);
if (((_local4 * _local4) + (_local3 * _local3)) <= ((_local2 + circle2Radius) * (_local2 + circle2Radius))) {
LoveJuice.Baddies.BaddieHandler.player.hiJump();
return(undefined);
}
}
var _local7 = LoveJuice.Baddies.BaddieHandler.player.getCollisionCircle();
_local2 = _local7[0];
_local6 = LoveJuice.Baddies.BaddieHandler.playerSprite._x + (_local7[1].x + _local2);
_local5 = LoveJuice.Baddies.BaddieHandler.playerSprite._y + (_local7[1].y + _local2);
_local4 = _local6 - (sprite._x + circle1x);
_local3 = _local5 - (sprite._y + circle1y);
if (((_local4 * _local4) + (_local3 * _local3)) <= ((_local2 + circle1Radius) * (_local2 + circle1Radius))) {
pushSpeed = 8;
if (direction == "Left") {
moveFunc = pushedRight;
} else {
moveFunc = pushedLeft;
}
return(undefined);
}
_local4 = _local6 - (sprite._x + circle2x);
_local3 = _local5 - (sprite._y + circle2y);
if (((_local4 * _local4) + (_local3 * _local3)) <= ((_local2 + circle2Radius) * (_local2 + circle2Radius))) {
pushSpeed = 8;
if (direction == "Left") {
moveFunc = pushedLeft;
} else {
moveFunc = pushedRight;
}
return(undefined);
}
}
function pushedRight() {
if ((sprite._x + pushSpeed) > 550) {
var _local2 = 550 - sprite._x;
sprite._x = sprite._x + _local2;
pushSpeed = pushSpeed * 0.84;
moveFunc = pushedLeft;
return(undefined);
}
sprite._x = sprite._x + pushSpeed;
pushSpeed = pushSpeed * 0.84;
if (pushSpeed < 0.5) {
moveFunc = null;
}
}
function pushedLeft() {
if ((sprite._x - pushSpeed) < 20) {
var _local2 = 20 - sprite._x;
sprite._x = sprite._x - _local2;
pushSpeed = pushSpeed * 0.84;
moveFunc = pushedRight;
return(undefined);
}
sprite._x = sprite._x - pushSpeed;
pushSpeed = pushSpeed * 0.84;
if (pushSpeed < 0.5) {
moveFunc = null;
}
}
function trappedVerticalMove() {
if (trappedVerticalDirection == "up") {
sprite._y = sprite._y - trappedVerticalSpeed;
if (trappedVerticalMidPointFlag == false) {
var _local2 = trappedVerticalSpeed;
_local2 = _local2 * 0.22;
trappedVerticalSpeed = trappedVerticalSpeed + _local2;
if (trappedVerticalSpeed >= 1.9) {
trappedVerticalMidPointFlag = true;
}
} else {
trappedVerticalSpeed = trappedVerticalSpeed * 0.78;
if (trappedVerticalSpeed <= 0.2) {
trappedVerticalDirection = "down";
trappedVerticalSpeed = 0.2;
trappedVerticalMidPointFlag = false;
}
}
} else {
sprite._y = sprite._y + trappedVerticalSpeed;
if (trappedVerticalMidPointFlag == false) {
var _local3 = trappedVerticalSpeed;
_local3 = _local3 * 0.22;
trappedVerticalSpeed = trappedVerticalSpeed + _local3;
if (trappedVerticalSpeed >= 1.9) {
trappedVerticalMidPointFlag = true;
}
} else {
trappedVerticalSpeed = trappedVerticalSpeed * 0.78;
if (trappedVerticalSpeed <= 0.2) {
trappedVerticalDirection = "up";
trappedVerticalSpeed = 0.2;
trappedVerticalMidPointFlag = false;
}
}
}
}
function handleBullets() {
if (currentStatus >= 2) {
updateBullets();
return(undefined);
}
if ((++reloadCnt) == reloadSpeed) {
reloadCnt = 0;
shoot();
stoneVisibleFlag = false;
} else if (reloadCnt == 31) {
stoneVisibleFlag = true;
}
updateBullets();
}
function updateBullets() {
var _local4 = activeStones.length;
if (_local4 == 0) {
return(undefined);
}
var _local3;
var _local2 = -1;
while (_local2++ , _local2 != _local4) {
_local3 = activeStones[_local2];
if (_local3.mainloop() == "dead") {
_local3.dispose();
activeStones.splice(_local2, 1);
_local2--;
if (_local2 >= _local4) {
break;
}
}
}
}
function shoot() {
var _local2 = new flash.geom.Point(sprite._x, sprite._y - 17);
if (direction == "Right") {
_local2.x = _local2.x - 24;
} else {
_local2.x = _local2.x + 51;
}
var _local3 = new LoveJuice.Baddies.LoveBirdStone(_local2, direction, LoveJuice.Baddies.BaddieHandler.mapData);
activeStones.push(_local3);
}
function bulletDispose() {
var _local3;
var _local2 = -1;
var _local4 = activeStones.length;
while (_local2++ , _local2 != _local4) {
_local3 = activeStones[_local2];
_local3.dispose();
}
}
function plotPoints(amount) {
if ((--pointsDelay) > 0) {
return(undefined);
}
pointsDelay = 5;
var _local2 = LoveJuice.Baddies.BaddieHandler.playField.getNextHighestDepth();
var _local4 = "tenPointsAnim";
if (amount == 20) {
_local4 = "twentyPointsAnim";
}
var _local3 = LoveJuice.Baddies.BaddieHandler.playField.attachMovie(_local4, "points" + _local2, _local2);
_local3._x = sprite._x;
_local3._y = sprite._y;
}
var speed = 4;
var power = 5;
var anim_walkLeft = 1;
var anim_walkRight = 2;
var anim_trappedLeft = 3;
var anim_trappedRight = 4;
var anim_mutatedLeft = 5;
var anim_mutatedRight = 6;
}
Symbol 872 MovieClip [__Packages.LoveJuice.Baddies.LoveBirdStone] Frame 0
class LoveJuice.Baddies.LoveBirdStone extends LoveJuice.Baddies.LoveBird
{
var finePos, pos, mapData, fineY, fineX, acceleration, speed, xSpeed, direction, moveFunc, vertMoveFunc, stoneSprite;
function LoveBirdStone (posArg, dir, mapDataArg) {
super();
finePos = posArg;
pos = new flash.geom.Point(Math.round(finePos.x / 32), Math.round((finePos.y - 16) / 32));
mapData = mapDataArg;
fineY = (fineX = (acceleration = 0));
speed = 4;
xSpeed = 2;
direction = dir;
createSprite();
if (direction == "Right") {
moveFunc = moveRight;
} else {
moveFunc = moveLeft;
pos.x--;
}
vertMoveFunc = moveDown;
}
function toString() {
return("LoveBirdStone");
}
function mainloop() {
return(moveFunc());
}
function dispose() {
stoneSprite.removeMovieClip();
}
function createSprite() {
var _local2 = LoveJuice.Baddies.BaddieHandler.playField.getNextHighestDepth();
stoneSprite = LoveJuice.Baddies.BaddieHandler.playField.attachMovie("loveBirdStone", "lbStone" + _local2, _local2);
stoneSprite._x = finePos.x;
stoneSprite._y = finePos.y;
}
function moveRight() {
stoneSprite._x = stoneSprite._x + xSpeed;
fineX = fineX + xSpeed;
if (fineX > 32) {
fineX = fineX - 32;
pos.x++;
}
if (stoneSprite._x > 640) {
return("dead");
}
if (!LoveJuice.Baddies.BaddieHandler.mainMovie.hitAreaMC.hitTest(stoneSprite)) {
return("dead");
}
if (vertMoveFunc() == "dead") {
stoneSprite.gotoAndPlay(2);
moveFunc = waitingToDie;
return(null);
}
return(collisionCheck());
}
function moveLeft() {
stoneSprite._x = stoneSprite._x - xSpeed;
fineX = fineX + xSpeed;
if (fineX > 32) {
fineX = fineX - 32;
pos.x--;
}
if (stoneSprite._x < 0) {
return("dead");
}
if (!LoveJuice.Baddies.BaddieHandler.mainMovie.hitAreaMC.hitTest(stoneSprite)) {
return("dead");
}
if (vertMoveFunc() == "dead") {
stoneSprite.gotoAndPlay(2);
LoveJuice.Baddies.BaddieHandler.soundHandler.createPlayAndDispose(stoneSprite, "bonusDyingSquelchSFX");
moveFunc = waitingToDie;
return(null);
}
return(collisionCheck());
}
function moveDown() {
acceleration = acceleration + 0.1;
speed = speed + acceleration;
if (speed > 12) {
speed = 12;
}
stoneSprite._y = stoneSprite._y + speed;
fineY = fineY + speed;
if (fineY > 32) {
fineY = fineY - 32;
pos.y++;
var _local2 = mapData[pos.y + 1][pos.x][1];
if (_local2 == 1) {
acceleration = 0;
speed = int(speed / 2);
if (speed <= 4) {
if (speed <= 1) {
if (xSpeed == 1) {
return("dead");
}
} else {
xSpeed = 1;
}
}
LoveJuice.Baddies.BaddieHandler.soundHandler.createPlayAndDispose(stoneSprite, "thump2SFX");
vertMoveFunc = moveUp;
}
}
return(null);
}
function moveUp() {
acceleration = acceleration + 0.1;
if (acceleration > 1) {
acceleration = 1;
}
speed = speed - acceleration;
if (speed < 1) {
speed = 1;
acceleration = 0;
vertMoveFunc = moveDown;
}
stoneSprite._y = stoneSprite._y - speed;
fineY = fineY - speed;
if (fineY < 0) {
fineY = fineY + 32;
pos.y--;
}
return(null);
}
function waitingToDie() {
if (stoneSprite._currentframe == stoneSprite._totalframes) {
return("dead");
}
return(null);
}
function collisionCheck() {
if (stoneSprite.hitTest(LoveJuice.Baddies.BaddieHandler.playerSprite.hitAreaMC)) {
LoveJuice.Baddies.BaddieHandler.eventHandler.sendEvent("baddieCollision", this);
return("dead");
}
return(null);
}
}
Symbol 873 MovieClip [__Packages.LoveJuice.Baddies.HeartWasp] Frame 0
class LoveJuice.Baddies.HeartWasp extends LoveJuice.Baddies.BaddieHandler
{
var colourHandler, activeStones, restorePos, pos, colour, fineX, stunnedCnt, pushSpeed, offScreenTestCnt, currentStatus, reloadCnt, reloadSpeed, direction, mutatedFlag, stoneVisibleFlag, sprite, oldMoveFunc, collisionFunc, moveFunc, walkerSlimeSFX, colourFlashCnt, colourValue, trappedVerticalDirection, trappedVerticalSpeed, trappedVerticalMidPointFlag, maxLeft, maxRight, circle1Radius, circle2Radius, circle1x, circle2x, circle1y, circle2y, pointsDelay;
function HeartWasp (posArg) {
super();
colourHandler = new gamingyourway.common.ColourHandler();
activeStones = new Array();
restorePos = posArg.clone();
restore();
}
function toString() {
return("HeartWasp");
}
function restore() {
pos = restorePos.clone();
createSprite();
colour.setTransform(colourHandler.restoreColour());
fineX = (stunnedCnt = (pushSpeed = (offScreenTestCnt = (currentStatus = (reloadCnt = 0)))));
reloadSpeed = 155;
direction = "Left";
mutatedFlag = false;
stoneVisibleFlag = true;
sprite.gotoAndStop(anim_walkLeft);
oldMoveFunc = null;
collisionFunc = collisionCheck;
moveFunc = moveLeft;
}
function mainloop() {
if (sprite._visible == true) {
if ((--offScreenTestCnt) <= 0) {
if (!LoveJuice.Baddies.BaddieHandler.mainMovie.hitAreaMC.hitTest(sprite)) {
hideSprite();
updateBullets();
return(null);
}
offScreenTestCnt = 31;
}
} else {
if ((pos.y + 3) < LoveJuice.Baddies.BaddieHandler.scrollWindow.y) {
updateBullets();
return("notReached");
}
if (!LoveJuice.Baddies.BaddieHandler.mainMovie.hitAreaMC.hitTest(sprite)) {
updateBullets();
return(null);
}
sprite._visible = true;
offScreenTestCnt = 31;
if (currentStatus < 2) {
currentStatus = 1;
if (mutatedFlag == true) {
if (direction == "Left") {
sprite.gotoAndStop(anim_mutatedLeft);
} else {
sprite.gotoAndStop(anim_mutatedRight);
}
} else if (direction == "Left") {
sprite.gotoAndStop(anim_walkLeft);
} else {
sprite.gotoAndStop(anim_walkRight);
}
sprite.anim.gotoAndPlay(1);
} else if (currentStatus == 2) {
if (direction == "Left") {
sprite.gotoAndStop(anim_trappedLeft);
} else {
sprite.gotoAndStop(anim_trappedRight);
}
sprite.anim.gotoAndStop(1);
sprite.anim.heartAnim.gotoAndStop(sprite.anim.heartAnim._totalframes);
}
}
moveFunc();
collisionFunc();
sprite.anim.stone._visible = stoneVisibleFlag;
handleBullets();
return("running");
}
function dispose() {
LoveJuice.Baddies.BaddieHandler.soundHandler.stopSound(walkerSlimeSFX);
sprite.removeMovieClip();
bulletDispose();
}
function hit(shotPower) {
if (currentStatus == 2) {
pushSpeed = shotPower;
if ((sprite._x + (sprite._width / 2)) > LoveJuice.Baddies.BaddieHandler.playerSprite._x) {
moveFunc = pushedRight;
} else {
moveFunc = pushedLeft;
}
return(undefined);
}
if (shotPower == 6) {
LoveJuice.Baddies.BaddieHandler.eventHandler.sendEvent("incScore", 500);
trapHim();
return(undefined);
}
stunnedCnt = stunnedCnt + (shotPower * 5);
if (stunnedCnt > 31) {
stunnedCnt = 31;
}
if (power <= 0) {
if (mutatedFlag == false) {
mutatedFlag = true;
LoveJuice.Baddies.BaddieHandler.playMutatedSFX();
reloadCnt = 0;
reloadSpeed = 31;
speed = 6;
var _local3 = sprite.anim._currentframe;
if (direction == "Left") {
sprite.gotoAndStop(anim_mutatedLeft);
} else {
sprite.gotoAndStop(anim_mutatedRight);
}
sprite.anim.gotoAndStop(_local3);
} else {
LoveJuice.Baddies.BaddieHandler.eventHandler.sendEvent("incScore", 20);
plotPoints(20);
}
} else {
power = power - shotPower;
LoveJuice.Baddies.BaddieHandler.eventHandler.sendEvent("incScore", 10);
plotPoints(10);
}
if (oldMoveFunc == null) {
sprite.anim.gotoAndStop(sprite.anim._currentframe);
oldMoveFunc = moveFunc;
colourFlashCnt = 0;
colourValue = "Normal";
colour.setTransform(colourHandler.restoreColour());
trappedVerticalDirection = "up";
trappedVerticalSpeed = 1;
trappedVerticalMidPointFlag = false;
}
moveFunc = stunned;
}
function getSprite() {
return(sprite);
}
function createSprite() {
var _local2 = LoveJuice.Baddies.BaddieHandler.playField.getNextHighestDepth();
sprite = LoveJuice.Baddies.BaddieHandler.playField.attachMovie("baddie_heartWasp", "wasp" + _local2, _local2);
sprite._x = pos.x * 32;
sprite._y = pos.y * 32;
colour = new Color(sprite);
hideSprite();
}
function hideSprite() {
sprite._visible = false;
sprite.anim.gotoAndStop(1);
colourValue = "Normal";
colour.setTransform(colourHandler.restoreColour());
LoveJuice.Baddies.BaddieHandler.soundHandler.stopSound(walkerSlimeSFX);
}
function moveLeft() {
sprite._x = sprite._x - speed;
fineX = fineX - speed;
if (fineX < 0) {
fineX = fineX + 32;
pos.x--;
var _local2 = LoveJuice.Baddies.BaddieHandler.mapData[pos.y][pos.x][1];
if (_local2 != 0) {
maxLeft = pos.x;
direction = "Right";
if (mutatedFlag == false) {
sprite.gotoAndStop(anim_walkRight);
} else {
sprite.gotoAndStop(anim_mutatedRight);
}
moveFunc = moveRight;
}
}
}
function moveRight() {
sprite._x = sprite._x + speed;
fineX = fineX + speed;
if (fineX > 32) {
fineX = fineX - 32;
pos.x++;
var _local2 = LoveJuice.Baddies.BaddieHandler.mapData[pos.y][pos.x + 2][1];
if (_local2 != 0) {
maxRight = pos.x;
direction = "Left";
if (mutatedFlag == false) {
sprite.gotoAndStop(anim_walkLeft);
} else {
sprite.gotoAndStop(anim_mutatedLeft);
}
moveFunc = dumbMoveLeft;
}
}
}
function dumbMoveLeft() {
sprite._x = sprite._x - speed;
fineX = fineX - speed;
if (fineX < 0) {
fineX = fineX + 32;
pos.x--;
if (pos.x == maxLeft) {
direction = "Right";
if (mutatedFlag == false) {
sprite.gotoAndStop(anim_walkRight);
} else {
sprite.gotoAndStop(anim_mutatedRight);
}
moveFunc = dumbMoveRight;
}
}
}
function dumbMoveRight() {
sprite._x = sprite._x + speed;
fineX = fineX + speed;
if (fineX > 32) {
fineX = fineX - 32;
pos.x++;
if (pos.x == maxRight) {
direction = "Left";
if (mutatedFlag == false) {
sprite.gotoAndStop(anim_walkLeft);
} else {
sprite.gotoAndStop(anim_mutatedLeft);
}
moveFunc = dumbMoveLeft;
}
}
}
function collisionCheck() {
var _local2 = Math.abs(LoveJuice.Baddies.BaddieHandler.playerPos.y - pos.y);
if (_local2 >= 2) {
return(undefined);
}
_local2 = Math.abs(LoveJuice.Baddies.BaddieHandler.playerPos.x - pos.x);
if (_local2 >= 2) {
return(undefined);
}
if (sprite.hitAreaMC.hitTest(LoveJuice.Baddies.BaddieHandler.playerSprite.hitAreaMC)) {
LoveJuice.Baddies.BaddieHandler.eventHandler.sendEvent("baddieCollision", this);
collisionFunc = null;
}
}
function stunned() {
if ((--stunnedCnt) <= 0) {
sprite.anim.gotoAndPlay(sprite.anim._currentframe);
colour.setTransform(colourHandler.restoreColour());
moveFunc = oldMoveFunc;
oldMoveFunc = null;
return(null);
}
if ((++colourFlashCnt) == 4) {
if (colourValue == "Normal") {
colourFlashCnt = 0;
colourValue = "Red";
colour.setTransform(colourHandler.setTint(255, 0, 0, 80));
} else {
colourFlashCnt = 2;
colourValue = "Normal";
colour.setTransform(colourHandler.restoreColour());
}
}
return(null);
}
function trapHim() {
var _local2 = sprite.anim._currentframe;
if (direction == "Left") {
sprite.gotoAndStop(anim_trappedLeft);
} else {
sprite.gotoAndStop(anim_trappedRight);
}
mutatedFlag = false;
bulletDispose();
sprite.anim.gotoAndStop(_local2);
currentStatus = 2;
collisionFunc = trappedCollisionChecks;
moveFunc = null;
circle1Radius = 39;
circle2Radius = 27;
if (direction == "Left") {
circle1x = -32;
circle2x = 38;
} else {
circle1x = -5;
circle2x = -49;
}
circle1y = -54;
circle2y = -44;
circle1x = circle1x + circle1Radius;
circle1y = circle1y + circle1Radius;
circle2x = circle2x + circle2Radius;
circle2y = circle2y + circle2Radius;
if (sprite._x >= 550) {
var _local3 = 550 - sprite._x;
sprite._x = sprite._x + _local3;
pushSpeed = 8;
moveFunc = pushedLeft;
return(undefined);
}
if (sprite._x < 20) {
var _local3 = 20 - sprite._x;
sprite._x = sprite._x - _local3;
pushSpeed = 8;
moveFunc = pushedRight;
return(undefined);
}
sprite.swapDepths(LoveJuice.Baddies.BaddieHandler.playField.getNextHighestDepth());
}
function trappedCollisionChecks() {
trappedVerticalMove();
if (!LoveJuice.Baddies.BaddieHandler.playerSprite.hitTest(sprite)) {
return(undefined);
}
var _local2;
var _local6;
var _local5;
var _local4;
var _local3;
if (LoveJuice.Baddies.BaddieHandler.player.jumpStatus == "jumpingDown") {
_local2 = 10;
_local6 = LoveJuice.Baddies.BaddieHandler.playerSprite._x + (9 + _local2);
_local5 = LoveJuice.Baddies.BaddieHandler.playerSprite._y + (18 + _local2);
_local4 = _local6 - (sprite._x + circle1x);
_local3 = _local5 - (sprite._y + circle1y);
if (((_local4 * _local4) + (_local3 * _local3)) <= ((_local2 + circle1Radius) * (_local2 + circle1Radius))) {
LoveJuice.Baddies.BaddieHandler.player.hiJump();
return(undefined);
}
_local4 = _local6 - (sprite._x + circle2x);
_local3 = _local5 - (sprite._y + circle2y);
if (((_local4 * _local4) + (_local3 * _local3)) <= ((_local2 + circle2Radius) * (_local2 + circle2Radius))) {
LoveJuice.Baddies.BaddieHandler.player.hiJump();
return(undefined);
}
}
var _local7 = LoveJuice.Baddies.BaddieHandler.player.getCollisionCircle();
_local2 = _local7[0];
_local6 = LoveJuice.Baddies.BaddieHandler.playerSprite._x + (_local7[1].x + _local2);
_local5 = LoveJuice.Baddies.BaddieHandler.playerSprite._y + (_local7[1].y + _local2);
_local4 = _local6 - (sprite._x + circle1x);
_local3 = _local5 - (sprite._y + circle1y);
if (((_local4 * _local4) + (_local3 * _local3)) <= ((_local2 + circle1Radius) * (_local2 + circle1Radius))) {
pushSpeed = 8;
if (direction == "Left") {
moveFunc = pushedRight;
} else {
moveFunc = pushedLeft;
}
return(undefined);
}
_local4 = _local6 - (sprite._x + circle2x);
_local3 = _local5 - (sprite._y + circle2y);
if (((_local4 * _local4) + (_local3 * _local3)) <= ((_local2 + circle2Radius) * (_local2 + circle2Radius))) {
pushSpeed = 8;
if (direction == "Left") {
moveFunc = pushedLeft;
} else {
moveFunc = pushedRight;
}
return(undefined);
}
}
function pushedRight() {
if ((sprite._x + pushSpeed) > 550) {
var _local2 = 550 - sprite._x;
sprite._x = sprite._x + _local2;
pushSpeed = pushSpeed * 0.84;
moveFunc = pushedLeft;
return(undefined);
}
sprite._x = sprite._x + pushSpeed;
pushSpeed = pushSpeed * 0.84;
if (pushSpeed < 0.5) {
moveFunc = null;
}
}
function pushedLeft() {
if ((sprite._x - pushSpeed) < 20) {
var _local2 = 20 - sprite._x;
sprite._x = sprite._x - _local2;
pushSpeed = pushSpeed * 0.84;
moveFunc = pushedRight;
return(undefined);
}
sprite._x = sprite._x - pushSpeed;
pushSpeed = pushSpeed * 0.84;
if (pushSpeed < 0.5) {
moveFunc = null;
}
}
function trappedVerticalMove() {
if (trappedVerticalDirection == "up") {
sprite._y = sprite._y - trappedVerticalSpeed;
if (trappedVerticalMidPointFlag == false) {
var _local2 = trappedVerticalSpeed;
_local2 = _local2 * 0.22;
trappedVerticalSpeed = trappedVerticalSpeed + _local2;
if (trappedVerticalSpeed >= 1.9) {
trappedVerticalMidPointFlag = true;
}
} else {
trappedVerticalSpeed = trappedVerticalSpeed * 0.78;
if (trappedVerticalSpeed <= 0.2) {
trappedVerticalDirection = "down";
trappedVerticalSpeed = 0.2;
trappedVerticalMidPointFlag = false;
}
}
} else {
sprite._y = sprite._y + trappedVerticalSpeed;
if (trappedVerticalMidPointFlag == false) {
var _local3 = trappedVerticalSpeed;
_local3 = _local3 * 0.22;
trappedVerticalSpeed = trappedVerticalSpeed + _local3;
if (trappedVerticalSpeed >= 1.9) {
trappedVerticalMidPointFlag = true;
}
} else {
trappedVerticalSpeed = trappedVerticalSpeed * 0.78;
if (trappedVerticalSpeed <= 0.2) {
trappedVerticalDirection = "up";
trappedVerticalSpeed = 0.2;
trappedVerticalMidPointFlag = false;
}
}
}
}
function handleBullets() {
if (currentStatus >= 2) {
updateBullets();
return(undefined);
}
if ((++reloadCnt) == reloadSpeed) {
reloadCnt = 0;
shoot();
stoneVisibleFlag = false;
} else if (reloadCnt == 15) {
stoneVisibleFlag = true;
}
updateBullets();
}
function updateBullets() {
var _local4 = activeStones.length;
if (_local4 == 0) {
return(undefined);
}
var _local3;
var _local2 = -1;
while (_local2++ , _local2 != _local4) {
_local3 = activeStones[_local2];
if (_local3.mainloop() == "dead") {
_local3.dispose();
activeStones.splice(_local2, 1);
_local2--;
if (_local2 >= _local4) {
break;
}
}
}
}
function shoot() {
var _local2 = new flash.geom.Point(sprite._x, sprite._y + 35);
if (direction == "Right") {
_local2.x = _local2.x - 2;
} else {
_local2.x = _local2.x + 14;
}
var _local3 = new LoveJuice.Baddies.HeartWaspStone(_local2, direction, LoveJuice.Baddies.BaddieHandler.mapData);
activeStones.push(_local3);
}
function bulletDispose() {
var _local3;
var _local2 = -1;
var _local4 = activeStones.length;
while (_local2++ , _local2 != _local4) {
_local3 = activeStones[_local2];
_local3.dispose();
}
}
function plotPoints(amount) {
if ((--pointsDelay) > 0) {
return(undefined);
}
pointsDelay = 5;
var _local2 = LoveJuice.Baddies.BaddieHandler.playField.getNextHighestDepth();
var _local4 = "tenPointsAnim";
if (amount == 20) {
_local4 = "twentyPointsAnim";
}
var _local3 = LoveJuice.Baddies.BaddieHandler.playField.attachMovie(_local4, "points" + _local2, _local2);
_local3._x = sprite._x;
_local3._y = sprite._y;
}
var speed = 4;
var power = 4;
var anim_walkLeft = 1;
var anim_walkRight = 2;
var anim_trappedLeft = 3;
var anim_trappedRight = 4;
var anim_mutatedLeft = 5;
var anim_mutatedRight = 6;
}
Symbol 874 MovieClip [__Packages.LoveJuice.Baddies.HeartWaspStone] Frame 0
class LoveJuice.Baddies.HeartWaspStone extends LoveJuice.Baddies.HeartWasp
{
var finePos, pos, mapData, fineY, fineX, acceleration, speed, xSpeed, direction, moveFunc, vertMoveFunc, stoneSprite;
function HeartWaspStone (posArg, dir, mapDataArg) {
super();
finePos = posArg;
pos = new flash.geom.Point(Math.round(finePos.x / 32), Math.round((finePos.y - 16) / 32));
mapData = mapDataArg;
fineY = (fineX = (acceleration = 0));
speed = 4;
xSpeed = 2;
direction = dir;
createSprite();
if (direction == "Right") {
moveFunc = moveRight;
} else {
moveFunc = moveLeft;
pos.x--;
}
vertMoveFunc = moveDown;
}
function toString() {
return("HeartWaspStone");
}
function mainloop() {
return(moveFunc());
}
function dispose() {
stoneSprite.removeMovieClip();
}
function createSprite() {
var _local2 = LoveJuice.Baddies.BaddieHandler.playField.getNextHighestDepth();
stoneSprite = LoveJuice.Baddies.BaddieHandler.playField.attachMovie("heartWaspStone", "hwStone" + _local2, _local2);
stoneSprite._x = finePos.x;
stoneSprite._y = finePos.y;
}
function moveRight() {
stoneSprite._x = stoneSprite._x + xSpeed;
fineX = fineX + xSpeed;
if (fineX > 32) {
fineX = fineX - 32;
pos.x++;
}
if (stoneSprite._x > 640) {
return("dead");
}
if (!LoveJuice.Baddies.BaddieHandler.mainMovie.hitAreaMC.hitTest(stoneSprite)) {
return("dead");
}
if (vertMoveFunc() == "dead") {
stoneSprite.gotoAndPlay(2);
LoveJuice.Baddies.BaddieHandler.soundHandler.createPlayAndDispose(stoneSprite, "bonusDyingSquelchSFX");
moveFunc = waitingToDie;
return(null);
}
return(collisionCheck());
}
function moveLeft() {
stoneSprite._x = stoneSprite._x - xSpeed;
fineX = fineX + xSpeed;
if (fineX > 32) {
fineX = fineX - 32;
pos.x--;
}
if (stoneSprite._x < 0) {
return("dead");
}
if (!LoveJuice.Baddies.BaddieHandler.mainMovie.hitAreaMC.hitTest(stoneSprite)) {
return("dead");
}
if (vertMoveFunc() == "dead") {
stoneSprite.gotoAndPlay(2);
moveFunc = waitingToDie;
return(null);
}
return(collisionCheck());
}
function moveDown() {
acceleration = acceleration + 0.1;
speed = speed + acceleration;
if (speed > 12) {
speed = 12;
}
stoneSprite._y = stoneSprite._y + speed;
fineY = fineY + speed;
if (fineY > 32) {
fineY = fineY - 32;
pos.y++;
var _local2 = mapData[pos.y + 1][pos.x][1];
if (_local2 == 1) {
acceleration = 0;
speed = int(speed / 2);
if (speed <= 4) {
if (speed <= 1) {
if (xSpeed == 1) {
return("dead");
}
} else {
xSpeed = 1;
}
}
LoveJuice.Baddies.BaddieHandler.soundHandler.createPlayAndDispose(stoneSprite, "thump1SFX");
vertMoveFunc = moveUp;
}
}
return(null);
}
function moveUp() {
acceleration = acceleration + 0.1;
if (acceleration > 1) {
acceleration = 1;
}
speed = speed - acceleration;
if (speed < 1) {
speed = 1;
acceleration = 0;
vertMoveFunc = moveDown;
}
stoneSprite._y = stoneSprite._y - speed;
fineY = fineY - speed;
if (fineY < 0) {
fineY = fineY + 32;
pos.y--;
}
return(null);
}
function waitingToDie() {
if (stoneSprite._currentframe == stoneSprite._totalframes) {
return("dead");
}
return(null);
}
function collisionCheck() {
if (stoneSprite.hitTest(LoveJuice.Baddies.BaddieHandler.playerSprite.hitAreaMC)) {
LoveJuice.Baddies.BaddieHandler.eventHandler.sendEvent("baddieCollision", this);
return("dead");
}
return(null);
}
}
Symbol 875 MovieClip [__Packages.LoveJuice.Baddies.Fox] Frame 0
class LoveJuice.Baddies.Fox extends LoveJuice.Baddies.BaddieHandler
{
var colourHandler, restorePos, pos, colour, fineX, stunnedCnt, pushSpeed, offScreenTestCnt, currentStatus, direction, mutatedFlag, sprite, oldMoveFunc, collisionFunc, moveFunc, walkerSlimeSFX, colourFlashCnt, colourValue, trappedVerticalDirection, trappedVerticalSpeed, trappedVerticalMidPointFlag, maxLeft, maxRight, pointsDelay;
function Fox (posArg) {
super();
colourHandler = new gamingyourway.common.ColourHandler();
restorePos = posArg.clone();
restore();
}
function toString() {
return("Fox");
}
function restore() {
pos = restorePos.clone();
createSprite();
colour.setTransform(colourHandler.restoreColour());
fineX = (stunnedCnt = (pushSpeed = (offScreenTestCnt = (currentStatus = 0))));
direction = "Left";
mutatedFlag = false;
speed = 4;
sprite.gotoAndStop(anim_walkLeft);
oldMoveFunc = null;
collisionFunc = collisionCheck;
moveFunc = moveLeft;
}
function mainloop() {
if (sprite._visible == true) {
if ((--offScreenTestCnt) <= 0) {
if (!LoveJuice.Baddies.BaddieHandler.mainMovie.hitAreaMC.hitTest(sprite)) {
hideSprite();
return(null);
}
offScreenTestCnt = 31;
}
} else {
if ((pos.y + 3) < LoveJuice.Baddies.BaddieHandler.scrollWindow.y) {
return("notReached");
}
if (!LoveJuice.Baddies.BaddieHandler.mainMovie.hitAreaMC.hitTest(sprite)) {
return(null);
}
sprite._visible = true;
offScreenTestCnt = 31;
if (currentStatus < 2) {
currentStatus = 1;
if (mutatedFlag == true) {
if (direction == "Left") {
sprite.gotoAndStop(anim_mutatedLeft);
} else {
sprite.gotoAndStop(anim_mutatedRight);
}
} else if (direction == "Left") {
sprite.gotoAndStop(anim_walkLeft);
} else {
sprite.gotoAndStop(anim_walkRight);
}
sprite.anim.gotoAndPlay(1);
}
}
moveFunc();
collisionFunc();
return("running");
}
function dispose() {
LoveJuice.Baddies.BaddieHandler.soundHandler.stopSound(walkerSlimeSFX);
sprite.removeMovieClip();
}
function hit(shotPower) {
stunnedCnt = stunnedCnt + (shotPower * 5);
if (stunnedCnt > 25) {
stunnedCnt = 25;
}
if (power <= 0) {
if (mutatedFlag == false) {
mutatedFlag = true;
LoveJuice.Baddies.BaddieHandler.playMutatedSFX();
speed = 8;
var _local2 = sprite.anim._currentframe;
if (direction == "Left") {
sprite.gotoAndStop(anim_mutatedLeft);
} else {
sprite.gotoAndStop(anim_mutatedRight);
}
sprite.anim.gotoAndStop(_local2);
} else {
LoveJuice.Baddies.BaddieHandler.eventHandler.sendEvent("incScore", 20);
plotPoints(20);
}
} else {
power = power - shotPower;
LoveJuice.Baddies.BaddieHandler.eventHandler.sendEvent("incScore", 10);
plotPoints(10);
}
if (oldMoveFunc == null) {
sprite.anim.gotoAndStop(sprite.anim._currentframe);
oldMoveFunc = moveFunc;
colourFlashCnt = 0;
colourValue = "Normal";
colour.setTransform(colourHandler.restoreColour());
trappedVerticalDirection = "up";
trappedVerticalSpeed = 1;
trappedVerticalMidPointFlag = false;
}
moveFunc = stunned;
}
function getSprite() {
return(sprite);
}
function createSprite() {
var _local2 = LoveJuice.Baddies.BaddieHandler.playField.getNextHighestDepth();
sprite = LoveJuice.Baddies.BaddieHandler.playField.attachMovie("baddie_fox", "fox" + _local2, _local2);
sprite._x = pos.x * 32;
sprite._y = pos.y * 32;
colour = new Color(sprite);
hideSprite();
}
function hideSprite() {
sprite._visible = false;
sprite.anim.gotoAndStop(1);
colourValue = "Normal";
colour.setTransform(colourHandler.restoreColour());
LoveJuice.Baddies.BaddieHandler.soundHandler.stopSound(walkerSlimeSFX);
}
function moveLeft() {
sprite._x = sprite._x - speed;
fineX = fineX - speed;
if (fineX < 0) {
fineX = fineX + 32;
pos.x--;
var _local2 = LoveJuice.Baddies.BaddieHandler.mapData[pos.y][pos.x][1];
if (_local2 != 0) {
maxLeft = pos.x;
direction = "Right";
if (mutatedFlag == false) {
sprite.gotoAndStop(anim_walkRight);
} else {
sprite.gotoAndStop(anim_mutatedRight);
}
moveFunc = moveRight;
} else {
_local2 = LoveJuice.Baddies.BaddieHandler.mapData[pos.y + 1][pos.x][1];
if (_local2 != 1) {
maxLeft = pos.x;
direction = "Right";
sprite.gotoAndStop(2);
moveFunc = moveRight;
}
}
}
}
function moveRight() {
sprite._x = sprite._x + speed;
fineX = fineX + speed;
if (fineX > 32) {
fineX = fineX - 32;
pos.x++;
var _local2 = LoveJuice.Baddies.BaddieHandler.mapData[pos.y][pos.x + 1][1];
if (_local2 != 0) {
maxRight = pos.x;
direction = "Left";
if (mutatedFlag == false) {
sprite.gotoAndStop(anim_walkLeft);
} else {
sprite.gotoAndStop(anim_mutatedLeft);
}
moveFunc = dumbMoveLeft;
} else {
_local2 = LoveJuice.Baddies.BaddieHandler.mapData[pos.y + 1][pos.x + 1][1];
if (_local2 != 1) {
maxRight = pos.x;
direction = "Left";
sprite.gotoAndStop(1);
moveFunc = dumbMoveLeft;
}
}
}
}
function dumbMoveLeft() {
sprite._x = sprite._x - speed;
fineX = fineX - speed;
if (fineX < 0) {
fineX = fineX + 32;
pos.x--;
if (pos.x == maxLeft) {
direction = "Right";
if (mutatedFlag == false) {
sprite.gotoAndStop(anim_walkRight);
} else {
sprite.gotoAndStop(anim_mutatedRight);
}
moveFunc = dumbMoveRight;
}
}
}
function dumbMoveRight() {
sprite._x = sprite._x + speed;
fineX = fineX + speed;
if (fineX > 32) {
fineX = fineX - 32;
pos.x++;
if (pos.x == maxRight) {
direction = "Left";
if (mutatedFlag == false) {
sprite.gotoAndStop(anim_walkLeft);
} else {
sprite.gotoAndStop(anim_mutatedLeft);
}
moveFunc = dumbMoveLeft;
}
}
}
function collisionCheck() {
var _local2 = Math.abs(LoveJuice.Baddies.BaddieHandler.playerPos.y - pos.y);
if (_local2 >= 2) {
return(undefined);
}
_local2 = Math.abs(LoveJuice.Baddies.BaddieHandler.playerPos.x - pos.x);
if (_local2 >= 2) {
return(undefined);
}
if (sprite.hitAreaMC.hitTest(LoveJuice.Baddies.BaddieHandler.playerSprite.hitAreaMC)) {
LoveJuice.Baddies.BaddieHandler.eventHandler.sendEvent("baddieCollision", this);
collisionFunc = null;
}
}
function stunned() {
if ((--stunnedCnt) <= 0) {
sprite.anim.gotoAndPlay(sprite.anim._currentframe);
colour.setTransform(colourHandler.restoreColour());
moveFunc = oldMoveFunc;
oldMoveFunc = null;
return(null);
}
if ((++colourFlashCnt) == 4) {
if (colourValue == "Normal") {
colourFlashCnt = 0;
colourValue = "Red";
colour.setTransform(colourHandler.setTint(255, 0, 0, 80));
} else {
colourFlashCnt = 2;
colourValue = "Normal";
colour.setTransform(colourHandler.restoreColour());
}
}
return(null);
}
function plotPoints(amount) {
if ((--pointsDelay) > 0) {
return(undefined);
}
pointsDelay = 5;
var _local2 = LoveJuice.Baddies.BaddieHandler.playField.getNextHighestDepth();
var _local4 = "tenPointsAnim";
if (amount == 20) {
_local4 = "twentyPointsAnim";
}
var _local3 = LoveJuice.Baddies.BaddieHandler.playField.attachMovie(_local4, "points" + _local2, _local2);
_local3._x = sprite._x;
_local3._y = sprite._y;
}
var speed = 2;
var power = 8;
var anim_walkLeft = 1;
var anim_walkRight = 2;
var anim_mutatedLeft = 5;
var anim_mutatedRight = 6;
}
Symbol 876 MovieClip [__Packages.LoveJuice.Baddies.Unicorn] Frame 0
class LoveJuice.Baddies.Unicorn extends LoveJuice.Baddies.BaddieHandler
{
var colourHandler, restorePos, pos, colour, fineX, stunnedCnt, pushSpeed, offScreenTestCnt, currentStatus, direction, mutatedFlag, stampedeDelay, stampedeCnt, sprite, oldMoveFunc, collisionFunc, moveFunc, walkerSlimeSFX, colourFlashCnt, colourValue, maxLeft, stampedeFlag, maxRight, pointsDelay;
function Unicorn (posArg) {
super();
colourHandler = new gamingyourway.common.ColourHandler();
restorePos = posArg.clone();
restore();
}
function toString() {
return("Unicorn");
}
function restore() {
pos = restorePos.clone();
createSprite();
colour.setTransform(colourHandler.restoreColour());
fineX = (stunnedCnt = (pushSpeed = (offScreenTestCnt = (currentStatus = 0))));
direction = "Left";
mutatedFlag = false;
speed = 8;
stampedeDelay = 155;
stampedeCnt = 0;
sprite.gotoAndStop(anim_walkLeft);
sprite.anim.gotoAndStop(1);
oldMoveFunc = null;
collisionFunc = collisionCheck;
moveFunc = waitingToStampede;
}
function mainloop() {
if (sprite._visible == true) {
if ((--offScreenTestCnt) <= 0) {
if (!LoveJuice.Baddies.BaddieHandler.mainMovie.hitAreaMC.hitTest(sprite)) {
hideSprite();
return(null);
}
offScreenTestCnt = 31;
}
} else {
if ((pos.y + 3) < LoveJuice.Baddies.BaddieHandler.scrollWindow.y) {
return("notReached");
}
if (!LoveJuice.Baddies.BaddieHandler.mainMovie.hitAreaMC.hitTest(sprite)) {
return(null);
}
sprite._visible = true;
offScreenTestCnt = 31;
if (currentStatus < 2) {
currentStatus = 1;
if (mutatedFlag == true) {
if (direction == "Left") {
sprite.gotoAndStop(anim_mutatedLeft);
} else {
sprite.gotoAndStop(anim_mutatedRight);
}
} else if (direction == "Left") {
sprite.gotoAndStop(anim_walkLeft);
} else {
sprite.gotoAndStop(anim_walkRight);
}
sprite.anim.gotoAndStop(1);
}
}
moveFunc();
collisionFunc();
return("running");
}
function dispose() {
LoveJuice.Baddies.BaddieHandler.soundHandler.stopSound(walkerSlimeSFX);
sprite.removeMovieClip();
}
function hit(shotPower) {
stunnedCnt = stunnedCnt + (shotPower * 5);
if (stunnedCnt > 25) {
stunnedCnt = 25;
}
if (power <= 0) {
if (mutatedFlag == false) {
mutatedFlag = true;
LoveJuice.Baddies.BaddieHandler.playMutatedSFX();
stampedeDelay = 62;
var _local2 = sprite.anim._currentframe;
if (direction == "Left") {
sprite.gotoAndStop(anim_mutatedLeft);
} else {
sprite.gotoAndStop(anim_mutatedRight);
}
sprite.anim.gotoAndStop(_local2);
} else {
LoveJuice.Baddies.BaddieHandler.eventHandler.sendEvent("incScore", 20);
plotPoints(20);
}
} else {
power = power - shotPower;
LoveJuice.Baddies.BaddieHandler.eventHandler.sendEvent("incScore", 10);
plotPoints(10);
}
if (oldMoveFunc == null) {
sprite.anim.gotoAndStop(sprite.anim._currentframe);
oldMoveFunc = moveFunc;
colourFlashCnt = 0;
colourValue = "Normal";
colour.setTransform(colourHandler.restoreColour());
}
moveFunc = stunned;
}
function getSprite() {
return(sprite);
}
function createSprite() {
var _local2 = LoveJuice.Baddies.BaddieHandler.playField.getNextHighestDepth();
sprite = LoveJuice.Baddies.BaddieHandler.playField.attachMovie("baddie_unicorn", "unicorn" + _local2, _local2);
sprite._x = pos.x * 32;
sprite._y = pos.y * 32;
colour = new Color(sprite);
hideSprite();
}
function hideSprite() {
sprite._visible = false;
sprite.anim.gotoAndStop(1);
colourValue = "Normal";
colour.setTransform(colourHandler.restoreColour());
LoveJuice.Baddies.BaddieHandler.soundHandler.stopSound(walkerSlimeSFX);
}
function moveLeft() {
sprite._x = sprite._x - speed;
fineX = fineX - speed;
if (fineX < 0) {
fineX = fineX + 32;
pos.x--;
var _local2 = LoveJuice.Baddies.BaddieHandler.mapData[pos.y][pos.x][1];
if (_local2 != 0) {
maxLeft = pos.x;
direction = "Right";
if (mutatedFlag == false) {
sprite.gotoAndStop(anim_walkRight);
} else {
sprite.gotoAndStop(anim_mutatedRight);
}
sprite.anim.gotoAndStop(1);
stampedeFlag = false;
moveFunc = waitingToStampede;
} else {
_local2 = LoveJuice.Baddies.BaddieHandler.mapData[pos.y + 1][pos.x][1];
if (_local2 != 1) {
maxLeft = pos.x;
direction = "Right";
if (mutatedFlag == false) {
sprite.gotoAndStop(anim_walkRight);
} else {
sprite.gotoAndStop(anim_mutatedRight);
}
sprite.anim.gotoAndStop(1);
stampedeFlag = false;
moveFunc = waitingToStampede;
}
}
}
}
function moveRight() {
sprite._x = sprite._x + speed;
fineX = fineX + speed;
if (fineX > 32) {
fineX = fineX - 32;
pos.x++;
var _local2 = LoveJuice.Baddies.BaddieHandler.mapData[pos.y][pos.x + 3][1];
if (_local2 != 0) {
maxRight = pos.x;
direction = "Left";
if (mutatedFlag == false) {
sprite.gotoAndStop(anim_walkLeft);
} else {
sprite.gotoAndStop(anim_mutatedLeft);
}
sprite.anim.gotoAndStop(1);
stampedeFlag = false;
moveFunc = waitingToStampede;
} else {
_local2 = LoveJuice.Baddies.BaddieHandler.mapData[pos.y + 1][pos.x + 1][1];
if (_local2 != 1) {
maxRight = pos.x;
direction = "Left";
if (mutatedFlag == false) {
sprite.gotoAndStop(anim_walkLeft);
} else {
sprite.gotoAndStop(anim_mutatedLeft);
}
sprite.anim.gotoAndStop(1);
stampedeFlag = false;
moveFunc = waitingToStampede;
}
}
}
}
function waitingToStampede() {
if ((++stampedeCnt) >= stampedeDelay) {
stampedeCnt = 0;
stampedeFlag = true;
if (direction == "Left") {
moveFunc = moveLeft;
} else {
moveFunc = moveRight;
}
sprite.anim.gotoAndPlay(2);
}
}
function collisionCheck() {
var _local2 = Math.abs(LoveJuice.Baddies.BaddieHandler.playerPos.y - pos.y);
if (_local2 >= 2) {
return(undefined);
}
if (sprite.hitAreaMC.hitTest(LoveJuice.Baddies.BaddieHandler.playerSprite.hitAreaMC)) {
LoveJuice.Baddies.BaddieHandler.eventHandler.sendEvent("baddieCollision", this);
collisionFunc = null;
}
}
function stunned() {
if ((--stunnedCnt) <= 0) {
if (stampedeFlag == true) {
sprite.anim.gotoAndPlay(sprite.anim._currentframe);
}
colour.setTransform(colourHandler.restoreColour());
moveFunc = oldMoveFunc;
oldMoveFunc = null;
return(null);
}
if ((++colourFlashCnt) == 4) {
if (colourValue == "Normal") {
colourFlashCnt = 0;
colourValue = "Red";
colour.setTransform(colourHandler.setTint(255, 0, 0, 80));
} else {
colourFlashCnt = 2;
colourValue = "Normal";
colour.setTransform(colourHandler.restoreColour());
}
}
return(null);
}
function plotPoints(amount) {
if ((--pointsDelay) > 0) {
return(undefined);
}
pointsDelay = 5;
var _local2 = LoveJuice.Baddies.BaddieHandler.playField.getNextHighestDepth();
var _local4 = "tenPointsAnim";
if (amount == 20) {
_local4 = "twentyPointsAnim";
}
var _local3 = LoveJuice.Baddies.BaddieHandler.playField.attachMovie(_local4, "points" + _local2, _local2);
_local3._x = sprite._x;
_local3._y = sprite._y;
}
var speed = 2;
var power = 6;
var anim_walkLeft = 1;
var anim_walkRight = 2;
var anim_mutatedLeft = 5;
var anim_mutatedRight = 6;
}
Symbol 877 MovieClip [__Packages.LoveJuice.Baddies.Dog] Frame 0
class LoveJuice.Baddies.Dog extends LoveJuice.Baddies.BaddieHandler
{
var colourHandler, restorePos, pos, originalY, sprite, colour, fineX, stunnedCnt, pushSpeed, offScreenTestCnt, currentStatus, direction, mutatedFlag, mutateThisFrame, speed, vertDir, vertFunc, oldMoveFunc, collisionFunc, moveFunc, walkerSlimeSFX, colourFlashCnt, colourValue, trappedVerticalDirection, trappedVerticalSpeed, trappedVerticalMidPointFlag, maxLeft, maxRight, floatCnt, circle1Radius, circle2Radius, circle1x, circle2x, circle1y, circle2y, pointsDelay;
function Dog (posArg) {
super();
colourHandler = new gamingyourway.common.ColourHandler();
restorePos = posArg.clone();
restore();
}
function toString() {
return("Dog");
}
function restore() {
pos = restorePos.clone();
createSprite();
originalY = sprite._y;
colour.setTransform(colourHandler.restoreColour());
fineX = (stunnedCnt = (pushSpeed = (offScreenTestCnt = (currentStatus = 0))));
direction = "Left";
mutatedFlag = (mutateThisFrame = false);
speed = 4;
vertDir = "Up";
vertFunc = moveUp;
sprite.gotoAndStop(anim_walkLeft);
oldMoveFunc = null;
collisionFunc = collisionCheck;
moveFunc = moveLeft;
}
function mainloop() {
if (sprite._visible == true) {
if ((--offScreenTestCnt) <= 0) {
if (!LoveJuice.Baddies.BaddieHandler.mainMovie.hitAreaMC.hitTest(sprite)) {
hideSprite();
return(null);
}
offScreenTestCnt = 31;
}
} else {
if ((pos.y + 3) < LoveJuice.Baddies.BaddieHandler.scrollWindow.y) {
return("notReached");
}
if (!LoveJuice.Baddies.BaddieHandler.mainMovie.hitAreaMC.hitTest(sprite)) {
return(null);
}
sprite._visible = true;
offScreenTestCnt = 31;
if (currentStatus < 2) {
currentStatus = 1;
if (mutatedFlag == true) {
if (direction == "Left") {
sprite.gotoAndStop(anim_mutatedLeft);
} else {
sprite.gotoAndStop(anim_mutatedRight);
}
} else if (direction == "Left") {
sprite.gotoAndStop(anim_walkLeft);
} else {
sprite.gotoAndStop(anim_walkRight);
}
sprite.anim.gotoAndPlay(1);
} else if (currentStatus == 2) {
if (direction == "Left") {
sprite.gotoAndStop(anim_trappedLeft);
} else {
sprite.gotoAndStop(anim_trappedRight);
}
sprite.anim.gotoAndStop(1);
sprite.anim.heartAnim.gotoAndStop(sprite.anim.heartAnim._totalframes);
}
}
moveFunc();
vertFunc();
collisionFunc();
return("running");
}
function dispose() {
LoveJuice.Baddies.BaddieHandler.soundHandler.stopSound(walkerSlimeSFX);
sprite.removeMovieClip();
}
function hit(shotPower) {
if (currentStatus == 2) {
pushSpeed = shotPower;
if ((sprite._x + (sprite._width / 2)) > LoveJuice.Baddies.BaddieHandler.playerSprite._x) {
moveFunc = pushedRight;
} else {
moveFunc = pushedLeft;
}
return(undefined);
}
if (shotPower == 6) {
LoveJuice.Baddies.BaddieHandler.eventHandler.sendEvent("incScore", 500);
trapHim();
return(undefined);
}
stunnedCnt = stunnedCnt + (shotPower * 5);
if (stunnedCnt > 31) {
stunnedCnt = 31;
}
if (power <= 0) {
if (mutatedFlag == false) {
mutateThisFrame = true;
} else {
LoveJuice.Baddies.BaddieHandler.eventHandler.sendEvent("incScore", 20);
plotPoints(20);
}
} else {
power = power - shotPower;
LoveJuice.Baddies.BaddieHandler.eventHandler.sendEvent("incScore", 10);
plotPoints(10);
}
if (oldMoveFunc == null) {
sprite.anim.gotoAndStop(sprite.anim._currentframe);
oldMoveFunc = moveFunc;
colourFlashCnt = 0;
colourValue = "Normal";
colour.setTransform(colourHandler.restoreColour());
trappedVerticalDirection = "up";
trappedVerticalSpeed = 1;
trappedVerticalMidPointFlag = false;
vertFunc = null;
}
moveFunc = stunned;
}
function getSprite() {
return(sprite);
}
function createSprite() {
var _local2 = LoveJuice.Baddies.BaddieHandler.playField.getNextHighestDepth();
sprite = LoveJuice.Baddies.BaddieHandler.playField.attachMovie("baddie_dog", "dog" + _local2, _local2);
sprite._x = pos.x * 32;
sprite._y = pos.y * 32;
colour = new Color(sprite);
hideSprite();
}
function hideSprite() {
sprite._visible = false;
sprite.anim.gotoAndStop(1);
colourValue = "Normal";
colour.setTransform(colourHandler.restoreColour());
LoveJuice.Baddies.BaddieHandler.soundHandler.stopSound(walkerSlimeSFX);
}
function moveLeft() {
sprite._x = sprite._x - speed;
fineX = fineX - speed;
if (fineX < 0) {
fineX = fineX + 32;
pos.x--;
var _local2 = LoveJuice.Baddies.BaddieHandler.mapData[pos.y][pos.x][1];
if (_local2 != 0) {
maxLeft = pos.x;
direction = "Right";
if (mutatedFlag == false) {
sprite.gotoAndStop(anim_walkRight);
} else {
sprite.gotoAndStop(anim_mutatedRight);
}
moveFunc = moveRight;
} else {
_local2 = LoveJuice.Baddies.BaddieHandler.mapData[pos.y + 1][pos.x][1];
if (_local2 != 1) {
maxLeft = pos.x;
direction = "Right";
sprite.gotoAndStop(2);
moveFunc = moveRight;
}
}
}
}
function moveRight() {
sprite._x = sprite._x + speed;
fineX = fineX + speed;
if (fineX > 32) {
fineX = fineX - 32;
pos.x++;
var _local2 = LoveJuice.Baddies.BaddieHandler.mapData[pos.y][pos.x + 2][1];
if (_local2 != 0) {
maxRight = pos.x;
direction = "Left";
if (mutatedFlag == false) {
sprite.gotoAndStop(anim_walkLeft);
} else {
sprite.gotoAndStop(anim_mutatedLeft);
}
moveFunc = dumbMoveLeft;
} else {
_local2 = LoveJuice.Baddies.BaddieHandler.mapData[pos.y + 1][pos.x + 1][1];
if (_local2 != 1) {
maxRight = pos.x;
direction = "Left";
sprite.gotoAndStop(1);
moveFunc = dumbMoveLeft;
}
}
}
}
function dumbMoveLeft() {
sprite._x = sprite._x - speed;
fineX = fineX - speed;
if (fineX < 0) {
fineX = fineX + 32;
pos.x--;
if (pos.x == maxLeft) {
direction = "Right";
if (mutatedFlag == false) {
sprite.gotoAndStop(anim_walkRight);
} else {
sprite.gotoAndStop(anim_mutatedRight);
}
moveFunc = dumbMoveRight;
}
}
}
function dumbMoveRight() {
sprite._x = sprite._x + speed;
fineX = fineX + speed;
if (fineX > 32) {
fineX = fineX - 32;
pos.x++;
if (pos.x == maxRight) {
direction = "Left";
if (mutatedFlag == false) {
sprite.gotoAndStop(anim_walkLeft);
} else {
sprite.gotoAndStop(anim_mutatedLeft);
}
moveFunc = dumbMoveLeft;
}
}
}
function moveUp() {
if (mutatedFlag == false) {
sprite._y--;
if ((originalY - sprite._y) == 22) {
vertDir = "Floating";
floatCnt = 0;
vertFunc = float;
}
} else {
sprite._y = sprite._y - 2;
if ((originalY - sprite._y) == 44) {
vertDir = "Floating";
floatCnt = 0;
vertFunc = float;
}
}
}
function float() {
if (mutatedFlag == false) {
if ((++floatCnt) == 6) {
vertDir = "Down";
vertFunc = moveDown;
}
} else if ((++floatCnt) == 3) {
vertDir = "Down";
vertFunc = moveDown;
}
}
function moveDown() {
if (mutatedFlag == false) {
sprite._y = sprite._y + 2;
if (sprite._y >= originalY) {
sprite._y = originalY;
vertDir = "Up";
vertFunc = moveUp;
if (mutateThisFrame == true) {
mutateThisFrame = false;
mutatedFlag = true;
LoveJuice.Baddies.BaddieHandler.playMutatedSFX();
speed = 8;
var _local2 = sprite.anim._currentframe;
if (direction == "Left") {
sprite.gotoAndStop(anim_mutatedLeft);
} else {
sprite.gotoAndStop(anim_mutatedRight);
}
sprite.anim.gotoAndPlay(_local2);
}
}
} else {
sprite._y = sprite._y + 4;
if (sprite._y >= originalY) {
sprite._y = originalY;
vertDir = "Up";
vertFunc = moveUp;
}
}
}
function collisionCheck() {
var _local2 = Math.abs(LoveJuice.Baddies.BaddieHandler.playerPos.y - pos.y);
if (_local2 >= 2) {
return(undefined);
}
_local2 = Math.abs(LoveJuice.Baddies.BaddieHandler.playerPos.x - pos.x);
if (_local2 >= 2) {
return(undefined);
}
if (sprite.hitAreaMC.hitTest(LoveJuice.Baddies.BaddieHandler.playerSprite.hitAreaMC)) {
LoveJuice.Baddies.BaddieHandler.eventHandler.sendEvent("baddieCollision", this);
collisionFunc = null;
}
}
function stunned() {
if ((--stunnedCnt) <= 0) {
sprite.anim.gotoAndPlay(sprite.anim._currentframe);
colour.setTransform(colourHandler.restoreColour());
moveFunc = oldMoveFunc;
oldMoveFunc = null;
if (vertDir == "Up") {
vertFunc = moveUp;
} else if (vertDir == "Down") {
vertFunc = moveDown;
} else {
vertFunc = float;
}
return(null);
}
if ((++colourFlashCnt) == 4) {
if (colourValue == "Normal") {
colourFlashCnt = 0;
colourValue = "Red";
colour.setTransform(colourHandler.setTint(255, 0, 0, 80));
} else {
colourFlashCnt = 2;
colourValue = "Normal";
colour.setTransform(colourHandler.restoreColour());
}
}
return(null);
}
function trapHim() {
var _local2 = sprite.anim._currentframe;
if (direction == "Left") {
sprite.gotoAndStop(anim_trappedLeft);
} else {
sprite.gotoAndStop(anim_trappedRight);
}
sprite.anim.gotoAndStop(_local2);
currentStatus = 2;
collisionFunc = trappedCollisionChecks;
colour.setTransform(colourHandler.restoreColour());
moveFunc = null;
vertFunc = null;
sprite._y = originalY;
circle1Radius = 39;
circle2Radius = 27;
if (direction == "Left") {
circle1x = -32;
circle2x = 38;
} else {
circle1x = -5;
circle2x = -49;
}
circle1y = -54;
circle2y = -44;
circle1x = circle1x + circle1Radius;
circle1y = circle1y + circle1Radius;
circle2x = circle2x + circle2Radius;
circle2y = circle2y + circle2Radius;
if (sprite._x >= 550) {
var _local3 = 550 - sprite._x;
sprite._x = sprite._x + _local3;
pushSpeed = 8;
moveFunc = pushedLeft;
return(undefined);
}
if (sprite._x < 20) {
var _local3 = 20 - sprite._x;
sprite._x = sprite._x - _local3;
pushSpeed = 8;
moveFunc = pushedRight;
return(undefined);
}
sprite.swapDepths(LoveJuice.Baddies.BaddieHandler.playField.getNextHighestDepth());
}
function trappedCollisionChecks() {
trappedVerticalMove();
if (!LoveJuice.Baddies.BaddieHandler.playerSprite.hitTest(sprite)) {
return(undefined);
}
var _local2;
var _local6;
var _local5;
var _local4;
var _local3;
if (LoveJuice.Baddies.BaddieHandler.player.jumpStatus == "jumpingDown") {
_local2 = 10;
_local6 = LoveJuice.Baddies.BaddieHandler.playerSprite._x + (9 + _local2);
_local5 = LoveJuice.Baddies.BaddieHandler.playerSprite._y + (18 + _local2);
_local4 = _local6 - (sprite._x + circle1x);
_local3 = _local5 - (sprite._y + circle1y);
if (((_local4 * _local4) + (_local3 * _local3)) <= ((_local2 + circle1Radius) * (_local2 + circle1Radius))) {
LoveJuice.Baddies.BaddieHandler.player.hiJump();
return(undefined);
}
_local4 = _local6 - (sprite._x + circle2x);
_local3 = _local5 - (sprite._y + circle2y);
if (((_local4 * _local4) + (_local3 * _local3)) <= ((_local2 + circle2Radius) * (_local2 + circle2Radius))) {
LoveJuice.Baddies.BaddieHandler.player.hiJump();
return(undefined);
}
}
var _local7 = LoveJuice.Baddies.BaddieHandler.player.getCollisionCircle();
_local2 = _local7[0];
_local6 = LoveJuice.Baddies.BaddieHandler.playerSprite._x + (_local7[1].x + _local2);
_local5 = LoveJuice.Baddies.BaddieHandler.playerSprite._y + (_local7[1].y + _local2);
_local4 = _local6 - (sprite._x + circle1x);
_local3 = _local5 - (sprite._y + circle1y);
if (((_local4 * _local4) + (_local3 * _local3)) <= ((_local2 + circle1Radius) * (_local2 + circle1Radius))) {
pushSpeed = 8;
if (direction == "Left") {
moveFunc = pushedRight;
} else {
moveFunc = pushedLeft;
}
return(undefined);
}
_local4 = _local6 - (sprite._x + circle2x);
_local3 = _local5 - (sprite._y + circle2y);
if (((_local4 * _local4) + (_local3 * _local3)) <= ((_local2 + circle2Radius) * (_local2 + circle2Radius))) {
pushSpeed = 8;
if (direction == "Left") {
moveFunc = pushedLeft;
} else {
moveFunc = pushedRight;
}
return(undefined);
}
}
function pushedRight() {
if ((sprite._x + pushSpeed) > 550) {
var _local2 = 550 - sprite._x;
sprite._x = sprite._x + _local2;
pushSpeed = pushSpeed * 0.84;
moveFunc = pushedLeft;
return(undefined);
}
sprite._x = sprite._x + pushSpeed;
pushSpeed = pushSpeed * 0.84;
if (pushSpeed < 0.5) {
moveFunc = null;
}
}
function pushedLeft() {
if ((sprite._x - pushSpeed) < 20) {
var _local2 = 20 - sprite._x;
sprite._x = sprite._x - _local2;
pushSpeed = pushSpeed * 0.84;
moveFunc = pushedRight;
return(undefined);
}
sprite._x = sprite._x - pushSpeed;
pushSpeed = pushSpeed * 0.84;
if (pushSpeed < 0.5) {
moveFunc = null;
}
}
function trappedVerticalMove() {
if (trappedVerticalDirection == "up") {
sprite._y = sprite._y - trappedVerticalSpeed;
if (trappedVerticalMidPointFlag == false) {
var _local2 = trappedVerticalSpeed;
_local2 = _local2 * 0.22;
trappedVerticalSpeed = trappedVerticalSpeed + _local2;
if (trappedVerticalSpeed >= 1.9) {
trappedVerticalMidPointFlag = true;
}
} else {
trappedVerticalSpeed = trappedVerticalSpeed * 0.78;
if (trappedVerticalSpeed <= 0.2) {
trappedVerticalDirection = "down";
trappedVerticalSpeed = 0.2;
trappedVerticalMidPointFlag = false;
}
}
} else {
sprite._y = sprite._y + trappedVerticalSpeed;
if (trappedVerticalMidPointFlag == false) {
var _local3 = trappedVerticalSpeed;
_local3 = _local3 * 0.22;
trappedVerticalSpeed = trappedVerticalSpeed + _local3;
if (trappedVerticalSpeed >= 1.9) {
trappedVerticalMidPointFlag = true;
}
} else {
trappedVerticalSpeed = trappedVerticalSpeed * 0.78;
if (trappedVerticalSpeed <= 0.2) {
trappedVerticalDirection = "up";
trappedVerticalSpeed = 0.2;
trappedVerticalMidPointFlag = false;
}
}
}
}
function plotPoints(amount) {
if ((--pointsDelay) > 0) {
return(undefined);
}
pointsDelay = 5;
var _local2 = LoveJuice.Baddies.BaddieHandler.playField.getNextHighestDepth();
var _local4 = "tenPointsAnim";
if (amount == 20) {
_local4 = "twentyPointsAnim";
}
var _local3 = LoveJuice.Baddies.BaddieHandler.playField.attachMovie(_local4, "points" + _local2, _local2);
_local3._x = sprite._x;
_local3._y = sprite._y;
}
var power = 4;
var anim_walkLeft = 1;
var anim_walkRight = 2;
var anim_trappedLeft = 3;
var anim_trappedRight = 4;
var anim_mutatedLeft = 5;
var anim_mutatedRight = 6;
}
Symbol 878 MovieClip [__Packages.LoveJuice.Baddies.Switch] Frame 0
class LoveJuice.Baddies.Switch extends LoveJuice.Baddies.BaddieHandler
{
var mapData, groupNumber, restorePos, pos, buttonClickSFX, sprite, currentStatus, offScreenTestCnt, mainFunc;
function Switch (posArg, mapArg, groupNumberArg) {
super();
mapData = mapArg;
groupNumber = groupNumberArg;
restorePos = posArg.clone();
restore();
}
function toString() {
return("Switch");
}
function restore() {
pos = restorePos.clone();
createSprite();
buttonClickSFX = LoveJuice.Baddies.BaddieHandler.soundHandler.createSound(sprite, "buttonClickSFX");
currentStatus = 1;
offScreenTestCnt = 0;
}
function mainloop() {
if (sprite._visible == true) {
if ((--offScreenTestCnt) <= 0) {
if (!LoveJuice.Baddies.BaddieHandler.mainMovie.hitAreaMC.hitTest(sprite)) {
hideSprite();
return(null);
}
offScreenTestCnt = 31;
}
} else {
if ((pos.y + 3) < LoveJuice.Baddies.BaddieHandler.scrollWindow.y) {
return("notReached");
}
if (!LoveJuice.Baddies.BaddieHandler.mainMovie.hitAreaMC.hitTest(sprite)) {
return(null);
}
sprite._visible = true;
offScreenTestCnt = 31;
if (currentStatus < 2) {
currentStatus = 1;
sprite.gotoAndStop(1);
} else {
sprite.gotoAndStop(3);
}
}
return("running");
}
function dispose() {
sprite.removeMovieClip();
}
function hit(shotPower) {
if (currentStatus == 3) {
return(undefined);
}
currentStatus = 3;
sprite.gotoAndStop(2);
LoveJuice.Baddies.BaddieHandler.eventHandler.sendEvent("switchHit", groupNumber);
LoveJuice.Baddies.BaddieHandler.soundHandler.createPlayAndDispose(sprite, "yaySFX");
}
function createSprite() {
var _local2 = LoveJuice.Baddies.BaddieHandler.playField.getNextHighestDepth();
sprite = LoveJuice.Baddies.BaddieHandler.playField.attachMovie("object_switch", "switch" + _local2, _local2);
sprite._x = pos.x * 32;
sprite._y = pos.y * 32;
sprite._visible = false;
sprite.gotoAndStop(1);
}
function hideSprite() {
sprite._visible = false;
sprite.gotoAndStop(3);
mainFunc = null;
}
}
Symbol 879 MovieClip [__Packages.LoveJuice.Baddies.InvisibleTile] Frame 0
class LoveJuice.Baddies.InvisibleTile extends LoveJuice.Baddies.BaddieHandler
{
var mapData, objectMapData, groupNumber, restorePos, pos, buttonClickSFX, sprite, currentStatus, offScreenTestCnt, spriteStorage;
function InvisibleTile (posArg, mapArg, objectMapDataArg, groupNumberArg) {
super();
mapData = mapArg;
objectMapData = objectMapDataArg;
groupNumber = groupNumberArg;
restorePos = posArg.clone();
restore();
LoveJuice.Baddies.BaddieHandler.eventHandler.subscribeToEvent(this);
}
function toString() {
return("InvisibleTile");
}
function restore() {
pos = restorePos.clone();
createSprites();
buttonClickSFX = LoveJuice.Baddies.BaddieHandler.soundHandler.createSound(sprite, "buttonClickSFX");
currentStatus = 1;
}
function mainloop() {
if (sprite._visible == true) {
if ((--offScreenTestCnt) <= 0) {
if (!LoveJuice.Baddies.BaddieHandler.mainMovie.hitAreaMC.hitTest(sprite)) {
hideSprites();
return(null);
}
offScreenTestCnt = 31;
}
} else {
if ((pos.y + 3) < LoveJuice.Baddies.BaddieHandler.scrollWindow.y) {
return("notReached");
}
if (!LoveJuice.Baddies.BaddieHandler.mainMovie.hitAreaMC.hitTest(sprite)) {
return(null);
}
offScreenTestCnt = 31;
var _local2 = -1;
var _local4 = spriteStorage.length;
var _local3;
while (_local2++ , _local2 != _local4) {
_local3 = spriteStorage[_local2];
_local3._visible = true;
}
}
return(null);
}
function dispose() {
var _local2 = -1;
var _local4 = spriteStorage.length;
var _local3;
while (_local2++ , _local2 != _local4) {
_local3 = spriteStorage[_local2];
_local3.removeMovieClip();
}
}
function switchHit(groupArg) {
if (groupArg != groupNumber) {
return(undefined);
}
if (currentStatus == 2) {
return(undefined);
}
var _local6 = pos.clone();
var _local5 = _local6.x;
var _local2 = -1;
var _local4 = spriteStorage.length;
var _local3;
while (_local2++ , _local2 != _local4) {
_local3 = spriteStorage[_local2];
_local3.gotoAndPlay(2);
mapData[pos.y][_local5++][1] = 1;
}
}
function createSprites() {
spriteStorage = new Array();
var _local4 = LoveJuice.Baddies.BaddieHandler.playField.getNextHighestDepth();
var _local2;
var _local5 = pos.x * 32;
var _local7 = pos.clone();
var _local3 = _local7.x + 1;
mapData[pos.y][_local7.x][1] = 0;
var _local6 = -1;
while (_local6++ , _local6 != 20) {
mapData[pos.y][_local3][1] = 0;
_local2 = LoveJuice.Baddies.BaddieHandler.playField.attachMovie("object_invisibleTile", "invisibleTile" + _local4, _local4++);
_local2._x = _local5;
_local2._y = pos.y * 32;
_local2.gotoAndStop(1);
spriteStorage.push(_local2);
if (objectMapData[pos.y][_local3][1] != LoveJuice.ItemDefs.object_invisibleTileChildren) {
break;
}
_local3++;
_local5 = _local5 + 32;
}
}
function hideSprites() {
var _local2 = -1;
var _local4 = spriteStorage.length;
var _local3;
while (_local2++ , _local2 != _local4) {
_local3 = spriteStorage[_local2];
_local3._visible = false;
}
}
}
Symbol 880 MovieClip [__Packages.LoveJuice.Baddies.Tree] Frame 0
class LoveJuice.Baddies.Tree extends LoveJuice.Baddies.BaddieHandler
{
var restorePos, frame, pos, offScreenTestCnt, sprite;
function Tree (posArg, frameArg) {
super();
restorePos = posArg.clone();
frame = frameArg;
if (frame == 2) {
frame = int(Math.random() * 2) + 2;
}
restore();
}
function toString() {
return("Tree");
}
function restore() {
pos = restorePos.clone();
createSprite();
offScreenTestCnt = 0;
}
function mainloop() {
if (sprite._visible == true) {
if ((--offScreenTestCnt) <= 0) {
offScreenTestCnt = 31;
}
} else {
if ((pos.y + 3) < LoveJuice.Baddies.BaddieHandler.scrollWindow.y) {
return("notReached");
}
sprite._visible = true;
sprite.gotoAndStop(frame);
offScreenTestCnt = 31;
}
}
function dispose() {
sprite.removeMovieClip();
}
function createSprite() {
var _local2 = LoveJuice.Baddies.BaddieHandler.playField.getNextHighestDepth();
sprite = LoveJuice.Baddies.BaddieHandler.playField.attachMovie("object_tree", "tree" + _local2, _local2);
sprite._x = pos.x * 32;
sprite._y = pos.y * 32;
hideSprite();
}
function hideSprite() {
sprite._visible = false;
sprite.gotoAndStop(sprite._totalframes);
}
}
Symbol 881 MovieClip [__Packages.LoveJuice.Baddies.Goal] Frame 0
class LoveJuice.Baddies.Goal extends LoveJuice.Baddies.BaddieHandler
{
var restorePos, pos, mainFunc, sprite;
function Goal (posArg) {
super();
restorePos = posArg.clone();
restore();
}
function toString() {
return("Goal");
}
function restore() {
pos = restorePos.clone();
createSprite();
mainFunc = collisionCheck;
}
function mainloop() {
mainFunc();
return(null);
}
function dispose() {
sprite.removeMovieClip();
}
function createSprite() {
var _local2 = LoveJuice.Baddies.BaddieHandler.playField.getNextHighestDepth();
sprite = LoveJuice.Baddies.BaddieHandler.playField.attachMovie("object_goal", "goal" + _local2, _local2);
sprite._x = pos.x * 32;
sprite._y = pos.y * 32;
}
function collisionCheck() {
var _local2 = Math.abs(LoveJuice.Baddies.BaddieHandler.playerPos.y - pos.y);
if (_local2 >= 4) {
return(undefined);
}
if (sprite.hitAreaMC.hitTest(LoveJuice.Baddies.BaddieHandler.playerSprite.hitAreaMC)) {
LoveJuice.Baddies.BaddieHandler.eventHandler.sendEvent("triggerGoal");
mainFunc = null;
}
}
}
Symbol 882 MovieClip [__Packages.LoveJuice.Bullet] Frame 0
class LoveJuice.Bullet
{
var main, playField, pos, direction, power, range, sprite, onscreenBaddies, moveFunc, verticalSpeed;
function Bullet (playerPos, playerDirection, powerArg) {
main = Main.getInstance();
playField = main.getMainMovie().playField;
pos = playerPos;
direction = playerDirection;
power = powerArg;
range = 500 - (power * 60);
range = range / 8;
createSprite();
}
function toString() {
return("Bullet");
}
function dispose() {
sprite.removeMovieClip();
}
function mainloop(onscreenBaddiesArg) {
onscreenBaddies = onscreenBaddiesArg;
return(moveFunc());
}
function createSprite() {
var _local2 = playField.getNextHighestDepth();
sprite = playField.attachMovie("bullet", "bullet" + _local2, _local2);
sprite.gotoAndStop(power);
sprite._y = pos.y;
if (direction == "Right") {
sprite._x = pos.x + 40;
moveFunc = moveRight;
} else {
sprite._x = pos.x - 10;
moveFunc = moveLeft;
}
}
function moveRight() {
sprite._x = sprite._x + 8;
if (sprite._x > 640) {
return("dead");
}
if ((--range) <= 0) {
verticalSpeed = 4;
moveFunc = driftUp;
}
return(collisionCheckRight());
}
function moveLeft() {
sprite._x = sprite._x - 8;
if (sprite._x < 0) {
return("dead");
}
if ((--range) <= 0) {
verticalSpeed = 4;
moveFunc = driftUp;
}
return(collisionCheckLeft());
}
function driftUp() {
sprite._y = sprite._y - verticalSpeed;
verticalSpeed = verticalSpeed * 0.98;
if (verticalSpeed <= 1) {
triggerParticles(power * 2);
return("dead");
}
return(collisionCheckVertical());
}
function collisionCheckRight() {
var _local4 = -1;
var _local5 = onscreenBaddies.length;
var _local2;
var _local3;
while (_local4++ , _local4 != _local5) {
_local2 = onscreenBaddies[_local4];
_local3 = _local2.sprite;
if (_local3._x > (sprite._x - sprite._width)) {
if (_local3.hitAreaMC.hitTest(sprite.hitAreaMC)) {
_local2.hit(power);
triggerParticles();
return("dead");
}
}
}
return(null);
}
function collisionCheckLeft() {
var _local4 = -1;
var _local5 = onscreenBaddies.length;
var _local2;
var _local3;
while (_local4++ , _local4 != _local5) {
_local2 = onscreenBaddies[_local4];
_local3 = _local2.sprite;
if (_local3._x < sprite._x) {
if (_local3.hitAreaMC.hitTest(sprite.hitAreaMC)) {
_local2.hit(power);
triggerParticles();
return("dead");
}
}
}
return(null);
}
function collisionCheckVertical() {
var _local4 = -1;
var _local5 = onscreenBaddies.length;
var _local2;
var _local3;
while (_local4++ , _local4 != _local5) {
_local2 = onscreenBaddies[_local4];
_local3 = _local2.sprite;
if (_local3._y < sprite._y) {
if (_local3.hitAreaMC.hitTest(sprite.hitAreaMC)) {
_local2.hit(power);
triggerParticles();
return("dead");
}
}
}
return(null);
}
function triggerParticles(amount) {
var _local3 = playField.getNextHighestDepth();
var _local2;
var _local4 = -1;
if (amount == undefined) {
amount = 2;
}
while (_local4++ , _local4 != amount) {
_local2 = playField.attachMovie("particle", "particle" + _local3, _local3++);
_local2.xposition = (_local2._x = sprite._x);
_local2.yposition = (_local2._y = sprite._y);
_local2.xvel = int((Math.random() * 10) - 5);
_local2.yvel = int((Math.random() * 10) - 5);
_local2.gravity = 0.3;
_local2.delay = 30;
_local2.onEnterFrame = function () {
this.yposition = this.yposition + this.yvel;
this.yvel = this.yvel + this.gravity;
this.xposition = this.xposition + this.xvel;
this._y = this.yposition;
this._x = this.xposition;
if ((--this.delay) <= 0) {
this._alpha = this._alpha - 10;
if (this._alpha <= 0) {
this.removeMovieClip();
}
}
};
}
}
}
Symbol 883 MovieClip [__Packages.LoveJuice.TileDefs] Frame 0
class LoveJuice.TileDefs
{
function TileDefs () {
}
static function getCoords(tileAttribute) {
if (tileAttribute == 0) {
tileAttribute++;
}
return(attributeStorage[tileAttribute - 1]);
}
static var attributeStorage = [[0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 2, 2, 4, 4, 6, 6], [6, 8, 8, 10, 10, 12, 12, 12], [14, 14, 16, 16, 18, 18, 20], [20, 18, 18, 16, 16, 14, 14], [12, 12, 12, 10, 10, 8, 8, 6], [6, 6, 4, 4, 2, 2, 0, 0], [18, 18, 18, 18, 18, 18, 18, 18], [10, 10, 10, 10, 10, 10, 10, 10], [0, 4, 6, 8, 10, 12, 14, 16], [18, 20, 22, 22, 24, 24, 26, 28], [28, 26, 24, 24, 22, 22, 20, 18], [16, 14, 12, 10, 8, 6, 4, 0], [28, 28, 28, 28, 28, 28, 28, 28], [26, 26, 26, 26, 26, 26, 26, 26], [24, 24, 24, 24, 24, 24, 24, 24], [22, 22, 22, 22, 22, 22, 22, 22], [20, 20, 20, 20, 20, 20, 20, 20], [18, 18, 18, 18, 18, 18, 18, 18], [16, 16, 16, 16, 16, 16, 16, 16], [14, 14, 14, 14, 14, 14, 14, 14], [20, 22, 22, 24, 24, 26, 26, 28], [28, 26, 26, 24, 24, 22, 22, 20]];
}
Symbol 884 MovieClip [__Packages.LoveJuice.Master] Frame 0
class LoveJuice.Master
{
var gameControllerObj, main, mainMovie, player, levelHandler, baddieHandler, keyDelay, methodStore;
function Master () {
}
function toString() {
return("Master");
}
function mainLoopInit() {
if (gameControllerObj == undefined) {
main = Main.getInstance();
mainMovie = main.getMainMovie();
gameControllerObj = main.getInitInstance().getGameController();
player = gameControllerObj.getPlayer();
levelHandler = main.getInitInstance().getLevelHandler();
baddieHandler = gameControllerObj.getBaddieHandler();
}
keyDelay = 0;
mainMovie.onEnterFrame = gamingyourway.common.Delegate.create(this, mainloop);
}
function houseKeeping() {
delete mainMovie.onEnterFrame;
}
function pause() {
stopGame();
mainMovie.onEnterFrame = gamingyourway.common.Delegate.create(this, pauseHandler);
}
function stopGame() {
if (mainMovie.onEnterFrame != undefined) {
methodStore = mainMovie.onEnterFrame;
} else {
methodStore = null;
}
houseKeeping();
}
function resume() {
if (methodStore != null) {
mainMovie.onEnterFrame = methodStore;
}
}
function mainloop() {
if ((--keyDelay) > 0) {
return(undefined);
}
if (inkey(80)) {
keyDelay = 10;
pause();
gameControllerObj.pause();
return(undefined);
}
player.mainloop();
baddieHandler.mainloop();
}
function pauseHandler() {
if ((--keyDelay) > 0) {
return(undefined);
}
if (inkey(80)) {
keyDelay = 5;
resume();
gameControllerObj.resume();
} else if (inkey(81)) {
gameControllerObj.quit();
}
}
var inkey = Key.isDown;
}
Symbol 885 MovieClip [__Packages.LoveJuice.Transition] Frame 0
class LoveJuice.Transition
{
var main, mainMovie, screenGrab, grabHolder, wipeCircle;
function Transition () {
main = Main.getInstance();
mainMovie = main.getMainMovie();
screenGrab = new flash.display.BitmapData(640, 480, false, 0);
grabHolder = mainMovie.grabHolder;
}
function toString() {
return("Transition");
}
function grabScreen() {
screenGrab.draw(mainMovie, new flash.geom.Matrix(), null);
var _local2 = grabHolder.createEmptyMovieClip("innerClip", 1);
_local2.attachBitmap(screenGrab, 1);
wipeCircle = grabHolder.attachMovie("wipeCircle", "wipeCircle", 2);
wipeCircle.gotoAndStop(1);
wipeCircle.cacheAsBitmap = true;
_local2.cacheAsBitmap = true;
_local2.setMask(wipeCircle);
grabHolder._alpha = 100;
grabHolder._visible = true;
}
function removeGrabbedScreen() {
grabHolder.innerClip.removeMovieClip();
wipeCircle.removeMovieClip();
}
function wipeOutInit() {
wipeCircle.gotoAndPlay(1);
grabHolder.onEnterFrame = gamingyourway.common.Delegate.create(this, wipeOut);
}
function crossFadeInit() {
grabHolder.onEnterFrame = gamingyourway.common.Delegate.create(this, crossFade);
}
function wipeOut() {
if (wipeCircle._currentframe == wipeCircle._totalframes) {
grabHolder.innerClip.removeMovieClip();
wipeCircle.removeMovieClip();
delete grabHolder.onEnterFrame;
grabHolder._visible = false;
}
}
function crossFade() {
grabHolder._alpha = grabHolder._alpha - 10;
if (grabHolder._alpha <= 0) {
delete grabHolder.onEnterFrame;
grabHolder._visible = false;
grabHolder._alpha = 100;
}
}
}
Symbol 886 MovieClip [__Packages.LoveJuice.Attract] Frame 0
class LoveJuice.Attract
{
var main, mainMovie, eventHandler, highScoreHandler, transition, attractMode, soundHandler, titleMod, gameCompleteSFX, cryingSFX, buttonClickSFX, particleLaunchCount, keyScanDelay, playButton, hiscoresButton, creditsButton, soundButton, helpButton, backButton, instructionsClip, nextButton, prevButton, continueButton;
function Attract () {
}
function toString() {
return("Attract");
}
function oneShot() {
main = Main.getInstance();
mainMovie = main.getMainMovie();
eventHandler = main.getInitInstance().getEventHandler();
eventHandler.subscribeToEvent(this);
highScoreHandler = new LoveJuice.IO.HighScoreHandler();
transition = main.getInitInstance().getTransition();
attractMode = mainMovie.attractMode;
soundHandler = main.getInitInstance().getSoundHandler();
soundHandler.setMasterVolume(defaultVolume);
titleMod = soundHandler.createSound(attractMode, "tune1");
gameCompleteSFX = soundHandler.createSoundAndMC(mainMovie, "gameCompleteSFX");
cryingSFX = soundHandler.createSoundAndMC(mainMovie, "cryingSFX");
buttonClickSFX = soundHandler.createSoundAndMC(mainMovie, "buttonClickSFX");
preInit();
}
function preInit() {
mainMovie.coverAll.onEnterFrame = gamingyourway.common.Delegate.create(this, fadeDownCoverAll);
soundHandler.setDefaultVolume(titleMod, 0);
soundHandler.loopSound(titleMod, 0);
init();
}
function init() {
attractMode.gotoAndStop(2);
attractMode._visible = true;
initTitleButtons();
soundHandler.fadeSoundIn(titleMod, 2, defaultVolume, 1);
}
function killAttractMode() {
attractMode.onEnterFrame = gamingyourway.common.Delegate.create(this, fadeDownAttract);
}
function gameOverInit() {
attractMode.gotoAndStop("gameOver");
attractMode._visible = true;
transition.wipeOutInit();
soundHandler.loopSound(cryingSFX);
gameOver();
}
function gameCompleteInit() {
attractMode.gotoAndStop("gameComplete");
attractMode._alpha = 100;
attractMode._visible = true;
transition.wipeOutInit();
soundHandler.playSound(gameCompleteSFX);
triggerParticles(8);
particleLaunchCount = 0;
gameCompleteSFX._MovieClip.onEnterFrame = gamingyourway.common.Delegate.create(this, fireOffParticles);
gameOver();
}
function displayLoadingScreen() {
attractMode._alpha = 100;
attractMode._visible = true;
attractMode.gotoAndStop("loadingScreen");
transition.crossFadeInit();
loadingScreenInit();
}
function loadingComplete() {
loadedFlag = true;
}
function hsFailedToLoad() {
attractMode.hsLoadingText.gotoAndStop(2);
}
function hsLoaded() {
attractMode.hsLoadingText._visible = false;
var _local3 = highScoreHandler.getHiscoreTable();
var _local2 = -1;
while (_local2++ , _local2 != 10) {
attractMode["hn" + (_local2 + 1)].text = _local3.names[_local2];
}
_local2 = -1;
while (_local2++ , _local2 != 10) {
attractMode["hs" + (_local2 + 1)].text = _local3.scores[_local2];
}
}
function initButton(mc) {
mc.enabled = true;
mc.useHandCursor = true;
}
function killButton(mc) {
mc.enabled = false;
mc.useHandCursor = false;
mc.gotoAndStop(1);
if (mc.onEnterFrame != undefined) {
delete mc.onEnterFrame;
}
}
function scanForKeys() {
if ((--keyScanDelay) > 0) {
return(false);
}
if (inkey(32) || (inkey(13))) {
return(true);
}
return(false);
}
function fadeDownCoverAll() {
var _local2 = mainMovie.coverAll;
_local2._alpha = _local2._alpha - 10;
if (_local2._alpha <= 0) {
delete _local2.onEnterFrame;
_local2.swapDepths(mainMovie.getNextHighestDepth());
_local2.removeMovieClip();
}
}
function initTitleButtons() {
playButton = attractMode.playButton;
initButton(playButton);
playButton.onPress = gamingyourway.common.Delegate.create(this, startButtonPressed);
keyScanDelay = 20;
playButton.onEnterFrame = gamingyourway.common.Delegate.create(this, startButtonScanKeys);
hiscoresButton = attractMode.hiscoresButton;
initButton(hiscoresButton);
hiscoresButton.onPress = gamingyourway.common.Delegate.create(this, hiscoresButtonPressed);
creditsButton = attractMode.creditsButton;
initButton(creditsButton);
creditsButton.onPress = gamingyourway.common.Delegate.create(this, creditsButtonPressed);
soundButton = attractMode.soundButton;
initButton(soundButton);
soundButton.onPress = gamingyourway.common.Delegate.create(this, soundButtonPressed);
soundButton.onRollOver = (soundButton.onRollOut = (soundButton.onDragOut = (soundButton.onDragOver = gamingyourway.common.Delegate.create(this, resetSoundButtonDisplay))));
resetSoundButtonDisplay();
helpButton = attractMode.helpButton;
initButton(helpButton);
helpButton.onPress = gamingyourway.common.Delegate.create(this, helpButtonPressed);
}
function killTitleScreenButtons() {
delete attractMode.playButton.onEnterFrame;
killButton(playButton);
killButton(hiscoresButton);
killButton(soundButton);
killButton(helpButton);
}
function startButtonScanKeys() {
if (scanForKeys() == true) {
startButtonPressed();
}
}
function startButtonPressed() {
killTitleScreenButtons();
transition.grabScreen();
transition.crossFadeInit();
soundHandler.playSound(buttonClickSFX);
main.getInitInstance().getGameController().loadLevel();
loadingScreenInit();
}
function hiscoresButtonPressed() {
getURL ("http://www.gimme5games.com/index.jsp?id=lovedup_hs", "_blank");
}
function helpButtonPressed() {
killTitleScreenButtons();
soundHandler.playSound(buttonClickSFX);
transition.grabScreen();
transition.crossFadeInit();
displayHelpInit();
}
function creditsButtonPressed() {
killTitleScreenButtons();
soundHandler.playSound(buttonClickSFX);
transition.grabScreen();
transition.crossFadeInit();
displayCreditsInit();
}
function backButtonPressed() {
soundHandler.playSound(buttonClickSFX);
killButton(backButton);
transition.grabScreen();
transition.crossFadeInit();
init();
}
function displayCreditsInit() {
attractMode.gotoAndStop("credits");
backButton = attractMode.backButton;
initButton(backButton);
backButton.onPress = gamingyourway.common.Delegate.create(this, backButtonPressed);
}
function displayHelpInit() {
attractMode.gotoAndStop("help");
backButton = attractMode.backButton;
initButton(backButton);
backButton.onPress = gamingyourway.common.Delegate.create(this, backButtonPressed);
instructionsClip = attractMode.instructionsClip;
instructionsClip.gotoAndStop(1);
nextButton = attractMode.nextButton;
initButton(nextButton);
nextButton.onPress = gamingyourway.common.Delegate.create(this, instructionsNextPressed);
prevButton = attractMode.prevButton;
initButton(prevButton);
prevButton.onPress = gamingyourway.common.Delegate.create(this, instructionsPrevPressed);
prevButton._visible = false;
}
function instructionsNextPressed() {
if (instructionsClip._currentframe != instructionsClip._totalframes) {
soundHandler.playSound(buttonClickSFX);
instructionsClip.direction = "Next";
instructionsClip.onEnterFrame = gamingyourway.common.Delegate.create(this, fadeDownInstructionsClip);
}
}
function instructionsPrevPressed() {
if (instructionsClip._currentframe != 1) {
soundHandler.playSound(buttonClickSFX);
instructionsClip.direction = "Prev";
instructionsClip.onEnterFrame = gamingyourway.common.Delegate.create(this, fadeDownInstructionsClip);
}
}
function fadeDownInstructionsClip() {
instructionsClip._alpha = instructionsClip._alpha - 25;
if (instructionsClip._alpha <= 0) {
if (instructionsClip.direction == "Next") {
instructionsClip.gotoAndStop(instructionsClip._currentframe + 1);
} else {
instructionsClip.gotoAndStop(instructionsClip._currentframe - 1);
}
instructionsClip.onEnterFrame = gamingyourway.common.Delegate.create(this, fadeUpInstructionsClip);
}
}
function fadeUpInstructionsClip() {
instructionsClip._alpha = instructionsClip._alpha + 25;
if (instructionsClip._alpha >= 100) {
instructionsClip._alpha = 100;
delete instructionsClip.onEnterFrame;
if (instructionsClip._currentframe == instructionsClip._totalframes) {
nextButton._visible = false;
} else {
nextButton._visible = true;
}
if (instructionsClip._currentframe == 1) {
prevButton._visible = false;
} else {
prevButton._visible = true;
}
}
}
function resetSoundButtonDisplay() {
defaultVolume = soundHandler.getMasterVolume();
if (defaultVolume == 0) {
soundButton.anim.gotoAndStop(2);
} else {
soundButton.anim.gotoAndStop(1);
}
}
function soundButtonPressed() {
defaultVolume = soundHandler.getMasterVolume();
if (defaultVolume == 0) {
defaultVolume = 100;
soundHandler.playSound(buttonClickSFX);
} else {
defaultVolume = 0;
}
soundHandler.setMasterVolume(defaultVolume);
main.getInitInstance().getGameController().getHUD().resetRootVolume();
soundHandler.setDefaultVolume(titleMod, defaultVolume);
soundHandler.setDefaultVolume(buttonClickSFX, defaultVolume);
if (defaultVolume != 0) {
if (titleMod._playing == false) {
soundHandler.loopSound(titleMod, 0);
soundHandler.fadeSoundIn(titleMod, 2, defaultVolume, 1);
}
}
resetSoundButtonDisplay();
}
function loadingScreenInit() {
attractMode.gotoAndStop("loadingScreen");
attractMode.loadingCopy.gotoAndStop(main.getInitInstance().getGameController().getLevel());
continueButton = attractMode.continueButton;
if (loadedFlag == true) {
loadedFlag = false;
loadingScreenContinueButtonInit();
} else {
continueButton._visible = false;
continueButton.onEnterFrame = gamingyourway.common.Delegate.create(this, waitingForAssetsToLoad);
}
}
function waitingForAssetsToLoad() {
if (loadedFlag == true) {
loadedFlag = false;
delete continueButton.onEnterFrame;
loadingScreenContinueButtonInit();
}
}
function loadingScreenContinueButtonInit() {
loadedFlag = false;
continueButton = attractMode.continueButton;
continueButton._visible = true;
initButton(continueButton);
continueButton.onPress = gamingyourway.common.Delegate.create(this, loadingScreenContinueButtonPressed);
keyScanDelay = 20;
continueButton.onEnterFrame = gamingyourway.common.Delegate.create(this, loadingScreenContinueButtonScanKeys);
}
function loadingScreenContinueButtonScanKeys() {
if (scanForKeys() == true) {
loadingScreenContinueButtonPressed();
}
}
function loadingScreenContinueButtonPressed() {
delete continueButton.onEnterFrame;
killButton(continueButton);
soundHandler.playSound(buttonClickSFX);
var _local2 = main.getInitInstance().getGameController().getLevel();
if (_local2 > 1) {
main.getInitInstance().getGameController().continueGame();
} else {
main.getInitInstance().getGameController().startGame();
}
}
function gameOver() {
continueButton = attractMode.continueButton;
attractMode.finalScore.text = main.getInitInstance().getGameController().getScore();
initButton(continueButton);
continueButton.onPress = gamingyourway.common.Delegate.create(this, gameOverContinueButtonPressed);
keyScanDelay = 20;
continueButton.onEnterFrame = gamingyourway.common.Delegate.create(this, gameOverContinueButtonScanKeys);
}
function gameOverContinueButtonScanKeys() {
if (scanForKeys() == true) {
gameOverContinueButtonPressed();
}
}
function gameOverContinueButtonPressed() {
killButton(continueButton);
soundHandler.stopSound(cryingSFX);
soundHandler.playSound(buttonClickSFX);
delete gameCompleteSFX._MovieClip.onEnterFrame;
transition.grabScreen();
transition.crossFadeInit();
hiscoreEntryInit();
}
function fireOffParticles() {
if ((++particleLaunchCount) == 10) {
particleLaunchCount = 0;
triggerParticles(8);
}
}
function triggerParticles(amount) {
var _local3 = attractMode.getNextHighestDepth();
var _local2;
var _local4 = -1;
while (_local4++ , _local4 != amount) {
_local2 = attractMode.attachMovie("particle2", "particle" + _local3, _local3++);
_local2.xposition = (_local2._x = 320);
_local2.yposition = (_local2._y = 198);
_local2.xvel = int((Math.random() * 10) - 5);
_local2.yvel = int((Math.random() * 10) - 25);
_local2.gravity = 0.7;
_local2.delay = 40;
_local2._alpha = 70;
_local2.onEnterFrame = function () {
this.yposition = this.yposition + this.yvel;
this.yvel = this.yvel + this.gravity;
this.xposition = this.xposition + this.xvel;
this._y = this.yposition;
this._x = this.xposition;
if ((--this.delay) <= 0) {
this._alpha = this._alpha - 5;
if (this._alpha <= 0) {
this.removeMovieClip();
}
}
};
}
}
function hiscoreEntryInit() {
attractMode.gotoAndStop("hsInput");
attractMode.onEnterFrame = gamingyourway.common.Delegate.create(this, oneFrameDelay);
}
function oneFrameDelay() {
delete attractMode.onEnterFrame;
setupHSComponent();
}
function setupHSComponent() {
var _local2 = main.getInitInstance().getGameController().getScore();
attractMode.movHiScores.setDetails(38, 0, "lovedup", false, _local2, _local2.toString(), "points");
attractMode.movHiScores.init();
initButton(continueButton);
continueButton.onPress = gamingyourway.common.Delegate.create(this, highScoreEntryContinueButtonPressed);
}
function highScoreEntryContinueButtonPressed() {
killButton(continueButton);
soundHandler.playSound(buttonClickSFX);
transition.grabScreen();
transition.crossFadeInit();
init();
}
function fadeDownAttract() {
attractMode._alpha = attractMode._alpha - 10;
if (attractMode._alpha <= 0) {
attractMode._visible = false;
attractMode.gotoAndStop(1);
attractMode._alpha = 100;
delete attractMode.onEnterFrame;
}
}
var loadedFlag = false;
var inkey = Key.isDown;
var playerName = "Your name";
var defaultVolume = 100;
}
Symbol 887 MovieClip [__Packages.LoveJuice.IO.HighScoreHandler] Frame 0
class LoveJuice.IO.HighScoreHandler
{
var main, mainMovie, eventHandler, xmlLoad;
function HighScoreHandler () {
main = Main.getInstance();
mainMovie = main.getMainMovie();
eventHandler = main.getInitInstance().getEventHandler();
xmlLoad = new XML();
}
function toString() {
return("HighScoreHandler");
}
function saveScore(name, score) {
var _local3 = new XML();
var _local2 = new LoadVars();
_local2.code = "gamingyourway";
_local2.source = dbName;
_local2.type = "add";
_local2.name = name;
_local2.score = score.toString();
_local2.game = "LandfillOfDoom";
_local2.top = "10";
_local2.sendAndLoad(URL, _local3, "post");
}
function loadScores() {
xmlLoad.onLoad = gamingyourway.common.Delegate.create(this, scoresLoaded);
var _local2 = new LoadVars();
_local2.code = "gamingyourway";
_local2.source = dbName;
_local2.type = "retrieve";
_local2.game = "LandfillOfDoom";
_local2.top = "10";
_local2.sendAndLoad(URL, xmlLoad, "post");
}
function getHiscoreTable() {
var _local2 = {names:nameArray, scores:scoreArray};
return(_local2);
}
function scoresLoaded(success) {
if (success == false) {
eventHandler.sendEvent("hsFailedToLoad");
return(undefined);
}
var _local6 = xmlLoad.toString();
if (_local6.indexOf("no s") != -1) {
eventHandler.sendEvent("hsLoaded");
}
var _local5 = new gamingyourway.common.XMLmakeObj();
_local5.ignoreWhite = true;
_local5.parseXML(_local6);
var _local3 = _local5.makeObj(_local5);
var _local2 = -1;
var _local4 = _local3.dataset.row.length;
if (_local4 == undefined) {
nameArray[0] = _local3.dataset.row.name;
scoreArray[0] = _local3.dataset.row.score;
eventHandler.sendEvent("hsLoaded");
return(undefined);
}
while (_local2++ , _local2 != _local4) {
nameArray[_local2] = _local3.dataset.row[_local2].name;
scoreArray[_local2] = _local3.dataset.row[_local2].score;
}
eventHandler.sendEvent("hsLoaded");
}
var URL = "http://highscores.toxicwastecandy.com/data.aspx";
var dbName = "gywSimpleHS";
var nameArray = new Array("Empty", "Empty", "Empty", "Empty", "Empty", "Empty", "Empty", "Empty", "Empty", "Empty");
var scoreArray = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
}
Symbol 888 MovieClip [__Packages.gamingyourway.common.XMLmakeObj] Frame 0
class gamingyourway.common.XMLmakeObj extends XML
{
function XMLmakeObj () {
super();
}
function makeObj(xObj) {
var _local2 = new Object();
var _local7;
for (_local7 in xObj.attributes) {
_local2[_local7] = xObj.attributes[_local7];
}
var _local5;
var _local3;
var _local6;
var _local8;
var _local9;
for (_local5 in xObj.childNodes) {
_local3 = xObj.childNodes[_local5].nodeName;
_local6 = xObj.childNodes[_local5].nodeType;
_local8 = xObj.childNodes[_local5].nodeValue;
if (_local6 == 3) {
_local2._value = _local8;
_local2["._type"] = "text";
}
if ((_local6 == 1) && (_local3 != null)) {
if (_local2[_local3] == null) {
_local2[_local3] = makeObj(xObj.childNodes[_local5]);
} else if (_local2[_local3]._type != "array") {
_local2[_local3] = [_local2[_local3]];
_local2[_local3]._type = "array";
}
if (_local2[_local3]._type == "array") {
_local2[_local3].unshift(makeObj(xObj.childNodes[_local5], {}));
}
}
}
return(_local2);
}
}
Symbol 616 MovieClip [__Packages.mx.core.UIObject] Frame 0
class mx.core.UIObject extends MovieClip
{
var _width, _height, _x, _y, _parent, _minHeight, _minWidth, _visible, dispatchEvent, _xscale, _yscale, methodTable, onEnterFrame, tfList, __width, __height, moveTo, lineTo, createTextField, attachMovie, buildDepthTable, findNextAvailableDepth, idNames, childrenCreated, _name, createAccessibilityImplementation, _endInit, validateNow, hasOwnProperty, initProperties, stylecache, className, ignoreClassStyleDeclaration, _tf, fontFamily, fontSize, color, marginLeft, marginRight, fontStyle, fontWeight, textAlign, textIndent, textDecoration, embedFonts, styleName, enabled;
function UIObject () {
super();
constructObject();
}
function get width() {
return(_width);
}
function get height() {
return(_height);
}
function get left() {
return(_x);
}
function get x() {
return(_x);
}
function get top() {
return(_y);
}
function get y() {
return(_y);
}
function get right() {
return(_parent.width - (_x + width));
}
function get bottom() {
return(_parent.height - (_y + height));
}
function getMinHeight(Void) {
return(_minHeight);
}
function setMinHeight(h) {
_minHeight = h;
}
function get minHeight() {
return(getMinHeight());
}
function set minHeight(h) {
setMinHeight(h);
//return(minHeight);
}
function getMinWidth(Void) {
return(_minWidth);
}
function setMinWidth(w) {
_minWidth = w;
}
function get minWidth() {
return(getMinWidth());
}
function set minWidth(w) {
setMinWidth(w);
//return(minWidth);
}
function setVisible(x, noEvent) {
if (x != _visible) {
_visible = x;
if (noEvent != true) {
dispatchEvent({type:(x ? "reveal" : "hide")});
}
}
}
function get visible() {
return(_visible);
}
function set visible(x) {
setVisible(x, false);
//return(visible);
}
function get scaleX() {
return(_xscale);
}
function set scaleX(x) {
_xscale = x;
//return(scaleX);
}
function get scaleY() {
return(_yscale);
}
function set scaleY(y) {
_yscale = y;
//return(scaleY);
}
function doLater(obj, fn) {
if (methodTable == undefined) {
methodTable = new Array();
}
methodTable.push({obj:obj, fn:fn});
onEnterFrame = doLaterDispatcher;
}
function doLaterDispatcher(Void) {
delete onEnterFrame;
if (invalidateFlag) {
redraw();
}
var _local3 = methodTable;
methodTable = new Array();
if (_local3.length > 0) {
var _local2;
while (_local2 = _local3.shift() , _local2 != undefined) {
_local2.obj[_local2.fn]();
}
}
}
function cancelAllDoLaters(Void) {
delete onEnterFrame;
methodTable = new Array();
}
function invalidate(Void) {
invalidateFlag = true;
onEnterFrame = doLaterDispatcher;
}
function invalidateStyle(Void) {
invalidate();
}
function redraw(bAlways) {
if (invalidateFlag || (bAlways)) {
invalidateFlag = false;
var _local2;
for (_local2 in tfList) {
tfList[_local2].draw();
}
draw();
dispatchEvent({type:"draw"});
}
}
function draw(Void) {
}
function move(x, y, noEvent) {
var _local3 = _x;
var _local2 = _y;
_x = x;
_y = y;
if (noEvent != true) {
dispatchEvent({type:"move", oldX:_local3, oldY:_local2});
}
}
function setSize(w, h, noEvent) {
var _local3 = __width;
var _local2 = __height;
__width = w;
__height = h;
size();
if (noEvent != true) {
dispatchEvent({type:"resize", oldWidth:_local3, oldHeight:_local2});
}
}
function size(Void) {
_width = __width;
_height = __height;
}
function drawRect(x1, y1, x2, y2) {
moveTo(x1, y1);
lineTo(x2, y1);
lineTo(x2, y2);
lineTo(x1, y2);
lineTo(x1, y1);
}
function createLabel(name, depth, text) {
createTextField(name, depth, 0, 0, 0, 0);
var _local2 = this[name];
_local2._color = textColorList;
_local2._visible = false;
_local2.__text = text;
if (tfList == undefined) {
tfList = new Object();
}
tfList[name] = _local2;
_local2.invalidateStyle();
invalidate();
_local2.styleName = this;
return(_local2);
}
function createObject(linkageName, id, depth, initobj) {
return(attachMovie(linkageName, id, depth, initobj));
}
function createClassObject(className, id, depth, initobj) {
var _local3 = className.symbolName == undefined;
if (_local3) {
Object.registerClass(className.symbolOwner.symbolName, className);
}
var _local4 = mx.core.UIObject(createObject(className.symbolOwner.symbolName, id, depth, initobj));
if (_local3) {
Object.registerClass(className.symbolOwner.symbolName, className.symbolOwner);
}
return(_local4);
}
function createEmptyObject(id, depth) {
return(createClassObject(mx.core.UIObject, id, depth));
}
function destroyObject(id) {
var _local2 = this[id];
if (_local2.getDepth() < 0) {
var _local4 = buildDepthTable();
var _local5 = findNextAvailableDepth(0, _local4, "up");
var _local3 = _local5;
_local2.swapDepths(_local3);
}
_local2.removeMovieClip();
delete this[id];
}
function getSkinIDName(tag) {
return(idNames[tag]);
}
function setSkin(tag, linkageName, initObj) {
if (_global.skinRegistry[linkageName] == undefined) {
mx.skins.SkinElement.registerElement(linkageName, mx.skins.SkinElement);
}
return(createObject(linkageName, getSkinIDName(tag), tag, initObj));
}
function createSkin(tag) {
var _local2 = getSkinIDName(tag);
createEmptyObject(_local2, tag);
return(this[_local2]);
}
function createChildren(Void) {
}
function _createChildren(Void) {
createChildren();
childrenCreated = true;
}
function constructObject(Void) {
if (_name == undefined) {
return(undefined);
}
init();
_createChildren();
createAccessibilityImplementation();
_endInit();
if (validateNow) {
redraw(true);
} else {
invalidate();
}
}
function initFromClipParameters(Void) {
var _local4 = false;
var _local2;
for (_local2 in clipParameters) {
if (hasOwnProperty(_local2)) {
_local4 = true;
this["def_" + _local2] = this[_local2];
delete this[_local2];
}
}
if (_local4) {
for (_local2 in clipParameters) {
var _local3 = this["def_" + _local2];
if (_local3 != undefined) {
this[_local2] = _local3;
}
}
}
}
function init(Void) {
__width = _width;
__height = _height;
if (initProperties == undefined) {
initFromClipParameters();
} else {
initProperties();
}
if (_global.cascadingStyles == true) {
stylecache = new Object();
}
}
function getClassStyleDeclaration(Void) {
var _local4 = this;
var _local3 = className;
while (_local3 != undefined) {
if (ignoreClassStyleDeclaration[_local3] == undefined) {
if (_global.styles[_local3] != undefined) {
return(_global.styles[_local3]);
}
}
_local4 = _local4.__proto__;
_local3 = _local4.className;
}
}
function setColor(color) {
}
function __getTextFormat(tf, bAll) {
var _local8 = stylecache.tf;
if (_local8 != undefined) {
var _local3;
for (_local3 in mx.styles.StyleManager.TextFormatStyleProps) {
if (bAll || (mx.styles.StyleManager.TextFormatStyleProps[_local3])) {
if (tf[_local3] == undefined) {
tf[_local3] = _local8[_local3];
}
}
}
return(false);
}
var _local6 = false;
for (var _local3 in mx.styles.StyleManager.TextFormatStyleProps) {
if (bAll || (mx.styles.StyleManager.TextFormatStyleProps[_local3])) {
if (tf[_local3] == undefined) {
var _local5 = _tf[_local3];
if (_local5 != undefined) {
tf[_local3] = _local5;
} else if ((_local3 == "font") && (fontFamily != undefined)) {
tf[_local3] = fontFamily;
} else if ((_local3 == "size") && (fontSize != undefined)) {
tf[_local3] = fontSize;
} else if ((_local3 == "color") && (color != undefined)) {
tf[_local3] = color;
} else if ((_local3 == "leftMargin") && (marginLeft != undefined)) {
tf[_local3] = marginLeft;
} else if ((_local3 == "rightMargin") && (marginRight != undefined)) {
tf[_local3] = marginRight;
} else if ((_local3 == "italic") && (fontStyle != undefined)) {
tf[_local3] = fontStyle == _local3;
} else if ((_local3 == "bold") && (fontWeight != undefined)) {
tf[_local3] = fontWeight == _local3;
} else if ((_local3 == "align") && (textAlign != undefined)) {
tf[_local3] = textAlign;
} else if ((_local3 == "indent") && (textIndent != undefined)) {
tf[_local3] = textIndent;
} else if ((_local3 == "underline") && (textDecoration != undefined)) {
tf[_local3] = textDecoration == _local3;
} else if ((_local3 == "embedFonts") && (embedFonts != undefined)) {
tf[_local3] = embedFonts;
} else {
_local6 = true;
}
}
}
}
if (_local6) {
var _local9 = styleName;
if (_local9 != undefined) {
if (typeof(_local9) != "string") {
_local6 = _local9.__getTextFormat(tf, true, this);
} else if (_global.styles[_local9] != undefined) {
_local6 = _global.styles[_local9].__getTextFormat(tf, true, this);
}
}
}
if (_local6) {
var _local10 = getClassStyleDeclaration();
if (_local10 != undefined) {
_local6 = _local10.__getTextFormat(tf, true, this);
}
}
if (_local6) {
if (_global.cascadingStyles) {
if (_parent != undefined) {
_local6 = _parent.__getTextFormat(tf, false);
}
}
}
if (_local6) {
_local6 = _global.style.__getTextFormat(tf, true, this);
}
return(_local6);
}
function _getTextFormat(Void) {
var _local2 = stylecache.tf;
if (_local2 != undefined) {
return(_local2);
}
_local2 = new TextFormat();
__getTextFormat(_local2, true);
stylecache.tf = _local2;
if (enabled == false) {
var _local3 = getStyle("disabledColor");
_local2.color = _local3;
}
return(_local2);
}
function getStyleName(Void) {
var _local2 = styleName;
if (_local2 != undefined) {
if (typeof(_local2) != "string") {
return(_local2.getStyleName());
}
return(_local2);
}
if (_parent != undefined) {
return(_parent.getStyleName());
}
return(undefined);
}
function getStyle(styleProp) {
var _local3;
_global.getStyleCounter++;
if (this[styleProp] != undefined) {
return(this[styleProp]);
}
var _local6 = styleName;
if (_local6 != undefined) {
if (typeof(_local6) != "string") {
_local3 = _local6.getStyle(styleProp);
} else {
var _local7 = _global.styles[_local6];
_local3 = _local7.getStyle(styleProp);
}
}
if (_local3 != undefined) {
return(_local3);
}
var _local7 = getClassStyleDeclaration();
if (_local7 != undefined) {
_local3 = _local7[styleProp];
}
if (_local3 != undefined) {
return(_local3);
}
if (_global.cascadingStyles) {
if (mx.styles.StyleManager.isInheritingStyle(styleProp) || (mx.styles.StyleManager.isColorStyle(styleProp))) {
var _local5 = stylecache;
if (_local5 != undefined) {
if (_local5[styleProp] != undefined) {
return(_local5[styleProp]);
}
}
if (_parent != undefined) {
_local3 = _parent.getStyle(styleProp);
} else {
_local3 = _global.style[styleProp];
}
if (_local5 != undefined) {
_local5[styleProp] = _local3;
}
return(_local3);
}
}
if (_local3 == undefined) {
_local3 = _global.style[styleProp];
}
return(_local3);
}
static function mergeClipParameters(o, p) {
for (var _local3 in p) {
o[_local3] = p[_local3];
}
return(true);
}
static var symbolName = "UIObject";
static var symbolOwner = mx.core.UIObject;
static var version = "2.0.2.127";
static var textColorList = {color:1, disabledColor:1};
var invalidateFlag = false;
var lineWidth = 1;
var lineColor = 0;
var tabEnabled = false;
var clipParameters = {visible:1, minHeight:1, minWidth:1, maxHeight:1, maxWidth:1, preferredHeight:1, preferredWidth:1};
}
Symbol 617 MovieClip [__Packages.mx.core.UIComponent] Frame 0
class mx.core.UIComponent extends mx.core.UIObject
{
var __width, __height, invalidate, stylecache, removeEventListener, dispatchEvent, drawFocus, addEventListener, _xscale, _yscale, _focusrect, watch, enabled;
function UIComponent () {
super();
}
function get width() {
return(__width);
}
function get height() {
return(__height);
}
function setVisible(x, noEvent) {
super.setVisible(x, noEvent);
}
function enabledChanged(id, oldValue, newValue) {
setEnabled(newValue);
invalidate();
delete stylecache.tf;
return(newValue);
}
function setEnabled(enabled) {
invalidate();
}
function getFocus() {
var selFocus = Selection.getFocus();
return(((selFocus === null) ? null : (eval (selFocus))));
}
function setFocus() {
Selection.setFocus(this);
}
function getFocusManager() {
var _local2 = this;
while (_local2 != undefined) {
if (_local2.focusManager != undefined) {
return(_local2.focusManager);
}
_local2 = _local2._parent;
}
return(undefined);
}
function onKillFocus(newFocus) {
removeEventListener("keyDown", this);
removeEventListener("keyUp", this);
dispatchEvent({type:"focusOut"});
drawFocus(false);
}
function onSetFocus(oldFocus) {
addEventListener("keyDown", this);
addEventListener("keyUp", this);
dispatchEvent({type:"focusIn"});
if (getFocusManager().bDrawFocus != false) {
drawFocus(true);
}
}
function findFocusInChildren(o) {
if (o.focusTextField != undefined) {
return(o.focusTextField);
}
if (o.tabEnabled == true) {
return(o);
}
return(undefined);
}
function findFocusFromObject(o) {
if (o.tabEnabled != true) {
if (o._parent == undefined) {
return(undefined);
}
if (o._parent.tabEnabled == true) {
o = o._parent;
} else if (o._parent.tabChildren) {
o = findFocusInChildren(o._parent);
} else {
o = findFocusFromObject(o._parent);
}
}
return(o);
}
function pressFocus() {
var _local3 = findFocusFromObject(this);
var _local2 = getFocus();
if (_local3 != _local2) {
_local2.drawFocus(false);
if (getFocusManager().bDrawFocus != false) {
_local3.drawFocus(true);
}
}
}
function releaseFocus() {
var _local2 = findFocusFromObject(this);
if (_local2 != getFocus()) {
_local2.setFocus();
}
}
function isParent(o) {
while (o != undefined) {
if (o == this) {
return(true);
}
o = o._parent;
}
return(false);
}
function size() {
}
function init() {
super.init();
_xscale = 100;
_yscale = 100;
_focusrect = _global.useFocusRect == false;
watch("enabled", enabledChanged);
if (enabled == false) {
setEnabled(false);
}
}
function dispatchValueChangedEvent(value) {
dispatchEvent({type:"valueChanged", value:value});
}
static var symbolName = "UIComponent";
static var symbolOwner = mx.core.UIComponent;
static var version = "2.0.2.127";
static var kStretch = 5000;
var focusEnabled = true;
var tabEnabled = true;
var origBorderStyles = {themeColor:16711680};
var clipParameters = {};
static var mergedClipParameters = mx.core.UIObject.mergeClipParameters(mx.core.UIComponent.prototype.clipParameters, mx.core.UIObject.prototype.clipParameters);
}
Symbol 618 MovieClip [__Packages.Splash] Frame 0
class Splash extends mx.core.UIComponent
{
var useHandCursor, boundingBox_mc, invalidate;
function Splash () {
super();
}
function init() {
super.init();
useHandCursor = false;
boundingBox_mc._visible = false;
}
function createChildren() {
size();
}
function size() {
super.size();
invalidate();
}
function draw() {
super.draw();
if (_global.isLivePreview) {
boundingBox_mc._visible = true;
} else {
boundingBox_mc._visible = false;
}
}
function getFrameAfterCompletion() {
return(frameAfterCompletion);
}
function setFrameAfterCompletion(frameAfterCompletion) {
this.frameAfterCompletion = frameAfterCompletion;
}
static var symbolName = "Splash";
static var symbolOwner = Splash;
var className = "Splash";
var frameAfterCompletion = 0;
}
Symbol 640 MovieClip [__Packages.mx.skins.SkinElement] Frame 0
class mx.skins.SkinElement extends MovieClip
{
var _visible, _x, _y, _width, _height;
function SkinElement () {
super();
}
static function registerElement(name, className) {
Object.registerClass(name, ((className == undefined) ? (mx.skins.SkinElement) : (className)));
_global.skinRegistry[name] = true;
}
function __set__visible(visible) {
_visible = visible;
}
function move(x, y) {
_x = x;
_y = y;
}
function setSize(w, h) {
_width = w;
_height = h;
}
}
Symbol 641 MovieClip [__Packages.mx.styles.CSSTextStyles] Frame 0
class mx.styles.CSSTextStyles
{
function CSSTextStyles () {
}
static function addTextStyles(o, bColor) {
o.addProperty("textAlign", function () {
return(this._tf.align);
}, function (x) {
if (this._tf == undefined) {
this._tf = new TextFormat();
}
this._tf.align = x;
});
o.addProperty("fontWeight", function () {
return(((this._tf.bold != undefined) ? ((this._tf.bold ? "bold" : "none")) : undefined));
}, function (x) {
if (this._tf == undefined) {
this._tf = new TextFormat();
}
this._tf.bold = x == "bold";
});
if (bColor) {
o.addProperty("color", function () {
return(this._tf.color);
}, function (x) {
if (this._tf == undefined) {
this._tf = new TextFormat();
}
this._tf.color = x;
});
}
o.addProperty("fontFamily", function () {
return(this._tf.font);
}, function (x) {
if (this._tf == undefined) {
this._tf = new TextFormat();
}
this._tf.font = x;
});
o.addProperty("textIndent", function () {
return(this._tf.indent);
}, function (x) {
if (this._tf == undefined) {
this._tf = new TextFormat();
}
this._tf.indent = x;
});
o.addProperty("fontStyle", function () {
return(((this._tf.italic != undefined) ? ((this._tf.italic ? "italic" : "none")) : undefined));
}, function (x) {
if (this._tf == undefined) {
this._tf = new TextFormat();
}
this._tf.italic = x == "italic";
});
o.addProperty("marginLeft", function () {
return(this._tf.leftMargin);
}, function (x) {
if (this._tf == undefined) {
this._tf = new TextFormat();
}
this._tf.leftMargin = x;
});
o.addProperty("marginRight", function () {
return(this._tf.rightMargin);
}, function (x) {
if (this._tf == undefined) {
this._tf = new TextFormat();
}
this._tf.rightMargin = x;
});
o.addProperty("fontSize", function () {
return(this._tf.size);
}, function (x) {
if (this._tf == undefined) {
this._tf = new TextFormat();
}
this._tf.size = x;
});
o.addProperty("textDecoration", function () {
return(((this._tf.underline != undefined) ? ((this._tf.underline ? "underline" : "none")) : undefined));
}, function (x) {
if (this._tf == undefined) {
this._tf = new TextFormat();
}
this._tf.underline = x == "underline";
});
o.addProperty("embedFonts", function () {
return(this._tf.embedFonts);
}, function (x) {
if (this._tf == undefined) {
this._tf = new TextFormat();
}
this._tf.embedFonts = x;
});
}
}
Symbol 642 MovieClip [__Packages.mx.styles.StyleManager] Frame 0
class mx.styles.StyleManager
{
function StyleManager () {
}
static function registerInheritingStyle(styleName) {
inheritingStyles[styleName] = true;
}
static function isInheritingStyle(styleName) {
return(inheritingStyles[styleName] == true);
}
static function registerColorStyle(styleName) {
colorStyles[styleName] = true;
}
static function isColorStyle(styleName) {
return(colorStyles[styleName] == true);
}
static function registerColorName(colorName, colorValue) {
colorNames[colorName] = colorValue;
}
static function isColorName(colorName) {
return(colorNames[colorName] != undefined);
}
static function getColorName(colorName) {
return(colorNames[colorName]);
}
static var inheritingStyles = {color:true, direction:true, fontFamily:true, fontSize:true, fontStyle:true, fontWeight:true, textAlign:true, textIndent:true};
static var colorStyles = {barColor:true, trackColor:true, borderColor:true, buttonColor:true, color:true, dateHeaderColor:true, dateRollOverColor:true, disabledColor:true, fillColor:true, highlightColor:true, scrollTrackColor:true, selectedDateColor:true, shadowColor:true, strokeColor:true, symbolBackgroundColor:true, symbolBackgroundDisabledColor:true, symbolBackgroundPressedColor:true, symbolColor:true, symbolDisabledColor:true, themeColor:true, todayIndicatorColor:true, shadowCapColor:true, borderCapColor:true, focusColor:true};
static var colorNames = {black:0, white:16777215, red:16711680, green:65280, blue:255, magenta:16711935, yellow:16776960, cyan:65535, haloGreen:8453965, haloBlue:2881013, haloOrange:16761344};
static var TextFormatStyleProps = {font:true, size:true, color:true, leftMargin:false, rightMargin:false, italic:true, bold:true, align:true, indent:true, underline:false, embedFonts:false};
static var TextStyleMap = {textAlign:true, fontWeight:true, color:true, fontFamily:true, textIndent:true, fontStyle:true, lineHeight:true, marginLeft:true, marginRight:true, fontSize:true, textDecoration:true, embedFonts:true};
}
Symbol 643 MovieClip [__Packages.mx.styles.CSSStyleDeclaration] Frame 0
class mx.styles.CSSStyleDeclaration
{
var _tf;
function CSSStyleDeclaration () {
}
function __getTextFormat(tf, bAll) {
var _local5 = false;
if (_tf != undefined) {
var _local2;
for (_local2 in mx.styles.StyleManager.TextFormatStyleProps) {
if (bAll || (mx.styles.StyleManager.TextFormatStyleProps[_local2])) {
if (tf[_local2] == undefined) {
var _local3 = _tf[_local2];
if (_local3 != undefined) {
tf[_local2] = _local3;
} else {
_local5 = true;
}
}
}
}
} else {
_local5 = true;
}
return(_local5);
}
function getStyle(styleProp) {
var _local2 = this[styleProp];
var _local3 = mx.styles.StyleManager.getColorName(_local2);
return(((_local3 == undefined) ? (_local2) : (_local3)));
}
static function classConstruct() {
mx.styles.CSSTextStyles.addTextStyles(mx.styles.CSSStyleDeclaration.prototype, true);
return(true);
}
static var classConstructed = classConstruct();
static var CSSTextStylesDependency = mx.styles.CSSTextStyles;
}
Symbol 776 MovieClip [__Packages.HiScores] Frame 0
class HiScores extends mx.core.UIComponent
{
var _visible, gameId, levelId, gameCode, lowIsBest, score, invalidate, getURL;
function HiScores () {
super();
_visible = false;
}
function setDetails(gameId, levelId, gameCode, lowIsBest, score, msg1, msg2) {
this.gameId = gameId;
this.levelId = levelId;
this.gameCode = gameCode;
this.lowIsBest = lowIsBest;
this.score = score;
movEntryScreen = movEntryScreen;
movInfoScreen = movInfoScreen;
movEntryScreen.txtMsg1.text = msg1;
movEntryScreen.txtMsg2.text = msg2;
movEntryScreen.txtName.text = "";
movEntryScreen.txtCode.text = "";
movEntryScreen._visible = true;
movInfoScreen._visible = false;
secCodeLoad();
_visible = true;
}
function createChildren() {
size();
}
function size() {
super.size();
invalidate();
}
function secCodeLoad() {
var _local2 = new MovieClipLoader();
_local2.loadClip((HS_SERVLET_URL + "?type=genCode&cachebuster=") + new Date().getTime(), movEntryScreen.movCode);
}
function back() {
movEntryScreen._visible = true;
movInfoScreen._visible = false;
}
function viewScore() {
getURL((((((((HI_SCORE_URL + gameCode) + "_hs") + "&name=") + movEntryScreen.txtName.text) + "&levelId=") + levelId) + "&cachebuster=") + new Date().getTime(), "_blank");
}
function showInfoMessage(msg, error) {
movInfoScreen.txtInfo.text = msg;
movInfoScreen.btnBack._visible = error;
movInfoScreen.btnView._visible = !error;
}
function submitScore() {
movEntryScreen._visible = false;
movInfoScreen._visible = true;
var _local8 = true;
if (movEntryScreen.txtName.text.length == 0) {
showInfoMessage("Please enter your name.", true);
} else if (movEntryScreen.txtCode.text.length != 5) {
showInfoMessage("Please enter all 5 letters of the security code.", true);
} else {
showInfoMessage("Submitting hi-score details to the server, please wait.", true);
movInfoScreen.btnBack._visible = false;
_local8 = false;
}
if (!_local8) {
var _local9 = movEntryScreen.txtName.text;
var _local4 = (((((((("save|" + _local9) + "|") + movEntryScreen.txtCode.text) + "|") + score) + "|") + gameId) + "|") + levelId;
var _local5 = "";
var _local3 = 0;
var _local2 = 0;
while (_local3 < _local4.length) {
if (_local2 >= KEY.length) {
_local2 = 0;
}
_local5 = _local5 + String.fromCharCode((_local4.charCodeAt(_local3) ^ KEY.charCodeAt(_local2)) + 1);
_local3++;
_local2++;
}
var self = this;
var _local6 = new LoadVars();
_local6.ffdata = _local5;
_local6.lowIsBest = lowIsBest;
_local6.sendAndLoad(HS_SERVLET_URL, _local6, "POST");
_local6.onLoad = function (success) {
var _local2 = parseInt(this.res);
if (!success) {
self.showInfoMessage("A serious problem was encountered with the server, please try again in a few minutes.", true);
} else if (_local2 == -1) {
self.showInfoMessage("Could not store hi-score details. Click on back, generate a new security code and re-submit.", true);
} else if (_local2 == 0) {
self.showInfoMessage("Sorry, a better score already exists with that name.", false);
} else if (_local2 == 1) {
self.showInfoMessage("Congratulations! You made it into the\nhi-score table.", false);
}
};
}
}
static var symbolName = "HiScores";
static var symbolOwner = HiScores;
var className = "HiScores";
static var SERVER_URL = "http://www.gimme5games.com";
static var SERVLET_URL = SERVER_URL + "/servlet/otwServlet";
static var HS_SERVLET_URL = SERVER_URL + "/servlet/hiServlet";
static var HI_SCORE_URL = SERVER_URL + "/index.jsp?id=";
var KEY = "rocket";
var movEntryScreen = null;
var movInfoScreen = null;
}
Symbol 21 MovieClip [twentyPointsAnim] Frame 38
this.removeMovieClip();
Symbol 24 MovieClip [tenPointsAnim] Frame 38
this.removeMovieClip();
Symbol 29 MovieClip [object_invisibleTile] Frame 1
stop();
Symbol 29 MovieClip [object_invisibleTile] Frame 14
stop();
Symbol 70 MovieClip Frame 41
_visible = false;
stop();
Symbol 73 MovieClip Frame 9
stop();
Symbol 78 MovieClip [baddie_dog] Frame 1
stop();
Instance of Symbol 30 MovieClip "hitAreaMC" in Symbol 78 MovieClip [baddie_dog] Frame 1
onClipEvent (load) {
_visible = false;
}
Symbol 78 MovieClip [baddie_dog] Frame 7
stop();
Symbol 127 MovieClip [baddie_unicorn] Frame 1
stop();
Instance of Symbol 30 MovieClip "hitAreaMC" in Symbol 127 MovieClip [baddie_unicorn] Frame 1
onClipEvent (load) {
_visible = false;
}
Symbol 127 MovieClip [baddie_unicorn] Frame 2
stop();
Instance of Symbol 30 MovieClip "hitAreaMC" in Symbol 127 MovieClip [baddie_unicorn] Frame 5
onClipEvent (load) {
_visible = false;
}
Symbol 127 MovieClip [baddie_unicorn] Frame 7
stop();
Symbol 194 MovieClip [baddie_fox] Frame 1
stop();
Instance of Symbol 30 MovieClip "hitAreaMC" in Symbol 194 MovieClip [baddie_fox] Frame 1
onClipEvent (load) {
_visible = false;
}
Symbol 194 MovieClip [baddie_fox] Frame 2
stop();
Instance of Symbol 30 MovieClip "hitAreaMC" in Symbol 194 MovieClip [baddie_fox] Frame 5
onClipEvent (load) {
_visible = false;
}
Symbol 194 MovieClip [baddie_fox] Frame 7
stop();
Symbol 223 MovieClip [heartWaspStone] Frame 1
stop();
Symbol 223 MovieClip [heartWaspStone] Frame 15
stop();
Symbol 263 MovieClip [baddie_heartWasp] Frame 1
stop();
Instance of Symbol 30 MovieClip "hitAreaMC" in Symbol 263 MovieClip [baddie_heartWasp] Frame 1
onClipEvent (load) {
_visible = false;
}
Symbol 263 MovieClip [baddie_heartWasp] Frame 2
stop();
Symbol 263 MovieClip [baddie_heartWasp] Frame 7
stop();
Symbol 266 MovieClip [loveBirdStone] Frame 1
stop();
Symbol 266 MovieClip [loveBirdStone] Frame 15
stop();
Symbol 298 MovieClip [baddie_loveBird] Frame 1
stop();
Instance of Symbol 30 MovieClip "hitAreaMC" in Symbol 298 MovieClip [baddie_loveBird] Frame 1
onClipEvent (load) {
_visible = false;
}
Symbol 298 MovieClip [baddie_loveBird] Frame 2
stop();
Symbol 298 MovieClip [baddie_loveBird] Frame 7
stop();
Symbol 301 MovieClip [rabbitLazerLeft] Frame 5
stop();
Symbol 302 MovieClip [rabbitLazerRight] Frame 5
stop();
Symbol 338 MovieClip [baddie_rabbit] Frame 1
stop();
Instance of Symbol 30 MovieClip "hitAreaMC" in Symbol 338 MovieClip [baddie_rabbit] Frame 1
onClipEvent (load) {
_visible = false;
}
Symbol 338 MovieClip [baddie_rabbit] Frame 2
stop();
Symbol 338 MovieClip [baddie_rabbit] Frame 7
stop();
Symbol 383 MovieClip [baddie_panda] Frame 1
stop();
Instance of Symbol 30 MovieClip "hitAreaMC" in Symbol 383 MovieClip [baddie_panda] Frame 1
onClipEvent (load) {
_visible = false;
}
Symbol 383 MovieClip [baddie_panda] Frame 2
stop();
Symbol 383 MovieClip [baddie_panda] Frame 7
stop();
Symbol 392 MovieClip [bullet] Frame 1
stop();
Instance of Symbol 30 MovieClip "hitAreaMC" in Symbol 392 MovieClip [bullet] Frame 1
onClipEvent (load) {
_visible = false;
}
Instance of Symbol 30 MovieClip "hitAreaMC" in Symbol 393 MovieClip [object_goal] Frame 1
onClipEvent (load) {
_visible = false;
}
Symbol 411 MovieClip Frame 14
stop();
Symbol 413 MovieClip [object_candy] Frame 1
stop();
Instance of Symbol 30 MovieClip "hitAreaMC" in Symbol 413 MovieClip [object_candy] Frame 1
onClipEvent (load) {
_visible = false;
}
Symbol 423 MovieClip [object_tree] Frame 1
stop();
Symbol 426 MovieClip [object_switch] Frame 1
stop();
Instance of Symbol 30 MovieClip "hitAreaMC" in Symbol 426 MovieClip [object_switch] Frame 1
onClipEvent (load) {
_visible = false;
}
Symbol 429 MovieClip [wipeCircle] Frame 20
stop();
Symbol 433 MovieClip [smoke] Frame 5
stop();
this.removeMovieClip();
Symbol 529 MovieClip Frame 35
stop();
Symbol 573 MovieClip [player] Frame 1
stop();
Instance of Symbol 30 MovieClip "hitAreaMC" in Symbol 573 MovieClip [player] Frame 1
onClipEvent (load) {
_visible = false;
}
Symbol 582 MovieClip [coin1] Frame 1
stop();
Instance of Symbol 30 MovieClip "hitAreaMC" in Symbol 582 MovieClip [coin1] Frame 1
onClipEvent (load) {
_visible = false;
}
Symbol 628 Button
on (release) {
getURL ("http://www.gimme5games.com", "_blank");
}
Symbol 639 MovieClip [Splash] Frame 1
#initclip 48
Object.registerClass("Splash", Splash);
#endinitclip
Symbol 639 MovieClip [Splash] Frame 91
_root.gotoAndStop(this.getFrameAfterCompletion());
Symbol 671 MovieClip Frame 1
stop();
Symbol 674 MovieClip Frame 1
stop();
Symbol 677 MovieClip Frame 1
stop();
Symbol 678 MovieClip Frame 1
stop();
Symbol 681 MovieClip Frame 1
stop();
Symbol 684 MovieClip Frame 1
stop();
Symbol 687 MovieClip Frame 1
stop();
Symbol 699 MovieClip Frame 1
stop();
Symbol 702 MovieClip Frame 1
stop();
Symbol 762 MovieClip Frame 1
stop();
Symbol 765 MovieClip Frame 1
stop();
Symbol 768 MovieClip Frame 1
stop();
Symbol 771 MovieClip Frame 1
stop();
Symbol 794 Button
on (release) {
_parent.submitScore();
}
Symbol 796 Button
on (release) {
_parent.secCodeLoad();
}
Symbol 803 Button
on (release) {
_parent.back();
}
Symbol 806 Button
on (release) {
_parent.viewScore();
}
Symbol 810 MovieClip [HiScores] Frame 1
#initclip 49
Object.registerClass("HiScores", HiScores);
#endinitclip
Symbol 812 MovieClip Frame 1
stop();
Symbol 812 MovieClip Frame 2
stop();
Instance of Symbol 668 MovieClip in Symbol 812 MovieClip Frame 2
onClipEvent (load) {
this.onPress = function () {
getURL ("http://www.gimme5games.com", "_blank");
};
}
Instance of Symbol 650 MovieClip in Symbol 812 MovieClip Frame 2
onClipEvent (load) {
this.gotoAndPlay(80);
}
Instance of Symbol 650 MovieClip in Symbol 812 MovieClip Frame 2
onClipEvent (load) {
this.gotoAndPlay(80);
}
Symbol 812 MovieClip Frame 5
stop();
Symbol 812 MovieClip Frame 18
stop();
Symbol 812 MovieClip Frame 29
stop();
Instance of Symbol 650 MovieClip in Symbol 812 MovieClip Frame 50
onClipEvent (load) {
this.gotoAndPlay(80);
}
Instance of Symbol 650 MovieClip in Symbol 812 MovieClip Frame 50
onClipEvent (load) {
this.gotoAndPlay(80);
}
Instance of Symbol 810 MovieClip [HiScores] "movHiScores" in Symbol 812 MovieClip Frame 57
//component parameters
onClipEvent (construct) {
enabled = true;
visible = true;
minHeight = 0;
minWidth = 0;
}
Symbol 815 MovieClip Frame 1
stop();
Symbol 826 MovieClip Frame 31
stop();
Symbol 826 MovieClip Frame 50
stop();
Instance of Symbol 815 MovieClip "levelNameInfo" in Symbol 827 MovieClip Frame 1
onClipEvent (load) {
_visible = false;
this.gotoAndStop(1);
}
Instance of Symbol 826 MovieClip "goalText" in Symbol 827 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndStop(1);
_visible = false;
}
Symbol 846 MovieClip Frame 1
stop();
Symbol 849 MovieClip Frame 1
stop();