Frame 1
Stage.showMenu = false;
fscommand ("fullscreen", "false");
fscommand ("allowscale", "false");
Frame 4
stop();
Frame 15
stop();
_global.doDebug = function () {
trace("debugging");
};
com.studiocom.islandhop.IslandHop.Main(this, 0, 0);
Symbol 28 MovieClip [JumperClip] Frame 1
stop();
Symbol 28 MovieClip [JumperClip] Frame 13
gotoAndStop ("stand");
Symbol 28 MovieClip [JumperClip] Frame 28
stop();
Symbol 44 MovieClip Frame 1
perc = Math.round((_parent.getBytesLoaded() / _parent.getBytesTotal()) * 100);
xperc = perc / 100;
barlength = 200;
if ((perc == 100) and (bar._width == barlength)) {
_parent.gotoAndPlay("main");
} else {
nperc = perc + "%";
bar._width = barlength * xperc;
bar._x = -100 + (bar._width / 2);
}
Symbol 226 MovieClip [__Packages.com.studiocom.islandhop.Floater] Frame 0
class com.studiocom.islandhop.Floater extends MovieClip
{
var onEnterFrame, gotoAndPlay;
function Floater () {
super();
}
static function createFloater(floaterClip, target, scale, x, y, direction, step) {
var _local1 = target.attachMovie(floaterClip, "floater_" + (_global.nextLevel++), _global.nextLevel);
_local1.init(floaterClip, x, y, scale, direction, step);
return(_local1);
}
function init(floaterType, x, y, scale, direction, step) {
var _local1 = this;
mx.events.EventDispatcher.initialize(_local1);
_local1.floaterType = floaterType;
_local1._xscale = scale;
_local1._yscale = scale;
_local1.floatWidth = _local1._width;
_local1.direction = direction;
_local1._x = x;
if (_local1.direction == "right") {
_local1.step = step;
} else {
_local1.step = -step;
}
if (y != null) {
_local1._y = y;
}
}
function start() {
onEnterFrame = function () {
this.moveFloater();
};
}
function stop() {
var _local1 = this;
_local1.onEnterFrame = null;
if (_local1.floaterType != "FloaterShark") {
_local1.gotoAndStop(1);
}
}
function reset() {
var _local1 = this;
if (_local1.direction == "right") {
_local1._x = -130 - (_local1.getBounds(_local1._parent).xMax - _local1.getBounds(_local1._parent).xMin);
} else {
_local1._x = 630 + (130 + _local1.getBounds(_local1._parent).xMin);
}
}
function moveFloater() {
var _local1 = this;
_local1._x = _local1._x + _local1.step;
_local1.dispatchEvent({type:"onRide", target:_local1});
if (_local1.direction == "right") {
if (_local1.getBounds(_local1._parent).xMax > 630) {
_local1.reset();
}
} else if (_local1.getBounds(_local1._parent).xMin < -130) {
_local1.reset();
}
}
function eat() {
gotoAndPlay("eat");
}
var rightMargin = Stage.width;
}
Symbol 227 MovieClip [__Packages.mx.events.EventDispatcher] Frame 0
class mx.events.EventDispatcher
{
function EventDispatcher () {
}
static function _removeEventListener(queue, event, handler) {
var _local3 = queue;
if (_local3 != undefined) {
var l = _local3.length;
var _local1;
_local1 = 0;
while (_local1 < l) {
var _local2 = _local3[_local1];
if (_local2 == handler) {
_local3.splice(_local1, 1);
return;
}
_local1++;
}
}
}
static function initialize(object) {
var _local1 = object;
if (_fEventDispatcher == undefined) {
_fEventDispatcher = new mx.events.EventDispatcher();
}
_local1.addEventListener = _fEventDispatcher.addEventListener;
_local1.removeEventListener = _fEventDispatcher.removeEventListener;
_local1.dispatchEvent = _fEventDispatcher.dispatchEvent;
_local1.dispatchQueue = _fEventDispatcher.dispatchQueue;
}
function dispatchQueue(queueObj, eventObj) {
var _local2 = eventObj;
var queueName = ("__q_" + _local2.type);
var queue = queueObj[queueName];
if (queue != undefined) {
var i;
for (i in queue) {
var _local1 = queue[i];
var _local3 = typeof(_local1);
if ((_local3 == "object") || (_local3 == "movieclip")) {
if (_local1.handleEvent != undefined) {
_local1.handleEvent(_local2);
}
if (_local1[_local2.type] != undefined) {
if (exceptions[_local2.type] == undefined) {
_local1[_local2.type](_local2);
}
}
} else {
_local1.apply(queueObj, [_local2]);
}
}
}
}
function dispatchEvent(eventObj) {
var _local1 = eventObj;
var _local2 = this;
if (_local1.target == undefined) {
_local1.target = _local2;
}
_local2[_local1.type + "Handler"](_local1);
_local2.dispatchQueue(_local2, _local1);
}
function addEventListener(event, handler) {
var _local2 = this;
var _local1 = "__q_" + event;
if (_local2[_local1] == undefined) {
_local2[_local1] = new Array();
}
_global.ASSetPropFlags(_local2, _local1, 1);
_removeEventListener(_local2[_local1], event, handler);
_local2[_local1].push(handler);
}
function removeEventListener(event, handler) {
var _local1 = "__q_" + event;
_removeEventListener(this[_local1], event, handler);
}
static var _fEventDispatcher = undefined;
static var exceptions = {move:1, draw:1};
}
Symbol 228 MovieClip [__Packages.com.studiocom.islandhop.HomeScreen] Frame 0
class com.studiocom.islandhop.HomeScreen extends MovieClip
{
function HomeScreen () {
var _local1 = this;
super();
mx.events.EventDispatcher.initialize(_local1);
_local1.btnPlay.onRelease = function (e) {
this._parent.dispatchEvent({type:"onPlayClicked", target:this._parent});
};
}
}
Symbol 229 MovieClip [__Packages.com.studiocom.islandhop.Fire] Frame 0
class com.studiocom.islandhop.Fire extends MovieClip
{
var _x, _y;
function Fire () {
super();
_x = 255;
_y = 130;
}
}
Symbol 230 MovieClip [__Packages.com.studiocom.islandhop.Boat] Frame 0
class com.studiocom.islandhop.Boat extends MovieClip
{
var onEnterFrame;
function Boat () {
var _local1 = this;
super();
_local1.timer = com.studiocom.utils.Timer.getInstance();
_local1.xMin = 0;
_local1.xMax = 400;
_local1._y = 75;
_local1.reset();
}
function reset() {
var _local1 = this;
_local1.gotoAndStop("start");
_local1._xscale = 100;
_local1._xscale = 100;
_local1._x = _local1.xMin;
}
function startBoat() {
onEnterFrame = function () {
this.stepBoat();
};
}
function stopBoat() {
onEnterFrame = null;
}
function stepBoat() {
var _local1 = this;
var _local2 = _local1.timer.__get__percentElapsed();
_local1._x = _local1.xMax - (_local1.xMax * (_local2 / 100));
_local1._xscale = _local2;
_local1._yscale = _local2;
}
function win() {
var _local1 = this;
_local1.onEnterFrame = null;
_local1._x = _local1.xMax;
_local1._xscale = 100;
_local1._yscale = 100;
_local1.gotoAndStop("win");
}
}
Symbol 231 MovieClip [__Packages.com.studiocom.utils.Timer] Frame 0
class com.studiocom.utils.Timer
{
var _mode, __get__mode, _now, _duration, _intervalId;
function Timer () {
var _local1 = this;
mx.events.EventDispatcher.initialize(_local1);
_local1._mode = "minutes";
_local1._direction = "down";
_local1._duration = 60;
_local1.reset();
}
static function getInstance() {
if (_instance == null) {
_instance = new com.studiocom.utils.Timer();
}
return(_instance);
}
function set duration(value) {
var _local1 = this;
if (value > 0) {
_local1._duration = value;
_local1.reset();
}
//return(_local1.__get__duration());
}
function set mode(value) {
var _local1 = value;
if ((_local1 == "minutes") || (_local1 == "seconds")) {
_mode = _local1;
}
//return(__get__mode());
}
function set direction(value) {
var _local1 = this;
if ((_local1.__get__direction() == "up") || (_local1.__get__direction() == "down")) {
_local1._direction = value;
}
//return(_local1.__get__direction());
}
function get seconds() {
return(_now);
}
function get totalSeconds() {
return(_duration);
}
function get percentElapsed() {
var _local3 = this;
var _local2 = getTimer() - _local3._startMs;
var _local1 = _local3._endMs - _local3._startMs;
return((1 - (_local2 / _local1)) * 100);
}
function start() {
var _local1 = this;
_local1.stop();
_local1._startMs = getTimer();
_local1._endMs = _local1._startMs + (_local1._duration * 1000);
if (_local1._step > 0) {
_local1._startMs = _local1._startMs - (_local1._now * 1000);
_local1._endMs = _local1._endMs - (_local1._now * 1000);
} else {
_local1._startMs = _local1._startMs - ((_local1._duration - _local1._now) * 1000);
_local1._endMs = _local1._endMs - ((_local1._duration - _local1._now) * 1000);
}
_local1._intervalId = setInterval(_local1.tick, 1000, _local1);
}
function stop() {
if (_intervalId != 0) {
clearInterval(_intervalId);
}
}
function tick(owner) {
owner.stepClock();
}
function stepClock() {
var _local1 = this;
_local1._now = _local1._now + _local1._step;
_local1.dispatchEvent({type:"onTick", target:_local1, time:_local1.getTime()});
if (_local1._now == _local1._end) {
_local1.timeOut();
}
}
function timeOut() {
var _local1 = this;
_local1.stop();
_local1.dispatchEvent({type:"onTimeOut", target:_local1, time:_local1.getTime()});
}
function getTime() {
var _local2 = this;
if (_local2._mode == "minutes") {
var _local3 = Math.floor(_local2._now / 60);
var secs = (_local2._now % 60);
var _local1 = "";
if (_local3 < 10) {
_local1 = _local1 + "0";
}
_local1 = _local1 + String(_local3);
_local1 = _local1 + ":";
if (secs < 10) {
_local1 = _local1 + "0";
}
_local1 = _local1 + String(secs);
return(_local1);
}
return(String(_local2._now));
}
function reset() {
var _local1 = this;
if (_local1._direction == "down") {
_local1._now = _local1._duration;
_local1._end = 0;
_local1._step = -1;
} else {
_local1._now = 0;
_local1._end = _local1._duration;
_local1._step = 1;
}
}
static var _instance = null;
}
Symbol 232 MovieClip [__Packages.com.studiocom.islandhop.GameOverScreen] Frame 0
class com.studiocom.islandhop.GameOverScreen extends MovieClip
{
function GameOverScreen () {
var _local1 = this;
super();
mx.events.EventDispatcher.initialize(_local1);
_local1.txtScore.text = "Score " + String(com.studiocom.utils.Score.getInstance().getScore());
_local1.btnPlayAgain.onRelease = function () {
this._parent.dispatchEvent({type:"onPlayAgain", target:this._parent});
};
_local1.btnSubmitScore.onRelease = function () {
this._parent.dispatchEvent({type:"onSubmitScore", target:this._parent});
};
}
}
Symbol 233 MovieClip [__Packages.com.studiocom.utils.Score] Frame 0
class com.studiocom.utils.Score
{
var _score;
function Score () {
mx.events.EventDispatcher.initialize(this);
_score = 0;
}
static function getInstance() {
if (_instance == null) {
_instance = new com.studiocom.utils.Score();
}
return(_instance);
}
function getScore() {
return(_score);
}
function setScore(value) {
var _local1 = this;
_local1._score = value;
_local1.dispatchEvent({type:"onScoreUpdate", target:_local1, score:_local1._score});
}
function increase(value) {
setScore(_score + value);
}
function decrease(value) {
setScore(_score - value);
}
function getHighScore() {
var _local1 = SharedObject.getLocal("highscore");
if (_local1.data.highscore == undefined) {
return(0);
}
return(_local1.data.highscore);
}
function setHighScore() {
var _local2 = this;
if (_local2._score > _local2.getHighScore()) {
var _local1 = SharedObject.getLocal("highscore");
_local1.data.highscore = _local2._score;
_local1.flush();
}
}
static var _instance = null;
}
Symbol 234 MovieClip [__Packages.com.studiocom.islandhop.IslandHop] Frame 0
class com.studiocom.islandhop.IslandHop
{
static var LEVEL_NUM, TRIP_NUM;
var gameOver_mc, score, lvSubmit, jumper;
function IslandHop (target, x, y) {
var _local1 = this;
_global.nextLevel = 0;
_local1.game_mc = target.createEmptyMovieClip("game_mc", _global.nextLevel++);
_local1.game_mc._x = x;
_local1.game_mc._y = y;
_local1.game_mc_mask = target.attachMovie("Top Mask", "game_mc_mask", 10000);
_local1.game_mc_mask._x = 4;
_local1.game_mc_mask._y = 5;
_local1.game_mc.setMask(_local1.game_mc_mask);
_local1.sounds = com.studiocom.islandhop.SoundFx.getInstance();
_local1.lvSubmit = new LoadVars();
_local1.lvSubmit.load("submit_url.as");
_local1.showHome(_local1.game_mc);
}
static function Main(target, x, y) {
var islandHop = (new com.studiocom.islandhop.IslandHop(target, x, y));
}
function showHome(target) {
var _local2 = this;
var _local1 = target.attachMovie("HomeScreen", "home_mc", _global.nextLevel++);
_local1._x = 0;
_local1._y = 0;
_local1.addEventListener("onPlayClicked", _local2);
_local2.sounds.stop();
_local2.sounds.intro();
}
function onPlayClicked(e) {
var _local1 = this;
var _local2 = e;
_local1.sounds.stopIntro();
_local2.target.removeEventListener("onPlayClicked", _local1);
_local2.target.removeMovieClip();
delete _local2.target;
_local1.buildGame();
_local1.startGame();
}
function buildGame() {
var _local1 = this;
var _local2 = _global;
_local1.timer = com.studiocom.utils.Timer.getInstance();
_local1.timer.addEventListener("onTimeOut", _local1);
_local1.timer.__set__duration(TIMER_LENGTH);
_local1.score = com.studiocom.utils.Score.getInstance();
_local1.bg_mc = _local1.game_mc.attachMovie("BackgroundClip", "bg_mc", _local2.nextLevel++);
_local1.boat_mc = _local1.game_mc.attachMovie("BoatClip", "boat_mc", _local2.nextLevel++);
_local1.island_mc = _local1.game_mc.attachMovie("IslandClip", "island_mc", _local2.nextLevel++);
_local1.fire_mc = _local1.game_mc.attachMovie("FireClip", "fire_mc", _local2.nextLevel++);
_local1.grid = com.studiocom.islandhop.Grid.getInstance(_local1.game_mc, false);
_local1.jumper = com.studiocom.islandhop.Jumper.getInstance(_local1.game_mc, 60);
_local1.overlay = com.studiocom.islandhop.Overlay.getInstance(_local1.game_mc);
_local1.arrowListener = com.studiocom.utils.ArrowListener.getInstance();
_local1.arrowListener.addEventListener("onArrowPressed", _local1);
}
function startGame() {
var _local1 = this;
_local1.score.setScore(0);
LEVEL_NUM = 1;
_local1.lives = MAX_LIVES;
_local1.overlay.setLives(_local1.lives);
_local1.overlay.setHighScore(_local1.score.getHighScore());
_local1.rain_mc.removeMovieClip();
_local1.startLevel();
}
function startLevel() {
var _local1 = this;
TRIP_NUM = 1;
_local1.timer.reset();
_local1.boat_mc.reset();
_local1.startTrip();
_local1.sounds.game();
}
function startTrip() {
var _local1 = this;
_local1.overlay.updateLevel(LEVEL_NUM, TRIP_NUM);
_local1.grid.reset(LEVEL_NUM, TRIP_NUM);
_local1.jumper.reset();
_local1.jumper.addEventListener("onTripComplete", _local1);
_local1.jumper.addEventListener("onDie", _local1);
_local1.grid.startFloaters();
_local1.timer.start();
_local1.boat_mc.startBoat();
_local1.fire_mc.gotoAndStop("trip" + TRIP_NUM);
_local1.arrowListener.__set__enabled(true);
}
function onTimeOut(e) {
var _local1 = this;
_local1.endTrip();
_local1.lives = 0;
_local1.rain_mc = _local1.game_mc.attachMovie("RainClip", "rain_mc", _global.nextLevel++);
_local1.rain_mc._x = 170;
_local1.rain_mc._y = 45;
_local1.fire_mc.gotoAndStop("trip1");
_local1.sounds.rain();
_local1.sounds.stopGame();
_local1.pauseForAnimId = setInterval(_local1.pauseForAnim, 3000, _local1, _local1.processDie);
}
function onDie(e) {
var _local1 = this;
_local1.endTrip();
_local1.lives--;
_local1.overlay.setLives(_local1.lives);
_local1.pauseForAnimId = setInterval(_local1.pauseForAnim, 2000, _local1, _local1.processDie);
}
function onTripComplete() {
var _local1 = this;
_local1.endTrip();
var _local2 = 2000;
if (TRIP_NUM == 6) {
_local1.fire_mc.gotoAndStop("fire");
_local1.boat_mc.win();
_local1.sounds.stopGame();
_local1.sounds.boat();
_local1.sounds.fire();
_local2 = 4000;
}
if (TRIP_NUM == 4) {
_local1.sounds.smoke1();
} else if (TRIP_NUM == 5) {
_local1.sounds.smoke2();
}
_local1.pauseForAnimId = setInterval(_local1.pauseForAnim, _local2, _local1, _local1.processTripComplete);
}
function processDie(owner) {
var _local1 = owner;
if (_local1.lives == 0) {
_local1.gameOver(_local1);
} else {
_local1.startTrip();
}
}
function processTripComplete(owner) {
var _local1 = owner;
if (TRIP_NUM == 6) {
var _local2 = _local1.timer.seconds * LEVEL_NUM;
LEVEL_NUM++;
_local1.sounds.boat2();
_local1.score.increase(_local2);
_local1.showPoints(_local2);
} else {
TRIP_NUM++;
_local1.startTrip();
}
}
function pauseForAnim(owner, functionName) {
clearInterval(owner.pauseForAnimId);
functionName(owner);
}
function endTrip(win) {
var _local1 = this;
_local1.timer.stop();
_local1.grid.stopFloaters();
_local1.boat_mc.stopBoat();
_local1.arrowListener.__set__enabled(false);
_local1.jumper.removeEventListener("onWin", _local1);
_local1.jumper.removeEventListener("onDie", _local1);
}
function showPoints(bonus) {
var _local1 = this;
_local1.levelComplete_mc = _local1.game_mc.attachMovie("LevelCompleteClip", "levelComplete_mc", _global.nextLevel++);
_local1.levelComplete_mc._x = GAME_WIDTH / 2;
_local1.levelComplete_mc._y = GAME_HEIGHT / 2;
_local1.levelComplete_mc.txtLevel.text = ("LEVEL " + String(LEVEL_NUM - 1)) + " COMPLETE";
_local1.levelComplete_mc.txtTime.text = "Time " + _local1.timer.getTime();
_local1.levelComplete_mc.txtBonus.text = "Bonus Points " + String(bonus);
_local1.pauseForAnimId = setInterval(_local1.hidePoints, 5000, _local1);
}
function hidePoints(owner) {
var _local1 = owner;
clearInterval(_local1.pauseForAnimId);
_local1.levelComplete_mc.removeMovieClip();
_local1.startLevel();
}
function gameOver(owner) {
var _local1 = this;
_local1.gameOver_mc = _local1.game_mc.attachMovie("GameOverClip", "gameOver_mc", _global.nextLevel++);
_local1.gameOver_mc._x = GAME_WIDTH / 2;
_local1.gameOver_mc._y = GAME_HEIGHT / 2;
_local1.gameOver_mc.addEventListener("onPlayAgain", owner);
_local1.gameOver_mc.addEventListener("onSubmitScore", owner);
_local1.sounds.gameOver();
_local1.score.setHighScore();
}
function onPlayAgain(e) {
gameOver_mc.removeMovieClip();
startGame();
}
function onSubmitScore(e) {
getURL ((lvSubmit.submitUrl + "?score=") + score.getScore(), "_blank");
}
function onArrowPressed(e) {
jumper.jump(e.arrow);
}
static var GAME_WIDTH = 500;
static var GAME_HEIGHT = 400;
static var MAX_TRIPS = 6;
static var MAX_LIVES = 3;
static var TIMER_LENGTH = 90;
}
Symbol 235 MovieClip [__Packages.com.studiocom.islandhop.Overlay] Frame 0
class com.studiocom.islandhop.Overlay
{
var overlay_mc;
function Overlay (target) {
var _local1 = this;
_local1.overlay_mc = target.attachMovie("OverlayClip", "overlay_mc", 100000);
_local1.timer = com.studiocom.utils.Timer.getInstance();
_local1.overlay_mc.txtTime.text = _local1.timer.getTime();
_local1.timer.addEventListener("onTick", _local1);
_local1.score = com.studiocom.utils.Score.getInstance();
_local1.score.addEventListener("onScoreUpdate", _local1);
_local1.overlay_mc.txtScore.text = _local1.score.getScore();
_local1.overlay_mc.btnMute.owner = _local1;
_local1.overlay_mc.btnMute.onRelease = function () {
this.owner.muteSound();
this.play();
};
}
static function getInstance(target) {
if (_instance == null) {
_instance = new com.studiocom.islandhop.Overlay(target);
}
return(_instance);
}
static function deleteInstance() {
if (_instance != null) {
_instance.overlay_mc.removeMovieClip();
delete _instance.overlay_mc;
delete _instance;
_instance = null;
}
}
function muteSound() {
com.studiocom.islandhop.SoundFx.getInstance().mute();
}
function onTick(e) {
overlay_mc.txtTime.text = e.time;
}
function updateLevel(level, trip) {
overlay_mc.txtLevel.text = level;
overlay_mc.txtTrip.text = trip;
}
function onScoreUpdate(e) {
overlay_mc.txtScore.text = e.score;
}
function setHighScore(value) {
overlay_mc.txtHighScore.text = value;
}
function setLives(value) {
var _local1 = this;
switch (value) {
case 1 :
_local1.overlay_mc.lifeHat1._visible = false;
_local1.overlay_mc.lifeHat1._visible = false;
return;
case 2 :
_local1.overlay_mc.lifeHat1._visible = true;
_local1.overlay_mc.lifeHat2._visible = false;
return;
case 3 :
_local1.overlay_mc.lifeHat1._visible = true;
_local1.overlay_mc.lifeHat2._visible = true;
}
}
static var _instance = null;
}
Symbol 236 MovieClip [__Packages.com.studiocom.islandhop.SoundFx] Frame 0
class com.studiocom.islandhop.SoundFx
{
var sndIntro, sndEat, sndBoat, sndBoat2, sndFire, sndSmoke1, sndSmoke2, sndSide, sndTimeout, sndGame, sndSplash, sndRain, sndJump;
function SoundFx () {
var _local1 = this;
_local1._mute = false;
_local1.sndIntro = new Sound();
_local1.sndGame = new Sound();
_local1.sndGameOver = new Sound();
_local1.sndSplash = new Sound();
_local1.sndEat = new Sound();
_local1.sndBoat = new Sound();
_local1.sndBoat2 = new Sound();
_local1.sndFire = new Sound();
_local1.sndSmoke1 = new Sound();
_local1.sndSmoke2 = new Sound();
_local1.sndSide = new Sound();
_local1.sndTimeout = new Sound();
_local1.sndRain = new Sound();
_local1.sndTransition = new Sound();
_local1.sndJump = new Sound();
_local1.sndJump.attachSound("jump.wav");
}
static function getInstance() {
if (_instance == null) {
_instance = new com.studiocom.islandhop.SoundFx();
}
return(_instance);
}
function stop() {
sndIntro.stop();
}
function mute() {
var _local2 = this;
var _local1;
if (_local2._mute) {
_local1 = 100;
_local2._mute = false;
} else {
_local1 = 0;
_local2._mute = true;
}
_local2.sndEat.setVolume(_local1);
}
function bite() {
sndEat.attachSound("bite2.wav");
sndEat.start();
}
function boat() {
sndBoat.attachSound("Boat_leaving_v1.wav");
sndBoat.start();
}
function boat2() {
sndBoat2.attachSound("boat_leaving_short.wav");
sndBoat2.start();
}
function fire() {
var _local1 = this;
_local1.stopSmoke2();
_local1.sndFire.attachSound("burning.wav");
_local1.sndFire.start();
}
function stopFire() {
sndFire.stop("burning.wav");
}
function smoke1() {
sndSmoke1.attachSound("fire_burning.wav");
sndSmoke1.start();
}
function stopSmoke1() {
sndSmoke1.stop("fire_burning.wav");
}
function smoke2() {
var _local1 = this;
_local1.stopSmoke1();
_local1.sndSmoke2.attachSound("fire1.wav");
_local1.sndSmoke2.start();
}
function stopSmoke2() {
sndSmoke2.stop("fire1.wav");
}
function gameOver() {
var _local1 = this;
_local1.stopGame();
_local1.sndGameOver.attachSound("game_over.wav");
_local1.sndGameOver.start();
}
function side() {
sndSide.attachSound("boing5.wav");
sndSide.start();
}
function timeOut() {
sndTimeout.attachSound("cuckoocl.wav");
sndTimeout.start();
}
function intro() {
sndIntro.attachSound("intro_short.wav");
sndIntro.start(0, 10000);
}
function stopIntro() {
sndIntro.stop("intro_short.wav");
}
function game() {
sndGame.attachSound("Full_low.wav");
sndGame.start(0, 10000);
}
function stopGame() {
sndGame.stop("Full_low.wav");
}
function splash() {
sndSplash.attachSound("splash.wav");
sndSplash.start(0.3);
}
function rain() {
sndRain.attachSound("storm_stars.wav");
sndRain.start();
}
function transition() {
var _local1 = this;
_local1.stopGame();
_local1.sndTransition.attachSound("Transition_loop.wav");
_local1.sndTransition.start();
}
function jump() {
sndJump.start(0.2);
}
static var _instance = null;
}
Symbol 237 MovieClip [__Packages.com.studiocom.islandhop.Jumper] Frame 0
class com.studiocom.islandhop.Jumper
{
var startScale, jumperClip;
function Jumper (target, scale) {
var _local1 = this;
_local1.target = target;
_local1.jumperClip = target.attachMovie("JumperClip", "jumper", _global.nextLevel++);
_local1.jumperClip.match_mc._visible = false;
_local1.jumperClip.wood_mc._visible = false;
_local1.jumperClip.leaf_mc._visible = false;
_local1.jumpDistance = JUMP_DISTANCE;
}
static function getInstance(target, scale) {
if (_instance == null) {
_instance = new com.studiocom.islandhop.Jumper(target);
_instance.init(scale);
}
return(_instance);
}
static function deleteInstance() {
if (_instance != null) {
_instance.jumperClip.removeMovieClip();
delete _instance.jumperClip;
delete _instance;
_instance = null;
}
}
function init(scale) {
var _local1 = this;
mx.events.EventDispatcher.initialize(_local1);
_local1.sounds = com.studiocom.islandhop.SoundFx.getInstance();
_local1.startScale = scale;
_local1.jumperClip._xscale = _local1.startScale;
_local1.jumperClip._yscale = _local1.startScale;
_local1.jumperClip._x = com.studiocom.islandhop.IslandHop.GAME_WIDTH / 2;
_local1.jumperClip._y = com.studiocom.islandhop.Grid.getInstance().getLaneY(com.studiocom.islandhop.Grid.getInstance().__get__currentLane());
_local1.currentFloater = null;
_local1.setCarryObject();
}
function jump(direction) {
var _local1 = this;
_local1.sounds.jump();
var _local2 = com.studiocom.islandhop.Grid.getInstance();
_local1.jumperClip.gotoAndPlay("jump");
switch (direction) {
case "up" :
_local2.__set__currentLane(_local2.__get__currentLane() - 1);
_local1.jumpDistance = _local1.jumpDistance - 3;
_local1.setScale(_local2.__get__currentLane());
_local1.jumperClip._y = _local2.getLaneY(_local2.__get__currentLane());
if (_local2.__get__currentLane() == 0) {
if ((_local1.jumperClip._x > 220) && (_local1.jumperClip._x < 285)) {
_local1.dispatchEvent({type:"onTripComplete", target:_local1});
} else {
_local1.sounds.splash();
_local1.die();
}
return;
}
// unexpected jump
case "down" :
_local2.__set__currentLane(_local2.__get__currentLane() + 1);
_local1.jumpDistance = _local1.jumpDistance + 3;
_local1.setScale(_local2.__get__currentLane());
_local1.jumperClip._y = _local2.getLaneY(_local2.__get__currentLane());
// unexpected jump
case "left" :
if (_local1.jumperClip.getBounds(_local1.target).xMin > 0) {
_local1.jumperClip._x = _local1.jumperClip._x - _local1.jumpDistance;
}
// unexpected jump
case "right" :
if (_local1.jumperClip.getBounds(_local1.target).xMax < com.studiocom.islandhop.IslandHop.GAME_WIDTH) {
_local1.jumperClip._x = _local1.jumperClip._x + _local1.jumpDistance;
}
default :
var myLane = _local2.getLane(_local2.__get__currentLane());
var _local3 = myLane.checkHit(_local1.jumperClip);
if (_local1.currentFloater != _local3) {
_local1.currentFloater.removeEventListener("onRide", _local1);
_local1.currentFloater.removeEventListener("onDie", _local1);
_local1.currentFloater.removeEventListener("onOutOfBounds", _local1);
_local1.currentFloater = _local3;
}
if (_local1.currentFloater != null) {
_local1.floaterXOffset = _local1.jumperClip._x - _local1.currentFloater._x;
_local1.currentFloater.addEventListener("onRide", _local1);
_local1.currentFloater.addEventListener("onDie", _local1);
_local1.currentFloater.addEventListener("onOutOfBounds", _local1);
if (_local1.currentFloater.floaterType == "FloaterShark") {
_local1.currentFloater.eat();
_local1.jumperClip.swapDepths(_local1.currentFloater);
_local1.sounds.bite();
_local1.die();
} else if (direction == "up") {
com.studiocom.utils.Score.getInstance().increase(10);
}
} else {
if (_local2.__get__currentLane() == (com.studiocom.islandhop.Grid.NUM_LANES - 1)) {
break;
}
_local1.sounds.splash();
_local1.die();
}
}
}
function onRide(e) {
var _local1 = this;
_local1.jumperClip._x = e.target._x + _local1.floaterXOffset;
var _local2 = _local1.jumperClip.getBounds(_level0.game_mc);
if ((_local2.xMin < 0) || (_local2.xMax > com.studiocom.islandhop.IslandHop.GAME_WIDTH)) {
_local1.sounds.side();
_local1.currentFloater.removeEventListener("onRide", _local1);
_local1.currentFloater.removeEventListener("onDie", _local1);
_local1.currentFloater.removeEventListener("onOutOfBounds", _local1);
_local1.die();
}
}
function onDie(e) {
var _local1 = this;
_local1.currentFloater.removeEventListener("onRide", _local1);
_local1.currentFloater.removeEventListener("onDie", _local1);
_local1.currentFloater.removeEventListener("onOutOfBounds", _local1);
_local1.die();
}
function die() {
var _local1 = this;
_local1.jumperClip.gotoAndPlay("fall");
_local1.dispatchEvent({type:"onDie", target:_local1});
}
function win() {
var _local1 = this;
_local1.currentFloater.removeEventListener("onRide", _local1);
_local1.currentFloater.removeEventListener("onDie", _local1);
_local1.currentFloater.removeEventListener("onOutOfBounds", _local1);
_local1.dispatchEvent({type:"onTripComplete", target:_local1});
}
function reset() {
var _local1 = this;
_local1.jumperClip._xscale = _local1.startScale;
_local1.jumperClip._yscale = _local1.startScale;
_local1.currentFloater = null;
_local1.jumperClip.gotoAndStop("stand");
_local1.jumperClip._x = com.studiocom.islandhop.IslandHop.GAME_WIDTH / 2;
_local1.jumperClip._y = com.studiocom.islandhop.Grid.getInstance().getLaneY(com.studiocom.islandhop.Grid.getInstance().__get__currentLane());
_local1.jumperClip.swapDepths(_global.nextLevel++);
_local1.jumpDistance = JUMP_DISTANCE;
_local1.setCarryObject();
}
function setCarryObject() {
var _local1 = this;
_local1.jumperClip.match_mc._visible = false;
_local1.jumperClip.wood_mc._visible = false;
_local1.jumperClip.leaf_mc._visible = false;
if (com.studiocom.islandhop.IslandHop.TRIP_NUM > 1) {
var _local2 = Math.floor(Math.random() * 2);
if (_local2 < 1) {
_local1.jumperClip.wood_mc._visible = true;
} else {
_local1.jumperClip.leaf_mc._visible = true;
}
} else {
_local1.jumperClip.match_mc._visible = true;
}
}
function setScale(laneNum) {
var minPct = 30;
var _local1 = startScale;
var _local3 = (_local1 - minPct) / com.studiocom.islandhop.Grid.NUM_LANES;
var factor = (com.studiocom.islandhop.Grid.NUM_LANES - laneNum);
var _local2 = _local1 - (_local3 * factor);
jumperClip._xscale = _local2;
jumperClip._yscale = _local2;
}
static var _instance = null;
static var JUMP_DISTANCE = 25;
}
Symbol 238 MovieClip [__Packages.com.studiocom.islandhop.Grid] Frame 0
class com.studiocom.islandhop.Grid
{
var target, showBorder, lanes, _currentLane;
function Grid (target, showBorder) {
this.target = target;
this.showBorder = showBorder;
}
static function getInstance(target, showBorder) {
if (_instance == null) {
_instance = new com.studiocom.islandhop.Grid(target, showBorder);
}
return(_instance);
}
function init(difficulty) {
}
function build(level, trip) {
var _local2 = this;
_local2.lanes = new Array();
_local2._currentLane = 6;
var _local3 = 15;
var _local1 = TOP - 20;
var laneIncrement = 7;
var scale = 30;
var myLane;
myLane = new com.studiocom.islandhop.Lane(_local2.target, _local1, _local1 + _local3, null, "right", (scale = scale + 10), level, trip, _local2.showBorder);
_local2.lanes.push(myLane);
_local1 = _local1 + _local3;
_local3 = _local3 + laneIncrement;
myLane = new com.studiocom.islandhop.Lane(_local2.target, _local1, _local1 + _local3, "FloaterLeaf", "right", (scale = scale + 10), level, trip, _local2.showBorder);
_local2.lanes.push(myLane);
_local1 = _local1 + _local3;
_local3 = _local3 + laneIncrement;
myLane = new com.studiocom.islandhop.Lane(_local2.target, _local1, _local1 + _local3, "FloaterLog", "left", (scale = scale + 10), level, trip, _local2.showBorder);
_local2.lanes.push(myLane);
_local1 = _local1 + _local3;
_local3 = _local3 + laneIncrement;
myLane = new com.studiocom.islandhop.Lane(_local2.target, _local1, _local1 + _local3, "FloaterRing", "right", (scale = scale + 10), level, trip, _local2.showBorder);
_local2.lanes.push(myLane);
_local1 = _local1 + _local3;
_local3 = _local3 + laneIncrement;
myLane = new com.studiocom.islandhop.Lane(_local2.target, _local1, _local1 + _local3, "FloaterLog", "left", (scale = scale + 10), level, trip, _local2.showBorder);
_local2.lanes.push(myLane);
_local1 = _local1 + _local3;
_local3 = _local3 + laneIncrement;
myLane = new com.studiocom.islandhop.Lane(_local2.target, _local1, _local1 + _local3, "FloaterLeaf", "right", (scale = scale + 10), level, trip, _local2.showBorder);
_local2.lanes.push(myLane);
_local1 = _local1 + _local3;
_local3 = _local3 + laneIncrement;
myLane = new com.studiocom.islandhop.Lane(_local2.target, _local1, _local1 + _local3, null, "right", (scale = scale + 10), level, trip, _local2.showBorder);
_local2.lanes.push(myLane);
}
function getLaneY(laneNum) {
return(lanes[laneNum].centerY);
}
function get currentLane() {
return(_currentLane);
}
function set currentLane(value) {
var _local1 = value;
if ((_local1 < NUM_LANES) && (_local1 >= 0)) {
_currentLane = _local1;
}
//return(currentLane);
}
function getLane(laneNum) {
return(lanes[laneNum]);
}
function startFloaters() {
var _local2 = this;
var _local1 = 0;
while (_local1 < _local2.lanes.length) {
_local2.lanes[_local1].start();
_local1++;
}
}
function stopFloaters() {
var _local2 = this;
var _local1 = 0;
while (_local1 < _local2.lanes.length) {
_local2.lanes[_local1].stop();
_local1++;
}
}
function reset(level, trip) {
var _local2 = this;
var _local1 = 0;
while (_local1 < _local2.lanes.length) {
_local2.lanes[_local1].clear();
_local1++;
}
_local2.build(level, trip);
_local2.startFloaters();
}
static var _instance = null;
static var NUM_LANES = 7;
static var TOP = 145;
static var HEIGHT = 180;
}
Symbol 239 MovieClip [__Packages.com.studiocom.islandhop.Lane] Frame 0
class com.studiocom.islandhop.Lane
{
var _centerY, floaters;
function Lane (target, topY, bottomY, floaterType, direction, scale, level, trip, showBorder) {
var _local1 = this;
var _local3 = direction;
_local1.floaters = new Array();
_local1.floaterType = floaterType;
_local1._centerY = topY + ((bottomY - topY) / 2);
_local1.buildWidth = -130;
_local1.blankSpace = 20;
if (level <= 2) {
var min = (level * 0.4);
var max = (level * 2);
} else if (level <= 4) {
var min = (level * 0.3);
var max = (level * 1.5);
} else {
var min = (level * 0.2);
var max = (level * 1);
}
var rate = (Math.round(Math.random() * (max - min)) + min);
var logsArray = new Array();
logsArray.push("FloaterLogSmall");
logsArray.push("FloaterLogMedium");
logsArray.push("FloaterLogLarge");
if (floaterType != null) {
var continueLoop = true;
do {
if ((Math.random() * 100) > ((trip * 10) + 10)) {
var doShark = (Math.random() * 100);
var _local2;
if ((doShark < 3) && (_local3 == "right")) {
_local2 = com.studiocom.islandhop.Floater.createFloater("FloaterShark", target, scale * 0.3, _local1.buildWidth, _local1._centerY, _local3, rate);
} else if (floaterType == "FloaterLog") {
var myFloaterLog = logsArray[Math.floor(Math.random() * logsArray.length)];
_local2 = com.studiocom.islandhop.Floater.createFloater(myFloaterLog, target, scale, _local1.buildWidth, _local1._centerY, _local3, rate);
} else {
_local2 = com.studiocom.islandhop.Floater.createFloater(floaterType, target, scale, _local1.buildWidth, _local1._centerY, _local3, rate);
}
_local1.buildWidth = _local1.buildWidth + (_local2._width + _local1.blankSpace);
if (_local1.buildWidth > (com.studiocom.islandhop.IslandHop.GAME_WIDTH + 130)) {
_local2.removeMovieClip();
continueLoop = false;
} else {
_local1.floaters.push(_local2);
}
} else {
_local1.buildWidth = _local1.buildWidth + _local1.blankSpace;
}
} while (continueLoop);
}
if (showBorder) {
var myLane = target.createEmptyMovieClip("lane_" + (_global.nextLevel++), _global.nextLevel);
myLane.lineStyle(1, 16711680, 50);
myLane.beginFill();
myLane.moveTo(0, topY);
myLane.lineTo(com.studiocom.islandhop.IslandHop.GAME_WIDTH, topY);
myLane.lineTo(com.studiocom.islandhop.IslandHop.GAME_WIDTH, bottomY);
myLane.lineTo(0, bottomY);
myLane.lineTo(0, topY);
myLane.endFill();
}
}
function get centerY() {
return(_centerY);
}
function checkHit(mc) {
var _local2 = this;
var _local3 = mc;
var _local1 = 0;
while (_local1 < _local2.floaters.length) {
if (_local2.floaters[_local1].hitTest(_local3._x, _local3._y)) {
return(_local2.floaters[_local1]);
}
_local1++;
}
return(null);
}
function stop() {
var _local2 = this;
var _local1 = 0;
while (_local1 < _local2.floaters.length) {
_local2.floaters[_local1].stop();
_local1++;
}
}
function start() {
var _local2 = this;
var _local1 = 0;
while (_local1 < _local2.floaters.length) {
_local2.floaters[_local1].start();
_local1++;
}
}
function clear() {
var _local3 = floaters.length;
var _local1 = 0;
while (_local1 < _local3) {
var _local2 = floaters.pop();
_local2.removeMovieClip();
_local1++;
}
}
}
Symbol 240 MovieClip [__Packages.com.studiocom.utils.ArrowListener] Frame 0
class com.studiocom.utils.ArrowListener
{
var _enabled, dispatchEvent;
function ArrowListener () {
mx.events.EventDispatcher.initialize(this);
enabled = (false);
}
static function getInstance() {
if (_instance == null) {
_instance = new com.studiocom.utils.ArrowListener();
}
return(_instance);
}
function get enabled() {
return(_enabled);
}
function set enabled(value) {
var _local1 = this;
var _local2 = value;
if (_local2 == true) {
_local1._enabled = _local2;
Key.addListener(_local1);
} else {
_local1._enabled = _local2;
Key.removeListener(_local1);
}
//return(_local1.__get__enabled());
}
function onKeyDown() {
var _local1 = Key.getCode();
var arrow = null;
if (_local1 == 38) {
arrow = "up";
} else if (_local1 == 40) {
arrow = "down";
} else if (_local1 == 37) {
arrow = "left";
} else if (_local1 == 39) {
arrow = "right";
}
if (arrow != null) {
dispatchEvent({type:"onArrowPressed", target:this, arrow:arrow});
}
}
static var _instance = null;
}
Symbol 49 MovieClip [FloaterLeaf] Frame 1
#initclip 25
Object.registerClass("FloaterLeaf", com.studiocom.islandhop.Floater);
#endinitclip
Symbol 53 MovieClip [FloaterLogSmall] Frame 1
#initclip 16
Object.registerClass("FloaterLogSmall", com.studiocom.islandhop.Floater);
#endinitclip
Symbol 57 MovieClip [FloaterLogMedium] Frame 1
#initclip 17
Object.registerClass("FloaterLogMedium", com.studiocom.islandhop.Floater);
#endinitclip
Symbol 61 MovieClip [FloaterLogLarge] Frame 1
#initclip 18
Object.registerClass("FloaterLogLarge", com.studiocom.islandhop.Floater);
#endinitclip
Symbol 67 MovieClip [FloaterRing] Frame 1
#initclip 19
Object.registerClass("FloaterRing", com.studiocom.islandhop.Floater);
#endinitclip
Symbol 71 MovieClip [FloaterShark] Frame 1
#initclip 20
Object.registerClass("FloaterShark", com.studiocom.islandhop.Floater);
#endinitclip
stop();
Symbol 71 MovieClip [FloaterShark] Frame 2
Symbol 113 MovieClip [HomeScreen] Frame 1
#initclip 21
Object.registerClass("HomeScreen", com.studiocom.islandhop.HomeScreen);
#endinitclip
Symbol 113 MovieClip [HomeScreen] Frame 73
stop();
Symbol 135 MovieClip Frame 1
stop();
mute_btn.onRelease = function () {
gotoAndStop ("on");
};
Symbol 135 MovieClip Frame 3
stop();
mute_btn.onRelease = function () {
gotoAndStop ("off");
};
Symbol 143 MovieClip [FireClip] Frame 1
#initclip 22
Object.registerClass("FireClip", com.studiocom.islandhop.Fire);
#endinitclip
stop();
Symbol 174 MovieClip Frame 5
stop();
Symbol 174 MovieClip Frame 11
stop();
Symbol 175 MovieClip [BoatWinClip] Frame 1
mcBoatSwitch.gotoandplay("on");
Symbol 175 MovieClip [BoatWinClip] Frame 53
Symbol 175 MovieClip [BoatWinClip] Frame 151
stop();
Symbol 176 MovieClip [BoatClip] Frame 1
#initclip 23
Object.registerClass("BoatClip", com.studiocom.islandhop.Boat);
#endinitclip
stop();
Symbol 176 MovieClip [BoatClip] Frame 5
stop();
Symbol 209 MovieClip [GameOverClip] Frame 1
#initclip 24
Object.registerClass("GameOverClip", com.studiocom.islandhop.GameOverScreen);
#endinitclip