Frame 1
function init(module) {
this.module = module;
}
_global.hopeBSMrootPath = this;
var splashTime = 0;
var doPerformanceTest = false;
var doXMLload = false;
var bytesToLoad = getBytesTotal();
nextFrame();
Frame 2
var st = (getTimer() + splashTime);
play();
Frame 3
play();
Frame 4
if ((_framesloaded > 10) && (getTimer() > st)) {
delete st;
play();
} else {
prevFrame();
}
Frame 9
function loadDisplay(ratioLoaded) {
loader_mc.clock.mc_anim.gotoAndStop(Math.ceil(68 * ratioLoaded));
}
function lm(startBytes, totalBytes) {
updateAfterEvent();
var _local1 = (getBytesLoaded() - startBytes) / totalBytes;
if (_local1 < 1) {
loadDisplay(_local1);
} else if (loader_mc.clock.mc_anim._currentFrame != loader_mc.clock.mc_anim._totalFrames) {
loadDisplay(1);
} else {
clearInterval(loadID);
delete loadID;
delete lm;
gotoAndStop((doPerformanceTest ? "performance" : "complete"));
}
}
if ((!doPerformanceTest) && (getBytesLoaded() >= bytesToLoad)) {
loadDisplay(1);
gotoAndStop ("complete");
} else {
var loadID = setInterval(lm, 0, getBytesLoaded(), bytesToLoad - getBytesLoaded());
loadDisplay(0.001);
stop();
}
Frame 19
_global.performance = new smashing.performanceTest(null, function () {
gotoAndStop ("complete");
});
stop();
Frame 24
gotoAndStop ("gameInit");
stop();
Frame 29
hopeBSMEngine = new HopeBSM_engine();
hopeBSMEngine.init(this, placeholder_mc);
hopeBSMEngine.module = module;
hopeBSMEngine.activityid = module.activityid;
Symbol 41 MovieClip Frame 1
stop();
Symbol 45 MovieClip Frame 2
stop();
Symbol 45 MovieClip Frame 3
stop();
Symbol 45 MovieClip Frame 6
stop();
Symbol 482 MovieClip [__Packages.HopeBSM_engine] Frame 0
class HopeBSM_engine
{
var gameRoot, gamePlaceholder, loadTime, hasPlayed, soundMC, soundEngine, interval, loggedInUser, n_score, currentScript, paused, n_currentLevel, a_levels, activityid, module, activeGame;
function HopeBSM_engine () {
}
function init(t_root, t_placeholder) {
gameRoot = t_root;
gamePlaceholder = t_placeholder;
loadTime = getTimer();
trace("-- Init Hope Babysitting Maze Engine --");
hasPlayed = false;
soundMC = gamePlaceholder.createEmptyMovieClip("soundEngine_mc", 3300);
soundEngine = new smashing.SoundEngine(soundMC, 1, false);
soundEngine.createSound("music", "Housemelody 22-03.wav");
soundEngine.createSound("puppy", "Dog 2 Barks.wav");
soundEngine.createSound("pickup", "squeak07.wav");
soundEngine.createSound("pickupSP", "squeak07.wav");
soundEngine.createSound("pickupFinal", "nicechime.wav");
interval = new smashing.IntervalEngine(this, "stepFrame");
interval.startFast();
pause();
loadLevelData();
goTitle();
}
function olr(event) {
_global.RYMengine.onCheckLoginResponse(event);
}
function onCheckLoginResponse(event) {
if (event.loggedIn == false) {
loggedInUser = "";
} else {
loggedInUser = event.loggedIn;
}
}
function oli(event) {
_global.RYMengine.onLogIn(event);
}
function onLogIn(event) {
loggedInUser = event.username;
}
function olo(event) {
_global.RYMengine.onLogOut(event);
}
function onLogOut(event) {
loggedInUser = "";
}
function playMusic() {
soundEngine.playSound("music", 10000);
}
function stopMusic() {
soundEngine.stopSound("music");
}
function playSound(t_name, t_loops) {
soundEngine.playSound(t_name);
}
function stopSound(t_name) {
if (t_name == undefined) {
t_name = "music";
}
soundEngine.stopSound(t_name);
}
function changeVolume(t_vol) {
soundEngine.changeVolume(t_vol);
}
function addScore(t_val) {
n_score = n_score + t_val;
updateScore();
}
function loseScore() {
n_score = n_score - 50;
if (n_score < 0) {
n_score = 0;
}
updateScore();
}
function updateScore() {
gameRoot.txt_score.txt_score.text = n_score;
}
function startScript(t_script) {
trace("- Start Script : " + t_script);
currentScript = t_script;
if (!(t_script === "meetBaby")) {
} else {
finishScript("meetBaby");
}
}
function finishScript(t_script) {
trace("- Finish Script : " + t_script);
if (!(t_script === "meetBaby")) {
} else {
beatLevel();
}
}
function stepFrame(t_elapsed) {
if (!paused) {
a_levels[n_currentLevel].step(t_elapsed);
}
}
function startGame() {
reset();
goGameplay();
startLevel();
hasPlayed = true;
}
function stopGame() {
trace("- Stop and Clear game -");
stopSound();
pause();
clearLevel();
}
function reset() {
n_currentLevel = 0;
currentScript = "finish";
n_score = 0;
pause();
}
function pause() {
_quality = "HIGH";
stopMusic();
trace("Pause");
stopSound("dance");
paused = true;
}
function unpause() {
_quality = GAMEQUAL;
trace("UnPause");
paused = false;
}
function goHopePage() {
getURL ("/hope");
}
function goEverMe() {
getURL ("/everme");
}
function quitForHighscore() {
stopGame();
goHighscore();
}
function goHighscore() {
gameRoot.gotoAndStop("highscore");
submitScore();
}
function submitScore() {
gameRoot.txt_debug.text = (activityid + " , ") + n_score;
trace(loadTime);
var _local2 = getTimer() - loadTime;
module.dispatchEvent({type:"onAddModule", name:"submitScore_mc", content:"/modules/submitScore.swf", z:"top", gameid:activityid, score:n_score, time:_local2, silent:false, reload:true});
module.onScoreSubmitted = oss;
module.dispatchEvent({type:"onRegisterModuleListener", moduleName:"submitScore_mc", eventName:"onScoreSubmitted"});
}
function oss(event) {
_global.hopeBSMrootPath.hopeBSMEngine.onScoreSubmitted(event);
}
function onScoreSubmitted(event) {
if ((n_score >= TARGETSCORE) && (loggedInUser != "")) {
goEverAward();
} else {
goTitle();
}
}
function startOver() {
stopGame();
startGame();
gameRoot.house_mc.crib_mc.baby_mc.gotoAndStop("happy");
gameRoot.house_mc.crib_mc.baby_mc.anim.gotoAndPlay(1);
}
function goTitle() {
pause();
gameRoot.gotoAndStop("title");
}
function goQuit() {
pause();
gameRoot.gotoAndStop("quit");
gameRoot.window_mc.n_score = n_score;
}
function goEverAward() {
gameRoot.gotoAndStop("everAward");
}
function goHelp() {
pause();
gameRoot.gotoAndStop("help");
}
function leaveMenu() {
goGameplay();
unpause();
}
function beatLevel() {
pause();
n_score = n_score + ((200 * n_currentLevel) + 200);
n_score = n_score + (Math.floor(a_levels[n_currentLevel].n_timer) * 50);
updateScore();
clearLevel();
if (n_currentLevel == 2) {
beatGame();
} else {
gameRoot.gotoAndStop("levelend");
}
}
function getTimeSpent() {
var _local2 = a_levels[n_currentLevel].n_timerMax - a_levels[n_currentLevel].n_timer;
a_levels[n_currentLevel].previousCompleteTime = _local2;
var _local3 = String(Math.ceil(_local2));
return(_local3);
}
function getTotalTimeSpent() {
var _local3 = 0;
var _local2 = a_levels.length;
while (_local2--) {
_local3 = _local3 + a_levels[_local2].previousCompleteTime;
}
var _local4 = String(Math.ceil(_local3));
return(_local4);
}
function beatGame() {
pause();
gameRoot.gotoAndStop("levelend2");
}
function gameOver() {
pause();
gameRoot.gotoAndStop("gameover");
gameRoot.house_mc.crib_mc.baby_mc.gotoAndStop("cry2");
gameRoot.window_mc.n_score = n_score;
}
function goGameplay() {
playMusic();
gameRoot.gotoAndStop("game");
gameRoot.txt_lvl.gotoAndStop(n_currentLevel + 1);
gameRoot.icons_lvl.gotoAndStop(n_currentLevel + 1);
updateScore();
unpause();
}
function goGameWin() {
gameRoot.gotoAndStop("wingame");
gameRoot.window_mc.n_score = n_score;
}
function startLevel() {
trace(("-- Start Level " + (n_currentLevel + 1)) + " -- ");
activeGame = gamePlaceholder.createEmptyMovieClip("game", 1);
a_levels[n_currentLevel].start(activeGame);
unpause();
}
function restartLevel() {
eval ((gameRoot + ".enter_") + a_levels[n_currentLevel].store).gotoAndStop("hidden");
startLevel();
gameRoot.gotoAndPlay("loseOutro");
goGameplay();
}
function nextLevel() {
n_currentLevel++;
startLevel();
goGameplay();
}
function clearLevel() {
a_levels[n_currentLevel].clear();
activeGame.removeMovieClip();
}
function loadLevelData() {
a_levels = [new Classes.bsmLevel(this), new Classes.bsmLevel(this), new Classes.bsmLevel(this)];
var _local2 = a_levels[0];
_local2.playerData = {assetID:"player_mc", x:111, y:235};
_local2.iconData = [{x:344, y:64, special:3}, {x:236, y:110, special:0}, {x:307, y:236, special:1}, {x:236, y:236, special:4}, {x:236, y:170, special:2}, {x:117, y:166, special:6}, {x:117, y:37, special:5}];
_local2.iconFrameNum = 1;
_local2.enemyData = [{assetID:"puppy_mc", startPoint:"point23", type:"puppy", speed:40}];
_local2 = a_levels[1];
_local2.playerData = {assetID:"player_mc", x:111, y:235};
_local2.iconData = [{x:105, y:69, special:3}, {x:105, y:130, special:6}, {x:237, y:61, special:5}, {x:237, y:127, special:4}, {x:423, y:232, special:2}, {x:314, y:49, special:1}, {x:386, y:49, special:6}, {x:387, y:129, special:1}, {x:446, y:98, special:0}];
_local2.iconFrameNum = 2;
_local2.enemyData = [{assetID:"puppy_mc", startPoint:"point20", type:"puppy", speed:50}];
_local2 = a_levels[2];
_local2.playerData = {assetID:"player_mc", x:111, y:235};
_local2.iconData = [{x:156, y:123, special:3}, {x:156, y:82, special:6}, {x:237, y:110, special:8}, {x:237, y:170, special:7}, {x:237, y:236, special:1}, {x:401, y:232, special:0}, {x:237, y:56, special:9}, {x:320, y:320, special:2}, {x:457, y:320, special:10}, {x:543, y:320, special:11}, {x:553, y:151, special:4}, {x:552, y:54, special:5}, {x:443, y:44, special:1}];
_local2.iconFrameNum = 3;
_local2.enemyData = [{assetID:"puppy_mc", startPoint:"point7", type:"puppy", speed:60}];
}
var TARGETSCORE = 11000;
var endGameTimer_max = 16;
var GAMEQUAL = "MEDIUM";
var LOWQUAL_PROC = 5000;
}
Symbol 483 MovieClip [__Packages.smashing.SoundEngine] Frame 0
class smashing.SoundEngine
{
var mc, o_sounds, o_groups, flagOverwrite, groupCount, muted;
function SoundEngine (t_path, t_depth, t_overwrite) {
mc = t_path.createEmptyMovieClip(DEFAULTMCNAME, t_depth);
o_sounds = new Object();
o_groups = new Object();
if (t_overwrite == undefined) {
t_overwrite = false;
}
flagOverwrite = t_overwrite;
groupCount = 0;
createGroup(DEFAULTGROUPNAME);
trace("-- Init Sound Engine -- ");
}
function createGroup(t_name) {
groupCount++;
var _local2 = mc.createEmptyMovieClip(t_name, groupCount);
_local2.soundObject = new Sound(_local2);
o_groups[t_name] = _local2;
}
function createSound(t_name, t_assetID, t_group) {
var _local3;
if (t_group == undefined) {
_local3 = o_groups[DEFAULTGROUPNAME];
} else {
_local3 = o_groups[t_group];
}
if (_local3 != undefined) {
var _local2 = {};
_local2.soundEffect = new Sound(_local3);
_local2.soundEffect.attachSound(t_assetID);
o_sounds[t_name] = _local2;
} else {
trace(("Error Locating Group " + t_group) + " for create Sound");
}
}
function playSound(t_name, t_loops) {
if (muted) {
return(undefined);
}
var _local3 = o_sounds[t_name];
if (_local3 != undefined) {
if (t_loops == undefined) {
t_loops = 1;
} else if (t_loops == 0) {
t_loops = 1000;
}
if (_global.K_SoundEngine.OverwriteSounds) {
_local3.SoundEffect.stop(_local3.idName);
}
_local3.soundEffect.start(0, t_loops);
} else {
trace(("Error - sound " + t_name) + " not found");
}
}
function stopSound(t_name) {
o_sounds[t_name].soundEffect.stop();
}
function changeVolume(t_vol, t_groupName) {
if (t_groupName == undefined) {
t_groupName = DEFAULTGROUPNAME;
}
o_groups[t_groupName].soundObject.setVolume(t_vol);
}
function soundOff() {
muted = true;
}
function soundOn() {
muted = false;
}
var DEFAULTMCNAME = "soundEngine_MC";
var DEFAULTGROUPNAME = "sound";
}
Symbol 484 MovieClip [__Packages.smashing.IntervalEngine] Frame 0
class smashing.IntervalEngine
{
var _uo, _uf, _update_interval, _i, _last_update, _ft, _el;
function IntervalEngine (update_object, update_function) {
_uo = update_object;
_uf = update_function;
}
function startFlat(FPS) {
_FPS = FPS;
_update_interval = 1 / FPS;
_i = setInterval(this, "_flat_step", 0);
}
function startFlex() {
_last_update = getTimer() * 0.001;
_i = setInterval(this, "_flex_step", 0);
}
function startFast() {
_last_update = getTimer() * 0.001;
_i = setInterval(this, "_fast_step", 0);
}
function pause(Void) {
_is_paused = true;
}
function unpause(Void) {
_is_paused = false;
}
function reset(Void) {
if (_i != undefined) {
clearInterval(_i);
}
_ft = 0;
_last_update = getTimer() * 0.001;
_lel = _MAX_FRAMETIME / 2;
pause();
}
function _flex_step(Void) {
if (_is_paused) {
_last_update = getTimer() * 0.001;
return(undefined);
}
_el = Math.min(_MAX_FRAMETIME, (-_last_update) + ((_last_update = getTimer() * 0.001)));
_lel = _lel - Math.max(-_MAX_TIMEDIFF, Math.min(_MAX_TIMEDIFF, _lel - _el));
_uo[_uf](_lel);
}
function _flat_step(Void) {
if (_is_paused) {
return(undefined);
}
_ft = _ft + ((-_last_update) + ((_last_update = getTimer() * 0.001)));
if (_ft < _update_interval) {
return(undefined);
}
_uo[_uf](_ft);
_ft = 0;
}
function _fast_step(Void) {
_el = (-_last_update) + ((_last_update = getTimer()));
_uo[_uf](_el * 0.001);
}
var _MAX_TIMEDIFF = 0.005;
var _MIN_FPS = 5;
var _MAX_FRAMETIME = 1 / smashing.IntervalEngine.prototype._MIN_FPS;
var _lel = 0.2;
var _FPS = 0;
var _is_paused = false;
}
Symbol 485 MovieClip [__Packages.Classes.bsmLevel] Frame 0
class Classes.bsmLevel
{
var engine, n_timer, babyTimer, babySadness, alertLowTime, alertWarningTime, clockFrames, player, babyReady, path, iconsFound, iconsTotal, iconData, a_enemy, a_icons, currentSpecial, specialTimer, z_playerCurrent, z_iconCurrent, z_enemyCurrent, hd, a_aiPoints, playerData, enemyData, iconFrameNum;
function bsmLevel (t_engine) {
engine = t_engine;
}
function get timer() {
Math.ceil(n_timer);
}
function step(t_elapsed) {
babyTimer = babyTimer - t_elapsed;
if (babyTimer < 0) {
var _local3 = engine.gameRoot.house_mc.crib_mc.baby_mc;
if (babySadness == 0) {
_local3.gotoAndStop("happy");
} else if (babySadness > 2) {
} else {
_local3.gotoAndStop("cry");
}
_local3.anim.gotoAndPlay(1);
babySadness++;
babyTimer = BABYTIMER_MAX;
}
n_timer = n_timer - t_elapsed;
if (n_timer <= 0) {
n_timer = 0;
engine.gameOver();
return(undefined);
}
if (n_timer < 20) {
if (alertLowTime) {
engine.gameRoot.mc_watch.gotoAndPlay("twentysec");
alertLowTime = false;
} else if ((n_timer < 10) && (alertWarningTime)) {
engine.gameRoot.mc_watch.gotoAndPlay("tensec");
alertWarningTime = false;
}
}
engine.gameRoot.mc_clock.mc_anim.gotoAndStop(clockFrames - Math.floor(clockFrames * (n_timer / n_timerMax)));
player.update(t_elapsed);
stepEnemy(t_elapsed);
if (!player.hidden) {
player.update(t_elapsed);
runEntityHD();
player.move();
runSwingHD();
if (babyReady) {
runBabyHD();
} else {
runIconHD(t_elapsed);
}
}
player.render();
}
function runSwingHD() {
if (Math.sqrt(((player.x - SSP.x) * (player.x - SSP.x)) + ((player.y - SSP.y) * (player.y - SSP.y))) < 30) {
engine.gameRoot.house_mc.swingset_mc.play();
}
}
function start(t_path) {
reset();
clear();
path = t_path;
attachHD();
iconsFound = 0;
iconsTotal = iconData.length;
babyReady = false;
spawnPlayer();
spawnIcons();
setSpecial();
clockFrames = engine.gameRoot.mc_clock.mc_anim._totalFrames;
a_enemy = [];
spawnEnemy();
}
function setSpecial() {
var _local2 = a_icons.length;
var _local3 = 0;
while (_local2--) {
if ((a_icons[_local2].specialNum == currentSpecial) && (a_icons[_local2].isActive)) {
a_icons[_local2].goSpecial(specialTimer);
_local3++;
}
}
if (_local3 > 1) {
specialTimer = specialTimer + 6;
}
}
function reset() {
n_timer = n_timerMax;
specialTimer = SPECIALTIMER_MAX;
currentSpecial = 0;
babyTimer = BABYTIMER_MAX;
babySadness = 0;
engine.gameRoot.house_mc.crib_mc.baby_mc.gotoAndStop("happy");
z_playerCurrent = z_playerMin;
z_iconCurrent = z_iconMin;
z_enemyCurrent = z_enemyMin;
}
function clear() {
player.clear();
player = null;
alertLowTime = true;
alertWarningTime = true;
engine.gameRoot.babyArrow_mc.gotoAndStop("off");
clearIcons();
clearEnemy();
}
function attachHD() {
hd = path.attachMovie(hdAssetID, "hd", z_hd);
generateAIPoints();
}
function generateAIPoints() {
a_aiPoints = [];
a_aiPoints.push({point:"point1", adj:["point2", "point8"]});
a_aiPoints.push({point:"point2", adj:["point1", "point3", "point7"]});
a_aiPoints.push({point:"point3", adj:["point2", "point4"]});
a_aiPoints.push({point:"point4", adj:["point3", "point5"]});
a_aiPoints.push({point:"point5", adj:["point4", "point6"]});
a_aiPoints.push({point:"point6", adj:["point5", "point7", "point18"]});
a_aiPoints.push({point:"point7", adj:["point6", "point2", "point8"]});
a_aiPoints.push({point:"point8", adj:["point7", "point1", "point9"]});
a_aiPoints.push({point:"point9", adj:["point8", "point10", "point13"]});
a_aiPoints.push({point:"point10", adj:["point9", "point11"]});
a_aiPoints.push({point:"point11", adj:["point10", "point12"]});
a_aiPoints.push({point:"point12", adj:["point11", "point13"]});
a_aiPoints.push({point:"point13", adj:["point12", "point14", "point9"]});
a_aiPoints.push({point:"point14", adj:["point13", "point15", "point19"]});
a_aiPoints.push({point:"point15", adj:["point14", "point20"]});
a_aiPoints.push({point:"point16", adj:["point20", "point17"]});
a_aiPoints.push({point:"point17", adj:["point16", "point18"]});
a_aiPoints.push({point:"point18", adj:["point17", "point19"]});
a_aiPoints.push({point:"point19", adj:["point18", "point14"]});
a_aiPoints.push({point:"point20", adj:["point15", "point16", "point21"]});
a_aiPoints.push({point:"point21", adj:["point20", "point22"]});
a_aiPoints.push({point:"point22", adj:["point21", "point23", "point24"]});
a_aiPoints.push({point:"point23", adj:["point22"]});
a_aiPoints.push({point:"point24", adj:["point22", "point25"]});
a_aiPoints.push({point:"point25", adj:["point24", "point8"]});
}
function runEntityHD() {
var _local2 = a_enemy.length;
while (_local2--) {
if (player.mc.hitTest(a_enemy[_local2].mc)) {
player.hit(a_enemy[_local2]);
a_enemy[_local2].hitReact();
}
}
}
function runIconHD(el) {
var _local2 = a_icons.length;
while (_local2--) {
if (a_icons[_local2].isSpecial) {
a_icons[_local2].decSpecial(el);
}
if (a_icons[_local2].isActive && (Math.abs(player.x - a_icons[_local2].x) < 20)) {
if (a_icons[_local2].mc.hitTest(player.mc)) {
if (a_icons[_local2].isSpecial) {
currentSpecial++;
setSpecial();
}
a_icons[_local2].pickup();
engine.addScore(a_icons[_local2].value);
iconsFound++;
if (iconsFound == iconsTotal) {
startBaby();
}
}
}
}
}
function runBabyHD() {
if (engine.gameRoot.babyArrow_mc.hitTest(player.mc)) {
engine.gameRoot.babyArrow_mc.gotoAndStop("off");
engine.startScript("meetBaby");
}
}
function startBaby() {
engine.gameRoot.babyArrow_mc.gotoAndStop("on");
engine.playSound("pickupFinal");
babyReady = true;
}
function findPoint(t_point) {
var _local2 = a_aiPoints.length;
while (_local2--) {
if (t_point == a_aiPoints[_local2].point) {
return(_local2);
}
}
return(0);
}
function findAdjacentPoint(t_point) {
var _local3;
var _local2;
var _local6;
_local3 = a_aiPoints[t_point].adj;
var _local5 = _local3.length;
_local2 = Math.ceil(Math.random() * _local3.length) - 1;
if (_local2 < 0) {
_local2 = 0;
}
_local2 = _local3[_local2];
if (_local2 == undefined) {
trace("OMG ERROR");
return(t_point);
}
return(findPoint(_local2));
}
function findFurthestPointFromPlayer(t_point) {
var a_adj;
var t_pointMC;
var n_dist;
var n_winner;
var n_result;
var xDiff;
var yDiff;
var d;
a_adj = a_aiPoints[t_point].adj;
n_dist = 0;
d = a_adj.length;
while (d--) {
t_pointMC = eval ((hd + ".") + a_adj[d]);
xDiff = player.x - t_pointMC._x;
yDiff = player.y - t_pointMC._y;
n_result = Math.sqrt((xDiff * xDiff) + (yDiff * yDiff));
if (n_result > n_dist) {
n_dist = n_result;
n_winner = a_adj[d];
}
}
if (n_winner == undefined) {
trace("OMG ERROR");
return(t_point);
}
return(findPoint(n_winner));
}
function findClosestPointToPlayer(t_point) {
var a_adj;
var t_pointMC;
var n_dist;
var n_winner;
var n_result;
var xDiff;
var yDiff;
var d;
a_adj = a_aiPoints[t_point].adj;
n_dist = 2000;
d = a_adj.length;
while (d--) {
t_pointMC = eval ((hd + ".") + a_adj[d]);
xDiff = player.x - t_pointMC._x;
yDiff = player.y - t_pointMC._y;
n_result = Math.sqrt((xDiff * xDiff) + (yDiff * yDiff));
if (n_result < n_dist) {
n_dist = n_result;
n_winner = a_adj[d];
}
}
if (n_winner == undefined) {
trace("OMG ERROR");
return(t_point);
}
return(findPoint(n_winner));
}
function spawnPlayer() {
player = new Classes.bsmPlayer(playerData, this);
player.spawn(path, z_playerCurrent);
player.mc.gotoAndStop("glow");
z_playerCurrent++;
}
function stepEnemy(t_elapsed) {
var _local2 = a_enemy.length;
while (_local2--) {
a_enemy[_local2].step(t_elapsed);
}
}
function spawnEnemy() {
a_enemy = [];
var _local3 = enemyData.length;
while (_local3--) {
var _local2 = new Classes.bsmEnemy(enemyData[_local3], this);
a_enemy.push(_local2);
_local2.spawn(path, z_enemyCurrent);
z_enemyCurrent++;
}
}
function spawnSpecific(t_type) {
var _local3 = enemyData.length;
while (_local3--) {
if (enemyData[_local3].type == t_type) {
var _local2 = new Classes.bsmEnemy(enemyData[_local3], this);
a_enemy.push(_local2);
_local2.spawn(path, z_enemyCurrent);
z_enemyCurrent++;
}
}
}
function clearEnemy() {
var _local2 = a_enemy.length;
while (_local2--) {
a_enemy[_local2].clear();
}
a_enemy = [];
}
function spawnIcons() {
a_icons = [];
var _local3 = iconData.length;
var _local2;
while (_local3--) {
_local2 = new Classes.bsmIcon(iconData[_local3], this, iconFrameNum);
a_icons.push(_local2);
_local2.spawn(path, z_iconCurrent);
z_iconCurrent++;
}
}
function clearIcons() {
var _local2 = a_icons.length;
while (_local2--) {
a_icons[_local2].clear();
}
a_icons = [];
}
var BABYTIMER_MAX = 15;
var SPECIALTIMER_MAX = 11;
var hdAssetID = "mc_HD";
var z_hd = 5;
var z_playerMin = 200;
var z_enemyMin = 100;
var z_iconMin = 10;
var n_timerMax = 60;
var SSP = {x:530, y:53};
}
Symbol 486 MovieClip [__Packages.Classes.bsmEntity] Frame 0
class Classes.bsmEntity
{
var assetID, x, y, levelPath, xMove, yMove, path, mc, hdWidth, baseWidth, hdHeight, baseHeight, hidden;
function bsmEntity (t_data, t_levelPath) {
assetID = t_data.assetID;
x = t_data.x;
y = t_data.y;
levelPath = t_levelPath;
xMove = 0;
yMove = 0;
}
function spawn(t_path, t_depth) {
path = t_path;
mc = t_path.attachMovie(assetID, assetID + t_depth, t_depth);
mc.stop();
placeAt(x, y);
hdWidth = (baseWidth = mc._width);
hdHeight = (baseHeight = mc._height);
hidden = false;
render();
}
function step(t_elapsed) {
update(t_elapsed);
move();
render();
}
function update(t_elapsed) {
}
function move() {
x = x + xMove;
y = y + yMove;
}
function render() {
mc._x = x - (baseWidth / 2);
mc._y = y - (baseHeight / 2);
}
function hide() {
hidden = true;
mc._visible = false;
}
function show() {
trace("SHOW");
hidden = false;
mc._visible = true;
}
function placeAt(t_x, t_y) {
x = t_x;
y = t_y;
}
function clear() {
mc.removeMovieClip();
}
}
Symbol 487 MovieClip [__Packages.Classes.bsmPlayer] Frame 0
class Classes.bsmPlayer extends Classes.bsmEntity
{
var assetID, x, y, pushedBy, levelPath, path, mc, placeAt, hdOffsetPoint, baseWidth, baseHeight, hdWidth, hdHeight, render, xMove, yMove, hidden, slowTimer, invincibleTimer;
function bsmPlayer (t_data, t_levelPath) {
super();
assetID = t_data.assetID;
x = t_data.x;
y = t_data.y;
pushedBy = null;
levelPath = t_levelPath;
}
function spawn(t_path, t_depth) {
path = t_path;
mc = t_path.attachMovie(assetID, assetID + t_depth, t_depth);
mc.stop();
placeAt(x, y);
hdOffsetPoint = {x:0, y:0};
path.hd.localToGlobal(hdOffsetPoint);
pushedBy = null;
baseWidth = 25;
baseHeight = 30;
hdWidth = 20;
hdHeight = 20;
render();
}
function hit(t_enemy) {
push(t_enemy);
}
function push(t_enemy) {
var _local4 = calculateFacingHD(this, t_enemy.mc);
if (_local4.collision) {
xMove = 0;
yMove = 0;
}
var _local3 = calculateFacingHD(t_enemy, mc);
if (_local3.collision) {
if (t_enemy.type == "perfume") {
if ((t_enemy.ignoreTimer <= 0) && (t_enemy.sprayTimer <= 3)) {
t_enemy.sprayPerfume();
t_enemy.turnAround();
}
}
pushedBy = t_enemy;
if (_local3.dir == "left") {
xMove = xMove + t_enemy.xMove;
} else if (_local3.dir == "right") {
xMove = xMove + t_enemy.xMove;
} else if (_local3.dir == "up") {
yMove = yMove + t_enemy.yMove;
} else if (_local3.dir == "down") {
yMove = yMove + t_enemy.yMove;
}
}
}
function update(t_elapsed) {
var _local5 = xMove;
var _local6 = yMove;
xMove = 0;
yMove = 0;
if (t_elapsed > 0.04) {
t_elapsed = 0.04;
}
if (!hidden) {
var _local2 = speed * t_elapsed;
if (slowTimer > 0) {
_local2 = _local2 / 3;
slowTimer = slowTimer - t_elapsed;
if (slowTimer <= 0) {
mc.cloud.gotoAndStop("off");
}
}
if (Key.isDown(37)) {
xMove = -_local2;
mc.gotoAndStop("left");
} else if (Key.isDown(38)) {
yMove = -_local2;
mc.gotoAndStop("up");
} else if (Key.isDown(39)) {
xMove = _local2;
mc.gotoAndStop("right");
} else if (Key.isDown(40)) {
yMove = _local2;
mc.gotoAndStop("down");
} else if ((_local5 != 0) || (_local6 != 0)) {
var _local3 = "standUp";
if (_local6 > 0) {
_local3 = "standDown";
} else if (_local5 > 0) {
_local3 = "standRight";
} else if (_local5 < 0) {
_local3 = "standLeft";
}
mc.gotoAndStop(_local3);
}
if (invincibleTimer > 0) {
invincibleTimer = invincibleTimer - t_elapsed;
}
}
}
function move() {
if ((xMove != 0) || (yMove != 0)) {
var _local3 = calculateFacingHD(this, path.hd);
if (_local3.collision) {
if (pushedBy != null) {
pushedBy.turnAround();
pushedBy = null;
}
var _local4 = 0;
var _local5 = 0;
var _local2 = _local3.points.length;
while (_local2--) {
if (_local3.points[_local2].collide) {
if ((((_local3.points[_local2].point == "cr") || (_local3.points[_local2].point == "cl")) || (_local3.points[_local2].point == "ct")) || (_local3.points[_local2].point == "cb")) {
_local5 = 0;
_local4 = 0;
_local2 = 0;
} else if (_local3.points[_local2].point == "tl") {
if (xMove < 0) {
_local4 = Math.abs(xMove);
} else if (yMove < 0) {
_local5 = Math.abs(yMove);
}
} else if (_local3.points[_local2].point == "tr") {
if (xMove > 0) {
_local4 = xMove;
} else if (yMove < 0) {
_local5 = yMove;
}
} else if (_local3.points[_local2].point == "br") {
if (xMove > 0) {
_local4 = -xMove;
} else if (yMove > 0) {
_local5 = -yMove;
}
} else if (_local3.points[_local2].point == "bl") {
if (xMove < 0) {
_local4 = xMove;
} else if (yMove > 0) {
_local5 = yMove;
}
}
}
}
x = x + _local5;
y = y + _local4;
} else {
x = x + xMove;
y = y + yMove;
}
}
}
function hide() {
slowTimer = 0;
mc.cloud.gotoAndStop("off");
super.hide();
}
function calculateFacingHD(t_entity, t_mc) {
var _local4 = {tl:false, tr:false, bl:false, br:false, cb:false, cl:false, cr:false, ct:false};
var _local11;
if (t_entity.xMove < 0) {
_local11 = "left";
_local4.tl = true;
_local4.cl = true;
_local4.bl = true;
} else if (t_entity.xMove > 0) {
_local11 = "right";
_local4.tr = true;
_local4.cr = true;
_local4.br = true;
}
if (t_entity.yMove < 0) {
_local11 = "up";
_local4.tl = true;
_local4.tr = true;
_local4.ct = true;
} else if (t_entity.yMove > 0) {
_local11 = "down";
_local4.bl = true;
_local4.br = true;
_local4.cb = true;
}
var _local7 = t_entity.x + t_entity.xMove;
var _local6 = t_entity.y + t_entity.yMove;
var _local8;
var _local10;
var _local13 = 2;
if ((_local11 == "up") || (_local11 == "down")) {
_local8 = t_entity.hdWidth / _local13;
_local10 = t_entity.hdHeight / _local13;
} else {
_local8 = t_entity.hdHeight / _local13;
_local10 = t_entity.hdWidth / _local13;
}
var _local9 = false;
var _local3 = [{point:"tl", x:_local7 - _local8, y:_local6 - _local10}, {point:"tr", x:_local7 + _local8, y:_local6 - _local10}, {point:"bl", x:_local7 - _local8, y:_local6 + _local10}, {point:"br", x:_local7 + _local8, y:_local6 + _local10}, {point:"cr", x:(_local7 + _local8) + 2, y:_local6}, {point:"cb", x:_local7, y:(_local6 + _local10) + 2}, {point:"cl", x:(_local7 - _local8) - 2, y:_local6}, {point:"ct", x:_local7, y:(_local6 - _local10) - 2}];
var _local2 = _local3.length;
while (_local2--) {
_local3[_local2].collide = false;
if (_local4[_local3[_local2].point]) {
_local3[_local2].collide = t_mc.hitTest(_local3[_local2].x + hdOffsetPoint.x, _local3[_local2].y + hdOffsetPoint.y, true);
if (_local3[_local2].collide) {
_local9 = true;
}
}
}
return({collision:_local9, dir:_local11, points:_local3});
}
var INVINCIBLE_TIME = 3;
var SLOW_TIME_EASY = 3;
var SLOW_TIME_HARD = 5;
var speed = 90;
var SCENTERX = 287.5;
var SCENTERY = 200;
}
Symbol 488 MovieClip [__Packages.Classes.bsmEnemy] Frame 0
class Classes.bsmEnemy extends Classes.bsmEntity
{
var assetID, speed, levelPath, soundTimer, currentPoint, previousPoint, type, currentFacing, targetPoint, y, x, xMove, yMove, mc;
function bsmEnemy (t_data, t_levelPath) {
super();
assetID = t_data.assetID;
speed = t_data.speed;
levelPath = t_levelPath;
soundTimer = 0;
currentPoint = levelPath.findPoint(t_data.startPoint);
previousPoint = currentPoint;
type = t_data.type;
currentFacing = "up";
setToPoint();
targetPoint = {x:x, y:y};
}
function setToPoint() {
var t_point = eval ((levelPath.hd + ".point") + (currentPoint + 1));
x = t_point._x;
y = t_point._y;
}
function update(t_elapsed) {
xMove = 0;
yMove = 0;
var _local10;
if (soundTimer > 0) {
soundTimer = soundTimer - t_elapsed;
}
var _local9 = false;
var _local2;
var _local3;
var _local4;
var _local6;
var _local7 = speed * t_elapsed;
_local2 = targetPoint.x - x;
_local3 = targetPoint.y - y;
if ((Math.abs(_local2) < 1) && (Math.abs(_local3) < 1)) {
x = targetPoint.x;
y = targetPoint.y;
findNextPoint();
update(t_elapsed);
return(undefined);
}
var _local5 = "up";
if (_local2 >= 1) {
_local5 = "right";
} else if (_local2 <= -1) {
_local5 = "left";
} else if (_local3 >= 1) {
_local5 = "down";
}
currentFacing = _local5;
mc.gotoAndStop(currentFacing);
_local6 = Math.sqrt((_local2 * _local2) | (_local3 * _local3));
if (_local6 != 0) {
_local4 = _local7 / _local6;
if (_local4 > 1) {
_local4 = 1;
}
if (x != targetPoint.x) {
xMove = _local2 * _local4;
}
if (y != targetPoint.y) {
yMove = _local3 * _local4;
}
}
}
function turnAround() {
currentPoint = previousPoint;
var t_mc = eval ((levelPath.hd + ".point") + (currentPoint + 1));
targetPoint = {x:t_mc._x, y:t_mc._y};
}
function hitReact() {
if (soundTimer <= 0) {
levelPath.engine.playSound("puppy");
levelPath.engine.loseScore();
}
soundTimer = SOUNDTIMER_MAX;
}
function findNextPoint() {
previousPoint = currentPoint;
currentPoint = levelPath.findAdjacentPoint(currentPoint);
var t_mc = eval ((levelPath.hd + ".point") + (currentPoint + 1));
targetPoint = {x:t_mc._x, y:t_mc._y};
}
var IGNORE_TIMER = 5;
var SPRAY_TIMER = 4;
var SOUNDTIMER_MAX = 1;
}
Symbol 489 MovieClip [__Packages.Classes.bsmIcon] Frame 0
class Classes.bsmIcon extends Classes.bsmEntity
{
var x, y, specialNum, isSpecial, frameNum, levelPath, isActive, value, assetID, mc, specialTimer;
function bsmIcon (t_data, t_levelPath, t_frameNum) {
super();
x = t_data.x;
y = t_data.y;
specialNum = t_data.special;
isSpecial = false;
frameNum = t_frameNum;
levelPath = t_levelPath;
isActive = true;
value = DEF_VALUE;
assetID = "icon_mc";
}
function spawn(t_path, t_depth) {
super.spawn(t_path, t_depth);
mc.gotoAndStop(frameNum);
if (isSpecial) {
mc.mcAnim.icon.gotoAndStop("special");
}
}
function pickup() {
if (isSpecial) {
levelPath.engine.playSound("pickupSP");
} else {
levelPath.engine.playSound("pickup");
}
mc.mcAnim.gotoAndPlay("pickup");
if (!isSpecial) {
mc.mcAnim.bonus_mc.stop();
}
isActive = false;
isSpecial = false;
}
function decSpecial(t_el) {
specialTimer = specialTimer - t_el;
if (specialTimer < 0) {
goNormal();
}
}
function goSpecial(t_timer) {
mc.mcAnim.icon.gotoAndStop("special");
isSpecial = true;
value = DEF_VALUE * 2.5;
specialTimer = t_timer;
}
function goNormal() {
isSpecial = false;
mc.mcAnim.icon.gotoAndStop(1);
value = DEF_VALUE;
}
var DEF_VALUE = 200;
}
Symbol 73 MovieClip [player_mc] Frame 1
stop();
Symbol 90 MovieClip [puppy_mc] Frame 1
stop();
Symbol 102 MovieClip Frame 1
stop();
Symbol 108 MovieClip Frame 11
stop();
Symbol 111 MovieClip Frame 1
stop();
Symbol 111 MovieClip Frame 15
stop();
Symbol 122 MovieClip Frame 1
stop();
Symbol 123 MovieClip Frame 1
stop();
Symbol 123 MovieClip Frame 15
stop();
Symbol 140 MovieClip Frame 1
stop();
Symbol 141 MovieClip Frame 1
stop();
Symbol 141 MovieClip Frame 15
stop();
Symbol 149 MovieClip Frame 1
stop();
Symbol 210 MovieClip Frame 1
stop();
Symbol 210 MovieClip Frame 2
stop();
Symbol 212 Button
on (release) {
hopeBSMEngine.startGame();
}
Symbol 214 Button
on (release) {
_parent.hopeBSMEngine.startGame();
}
Symbol 215 MovieClip Frame 41
stop();
Symbol 226 MovieClip Frame 1
stop();
Symbol 242 MovieClip Frame 31
stop();
Symbol 253 MovieClip Frame 35
stop();
Symbol 256 MovieClip Frame 1
stop();
Symbol 256 MovieClip Frame 10
stop();
Symbol 265 MovieClip Frame 1
stop();
Symbol 315 MovieClip Frame 1
stop();
Symbol 315 MovieClip Frame 2
stop();
Symbol 315 MovieClip Frame 3
stop();
Symbol 324 Button
on (release) {
hopeBSMEngine.goHelp();
}
Symbol 327 Button
on (release) {
hopeBSMEngine.goQuit();
}
Symbol 355 Button
on (release) {
hopeBSMEngine.nextLevel();
}
Symbol 356 Button
on (release) {
play();
}
Symbol 357 MovieClip Frame 11
stop();
Symbol 357 MovieClip Frame 15
_parent.hopeBSMEngine.nextLevel();
stop();
Symbol 371 MovieClip Frame 1
stop();
Symbol 371 MovieClip Frame 2
stop();
Symbol 372 Button
on (release) {
hopeBSMEngine.goGameWin();
}
Symbol 373 Button
on (release) {
play();
}
Symbol 374 MovieClip Frame 15
stop();
Symbol 374 MovieClip Frame 19
_parent.hopeBSMEngine.goGameWin();
stop();
Symbol 389 Button
on (release) {
hopeBSMEngine.goHopePage();
}
Symbol 392 Button
on (release) {
hopeBSMEngine.leaveMenu();
}
Symbol 395 Button
on (release) {
hopeBSMEngine.startOver();
}
Symbol 399 Button
on (release) {
_parent.hopeBSMEngine.goHopePage();
}
Symbol 400 Button
on (release) {
play();
}
Symbol 401 Button
on (release) {
_parent.hopeBSMEngine.startOver();
}
Symbol 402 Button
on (release) {
_parent.hopeBSMEngine.quitForHighscore();
}
Symbol 403 MovieClip Frame 5
score_mc.score_txt.txt_score.text = n_score;
score_mc.score_txt_shadow.txt_score.text = n_score;
score_mc.score_txt_shadow2.txt_score.text = n_score;
Symbol 403 MovieClip Frame 14
stop();
Symbol 403 MovieClip Frame 18
_parent.hopeBSMEngine.leaveMenu();
stop();
Symbol 404 MovieClip Frame 34
stop();
Symbol 404 MovieClip Frame 38
_parent.hopeBSMEngine.leaveMenu();
stop();
Symbol 413 Button
on (release) {
hopeBSMEngine.startOver();
}
Symbol 414 Button
on (release) {
_parent.hopeBSMEngine.goHighscore();
}
Symbol 415 Button
on (release) {
play();
}
Symbol 416 MovieClip Frame 5
score_mc.txt_score.txt_score.text = n_score;
score_mc.txt_score_shadow.txt_score.text = n_score;
Symbol 416 MovieClip Frame 12
stop();
Symbol 416 MovieClip Frame 16
_parent.hopeBSMEngine.startOver();
stop();
Symbol 441 Button
on (release) {
hopeBSMEngine.goHighscore();
}
Symbol 442 Button
on (release) {
hopeBSMEngine.startGame();
}
Symbol 444 Button
on (release) {
_parent.hopeBSMEngine.startGame();
}
Symbol 446 MovieClip Frame 28
score_mc.txt_score.text = n_score;
Symbol 446 MovieClip Frame 31
score_shadow_mc.txt_score.text = n_score;
if (n_score >= 9000) {
awardtxt_mc.gotoAndStop(1);
} else {
awardtxt_mc.gotoAndStop(2);
}
Symbol 446 MovieClip Frame 43
stop();
Symbol 446 MovieClip Frame 44
stop();
Symbol 476 MovieClip Frame 1
stop();
Symbol 479 Button
on (release) {
hopeBSMEngine.goEverMe();
}
Symbol 480 Button
on (release) {
_parent.hopeBSMEngine.goEverMe();
}
Symbol 481 MovieClip Frame 15
stop();
Symbol 481 MovieClip Frame 19
_parent.hopeBSMEngine.startGame();
stop();