Frame 1
var LOCAL = true;
var domXML = new XML();
if (LOCAL) {
gotoAndPlay (2);
} else {
domXML.load("http://www.cartoonnetwork.com/crossdomain.xml");
}
domXML.onLoad = function () {
if (domXML.childNodes.length == 0) {
trace("!!! DOMAIN CHECK FAILED !!!");
getURL ("http://www.cartoonnetwork.com");
stop();
} else {
trace("*** Domain check OK! ***");
trace(domXML);
gotoAndPlay (2);
}
};
Frame 2
var loadedVal = Math.floor((_root.getBytesLoaded() / _root.getBytesTotal()) * 100);
if (loadedVal > 1) {
counter_txt.text = loadedVal + "%";
}
if (loadedVal >= 100) {
gotoAndStop (5);
}
Frame 3
gotoAndPlay (2);
Frame 5
function initApp() {
if (!_global.gameLoaded) {
_global.achievementSystem.achievementNotificationGameLoaded();
_global.gameLoaded = true;
}
clearInterval(m);
}
function onLoadComplete(success) {
if (success) {
_global.HAMSTER_SPACE = String(xmlDoc.firstChild.childNodes[0].attributes.name);
_global.HAMSTER_SPACE_ID = String(xmlDoc.firstChild.childNodes[0].attributes.id);
_global.HAMSTER_HOLE = String(xmlDoc.firstChild.childNodes[1].attributes.name);
_global.HAMSTER_HOLE_ID = String(xmlDoc.firstChild.childNodes[1].attributes.id);
_global.DISTANCE_SINGLE = String(xmlDoc.firstChild.childNodes[2].attributes.name);
_global.DISTANCE_SINGLE_ID = String(xmlDoc.firstChild.childNodes[2].attributes.id);
_global.TOTAL_DISTANCE = String(xmlDoc.firstChild.childNodes[3].attributes.name);
_global.TOTAL_DISTANCE_ID = String(xmlDoc.firstChild.childNodes[3].attributes.id);
} else {
trace("don't loaded stats.xml");
}
}
stop();
_global.achievementSystem = new com.cartoonnetwork.AchievementSystem.AchievementAS2(this);
trace("_global.achievementSystem = " + _global.achievementSystem);
var m = setInterval(this, "initApp", 1000);
var xmlDoc = new XML();
xmlDoc.ignoreWhite = true;
xmlDoc.onLoad = mx.utils.Delegate.create(this, onLoadComplete);
xmlDoc.load("stats.xml");
_global.sendStat = function (name, id, value) {
trace((((("<<SEND>> " + name) + " ") + id) + " ") + value);
_global.achievementSystem.sendStat(id, value);
};
Frame 6
this._lockroot = true;
gameOver_mc._visible = false;
stop();
Instance of Symbol 274 MovieClip "gravMeter" in Frame 6
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 490 MovieClip "skate_icon" in Frame 6
onClipEvent (load) {
this._visible = false;
}
Frame 7
var hamsterShoot = new Game(this.game_mc, fvGameData);
Mouse.addListener(hamsterShoot);
stop();
Symbol 506 MovieClip [__Packages.com.cartoonnetwork.AchievementSystem.AchievementAS2] Frame 0
class com.cartoonnetwork.AchievementSystem.AchievementAS2
{
static var _achievementNotificationFinished;
var _mc, _moduleConnection, _displayConnection, _swfLoader;
function AchievementAS2 (mc) {
_mc = mc;
_mc.x = 0;
_mc.y = 0;
_moduleConnection = new com.cartoonnetwork.connect.Connection("fromAchieveModule", "toAchieveModule", this, true);
}
function sendStat(statString, value) {
var _local2 = new Array();
_local2.push(statString);
_local2.push(value);
_moduleConnection.send("updateStat", _local2);
}
function xmlLoaded() {
_xmlLoaded = true;
_containerLoaded = true;
_displayConnection = new com.cartoonnetwork.connect.Connection("fromDisplayModule", "toDisplayModule", this, false);
_moduleConnection.slaveReceivedUnique();
_swfLoader = _root.createEmptyMovieClip("_swfLoader", 1);
_swfLoader._x = 175;
_swfLoader._y = 400;
loadMovie ("AchieveDisplay.swf", "_swfLoader");
}
function achievementEarned(arr) {
trace("<< achievement Earned " + arr.length);
showAchievement(arr);
}
function toString() {
return("<< AchievementAS2 >>");
}
function achievementNotificationGameLoaded() {
_moduleConnection.send("achievementNotificationGameLoaded");
}
function achievementNotificationGameStarted() {
_moduleConnection.send("achievementNotificationGameStarted");
}
function achievementNotificationGameEnded() {
_moduleConnection.send("achievementNotificationGameEnded");
}
function achievementNotificationFinished() {
_achievementNotificationFinished = true;
trace("<< Notification Finished");
}
function isAchievmentNotificationFinished() {
var _local1 = _achievementNotificationFinished;
_achievementNotificationFinished = false;
return(_local1);
}
function showAchievement(arr) {
if (!_containerLoaded) {
trace("<< container not loaded");
return(undefined);
}
_displayConnection.send("displayAchievement", arr);
}
static var STATUS_CONNECTING = 0;
static var STATUS_SHOWING_ACHIEVEMENT = 1;
static var STATUS_READY = 2;
static var _uniqueVal = -1;
var _xmlLoaded = false;
var _containerLoaded = false;
}
Symbol 507 MovieClip [__Packages.com.cartoonnetwork.connect.Connection] Frame 0
class com.cartoonnetwork.connect.Connection
{
var _rLC, _sLC, _rConnection, _sConnection, _uniqueClient, _master, _unique, _connectTimer, _connected;
function Connection (rConnection, sConnection, uniqueClient, master) {
_rLC = new LocalConnection();
_sLC = new LocalConnection();
_rConnection = rConnection;
_sConnection = sConnection;
_uniqueClient = uniqueClient;
_master = master;
trace("master : " + _master);
if (_master) {
_unique = Math.floor(Math.random() * 10000);
_rConnection = _rConnection + _unique;
initConnection();
_rLC.connect(_rConnection);
_rLC.client = this;
trace((("<< initing receiver as master with " + _rConnection) + " sender: ") + _sConnection);
var app = this;
_rLC.slaveReceivedUnique = function () {
trace("<< calling slaveReceivedUnique game");
app.slaveReceivedUnique();
};
_rLC.xmlLoaded = function () {
uniqueClient.xmlLoaded();
};
_rLC.achievementEarned = function (arr) {
trace((("<< achievement Earned " + arr[0]) + ", ") + arr[1]);
uniqueClient.achievementEarned(arr);
};
} else {
trace("<< initing slave receiver with " + _rConnection);
_rLC.connect(_rConnection);
_rLC.client = this;
var app = this;
_rLC.setUnique = function (unique) {
trace("<< setting unique from Display" + unique);
app.setUnique(unique);
};
}
}
function initConnection() {
_connectTimer = setInterval(this, "AttemptConnection", 2000);
AttemptConnection();
}
function AttemptConnection() {
trace((("sending unique to " + _sConnection) + " unique val: ") + _unique);
_sLC.send(_sConnection, "setUnique", _unique);
}
function setUnique(unique) {
_unique = unique;
_rConnection = _rConnection + _unique;
_sConnection = _sConnection + _unique;
trace("<< sending message to : " + _sConnection);
_sLC.send(_sConnection, "slaveReceivedUnique");
_rLC.close();
_rLC.connect(_rConnection);
_rLC.client = _uniqueClient;
_connected = true;
}
function slaveReceivedUnique() {
trace(("<< game slave received unique: " + _unique) + " as2 game");
_sConnection = _sConnection + _unique;
trace("_sConnection " + _sConnection);
_connected = true;
clearInterval(_connectTimer);
_rLC.close();
_rLC.connect(_rConnection);
_rLC.client = _uniqueClient;
}
function send(func, args) {
if (args.length > 0) {
trace((((_sConnection + " sending to ") + func) + " the value of ") + args);
_sLC.send(_sConnection, func, args);
} else {
trace("sending func " + func);
_sLC.send(_sConnection, func);
}
}
}
Symbol 508 MovieClip [__Packages.mx.utils.Delegate] Frame 0
class mx.utils.Delegate extends Object
{
var func;
function Delegate (f) {
super();
func = f;
}
static function create(obj, func) {
var _local2 = function () {
var _local2 = arguments.callee.target;
var _local3 = arguments.callee.func;
return(_local3.apply(_local2, arguments));
};
_local2.target = obj;
_local2.func = func;
return(_local2);
}
function createDelegate(obj) {
return(create(obj, func));
}
}
Symbol 509 MovieClip [__Packages.Game] Frame 0
class Game
{
var _$mc, gameData, shotNum, cam, bltNum, state, turn, distances, shooting, faceplant, skidding, bounce, speed, glide, wind, slide, superbounce, rebound, gravOn, bounceNum, superbounceNum, speedNum, glideNum, windNum, slideNum, reboundNum, gravPointsMax, gravPoints, gravButton, powerupCount, cloudCount, bushCount, vCount, tick, glideCnt, glideVals, glideDot, powerupClips, powerupMark, cloudMark, bushMark, vehicleMark, cloudList, bushList, sndTheme, sndEnding, sndPrelude, preludeSound, frCount, frArray, timer, blt, slideSound, skidSound, windSound, gravSound, themeSound, sndFadeInterval, waitInt, jumpInt, bltInt, bc, sndWind, grav, sndGrav, sndSlide, sndFly, sndSkid, sndPickup, sndBump, sndBounce, sndSuperbounce, sndHit, hitClip, sndShoot, yvel, boost, ar, ad, nodesXML, _so, _bestScore;
function Game (mcClip, xmlData) {
_$mc = mcClip;
gameData = xmlData;
shotNum = 0;
init();
hit = false;
}
function init() {
_global.achievementSystem.achievementNotificationGameStarted();
cam = new GameCamera(_$mc, 600, 400);
cam.dis.addEventListener("onDone", this);
bltNum = 0;
state = null;
turn = 1;
distances = new Array();
shooting = false;
faceplant = false;
skidding = false;
bounce = false;
speed = false;
glide = false;
wind = false;
slide = false;
superbounce = false;
rebound = false;
gravOn = false;
falling = false;
bounceNum = 0;
superbounceNum = 0;
speedNum = 0;
glideNum = 0;
windNum = 0;
slideNum = 0;
reboundNum = 0;
gravPointsMax = 100;
gravPoints = 100;
gravButton = false;
updateGravMeter();
powerupCount = 0;
cloudCount = 0;
bushCount = 0;
vCount = 0;
tick = 0;
glideCnt = 0;
glideVals = new Array();
glideDot = 0;
glideVals = [-0.5, -1, -1.5, -2, -1.5, -1, 0, 0.3, 0.5, 0.7, 1, 3, 5, 8, 12, 16, 21, 26, 30, 25, 20, 15, 10, 5, 3];
powerupClips = new Array();
powerupMark = 650;
cloudMark = 400;
bushMark = 650;
vehicleMark = 1200;
cloudList = new Array();
bushList = new Array();
_root.background_mc.spaceBG._y = -4790;
_root.launchMeter._visible = true;
_root.gravMeter._visible = false;
initSounds();
if (cheats) {
Key.addListener(this);
}
initSO();
if (MUSIC_MUTE == true) {
_root.musicBtn.gotoAndStop(1);
sndTheme.setVolume(0);
sndEnding.setVolume(0);
sndPrelude.setVolume(0);
} else {
_root.musicBtn.gotoAndStop(2);
sndTheme.setVolume(MUSIC_VOL);
sndEnding.setVolume(MUSIC_VOL);
sndPrelude.setVolume(MUSIC_VOL);
}
_root.musicBtn.owner = this;
_root.musicBtn.onRelease = function () {
this.owner.toggleMusic();
};
_root.musicBtn.onRollOver = function () {
this.owner.clickFlag = true;
if (this.owner.MUSIC_MUTE == true) {
_root.muteMC.gotoAndStop("musicOff_RO");
} else {
_root.muteMC.gotoAndStop("musicOn_RO");
}
};
_root.musicBtn.onRollOut = function () {
this.owner.clickFlag = false;
if (this.owner.MUSIC_MUTE == true) {
_root.muteMC.gotoAndStop("musicOff");
} else {
_root.muteMC.gotoAndStop("musicOn");
}
};
playSound(sndPrelude, MUSIC_VOL, 9999);
preludeSound = true;
_root.scrollRect = new flash.geom.Rectangle(0, 0, 600, 400);
frCount = 0;
frArray = [];
timer = 0;
}
function loadTracker() {
trace("\n----- loading tracker swf -----\n");
var _local1 = new Date().getTime();
loadMovieNum ("tracker.swf?" + _local1, 100000);
}
function onKeyUp() {
if (Key.getCode() == 39) {
trace("xvel up");
blt.xvel = blt.xvel + 5;
}
if (Key.getCode() == 32) {
paused = !paused;
}
if (Key.getCode() == 49) {
trace("## slide TRUE");
slide = true;
}
if (freemode) {
blt.grav = 0;
if (Key.getCode() == 38) {
blt.yvel = blt.yvel + 5;
}
if (Key.getCode() == 40) {
blt.yvel = blt.yvel - 5;
}
if (Key.getCode() == 37) {
blt.xvel = blt.xvel - 5;
}
}
}
function initSounds() {
_$mc.createEmptyMovieClip("sounds", 10);
createSound("sndShoot", "snd_shoot", "shoot");
createSound("sndFly", "snd_fly", "fly");
createSound("sndWind", "snd_wind", "wind");
createSound("sndBounce", "snd_bounce", "bounce");
createSound("sndSuperbounce", "snd_superbounce", "superbounce");
createSound("sndHit", "snd_hit", "hit");
createSound("sndPickup", "snd_pickup", "pickup");
createSound("sndBump", "snd_bump", "bump");
createSound("sndSlide", "snd_slide", "slide");
createSound("sndSkid", "snd_skid", "skid");
createSound("sndGrav", "snd_wind", "grav");
createSound("sndPrelude", "snd_prelude", "prelude");
createSound("sndTheme", "snd_theme", "theme");
createSound("sndEnding", "snd_ending", "ending");
slideSound = false;
skidSound = false;
windSound = false;
gravSound = false;
preludeSound = false;
themeSound = false;
_root.muteMC.gotoAndStop(2);
}
function createSound(name, linkName, clipName) {
var _local2 = _$mc.sounds.createEmptyMovieClip(clipName, _$mc.sounds.getNextHighestDepth());
this[name] = new Sound(_local2);
this[name].attachSound(linkName);
}
function fadeOutSound(s) {
trace("-- fadeOutSound() ");
clearInterval(sndFadeInterval);
sndFadeInterval = setInterval(this, "doFade", 50, s);
}
function playSound(snd, vol, loops) {
trace(("-- playSound(" + snd) + ")");
snd.setVolume(vol);
if (!loops) {
loops = 0;
}
snd.start(0, loops);
}
function toggleMusic() {
MUSIC_MUTE = !MUSIC_MUTE;
trace("## MUSIC_MUTE = " + MUSIC_MUTE);
if (MUSIC_MUTE == true) {
MUSIC_VOL = 0;
sndPrelude.setVolume(0);
sndTheme.setVolume(0);
sndEnding.setVolume(0);
_root.muteMC.gotoAndStop("musicOff");
} else {
MUSIC_VOL = 60;
sndPrelude.setVolume(MUSIC_VOL);
sndTheme.setVolume(MUSIC_VOL);
sndEnding.setVolume(MUSIC_VOL);
_root.muteMC.gotoAndStop("musicOn");
}
}
function doFade(s) {
var _local2 = s.getVolume() - 3;
s.setVolume(_local2);
if ((_local2 <= 0) || (MUSIC_MUTE == true)) {
s.stop();
clearInterval(sndFadeInterval);
}
}
function resetBtn() {
stopAllSounds();
resetSounds();
clearInterval(waitInt);
clearInterval(jumpInt);
clearInterval(bltInt);
_$mc.hamster._y = 956;
cam.zero();
reset();
}
function reset() {
_global.achievementSystem.achievementNotificationGameStarted();
cleanUp();
playSound(sndPrelude, MUSIC_VOL, 9999);
sndTheme.stop();
_root.launchMeter._visible = true;
_root.launchMeter.gotoAndStop(1);
_root.gravMeter._visible = false;
state = null;
turn = 1;
distances = new Array();
shooting = false;
faceplant = false;
shotNum = 0;
bltNum = 0;
bounce = false;
speed = false;
glide = false;
wind = false;
slide = false;
_root.skate_icon._visible = false;
falling = false;
var _local4 = 6;
while (_local4--) {
_root[("shotDistance" + _local4) + "_txt"].text = "= 0 ft.";
_root[("shotStatus" + _local4) + "_mc"].gotoAndStop(1);
}
_root.distanceTotal_txt.text = "";
_$mc.hamster._visible = true;
_$mc.hamster.gotoAndStop(1);
_$mc.hWalkOut2.gotoAndStop(1);
_$mc.hWalkOut2._x = 30.5;
_$mc.hWalkOut2._visible = true;
_$mc.hWalkOut3.gotoAndStop(1);
_$mc.hWalkOut3._x = 15.5;
_$mc.hWalkOut3._visible = true;
_$mc.hWalkOut4.gotoAndStop(1);
_$mc.hWalkOut4._x = 0.5;
_$mc.hWalkOut4._visible = true;
_$mc.hWalkOut5.gotoAndStop(1);
_$mc.hWalkOut5._x = -14.5;
_$mc.hWalkOut5._visible = true;
_root.gameOver_mc._visible = false;
_root.chalkboard_mc._visible = false;
_local4 = 6;
while (_local4--) {
_$mc["blt" + _local4].removeMovieClip();
}
powerupMark = 650;
cloudMark = 400;
bushMark = 650;
}
function setScore() {
var _local4 = updateDistance();
_global.sendStat(_global.DISTANCE_SINGLE, _global.DISTANCE_SINGLE_ID, _local4);
trace("DISTANCIA >> " + _local4);
distances.push(_local4);
_root[("shotStatus" + turn) + "_mc"].gotoAndStop("on");
_root[("shotDistance" + turn) + "_txt"].text = ("= " + _local4) + " ft.";
}
function updateGameState() {
turn++;
trace("GAME TURN: " + turn);
if (turn == 6) {
gameOver();
} else {
nextHamster();
}
}
function gameOver() {
shooting = true;
_root.gameOver_mc._visible = true;
_root.gameOver_mc.gotoAndPlay(2);
_root.gameOver_mc.mask_mc.gotoAndPlay(2);
_root.chalkboard_mc._visible = true;
sndPrelude.stop();
fadeOutSound(sndTheme);
playSound(sndEnding, MUSIC_VOL);
var _local8 = distances.length;
var _local5 = 0;
while (_local8--) {
_local5 = _local5 + Number(distances[_local8]);
}
_root.distanceTotal_txt.text = ("Total = " + _local5) + " ft.";
_root.gameOver_mc.distanceTotal_txt.text = _local5 + " ft.";
_root.gameOver_mc.finalScore_txt.text = _local5 + " ft.";
_global.sendStat(_global.TOTAL_DISTANCE, _global.TOTAL_DISTANCE_ID, _local5);
_local8 = distances.length;
var _local7 = "";
var _local4 = 0;
while (_local4 < _local8) {
_local7 = _local7 + (distances[_local4] + " ft. \r");
_local4++;
}
_local7 = _local7 + (_local5 + " ft.");
_root.gameOver_mc.shots_txt.text = _local7;
var _local6 = "You just need practice. Don't give up!";
if (_local5 >= 100) {
_local6 = "Keep trying -- you'll get the hang of it!";
}
if (_local5 >= 200) {
_local6 = "Not bad. Can you do even better?";
}
if (_local5 >= 300) {
_local6 = "Nice job!";
}
if (_local5 >= 400) {
_local6 = "Wow! You're a real pro!";
}
if (_local5 >= 600) {
_local6 = "That was totally sweet!";
}
if (_local5 >= 800) {
_local6 = "Hamsterrific!";
}
if (_local5 >= 1000) {
_local6 = "Incredible! You're the hamster champ!";
}
if (checkBestScore(_local5)) {
trace("!!! BEST SCORE EVER !!!");
_local6 = _local6 + "\nYou got a new high score!";
saveBestScore(_local5);
} else {
trace("... not your best score ...");
}
_root.gameOver_mc.rating_txt.text = _local6;
_global.achievementSystem.achievementNotificationGameEnded();
if (flash.external.ExternalInterface.available) {
flash.external.ExternalInterface.call("TopScoresModuleComm.onScore", _local5);
}
}
function onUpdate() {
if (paused) {
return(undefined);
}
frCount++;
frArray.push(Math.floor(10 * (1 / ((getTimer() - timer) / 1000))) / 10);
if (frArray.length > 20) {
frArray.shift();
}
timer = getTimer();
if (frCount > 20) {
frCount = 0;
var _local3 = frArray.length;
var _local4 = 0;
while (_local3--) {
_local4 = _local4 + frArray[_local3];
}
_root.framerate = _local4 / 20;
}
var _local8 = bc._y;
generatePowerups();
generateClouds();
generateBushes();
checkPowerUpsColl();
checkCollision();
if (wind) {
blt.yvel = blt.yvel - 8;
blt.xvel = blt.xvel + 2;
bc.flying_mc._visible = false;
wind = false;
if (!windSound) {
playSound(sndWind, SFX_VOLUME);
windSound = true;
} else {
windSound = false;
}
}
if (gravOn) {
grav = grav - 2;
gravOn = false;
if (!gravSound) {
playSound(sndGrav, SFX_VOLUME);
gravSound = true;
} else {
gravSound = false;
}
}
if (speed) {
blt.xvel = blt.xvel + 20;
speed = false;
}
if (rebound) {
blt.xvel = 40;
blt.yvel = -40;
rebound = false;
blt.doRotation = true;
bc.slide._visible = false;
bc.skid._visible = false;
bc.flying_mc._visible = true;
sndSlide.stop();
slideSound = false;
blt.hit = false;
}
if (slide && (skidding)) {
blt.doRotation = false;
bc.slide._visible = true;
bc.slide.play();
_root.skate_icon._visible = false;
if (!slideSound) {
playSound(sndSlide, SFX_VOLUME, 9999);
sndFly.setVolume(5);
slideSound = true;
} else {
var _local5 = Math.abs(blt.xvel);
_local5 = Math.floor(_local5);
var _local7 = Math.floor((_local5 / 20) * 100);
sndSlide.setVolume(_local7);
}
} else if (skidding) {
blt.doRotation = false;
bc.skid._visible = true;
bc.flying_mc._visible = false;
if (!skidSound) {
playSound(sndSkid, SFX_VOLUME);
sndFly.setVolume(5);
skidSound = true;
}
} else {
var _local5 = Math.abs(blt.xvel) + Math.abs(blt.yvel);
_local5 = Math.floor(_local5);
var _local7 = Math.floor((_local5 / 70) * 100);
sndFly.setVolume(_local7);
}
if (glide) {
if (falling || (gravPoints == 0)) {
glide = false;
glideOff();
}
}
blt.xvel = blt.xvel * 0.99;
if (!freemode) {
blt.yvel = blt.yvel + blt.grav;
}
if ((blt.yvel > 50) && ((!bounce) & (!superbounce))) {
if (falling == false) {
fallOn();
falling = true;
}
} else if (falling == true) {
falling = false;
fallOff();
}
if (blt.hit) {
var _local6 = bc._y;
if (((_local6 >= 946) && (_local8 >= 946)) && ((_local6 + blt.yvel) >= 946)) {
skidding = true;
}
}
blt.update();
cam.doFollow(bc);
if ((blt.xvel < 1) && (blt.hit)) {
onShotDone();
}
if (gravButton) {
gravPoints = gravPoints - 10;
if (gravPoints <= 0) {
gravPoints = 0;
blt.restoreGravity();
}
} else {
gravPoints++;
if (gravPoints > gravPointsMax) {
gravPoints = gravPointsMax;
}
}
updateGravMeter();
}
function fallOn() {
bc.drop._visible = true;
bc.drop.gotoAndPlay(2);
bc.flying_mc._visible = false;
}
function fallOff() {
bc.drop._visible = false;
bc.drop.gotoAndStop(1);
bc.flying_mc._visible = true;
}
function updateGravMeter() {
var _local3 = 1 + Math.floor((100 * gravPoints) / gravPointsMax);
_root.gravMeter.gotoAndStop(_local3);
}
function checkPowerUpsColl(Void) {
var _local5 = cam.getCameraPos().x;
var _local4 = 0;
while (_local4 < powerupClips.length) {
var _local3 = powerupClips[_local4];
if ((_$mc._x + _local3._x) < -100) {
_local3.removeMovieClip();
powerupClips.shift();
} else {
switch (_local3.typ) {
case "bounce" :
if (_local3.core.hitTest(bc.core) && (!bounce)) {
trace("BOUNCE ON!!");
bc.ball._visible = true;
bc.superball._visible = false;
bc.drop._visible = false;
bc.ball.gotoAndPlay(2);
bounce = true;
superbounce = false;
falling = false;
fallOff();
playSound(sndPickup, SFX_VOLUME);
_local3.play();
}
break;
case "superbounce" :
if (_local3.core.hitTest(bc.core) && (!superbounce)) {
trace("SUPERBOUNCE ON!!");
bc.ball._visible = false;
bc.superball._visible = true;
bc.drop._visible = false;
bc.superball.gotoAndPlay(2);
bounce = false;
superbounce = true;
falling = false;
fallOff();
playSound(sndPickup, SFX_VOLUME);
_local3.play();
}
break;
case "speed" :
if (_local3.core.hitTest(bc.core)) {
trace("SPEED ON!! ...hiding flying_mc.");
bc.blur._visible = true;
bc.flying_mc._visible = false;
bc.glide._visible = false;
bc.drop._visible = false;
bc.wind._visible = false;
bc.blur.gotoAndPlay(2);
speed = true;
_local3.play();
}
break;
case "wind" :
if (_local3.core.hitTest(bc.core)) {
trace("WIND ON!!");
if (!glide) {
bc.wind._visible = true;
bc.flying_mc._visible = false;
}
bc.drop._visible = false;
bc.blur._visible = false;
bc.wind.play();
wind = true;
}
break;
case "slide" :
if (_local3.core.hitTest(bc.core) && (!slide)) {
playSound(sndPickup, SFX_VOLUME);
slide = true;
_root.skate_icon._visible = true;
_local3.play();
}
break;
case "rebound" :
if (!(_local3.core.hitTest(bc.core) && (!rebound))) {
break;
}
rebound = true;
if (slide && (skidding)) {
slide = false;
}
skidding = false;
bc.slide.stop();
bc.slide._visible = false;
falling = false;
fallOff();
_local3.play();
}
}
_local4++;
}
}
function checkCollision() {
var _local7 = bc._y + blt.yvel;
if (rebound) {
return(undefined);
}
if (_local7 >= 950) {
bc._y = 950;
blt.hit = true;
if (glide) {
glide = false;
glideOff();
}
var _local11 = bc._x - blt.ox;
var _local10 = _local7 - blt.oy;
var _local3 = Math.atan2(_local10, _local11);
_local3 = radainsToDegrees(_local3);
var _local6 = 70;
if ((((_local3 < _local6) && (!bounce)) && (!superbounce)) && (!slide)) {
trace("NORMAL HIT");
bc._y = 949;
blt.xvel = blt.xvel * f;
blt.yvel = blt.yvel / -2;
if (!skidding) {
_$mc.bg_mc.bounce.removeMovieClip();
var _local4 = _$mc.bg_mc.attachMovie("bounce_fx", "bounce", 900000);
_local4._x = 155 - cam.getCameraPos().x;
_local4._y = 955;
bushCount++;
playSound(sndBump, SFX_VOLUME);
}
} else if (bounce) {
trace("BOUNCE!!");
bc._y = 949;
blt.xvel = blt.xvel * f;
blt.yvel = blt.yvel * -0.6;
if (blt.yvel > -30) {
blt.yvel = -30;
}
bc.ball._visible = false;
bc.drop._visible = false;
bc.flying_mc._visible = true;
playSound(sndBounce, SFX_VOLUME);
var _local4 = _$mc.bg_mc.attachMovie("break", "shatter", 900000);
_local4._x = 165 - cam.getCameraPos().x;
_local4._y = 955;
bounce = false;
blt.hit = false;
} else if (superbounce) {
trace("SUPERBOUNCE!!");
bc._y = 949;
blt.xvel = blt.xvel * (1 + f);
blt.yvel = blt.yvel * -1.5;
if (blt.yvel > -50) {
blt.yvel = -50;
}
bc.superball._visible = false;
bc.drop._visible = false;
bc.flying_mc._visible = true;
playSound(sndSuperbounce, SFX_VOLUME);
var _local4 = _$mc.bg_mc.attachMovie("super_break", "shatter", 900000);
_local4._x = 165 - cam.getCameraPos().x;
_local4._y = 955;
superbounce = false;
blt.hit = false;
} else if (_local3 > _local6) {
trace("STICK IN THE GROUND >>>");
bc._y = 950;
blt.xvel = 0;
blt.yvel = 0;
var _local9 = bc._x;
var _local8 = bc._y;
var _local5 = bc._rotation;
sndFly.stop();
faceplant = true;
if (falling) {
_global.sendStat(_global.HAMSTER_HOLE, _global.HAMSTER_HOLE_ID, 1);
createHitClip(_local9, _local8, _local5, "hole");
blt.shadClip._visible = false;
} else {
createHitClip(_local9, _local8 + 3, _local5, "faceplant");
playSound(sndHit, SFX_VOLUME);
blt.shadClip._visible = false;
}
} else if (slide && (!skidding)) {
trace("SLIDE1");
bc._y = 950;
blt.xvel = blt.xvel * slidef;
blt.yvel = blt.yvel / -2;
playSound(sndBump, SFX_VOLUME);
} else if (slide && (skidding)) {
trace("SLIDE2");
bc._y = 950;
blt.xvel = blt.xvel * slidef;
blt.yvel = blt.yvel / -2;
} else {
trace("OTHER HIT");
bc._y = 950;
blt.xvel = blt.xvel * f;
blt.yvel = blt.yvel / -2;
if (!skidding) {
playSound(sndBump, SFX_VOLUME);
}
}
falling = false;
}
}
function glideOn() {
bc.glide._visible = true;
bc.flying_mc._visible = false;
bc.blur._visible = false;
bc.wind._visible = false;
bc.glide.gotoAndPlay(2);
}
function glideOff() {
bc.glide._visible = false;
if ((bc.wind._visible != true) && (bc.blur._visible != true)) {
bc.flying_mc._visible = true;
} else {
bc.flying_mc._visible = false;
}
bc.glide.gotoAndStop(1);
}
function updateDistance() {
var _local2 = Math.floor(blt.bltClip._x / 100);
if (isNaN(_local2)) {
_local2 = 0;
}
return(_local2);
}
function updateBestDistance() {
if (bc._x > Number(_$mc.best_txt.text)) {
return(Math.floor(bc._x));
}
return(Number(_$mc.best_txt.text));
}
function resetSounds() {
sndFly.stop();
sndSlide.stop();
sndFly.setVolume(100);
sndSlide.setVolume(100);
sndSkid.setVolume(100);
skidSound = false;
slideSound = false;
windSound = false;
}
function onShotDone() {
clearInterval(bltInt);
blt.deleteBlt();
resetSounds();
if ((!faceplant) && (!falling)) {
var _local4 = bc._x;
var _local3 = bc._y;
var _local2 = bc._rotation;
createHitClip(_local4, _local3, _local2, "cheer");
}
blt.shadClip._visible = false;
}
function onDone() {
trace("GAME onDone");
blt = undefined;
slide = false;
_root.skate_icon._visible = false;
skidding = false;
_$mc.hamster._x = 148;
_$mc.hamster._y = 956;
_root.background_mc.pillow._x = 117.3;
_$mc.pillow._x = 117.3;
updateGameState();
cleanUpItems();
}
function nextHamster() {
if (!preludeSound) {
playSound(sndPrelude, MUSIC_VOL, 9999);
}
fadeOutSound(sndTheme);
preludeSound = true;
_root.launchMeter._visible = true;
_root.launchMeter.gotoAndStop(1);
_root.gravMeter._visible = false;
_$mc.hamster._visible = false;
_$mc["hWalkOut" + turn].play();
var _local4 = turn + 1;
var _local3 = _local4;
while (_local3 <= 5) {
_$mc["hWalkOut" + _local3].gotoAndPlay("walkUp");
_local3++;
}
updateGravMeter();
}
function createHitClip(x, y, rot, type, dpth) {
var _local2 = "hit_" + type;
trace("CREATE: " + _local2);
var _local3 = ((dpth == undefined) ? (bltNum) : (100 + bltNum));
hitClip = _$mc.attachMovie(_local2, "blt" + bltNum, _local3);
hitClip._rotation = 90;
hitClip._x = x;
hitClip._y = y;
}
function onMouseDown() {
if (clickFlag == true) {
return(undefined);
}
if ((state == null) && (!shooting)) {
state = "jump";
_$mc.hamster.gotoAndPlay("jump");
_root.background_mc.gotoAndPlay(2);
_root.background_mc.hamsterWheel1.play();
_root.background_mc.hamsterWheel2.play();
} else if ((state == "jump") && (!shooting)) {
_root.background_mc.nextFrame();
_root.background_mc.hamsterWheel1.gotoAndStop(1);
_root.background_mc.hamsterWheel2.gotoAndStop(1);
state = "launch";
playSound(sndShoot, SFX_VOLUME);
launch();
} else if (shooting && (!skidding)) {
blt.increaseGravity();
gravButton = true;
if ((glide == false) && (falling == false)) {
glide = true;
glideOn();
}
}
}
function onMouseUp() {
if (shooting) {
blt.restoreGravity();
gravButton = false;
if (glide == true) {
glide = false;
glideOff();
}
}
}
function jump() {
trace("JUMP LITTLE HAMSTER!!");
bltNum++;
yvel = (random(5) + 10) * -1;
boost = false;
if (jumpInt) {
clearInterval(jumpInt);
}
jumpInt = setInterval(this, "jumpFrame", 50);
}
function jumpFrame() {
if ((!boost) && (_$mc.hamster._y < 930)) {
var _local4 = random(5) + 15;
_local4 = _local4 * -1;
yvel = yvel + _local4;
boost = true;
}
var _local5 = ((yvel >= 0) ? 0.75 : 1.5);
yvel = yvel + _local5;
_$mc.hamster._y = _$mc.hamster._y + yvel;
if (_$mc.hamster._y >= 956) {
clearInterval(jumpInt);
state = null;
_$mc.hamster._y = 956;
_$mc.hamster.gotoAndStop(1);
_$mc.hamster._visible = false;
playSound(sndHit, SFX_VOLUME);
shooting = true;
faceplant = true;
createHitClip(140, 970, 90, "zero", true);
}
if (yvel > 0) {
_root.launchMeter.arrow._rotation = 180;
} else {
_root.launchMeter.arrow._rotation = 0;
}
var _local3 = 48 + (0.35417 * (_$mc.hamster._y - 715));
if (_local3 > 100) {
_local3 = 100;
}
if (_local3 < 10) {
_local3 = 10;
}
_root.launchMeter.arrow._y = _local3;
cam.doFollow(_$mc.hamster);
}
function launch() {
trace("LAUNCH THE HAMSTER");
_$mc.pillow._x = 140;
getPillowCollision();
}
function getPillowCollision() {
if (_$mc.hamster.core.hitTest(_$mc.pillow)) {
if (_$mc.hamster._y > 759) {
_$mc.hamster._y = 759;
yvel = 0;
}
clearInterval(jumpInt);
var _local4 = (_$mc.hamster._x - _$mc.pillow._x) + 30;
var _local3 = (_$mc.hamster._y - _$mc.pillow._y) - 5;
var _local5 = Math.sqrt((_local4 * _local4) + (_local3 * _local3));
ar = Math.atan2(_local3, _local4);
ad = ((ar * 180) / pi) + 90;
ar = (ad * pi) / 180;
trace((((("delta: " + _local5) + " | angle: ") + ar) + " / ") + ad);
trace("Hamster y: " + _$mc.hamster._y);
_$mc.hamster.gotoAndStop(1);
_$mc.hamster._visible = false;
shoot(_local5, ar);
} else {
_root.background_mc.gotoAndPlay("miss");
}
}
function shoot(f, a) {
sndPrelude.stop();
playSound(sndTheme, MUSIC_VOL, 9999);
preludeSound = false;
themeSound = true;
_root.launchMeter._visible = false;
_root.gravMeter._visible = true;
var _local6 = yvel;
var _local3 = 90 - f;
if (_local6 < 0) {
if (ad <= 90) {
_local3 = _local3 - (yvel / 2);
trace("add: " + (yvel / 2));
} else {
_local3 = _local3 + (yvel / 2);
trace("add: " + (yvel / 2));
}
}
faceplant = false;
shooting = true;
var _local4 = _$mc.hamster._x;
var _local5 = _$mc.hamster._y;
trace((("X: " + _local4) + ", Y: ") + _local5);
blt = new Bullet(_$mc, _local4, _local5, "arrow", _local3, ar, 0.99, bltNum);
bc = blt.bltClip;
setCamFollow();
playSound(sndFly, SFX_VOLUME, 9999);
gravPoints = gravPointsMax;
updateGravMeter();
bltInt = setInterval(this, "onUpdate", 50);
}
function cleanUp(Void) {
shooting = false;
state = null;
tick = 0;
glideCnt = 0;
}
function testShoot(y, f) {
_$mc.hamster.gotoAndStop("testFrame");
_$mc.hamster._y = y;
yvel = f;
launch();
}
function setCamFollow() {
cam.setCamMode("follow");
cam.setQuickPanSpeed(2);
cam.follow("blt" + bltNum);
}
function setCamReset() {
clearInterval(waitInt);
cam.setCamMode("qpan");
cam.setQuickPanSpeed(2);
cam.reset();
}
function degreesToRadians(degrees) {
var _local2 = (degrees * pi) / 180;
return(_local2);
}
function radainsToDegrees(radians) {
var _local2 = (radians * 180) / pi;
return(_local2);
}
function generateClouds() {
var _local4 = cam.getCameraPos();
var _local3 = _local4.x;
var _local9 = _local4.y;
if (cloudList[0]._x < (-120 - _local3)) {
var _local8 = cloudList.shift();
_local8.removeMovieClip();
}
if ((600 - _local3) < cloudMark) {
return(undefined);
}
var _local6 = 700 - random(3600);
var _local7 = random(3) + 1;
var _local5 = "c" + cloudCount;
var _local2 = _$mc.bg_mc.attachMovie("cloud" + _local7, _local5, 10000 + cloudCount);
cloudList.push(_local2);
_local2.cacheAsBitmap = true;
_local2._x = 800 - _local3;
_local2._y = _local6;
cloudCount++;
cloudMark = cloudMark + (100 + random(200));
}
function generateBushes() {
var _local4 = cam.getCameraPos();
var _local3 = _local4.x;
var _local8 = _local4.y;
if (bushList[0]._x < (-100 - _local3)) {
var _local7 = bushList.shift();
_local7.removeMovieClip();
}
if ((600 - _local3) < bushMark) {
return(undefined);
}
var _local6 = random(5) + 1;
var _local5 = "c" + bushCount;
var _local2 = _$mc.bg_mc.attachMovie("bush" + _local6, _local5, 20000 + bushCount);
bushList.push(_local2);
_local2.cacheAsBitmap = true;
_local2._x = 800 - _local3;
_local2._y = 885;
bushCount++;
bushMark = bushMark + (300 + random(300));
}
function generatePowerups() {
var _local4 = cam.getCameraPos();
var _local5 = _local4.x;
var _local6 = _local4.y;
if ((600 - _local5) < powerupMark) {
return(undefined);
}
powerupMark = powerupMark + 150;
powerupCount++;
var _local3 = random(11);
var _local2;
switch (_local3) {
case 0 :
case 1 :
_local2 = _$mc.opp_mc.attachMovie("_bounce", "bounce" + bounceNum, powerupCount);
_local2.typ = "bounce";
bounceNum++;
break;
case 2 :
case 3 :
case 4 :
_local2 = _$mc.opp_mc.attachMovie("_speed", "speed" + speedNum, powerupCount);
_local2.cacheAsBitmap = true;
_local2.typ = "speed";
speedNum++;
break;
case 5 :
case 6 :
case 7 :
_local2 = _$mc.opp_mc.attachMovie("_wind", "wind" + windNum, powerupCount);
_local2.typ = "wind";
windNum++;
break;
case 8 :
_local2 = _$mc.opp_mc.attachMovie("_slide", "slide" + slideNum, powerupCount);
_local2.cacheAsBitmap = true;
_local2.typ = "slide";
slideNum++;
break;
case 9 :
_local2 = _$mc.opp_mc.attachMovie("_rebound", "rebound" + reboundNum, powerupCount);
_local2.cacheAsBitmap = true;
_local2.typ = "rebound";
reboundNum++;
break;
case 10 :
_local2 = _$mc.opp_mc.attachMovie("_superbounce", "superbounce" + superbounceNum, powerupCount);
_local2.typ = "superbounce";
superbounceNum++;
}
_local2._x = 800 - _local5;
if (_local3 == 9) {
_local2._y = 930;
} else {
_local2._y = 840 - random(1200);
}
powerupClips.push(_local2);
}
function generateVehicle() {
var _local3 = cam.getCameraPos();
var _local4 = _local3.x;
var _local6 = _local3.y;
if ((600 - _local4) < vehicleMark) {
return(undefined);
}
vehicleMark = vehicleMark + 1200;
vCount++;
var _local5 = random(2);
var _local2;
switch (_local5) {
case 0 :
_local2 = _$mc.bg_mc.attachMovie("v_bus", "vehicle", 15000);
break;
case 1 :
_local2 = _$mc.bg_mc.attachMovie("v_scamper", "vehicle", 15000);
break;
case 2 :
_local2 = _$mc.bg_mc.attachMovie("v_plane", "vehicle", 15000);
}
_local2._x = 800 - _local4;
_local2._y = 840 - random(1200);
}
function cleanUpItems() {
var _local3 = powerupClips.length;
while (_local3--) {
var _local2 = powerupClips.pop();
_local2.removeMovieClip();
}
_local3 = cloudList.length;
while (_local3--) {
var _local2 = cloudList.pop();
_local2.removeMovieClip();
}
_local3 = bushList.length;
while (_local3--) {
var _local2 = bushList.pop();
_local2.removeMovieClip();
}
bounceNum = 0;
speedNum = 0;
glideNum = 0;
windNum = 0;
slideNum = 0;
powerupMark = 600;
bushMark = 650;
cloudMark = 400;
}
function plotNodes(oXML) {
var _local7 = nodesXML.getNode(["bounce"]).childNodes;
var _local2 = _local7.length;
var _local8 = 0;
while (_local2--) {
var _local3 = "bounce" + _local2;
var _local6 = _local7[_local2].attributes.x;
var _local5 = _local7[_local2].attributes.y;
var _local4 = _$mc.opp_mc.attachMovie("_bounce", _local3, _local8 + _local2);
_local4._x = _local6;
_local4._y = _local5 - 1000;
_local4.typ = "bounce";
bounceNum++;
}
_local7 = nodesXML.getNode(["speed"]).childNodes;
_local2 = _local7.length;
_local8 = 50;
while (_local2--) {
var _local3 = "speed" + _local2;
var _local6 = _local7[_local2].attributes.x;
var _local5 = _local7[_local2].attributes.y;
var _local4 = _$mc.opp_mc.attachMovie("_speed", _local3, _local8 + _local2);
_local4._x = _local6;
_local4._y = _local5 - 1000;
_local4.typ = "speed";
speedNum++;
}
_local7 = nodesXML.getNode(["glide"]).childNodes;
_local2 = _local7.length;
_local8 = 100;
while (_local2--) {
var _local3 = "glide" + _local2;
var _local6 = _local7[_local2].attributes.x;
var _local5 = _local7[_local2].attributes.y;
var _local4 = _$mc.opp_mc.attachMovie("_glide", _local3, _local8 + _local2);
_local4._x = _local6;
_local4._y = _local5 - 1000;
_local4.typ = "glide";
glideNum++;
}
_local7 = nodesXML.getNode(["wind"]).childNodes;
_local2 = _local7.length;
_local8 = 150;
while (_local2--) {
var _local3 = "wind" + _local2;
var _local6 = _local7[_local2].attributes.x;
var _local5 = _local7[_local2].attributes.y;
var _local4 = _$mc.opp_mc.attachMovie("_wind", _local3, _local8 + _local2);
_local4._x = _local6;
_local4._y = _local5 - 1000;
windNum++;
}
_local7 = nodesXML.getNode(["slide"]).childNodes;
_local2 = _local7.length;
_local8 = 200;
while (_local2--) {
var _local3 = "slide" + _local2;
var _local6 = _local7[_local2].attributes.x;
var _local5 = _local7[_local2].attributes.y;
var _local4 = _$mc.opp_mc.attachMovie("_slide", _local3, _local8 + _local2);
_local4._x = _local6;
_local4._y = _local5 - 1000;
_local4.typ = "slide";
slideNum++;
}
_local7 = nodesXML.getNode(["ring"]).childNodes;
_local2 = _local7.length;
_local8 = 250;
_$mc.createEmptyMovieClip("ringFront_mc", 5000);
while (_local2--) {
var _local3 = "ring" + _local2;
var _local6 = _local7[_local2].attributes.x;
var _local5 = _local7[_local2].attributes.y;
var _local4 = _$mc.ringFront_mc.attachMovie("_ring", _local3, _local8 + _local2);
_local4._x = _local6;
_local4._y = _local5 - 1000;
_local4 = _$mc.opp_mc.attachMovie("_ringBack", _local3, _local8 + _local2);
_local4._x = _local6;
_local4._y = _local5 - 1000;
}
}
function getPos() {
_root.pos_txt.text = (Math.floor(bc._x) + ", ") + Math.floor(bc._y);
}
function initSO(Void) {
_so = new CartoonSO("HamsterLaunch");
if (_so._info._bestScore == undefined) {
_so._info._bestScore = 0;
_so._info._careerScore = 0;
}
_bestScore = _so._info._bestScore;
}
function checkBestScore(s) {
trace("### checkBestScore(): _bestScore=" + _bestScore);
if (s > _bestScore) {
return(true);
}
return(false);
}
function saveBestScore(s) {
_bestScore = s;
_so._info._bestScore = _bestScore;
}
var cheats = false;
var paused = false;
var freemode = false;
var MUSIC_MUTE = false;
var MUSIC_VOL = 80;
var SFX_VOLUME = 100;
var pi = 3.141593;
var f = 0.6;
var slidef = 0.99;
var hit = false;
var falling = false;
var clickFlag = false;
}
Symbol 510 MovieClip [__Packages.Bullet] Frame 0
class Bullet
{
var mcBase, xpos, ypos, mcName, vel, ang, grav, num, doRotation, xvel, yvel, ox, bltClip, oy, shadClip;
function Bullet (base, x, y, name, velocity, angle, gravity, bNumber) {
mcBase = base;
xpos = x;
ypos = y;
mcName = name;
vel = velocity;
ang = angle;
grav = gravity;
num = ((bNumber == undefined) ? 1 : (bNumber));
doRotation = true;
init();
}
function init(Void) {
createClip();
setClipPos();
xvel = Math.sin(ang) * vel;
yvel = (-Math.cos(ang)) * vel;
}
function update() {
ox = bltClip._x;
oy = bltClip._y;
var _local2 = Math.atan2(yvel, xvel);
_local2 = radainsToDegrees(_local2);
if (((xvel < 7) && (bltClip._y > 940)) || (doRotation == false)) {
_local2 = 0;
}
bltClip._rotation = _local2 + 90;
bltClip._x = bltClip._x + xvel;
bltClip._y = bltClip._y + yvel;
shadClip._x = bltClip._x;
shadClip._y = 963;
var _local3 = (100 * (bltClip._y - 700)) / 263;
shadClip._xscale = (shadClip._yscale = _local3);
}
function increaseGravity(n) {
grav = -0.17 * xvel;
}
function restoreGravity() {
grav = 0.99;
}
function deleteBlt() {
trace("DELETE");
}
function createClip(Void) {
trace("### creating bullet clip " + num);
bltClip = mcBase.attachMovie(mcName, "blt" + num, num);
shadClip = mcBase.attachMovie("shadow", "shadow_mc", 0);
}
function setClipPos(Void) {
bltClip._x = xpos;
bltClip._y = ypos;
bltClip._rotation = ang;
}
function degreesToRadians(degrees) {
var _local2 = (degrees * pi) / 180;
return(_local2);
}
function radainsToDegrees(radians) {
var _local2 = (radians * 180) / pi;
return(_local2);
}
function toString() {
return("Bullet:" + bltClip);
}
var hit = false;
var pi = 3.141593;
}
Symbol 511 MovieClip [__Packages.GameCamera] Frame 0
class GameCamera
{
var _$mc, camHeight, camWidth, dis, gameClipRect, bgClipRect, lockSpacer, moveInt, qpan_time, panAngle, xvel, yvel, delta, target, pan_speed, moving, newTarget, mode;
function GameCamera (gameClip, cWidth, cHeight) {
_$mc = gameClip;
camHeight = cHeight;
camWidth = cWidth;
dis = new MyDispatcher();
if (clipper == true) {
gameClipRect = new flash.geom.Rectangle(0, 600, 600, 400);
bgClipRect = new flash.geom.Rectangle(0, 0, 600, 400);
_$mc._y = _$mc._y + 600;
_$mc.scrollRect = gameClipRect;
_root.background_mc.scrollRect = bgClipRect;
}
lockSpacer = false;
}
function reset() {
clearInterval(moveInt);
qpan_time = 2;
quickPanTo(300, 800);
}
function zero() {
cameraX = 0;
cameraY = 0;
_$mc._x = 0;
_$mc._y = -600;
_root.background_mc._x = 0;
_root.background_mc._y = 0;
}
function follow(targClip) {
var _local3 = _$mc[targClip]._x;
var _local2 = _$mc[targClip]._y;
if (moveInt != undefined) {
clearInterval(moveInt);
}
}
function doFollow(targClip) {
var _local4 = (-targClip._x) + 150;
var _local6 = (-targClip._y) + 200;
if (_local4 < 0) {
_$mc._x = _local4;
}
if (_local6 > -600) {
_$mc._y = _local6;
} else {
_$mc._y = -600;
}
if ((_local4 > -650) && (_local4 <= 0)) {
_root.background_mc._x = _local4;
}
if (_local6 < 4170) {
var _local5 = _local6 + 600;
if ((_local5 < 0) && (_local5 < 1)) {
_local5 = 0;
}
_root.background_mc._y = _local5;
}
if (_$mc._y > 3300) {
if (!lockSpacer) {
lockSpacer = true;
_global.sendStat(_global.HAMSTER_SPACE, _global.HAMSTER_SPACE_ID, 1);
}
_root.background_mc.spaceBG.stars._x = 665 + (_$mc._x % 705);
_root.background_mc.spaceBG.stars._y = -320 + (_$mc._y % 282);
} else {
lockSpacer = false;
}
updateHills();
}
function getCameraPos() {
return({x:_$mc._x, y:_$mc._y});
}
function panTo(x, y, targClip) {
if (targClip != undefined) {
var _local3 = _$mc[targClip]._x;
var _local2 = _$mc[targClip]._y;
} else {
var _local3 = x;
var _local2 = y;
}
panAngle = getPanAngle(_local3, _local2);
xvel = Math.sin(panAngle) * 20;
yvel = (-Math.cos(panAngle)) * 20;
delta = getDelta(_local3, _local2);
if (moveInt != undefined) {
clearInterval(moveInt);
}
moveInt = setInterval(this, "doPanTo", 50, _local3, _local2);
}
function quickPanTo(x, y, targClip) {
if (targClip != undefined) {
var _local3 = _$mc[targClip]._x;
var _local2 = _$mc[targClip]._y;
target = _$mc[targClip];
} else {
var _local3 = x;
var _local2 = y;
}
panAngle = getPanAngle(_local3, _local2);
xvel = Math.floor(Math.cos(panAngle) * qpan_time);
yvel = Math.floor(Math.sin(panAngle) * qpan_time);
delta = getDelta(_local3, _local2);
cameraTargetX = -_$mc._x;
cameraTargetY = -_$mc._y;
if (moveInt != undefined) {
clearInterval(moveInt);
}
moveInt = setInterval(this, "doQuickPanTo", 50, _local3, _local2);
}
function doPanTo(x, y) {
var _local6 = (_$mc._x - (camWidth / 2)) * -1;
var _local4 = (_$mc._y - (camHeight / 2)) * -1;
var _local10 = x;
var _local9 = y;
var _local3 = _local6 - x;
var _local2 = _local4 - y;
var _local5 = Math.floor(Math.sqrt((_local3 * _local3) + (_local2 * _local2)));
_$mc._x = _$mc._x + (-xvel);
if (_local5 < pan_speed) {
moving = false;
target = newTarget;
_$mc._x = (-x) + (camWidth / 2);
_$mc._y = (-y) + (camHeight / 2);
clearInterval(moveInt);
}
}
function doQuickPanTo(x, y) {
var _local7 = (_$mc._x - (camWidth / 2)) * -1;
var _local5 = (_$mc._y - (camHeight / 2)) * -1;
var _local11 = x;
var _local10 = y;
var _local4 = _local7 - x;
var _local3 = _local5 - y;
var _local6 = Math.floor(Math.sqrt((_local4 * _local4) + (_local3 * _local3)));
cameraTargetX = cameraTargetX - (_local4 / qpan_time);
cameraTargetY = cameraTargetY - (_local3 / qpan_time);
_$mc._x = -cameraTargetX;
_$mc._y = -cameraTargetY;
if (cameraTargetX < 600) {
_root.background_mc._x = -cameraTargetX;
}
if (_local6 < 2) {
if (mode == "follow") {
clearInterval(moveInt);
moveInt = setInterval(this, "doFollow", 50, target);
} else {
clearInterval(moveInt);
moving = false;
target = newTarget;
_$mc._x = (-x) + (camWidth / 2);
_$mc._y = (-y) + (camHeight / 2);
dis.disOnDone();
}
}
updateHills();
}
function updateHills() {
_root.background_mc.ground.hills._x = ((-_root.background_mc._x) - 1249) + (0.025 * _$mc._x);
var _local3 = (-1.05 * _$mc._y) - 950;
if (_local3 < -390) {
_local3 = -390;
}
_root.background_mc.ground.hills._y = _local3;
}
function getDelta(x, y) {
var _local3 = _$mc._x - x;
var _local2 = _$mc._y - y;
var _local4 = Math.sqrt((_local3 * _local3) + (_local2 * _local2));
return(_local4);
}
function getPanAngle(x, y) {
var _local2 = Math.atan2(y - _$mc._y, x - _$mc._x);
return(_local2);
}
function moveToTarget(mcTarget) {
}
function setCamMode(cMode, args) {
mode = cMode;
}
function setPanSpeed(pSpeed) {
pan_speed = pSpeed;
}
function setQuickPanSpeed(n) {
qpan_time = n;
}
var cameraTargetX = 0;
var cameraTargetY = 0;
var cameraX = 0;
var cameraY = 0;
var clipper = false;
}
Symbol 512 MovieClip [__Packages.MyDispatcher] Frame 0
class MyDispatcher
{
var dispatchEvent;
function MyDispatcher () {
mx.events.EventDispatcher.initialize(this);
}
function disOnDone() {
dispatchEvent({type:"onDone"});
}
function disOnUpdate() {
dispatchEvent({type:"onUpdate"});
}
}
Symbol 513 MovieClip [__Packages.mx.events.EventDispatcher] Frame 0
class mx.events.EventDispatcher
{
function EventDispatcher () {
}
static function _removeEventListener(queue, event, handler) {
if (queue != undefined) {
var _local4 = queue.length;
var _local1;
_local1 = 0;
while (_local1 < _local4) {
var _local2 = queue[_local1];
if (_local2 == handler) {
queue.splice(_local1, 1);
return(undefined);
}
_local1++;
}
}
}
static function initialize(object) {
if (_fEventDispatcher == undefined) {
_fEventDispatcher = new mx.events.EventDispatcher();
}
object.addEventListener = _fEventDispatcher.addEventListener;
object.removeEventListener = _fEventDispatcher.removeEventListener;
object.dispatchEvent = _fEventDispatcher.dispatchEvent;
object.dispatchQueue = _fEventDispatcher.dispatchQueue;
}
function dispatchQueue(queueObj, eventObj) {
var _local7 = "__q_" + eventObj.type;
var _local4 = queueObj[_local7];
if (_local4 != undefined) {
var _local5;
for (_local5 in _local4) {
var _local1 = _local4[_local5];
var _local3 = typeof(_local1);
if ((_local3 == "object") || (_local3 == "movieclip")) {
if (_local1.handleEvent != undefined) {
_local1.handleEvent(eventObj);
}
if (_local1[eventObj.type] != undefined) {
if (exceptions[eventObj.type] == undefined) {
_local1[eventObj.type](eventObj);
}
}
} else {
_local1.apply(queueObj, [eventObj]);
}
}
}
}
function dispatchEvent(eventObj) {
if (eventObj.target == undefined) {
eventObj.target = this;
}
this[eventObj.type + "Handler"](eventObj);
dispatchQueue(this, eventObj);
}
function addEventListener(event, handler) {
var _local3 = "__q_" + event;
if (this[_local3] == undefined) {
this[_local3] = new Array();
}
_global.ASSetPropFlags(this, _local3, 1);
_removeEventListener(this[_local3], event, handler);
this[_local3].push(handler);
}
function removeEventListener(event, handler) {
var _local2 = "__q_" + event;
_removeEventListener(this[_local2], event, handler);
}
static var _fEventDispatcher = undefined;
static var exceptions = {move:1, draw:1, load:1};
}
Symbol 514 MovieClip [__Packages.XML_Loader] Frame 0
class XML_Loader extends XML
{
var ignoreWhite, parseXML, _callbackFunction, _callbackParent, load, firstChild;
function XML_Loader (sXML) {
super();
trace("new XML_Loader()");
ignoreWhite = true;
if (sXML) {
parseXML(sXML);
}
}
function setXML(sXML) {
parseXML(sXML);
}
function getXML(sURL, callbackParent, callbackFunction) {
_callbackFunction = callbackFunction;
_callbackParent = callbackParent;
trace((("load XML for " + _callbackParent) + " then do ") + _callbackFunction);
load(sURL);
}
function onLoad(success) {
if (success) {
} else {
trace("ERROR: could not load XML");
_root.onError("Could not load XML");
}
_callbackParent[_callbackFunction].apply(_callbackParent, [this]);
}
function getNode(nodeNamesAr) {
var _local5;
var _local3 = nodeNamesAr.shift();
var _local2 = firstChild.firstChild;
while (_local2 != null) {
if (_local2.nodeName == _local3) {
if (nodeNamesAr.length == 0) {
_local5 = _local2;
break;
}
_local2 = _local2.firstChild;
_local3 = nodeNamesAr.shift();
} else {
_local2 = _local2.nextSibling;
}
}
return(_local5);
}
}
Symbol 515 MovieClip [__Packages.CartoonSO] Frame 0
class CartoonSO
{
var _$gameName, _$so;
function CartoonSO (gName) {
_$gameName = gName;
_$so = SharedObject.getLocal(_$USERS_SO, _$USERS_SO_PATH);
}
function get _info() {
if (_$so.data[_$gameName] == undefined) {
_$so.data[_$gameName] = {};
}
return(_$so.data[_$gameName]);
}
static var _$USERS_SO = "CN_users";
static var _$USERS_SO_PATH = "/";
}
Symbol 52 MovieClip Frame 4
this.gotoAndPlay(1);
Symbol 53 MovieClip Frame 1
stop();
Symbol 53 MovieClip Frame 23
var sndJump = new Sound();
sndJump.attachSound("snd_jump");
sndJump.start();
sndJump.onSoundComplete = function () {
delete sndJump;
};
Symbol 53 MovieClip Frame 28
this.core._visible = false;
this._y = this._y - 117.8;
_root.hamsterShoot.jump();
stop();
Symbol 53 MovieClip Frame 36
stop();
Symbol 54 MovieClip Frame 1
stop();
Symbol 54 MovieClip Frame 15
stop();
_root.hamsterShoot.cleanUp();
this._visible = false;
_parent.hamster._visible = true;
_parent.hamster.gotoAndStop(1);
Symbol 54 MovieClip Frame 26
this._x = this._x + 15;
this.gotoAndStop(1);
Symbol 55 MovieClip Frame 1
stop();
Symbol 55 MovieClip Frame 15
stop();
_parent.hamster._visible = true;
_parent.hamster.gotoAndStop(1);
this._visible = false;
Symbol 82 MovieClip Frame 1
stop();
Symbol 115 MovieClip Frame 1
stop();
Symbol 115 MovieClip Frame 33
this.gotoAndStop(1);
Symbol 117 MovieClip Frame 1
stop();
Symbol 117 MovieClip Frame 30
this.gotoAndStop(1);
Symbol 146 MovieClip Frame 1
stop();
Symbol 146 MovieClip Frame 4
stop();
Symbol 146 MovieClip Frame 5
play();
Symbol 146 MovieClip Frame 7
this.gotoAndStop(1);
Symbol 146 MovieClip Frame 49
gotoAndStop (1);
Symbol 150 MovieClip [break] Frame 4
stop();
Symbol 154 MovieClip [super_break] Frame 4
stop();
Symbol 162 MovieClip Frame 1
stop();
Symbol 162 MovieClip Frame 12
trace("clip is hiding itself");
_parent.flying_mc._visible = true;
this._visible = false;
this.gotoAndStop(1);
Symbol 178 MovieClip Frame 1
stop();
Symbol 178 MovieClip Frame 11
gotoAndStop (1);
Symbol 182 MovieClip [bounce_fx] Frame 4
stop();
Symbol 210 MovieClip [dot] Frame 11
this.removeMovieClip();
Symbol 214 MovieClip Frame 1
stop();
Symbol 214 MovieClip Frame 62
stop();
Symbol 236 MovieClip Frame 1
this.pillow._visible = false;
Symbol 253 MovieClip Frame 20
Symbol 259 Button
on (release) {
_root.hamsterShoot.reset();
}
Symbol 261 MovieClip Frame 1
stop();
Symbol 261 MovieClip Frame 81
stop();
Symbol 274 MovieClip Frame 1
stop();
Symbol 281 MovieClip Frame 1
stop();
Symbol 281 MovieClip Frame 17
this.gotoAndPlay(2);
Symbol 293 MovieClip Frame 1
stop();
Symbol 293 MovieClip Frame 7
this.gotoAndPlay(2);
Symbol 307 MovieClip Frame 1
stop();
Symbol 307 MovieClip Frame 5
if (_root.hamsterShoot.wind == true) {
this.gotoAndPlay(2);
} else {
this._visible = false;
_parent.flying_mc._visible = true;
this.gotoAndStop(1);
}
Symbol 308 MovieClip Frame 8
Symbol 314 MovieClip Frame 1
stop();
Symbol 314 MovieClip Frame 2
_parent.flying_mc._visible = false;
this._visible = true;
Symbol 314 MovieClip Frame 7
this.gotoAndPlay(3);
Symbol 332 MovieClip Frame 1
stop();
Symbol 332 MovieClip Frame 11
gotoAndStop (1);
Symbol 333 MovieClip [arrow] Frame 1
glide._visible = false;
wind._visible = false;
ball._visible = false;
superball._visible = false;
slide._visible = false;
blur._visible = false;
skid._visible = false;
drop._visible = false;
core._visible = false;
stop();
Symbol 353 MovieClip [hit_cheer] Frame 1
Symbol 353 MovieClip [hit_cheer] Frame 9
_root.hamsterShoot.setScore();
Symbol 353 MovieClip [hit_cheer] Frame 27
var l = _root.hamsterShoot.distances.length;
var txt = (_root.hamsterShoot.distances[l - 1] + " ft.");
distance_txt.text = txt;
distance1_txt.text = txt;
Symbol 353 MovieClip [hit_cheer] Frame 50
_root.hamsterShoot.setCamReset();
stop();
Symbol 367 MovieClip [hit_hole] Frame 1
Symbol 367 MovieClip [hit_hole] Frame 9
_root.hamsterShoot.setScore();
Symbol 367 MovieClip [hit_hole] Frame 27
var l = _root.hamsterShoot.distances.length;
var txt = (_root.hamsterShoot.distances[l - 1] + " ft.");
distance_txt.text = txt;
distance1_txt.text = txt;
Symbol 367 MovieClip [hit_hole] Frame 50
_root.hamsterShoot.setCamReset();
stop();
Symbol 374 MovieClip [hit_faceplant] Frame 1
Symbol 374 MovieClip [hit_faceplant] Frame 20
_root.hamsterShoot.createHitClip(this._x, this._y, this._rotation, "cheer");
stop();
Symbol 380 MovieClip [hit_zero] Frame 36
this._x = 220;
_root.hamsterShoot.createHitClip(this._x, this._y, this._rotation, "cheer", true);
_root.background_mc.gotoAndStop(1);
stop();
Symbol 397 MovieClip Frame 1
stop();
Symbol 404 MovieClip Frame 1
stop();
Symbol 409 MovieClip Frame 1
stop();
Symbol 409 MovieClip Frame 2
stop();
Symbol 454 MovieClip [_bounce] Frame 1
stop();
this.core._visible = false;
Symbol 454 MovieClip [_bounce] Frame 7
stop();
Symbol 462 MovieClip [_rebound] Frame 1
stop();
this.core._visible = false;
Symbol 462 MovieClip [_rebound] Frame 9
gotoAndStop (1);
Symbol 463 MovieClip [_slide] Frame 1
stop();
this.core._visible = false;
Symbol 463 MovieClip [_slide] Frame 7
stop();
Symbol 465 MovieClip [_speed] Frame 1
stop();
this.core._visible = false;
Symbol 465 MovieClip [_speed] Frame 8
stop();
Symbol 466 MovieClip [_superbounce] Frame 1
stop();
this.core._visible = false;
Symbol 466 MovieClip [_superbounce] Frame 7
stop();
Symbol 467 MovieClip [_wind] Frame 1
this.core._visible = false;
Symbol 487 MovieClip Frame 1
stop();
Symbol 488 Button
on (release) {
gotoAndStop (6);
}
Symbol 501 MovieClip Frame 1
stop();
Symbol 503 Button
on (release) {
stopAllSounds();
this.chalkboard_mc._visible = false;
this.nextFrame();
}
Symbol 505 Button
on (release) {
hamsterShoot.resetBtn();
}