Frame 1
if (_global.HQ == null) {
_global.HQ = new Object();
paths_lv = new LoadVars();
paths_lv.onLoad = function () {
var _local1 = this;
for (var _local2 in _local1) {
HQ[_local2] = _local1[_local2];
}
init();
};
paths_lv.load("http://web.hgtv.com/webhgtv/images/pac/23924/_paths.txt");
} else {
init();
}
MovieClip.prototype.tween = function (prop, propDest, timeSeconds, animType, delay, callback, callBackArg, extra1, extra2) {
var _local1 = this;
if (timeSeconds < 0.01) {
timeSeconds = 2;
}
if ((animType == undefined) || (animType == "")) {
animType = "easeOutExpo";
}
if (delay == undefined) {
delay = 0;
}
if (_local1.$_tweenPropList == undefined) {
_local1.$_tweenPropList = new Array();
}
if (_local1.$_tweenIndex == undefined) {
_local1.$_tweenIndex = 19929;
}
var properties = new Array();
var oldProperties = new Array();
var newProperties = new Array();
if (typeof(prop) == "string") {
properties.unshift(prop);
oldProperties.unshift(_local1[prop]);
newProperties.unshift(propDest);
} else {
for (var _local2 in prop) {
oldProperties.unshift(_local1[prop[_local2]]);
}
for (var _local2 in prop) {
properties.unshift(prop[_local2]);
}
for (var _local2 in propDest) {
newProperties.unshift(propDest[_local2]);
}
}
var $_callback_assigned = false;
if (_local1.__tweenController__ == undefined) {
var tweenHolder = _local1.createEmptyMovieClip("__tweenController__", 123432);
tweenHolder.onEnterFrame = function () {
var _local2 = this;
var _local3 = 0;
while (_local3 < _local2._parent.$_tweenPropList.length) {
var _local1 = _local2["prop_" + _local2._parent.$_tweenPropList[_local3]];
if ((_local1._timeStart + (_local1._delay * 1000)) <= getTimer()) {
if ((_local1._timeDest + (_local1._delay * 1000)) <= getTimer()) {
if (!_local1.ended) {
_local2._parent[_local1._prop] = _local1._propDest;
if (_local1._callback != undefined) {
_local2.$_callback = _local1._callback;
_local2.$_arguments = _local1._arguments;
_local2.$_callback(_local2.$_arguments);
}
_local1.ended = true;
} else {
for (var pti in _local2._parent.$_tweenPropList) {
if (_local2._parent.$_tweenPropList[pti] == _local1._prop) {
_local2._parent.$_tweenPropList.splice(pti, 1);
}
}
delete _local2["prop_" + _local1._prop];
if (_local2._parent.$_tweenPropList.length == 0) {
_local2.removeMovieClip();
}
}
} else {
_local1.ended = false;
_local2._parent[_local1._prop] = findTweenValue(_local1._propStart, _local1._propDest, _local1._timeStart, getTimer() - (_local1._delay * 1000), _local1._timeDest, _local1._animType, _local1._extra1, _local1._extra2);
}
}
_local3++;
}
};
} else {
var tweenHolder = _local1.__tweenController__;
}
var _local2 = 0;
while (_local2 < oldProperties.length) {
if (newProperties[_local2] != undefined) {
if (tweenHolder["prop_" + properties[_local2]] != undefined) {
delete tweenHolder["prop_" + properties[_local2]];
}
var propTweenExists = false;
for (var pti in _local1.$_tweenPropList) {
if (_local1.$_tweenPropList[pti] == properties[_local2]) {
propTweenExists = true;
}
}
if (!propTweenExists) {
_local1.$_tweenPropList.push(properties[_local2]);
}
tweenHolder["prop_" + properties[_local2]] = new Object();
var _local3 = tweenHolder["prop_" + properties[_local2]];
_local3._prop = properties[_local2];
_local3._propStart = oldProperties[_local2];
_local3._propDest = newProperties[_local2];
_local3._timeStart = getTimer();
_local3._timeDest = getTimer() + (timeSeconds * 1000);
_local3._animType = animType;
_local3._extra1 = extra1;
_local3._extra2 = extra2;
_local3._delay = delay;
_local3._arguments = callBackArg;
_local3._callback = ($_callback_assigned ? undefined : (callback));
$_callback_assigned = true;
}
_local2++;
}
ASSetPropFlags(_local1, "$_tweenIndex", 1, 0);
ASSetPropFlags(_local1, "$_tweenPropList", 1, 0);
};
ASSetPropFlags(MovieClip.prototype, "tween", 1, 0);
MovieClip.prototype.getTweens = function () {
return(((this.$_tweenPropList.length == undefined) ? 0 : (this.$_tweenPropList.length)));
};
ASSetPropFlags(MovieClip.prototype, "getTweens", 1, 0);
MovieClip.prototype.isTweening = function () {
return(((this.$_tweenPropList.length > 0) ? true : false));
};
ASSetPropFlags(MovieClip.prototype, "isTweening", 1, 0);
MovieClip.prototype.stopTween = function (props) {
var _local1 = this;
var _local2 = props;
switch (typeof(_local2)) {
case "string" :
_local2 = [_local2];
case "object" :
for (var i in _local2) {
delete _local1.__tweenController__["prop_" + _local2[i]];
for (var _local3 in _local1.$_tweenPropList) {
if (_local1.$_tweenPropList[_local3] == _local2[i]) {
_local1.$_tweenPropList.splice(_local3, 1);
}
}
}
if (_local1.$_tweenPropList.length == 0) {
_local1.$_tweenPropList = undefined;
_local1.__tweenController__.removeMovieClip();
_local1.__tweenController_ADVhelper__.removeMovieClip();
}
return;
default :
for (var i in _local1.$_tweenPropList) {
_local1.__tweenController_ADVhelper__.removeMovieClip();
_local1.__tweenController__.removeMovieClip();
}
_local1.$_tweenPropList = undefined;
delete _local1.$_tweenPropList;
}
};
ASSetPropFlags(MovieClip.prototype, "stopTween", 1, 0);
MovieClip.prototype.alphaTo = function (propDest_a, timeSeconds, animType, delay, callback, extra1, extra2) {
this.tween("_alpha", propDest_a, timeSeconds, animType, delay, callback, extra1, extra2);
};
ASSetPropFlags(MovieClip.prototype, "alphaTo", 1, 0);
MovieClip.prototype.rotateTo = function (propDest_rotation, timeSeconds, animType, delay, callback, extra1, extra2) {
this.tween("_rotation", propDest_rotation, timeSeconds, animType, delay, callback, extra1, extra2);
};
ASSetPropFlags(MovieClip.prototype, "rotateTo", 1, 0);
MovieClip.prototype.scaleTo = function (propDest_scale, timeSeconds, animType, delay, callback, extra1, extra2) {
this.tween(["_xscale", "_yscale"], [propDest_scale, propDest_scale], timeSeconds, animType, delay, callback, extra1, extra2);
};
ASSetPropFlags(MovieClip.prototype, "scaleTo", 1, 0);
MovieClip.prototype.slideTo = function (propDest_x, propDest_y, timeSeconds, animType, delay, callback, extra1, extra2) {
this.tween(["_x", "_y"], [propDest_x, propDest_y], timeSeconds, animType, delay, callback, extra1, extra2);
};
ASSetPropFlags(MovieClip.prototype, "slideTo", 1, 0);
MovieClip.prototype.colorTo = function (propDest_color, timeSeconds, animType, delay, callback, extra1, extra2) {
var $_clrTmp = new Color(this);
var _local1 = $_clrTmp.getTransform();
var aa = _local1.aa;
var ab = _local1.ab;
var _local2 = propDest_color >> 16;
var new_g = ((propDest_color & 65280) >> 8);
var _local3 = propDest_color & 255;
this.colorTransformTo(0, _local2, 0, new_g, 0, _local3, aa, ab, timeSeconds, animType, delay, callback, extra1, extra2);
};
ASSetPropFlags(MovieClip.prototype, "colorTo", 1, 0);
MovieClip.prototype.colorTransformTo = function (propDest_ra, propDest_rb, propDest_ga, propDest_gb, propDest_ba, propDest_bb, propDest_aa, propDest_ab, timeSeconds, animType, delay, callback, extra1, extra2) {
var _local1 = this;
var $_clrTmp = new Color(_local1);
var _local2 = $_clrTmp.getTransform();
_local1.$_ADVsetter_ra = _local2.ra;
_local1.$_ADVsetter_rb = _local2.rb;
_local1.$_ADVsetter_ga = _local2.ga;
_local1.$_ADVsetter_gb = _local2.gb;
_local1.$_ADVsetter_ba = _local2.ba;
_local1.$_ADVsetter_bb = _local2.bb;
_local1.$_ADVsetter_aa = _local2.aa;
_local1.$_ADVsetter_ab = _local2.ab;
_local1.$_new_ra = propDest_ra;
_local1.$_new_rb = propDest_rb;
_local1.$_new_ga = propDest_ga;
_local1.$_new_gb = propDest_gb;
_local1.$_new_ba = propDest_ba;
_local1.$_new_bb = propDest_bb;
_local1.$_new_aa = propDest_aa;
_local1.$_new_ab = propDest_ab;
_local1.tween(["$_ADVsetter_ra", "$_ADVsetter_rb", "$_ADVsetter_ga", "$_ADVsetter_gb", "$_ADVsetter_ba", "$_ADVsetter_bb", "$_ADVsetter_aa", "$_ADVsetter_ab"], [_local1.$_new_ra, _local1.$_new_rb, _local1.$_new_ga, _local1.$_new_gb, _local1.$_new_ba, _local1.$_new_bb, _local1.$_new_aa, _local1.$_new_ab], timeSeconds, animType, delay, callback, extra1, extra2);
_local1.__tweenController_ADVhelper__.removeMovieClip();
_local1.createEmptyMovieClip("__tweenController_ADVhelper__", 123434);
_local1.__tweenController_ADVhelper__.onEnterFrame = function () {
var _local1 = this;
var _local3 = new Color(_local1._parent);
var _local2 = {ra:_local1._parent.$_ADVsetter_ra, rb:_local1._parent.$_ADVsetter_rb, ga:_local1._parent.$_ADVsetter_ga, gb:_local1._parent.$_ADVsetter_gb, ba:_local1._parent.$_ADVsetter_ba, bb:_local1._parent.$_ADVsetter_bb, aa:_local1._parent.$_ADVsetter_aa, ab:_local1._parent.$_ADVsetter_ab};
_local3.setTransform(_local2);
if (_local1.$_toDelete) {
delete _local1._parent.$_ADVsetter_ra;
delete _local1._parent.$_ADVsetter_rb;
delete _local1._parent.$_ADVsetter_ga;
delete _local1._parent.$_ADVsetter_gb;
delete _local1._parent.$_ADVsetter_ba;
delete _local1._parent.$_ADVsetter_bb;
delete _local1._parent.$_ADVsetter_aa;
delete _local1._parent.$_ADVsetter_ab;
delete _local1._parent.$_new_ra;
delete _local1._parent.$_new_rb;
delete _local1._parent.$_new_ga;
delete _local1._parent.$_new_gb;
delete _local1._parent.$_new_ba;
delete _local1._parent.$_new_bb;
delete _local1._parent.$_new_aa;
delete _local1._parent.$_new_ab;
_local1.removeMovieClip();
}
if (((((((((_local1._parent.$_ADVsetter_ra == _local1._parent.$_new_ra) || (_local1._parent.$_new_ra == undefined)) && ((_local1._parent.$_ADVsetter_rb == _local1._parent.$_new_rb) || (_local1._parent.$_new_rb == undefined))) && ((_local1._parent.$_ADVsetter_ga == _local1._parent.$_new_ga) || (_local1._parent.$_new_ga == undefined))) && ((_local1._parent.$_ADVsetter_gb == _local1._parent.$_new_gb) || (_local1._parent.$_new_gb == undefined))) && ((_local1._parent.$_ADVsetter_ba == _local1._parent.$_new_ba) || (_local1._parent.$_new_ba == undefined))) && ((_local1._parent.$_ADVsetter_bb == _local1._parent.$_new_bb) || (_local1._parent.$_new_bb == undefined))) && ((_local1._parent.$_ADVsetter_aa == _local1._parent.$_new_aa) || (_local1._parent.$_new_aa == undefined))) && ((_local1._parent.$_ADVsetter_ab == _local1._parent.$_new_ab) || (_local1._parent.$_new_ab == undefined))) {
_local1.$_toDelete = true;
}
};
};
ASSetPropFlags(MovieClip.prototype, "colorTransformTo", 1, 0);
_global.findTweenValue = function (_propStart, _propDest, _timeStart, _timeNow, _timeDest, _animType, _extra1, _extra2) {
var _local1 = _timeNow - _timeStart;
var _local3 = _propStart;
var _local2 = _propDest - _propStart;
var d = (_timeDest - _timeStart);
var a = _extra1;
var p = _extra2;
var s = _extra1;
switch (_animType.toLowerCase()) {
case "linear" :
return(((_local2 * _local1) / d) + _local3);
case "easeinquad" :
_local1 = _local1 / d;
return(((_local2 * _local1) * _local1) + _local3);
case "easeoutquad" :
_local1 = _local1 / d;
return((((-_local2) * _local1) * (_local1 - 2)) + _local3);
case "easeinoutquad" :
_local1 = _local1 / (d / 2);
if (_local1 < 1) {
return((((_local2 / 2) * _local1) * _local1) + _local3);
}
_local1--;
return((((-_local2) / 2) * ((_local1 * (_local1 - 2)) - 1)) + _local3);
case "easeincubic" :
_local1 = _local1 / d;
return((((_local2 * _local1) * _local1) * _local1) + _local3);
case "easeoutcubic" :
_local1 = (_local1 / d) - 1;
return((_local2 * (((_local1 * _local1) * _local1) + 1)) + _local3);
case "easeinoutcubic" :
_local1 = _local1 / (d / 2);
if (_local1 < 1) {
return(((((_local2 / 2) * _local1) * _local1) * _local1) + _local3);
}
_local1 = _local1 - 2;
return(((_local2 / 2) * (((_local1 * _local1) * _local1) + 2)) + _local3);
case "easeinquart" :
_local1 = _local1 / d;
return(((((_local2 * _local1) * _local1) * _local1) * _local1) + _local3);
case "easeoutquart" :
_local1 = (_local1 / d) - 1;
return(((-_local2) * ((((_local1 * _local1) * _local1) * _local1) - 1)) + _local3);
case "easeinoutquart" :
_local1 = _local1 / (d / 2);
if (_local1 < 1) {
return((((((_local2 / 2) * _local1) * _local1) * _local1) * _local1) + _local3);
}
_local1 = _local1 - 2;
return((((-_local2) / 2) * ((((_local1 * _local1) * _local1) * _local1) - 2)) + _local3);
case "easeinquint" :
_local1 = _local1 / d;
return((((((_local2 * _local1) * _local1) * _local1) * _local1) * _local1) + _local3);
case "easeoutquint" :
_local1 = (_local1 / d) - 1;
return((_local2 * (((((_local1 * _local1) * _local1) * _local1) * _local1) + 1)) + _local3);
case "easeinoutquint" :
_local1 = _local1 / (d / 2);
if (_local1 < 1) {
return(((((((_local2 / 2) * _local1) * _local1) * _local1) * _local1) * _local1) + _local3);
}
_local1 = _local1 - 2;
return(((_local2 / 2) * (((((_local1 * _local1) * _local1) * _local1) * _local1) + 2)) + _local3);
case "easeinsine" :
return((((-_local2) * Math.cos((_local1 / d) * (Math.PI/2))) + _local2) + _local3);
case "easeoutsine" :
return((_local2 * Math.sin((_local1 / d) * (Math.PI/2))) + _local3);
case "easeinoutsine" :
return((((-_local2) / 2) * (Math.cos((Math.PI * _local1) / d) - 1)) + _local3);
case "easeinexpo" :
return(((_local1 == 0) ? (_local3) : ((_local2 * Math.pow(2, 10 * ((_local1 / d) - 1))) + _local3)));
case "easeoutexpo" :
return(((_local1 == d) ? (_local3 + _local2) : ((_local2 * ((-Math.pow(2, (-10 * _local1) / d)) + 1)) + _local3)));
case "easeinoutexpo" :
if (_local1 == 0) {
return(_local3);
}
if (_local1 == d) {
return(_local3 + _local2);
}
_local1 = _local1 / (d / 2);
if (_local1 < 1) {
return(((_local2 / 2) * Math.pow(2, 10 * (_local1 - 1))) + _local3);
}
_local1--;
return(((_local2 / 2) * ((-Math.pow(2, -10 * _local1)) + 2)) + _local3);
case "easeincirc" :
_local1 = _local1 / d;
return(((-_local2) * (Math.sqrt(1 - (_local1 * _local1)) - 1)) + _local3);
case "easeoutcirc" :
_local1 = (_local1 / d) - 1;
return((_local2 * Math.sqrt(1 - (_local1 * _local1))) + _local3);
case "easeinoutcirc" :
_local1 = _local1 / (d / 2);
if (_local1 < 1) {
return((((-_local2) / 2) * (Math.sqrt(1 - (_local1 * _local1)) - 1)) + _local3);
}
_local1 = _local1 - 2;
return(((_local2 / 2) * (Math.sqrt(1 - (_local1 * _local1)) + 1)) + _local3);
case "easeinelastic" :
if (_local1 == 0) {
return(_local3);
}
_local1 = _local1 / d;
if (_local1 == 1) {
return(_local3 + _local2);
}
if (!p) {
p = d * 0.3;
}
if (a < Math.abs(_local2)) {
a = _local2;
var s = (p / 4);
} else {
var s = ((p / (Math.PI*2)) * Math.asin(_local2 / a));
}
_local1 = _local1 - 1;
return((-((a * Math.pow(2, 10 * _local1)) * Math.sin((((_local1 * d) - s) * (Math.PI*2)) / p))) + _local3);
case "easeoutelastic" :
if (_local1 == 0) {
return(_local3);
}
_local1 = _local1 / d;
if (_local1 == 1) {
return(_local3 + _local2);
}
if (!p) {
p = d * 0.3;
}
if (a < Math.abs(_local2)) {
a = _local2;
var s = (p / 4);
} else {
var s = ((p / (Math.PI*2)) * Math.asin(_local2 / a));
}
return((((a * Math.pow(2, -10 * _local1)) * Math.sin((((_local1 * d) - s) * (Math.PI*2)) / p)) + _local2) + _local3);
case "easeinoutelastic" :
if (_local1 == 0) {
return(_local3);
}
_local1 = _local1 / (d / 2);
if (_local1 == 2) {
return(_local3 + _local2);
}
if (!p) {
p = d * 0.45;
}
if (a < Math.abs(_local2)) {
a = _local2;
var s = (p / 4);
} else {
var s = ((p / (Math.PI*2)) * Math.asin(_local2 / a));
}
if (_local1 < 1) {
_local1 = _local1 - 1;
return((-0.5 * ((a * Math.pow(2, 10 * _local1)) * Math.sin((((_local1 * d) - s) * (Math.PI*2)) / p))) + _local3);
}
_local1 = _local1 - 1;
return(((((a * Math.pow(2, -10 * _local1)) * Math.sin((((_local1 * d) - s) * (Math.PI*2)) / p)) * 0.5) + _local2) + _local3);
case "easeinback" :
if (s == undefined) {
s = 1.70158;
}
_local1 = _local1 / d;
return((((_local2 * _local1) * _local1) * (((s + 1) * _local1) - s)) + _local3);
case "easeoutback" :
if (s == undefined) {
s = 1.70158;
}
_local1 = (_local1 / d) - 1;
return((_local2 * (((_local1 * _local1) * (((s + 1) * _local1) + s)) + 1)) + _local3);
case "easeinoutback" :
if (s == undefined) {
s = 1.70158;
}
_local1 = _local1 / (d / 2);
if (_local1 < 1) {
return(((_local2 / 2) * ((_local1 * _local1) * (((((s = s * 1.525)) + 1) * _local1) - s))) + _local3);
}
_local1 = _local1 - 2;
return(((_local2 / 2) * (((_local1 * _local1) * (((((s = s * 1.525)) + 1) * _local1) + s)) + 2)) + _local3);
case "easeinbounce" :
return((_local2 - findTweenValue(0, _local2, 0, d - _local1, d, "easeOutBounce")) + _local3);
case "easeoutbounce" :
_local1 = _local1 / d;
if (_local1 < 0.363636363636364) {
return((_local2 * ((7.5625 * _local1) * _local1)) + _local3);
}
if (_local1 < 0.727272727272727) {
_local1 = _local1 - 0.545454545454545;
return((_local2 * (((7.5625 * _local1) * _local1) + 0.75)) + _local3);
}
if (_local1 < 0.909090909090909) {
_local1 = _local1 - 0.818181818181818;
return((_local2 * (((7.5625 * _local1) * _local1) + 0.9375)) + _local3);
}
_local1 = _local1 - 0.954545454545455;
return((_local2 * (((7.5625 * _local1) * _local1) + 0.984375)) + _local3);
case "easeinoutbounce" :
if (_local1 < (d / 2)) {
return((findTweenValue(0, _local2, 0, _local1 * 2, d, "easeInBounce") * 0.5) + _local3);
}
return(((findTweenValue(0, _local2, 0, (_local1 * 2) - d, d, "easeOutBounce") * 0.5) + (_local2 * 0.5)) + _local3);
}
return(undefined);
};
ASSetPropFlags(_global, "findTweenValue", 1, 0);
fscommand ("showmenu", false);
fscommand ("allowscale", false);
Frame 2
_quality = "high";
HQ.sectionsLoaded = false;
HQ.loadFinished = false;
HQ.highScoresLoaded = false;
HQ.highScoresFromIntro = false;
HQ.cheatsEnabled = false;
HQ.cheat_array = [1, 2, 3, 4, 5, 6];
loaderPos = loading_mc._y;
loading_mc._y = loading_mc._y - 200;
loading_mc._alpha = 0;
loading_mc.alphaTo(100, 1, "linear");
loading_mc.slideTo(undefined, loaderPos, 1.5, "easeoutbounce");
loading_mc.maxX = loading_mc.bar_mc._x;
loading_mc.minX = loading_mc.maxX - loading_mc.bar_mc._width;
loading_mc.dist = loading_mc.maxX - loading_mc.minX;
loading_mc.bar_mc._x = loading_mc.minX;
loading_mc.onEnterFrame = function () {
var _local1 = this;
var _local2 = _root;
var loaded = (_local2.getBytesLoaded() / _local2.getBytesTotal());
var _local3 = _local2._framesloaded;
if (_local3 > 6) {
HQ.sectionsLoaded = true;
}
if (_local3 > 15) {
if (!HQ.highScoresLoaded) {
HQ.highScoresLoaded = true;
}
}
_local2.screen.showButton();
_local1.bar_mc._x = _local1.minX + Math.round(_local1.dist * loaded);
if (loaded == 1) {
HQ.loadFinished = true;
_local2.screen.showButton();
_local1.gotoAndPlay("doneLoading");
_local1.bar_mc.slideTo(undefined, 25, 0.5, "linear");
delete _local1.onEnterFrame;
}
};
HQ.formatScore = function (score) {
var _local2 = String(score);
var _local3 = 6 - _local2.length;
var _local1 = 0;
while (_local1 < _local3) {
_local2 = "0" + _local2;
_local1++;
}
return(_local2);
};
Frame 3
stop();
Frame 4
stop();
Frame 5
stop();
Frame 6
stop();
Frame 7
var startGame = function () {
gotoAndStop (25);
};
if (HQ.playedGame) {
loading_mc._y = loading_mc._y + 100;
}
loading_mc.slideTo(undefined, loading_mc._y + 50, 0.5, "easeinback");
cover_mc.slideTo(undefined, 440, 2, "easeoutbounce", undefined, startGame);
cover_mc.rotateTo(0, 2, "easeoutelastic");
Frame 15
HQ.highScoresFromIntro = true;
highscores_mc.play();
Frame 25
Iso_class = function () {
var _local1 = this;
_local1.theta = 1.0471975511966;
_local1.alpha = (Math.PI/4);
_local1.sinTheta = Math.sin(_local1.theta);
_local1.cosTheta = Math.cos(_local1.theta);
_local1.sinAlpha = Math.sin(_local1.alpha);
_local1.cosAlpha = Math.cos(_local1.alpha);
};
Iso_class.prototype.isoToScreen = function (vectorObj) {
var _local1 = this;
var _local2 = vectorObj;
var screenX = ((_local2.x * _local1.cosAlpha) + (_local2.z * _local1.sinAlpha));
var _local3 = (_local2.z * _local1.cosAlpha) - (_local2.x * _local1.sinAlpha);
var screenY = ((_local2.y * _local1.cosTheta) - (_local3 * _local1.sinTheta));
return({x:Math.round(screenX), y:Math.round(screenY)});
};
Iso_class.prototype.screenToIso = function (xPos, yPos) {
var _local1 = this;
var _local2 = ((xPos / _local1.cosAlpha) - (yPos / (_local1.sinAlpha * _local1.sinTheta))) * (1 / ((_local1.cosAlpha / _local1.sinAlpha) + (_local1.sinAlpha / _local1.cosAlpha)));
var _local3 = (1 / _local1.cosAlpha) * (xPos - (_local2 * _local1.sinAlpha));
var newVec = new vector(_local3, 0, _local2);
return(newVec);
};
_global.vector = function (x, y, z) {
var _local1 = this;
_local1.x = x;
_local1.y = y;
_local1.z = z;
_local1.vectorAdd = function (addVec) {
var _local1 = addVec;
var _local2 = this;
_local2.x = _local2.x + _local1.x;
_local2.y = _local2.y + _local1.y;
_local2.z = _local2.z + _local1.z;
};
_local1.vectorCopy = function () {
var _local1 = this;
return(new vector(_local1.x, _local1.y, _local1.z));
};
_local1.vectorMultiply = function (multVec) {
var _local1 = multVec;
var _local2 = this;
_local2.x = _local2.x * _local1.x;
_local2.y = _local2.y * _local1.y;
_local2.z = _local2.z * _local1.z;
};
_local1.scalarMultiply = function (scalar) {
var _local1 = this;
var _local2 = scalar;
_local1.x = _local1.x * _local2;
_local1.y = _local1.y * _local2;
_local1.z = _local1.z * _local2;
};
};
_global.point = function (x, y) {
this.x = x;
this.y = y;
};
_global.rect = function (l, r, b, f) {
var _local1 = this;
_local1.l = l;
_local1.r = r;
_local1.b = b;
_local1.f = f;
};
HQ.obstacle_array = [{name:"ramp", box:new rect(-10, 75, 20, -150)}, {name:"buoy", box:new rect(-10, 10, 10, -10)}, {name:"cattails", box:new rect(-5, 5, 5, -5)}, {name:"sandbar", box:new rect(-10, 250, 125, -75)}, {name:"rocks_1", box:new rect(-20, 20, 20, -20)}, {name:"rocks_2", box:new rect(-20, 20, 20, -20)}, {name:"bigStar", item:true, box:new rect(-20, 20, 20, -20)}, {name:"smallStar", item:true, box:new rect(-10, 10, 10, -10)}, {name:"dock", item:false, box:new rect(-10, 10, 10, -10)}];
HQ.obstacleGroups_array = [];
HQ.obstacleGroups_array[0] = [{oType:2, pos:new vector(-120, 0, -341)}, {oType:6, pos:new vector(50, 0, -450)}, {oType:3, pos:new vector(-74, 0, -245)}, {oType:0, pos:new vector(0, 0, -77)}];
HQ.obstacleGroups_array[1] = [{oType:1, pos:new vector(-37, 0, -368)}, {oType:1, pos:new vector(206, 0, -445)}, {oType:3, pos:new vector(-215, 0, -518)}, {oType:3, pos:new vector(204, 0, -328)}];
HQ.obstacleGroups_array[2] = [{oType:2, pos:new vector(-16, 0, -678)}, {oType:1, pos:new vector(-161, 0, -338)}, {oType:6, pos:new vector(194, 0, -396)}, {oType:0, pos:new vector(100, 0, -142)}, {oType:7, pos:new vector(11, 0, -538)}, {oType:2, pos:new vector(-75, 0, -556)}, {oType:5, pos:new vector(-66, 0, -617)}];
HQ.obstacleGroups_array[3] = [{oType:1, pos:new vector(-56, 0, -258)}, {oType:2, pos:new vector(104, 0, -472)}, {oType:7, pos:new vector(62, 0, -257)}, {oType:7, pos:new vector(157, 0, -231)}, {oType:7, pos:new vector(33, 0, -674)}, {oType:7, pos:new vector(-55, 0, -549)}, {oType:1, pos:new vector(45, 0, -506)}, {oType:1, pos:new vector(-90, 0, -398)}, {oType:3, pos:new vector(100, 0, -398)}];
HQ.obstacleGroups_array[4] = [{oType:7, pos:new vector(257, 0, -399)}, {oType:7, pos:new vector(25, 0, -395)}, {oType:5, pos:new vector(-23, 0, -500)}, {oType:4, pos:new vector(166, 0, -206)}, {oType:1, pos:new vector(-102, 0, -463)}, {oType:1, pos:new vector(53, 0, -244)}, {oType:1, pos:new vector(150, 0, -92)}];
HQ.obstacleGroups_array[5] = [{oType:4, pos:new vector(236, 0, -223)}, {oType:2, pos:new vector(221, 0, -178)}, {oType:7, pos:new vector(150, 0, -550)}, {oType:7, pos:new vector(150, 0, -450)}, {oType:7, pos:new vector(150, 0, -350)}, {oType:1, pos:new vector(60, 0, -364)}, {oType:6, pos:new vector(-72, 0, -539)}, {oType:0, pos:new vector(-167, 0, -277)}];
HQ.obstacleGroups_array[6] = [{oType:7, pos:new vector(-172, 0, -387)}, {oType:7, pos:new vector(-16, 0, -456)}, {oType:7, pos:new vector(157, 0, -538)}, {oType:1, pos:new vector(252, 0, -478)}, {oType:1, pos:new vector(78, 0, -409)}, {oType:1, pos:new vector(-77, 0, -345)}, {oType:1, pos:new vector(-238, 0, -287)}];
HQ.obstacleGroups_array[6] = [{oType:4, pos:new vector(316, 0, -265)}, {oType:5, pos:new vector(-252, 0, -736)}, {oType:1, pos:new vector(-5, 0, -1000)}, {oType:7, pos:new vector(155, 0, -700)}, {oType:7, pos:new vector(-106, 0, -450)}, {oType:1, pos:new vector(-193, 0, -400)}, {oType:7, pos:new vector(70, 0, -150)}, {oType:1, pos:new vector(141, 0, -100)}];
HQ.obstacleGroups_array[7] = [{oType:0, pos:new vector(-375, 0, -302)}, {oType:1, pos:new vector(88, 0, -350)}, {oType:7, pos:new vector(202, 0, -275)}, {oType:7, pos:new vector(72, 0, -190)}, {oType:7, pos:new vector(-16, 0, -105)}, {oType:5, pos:new vector(93, 0, -45)}];
HQ.obstacleGroups_array[8] = [{oType:1, pos:new vector(-83, 0, -617)}, {oType:1, pos:new vector(191, 0, -652)}, {oType:7, pos:new vector(18, 0, -717)}, {oType:7, pos:new vector(76, 0, -615)}, {oType:7, pos:new vector(123, 0, -519)}, {oType:7, pos:new vector(131, 0, -422)}, {oType:7, pos:new vector(93, 0, -331)}, {oType:7, pos:new vector(33, 0, -249)}, {oType:1, pos:new vector(-68, 0, -315)}, {oType:1, pos:new vector(93, 0, -147)}];
HQ.obstacleGroups_array[9] = [{oType:5, pos:new vector(114, 0, -29)}, {oType:7, pos:new vector(-122, 0, -505)}, {oType:7, pos:new vector(-131, 0, -404)}, {oType:2, pos:new vector(-76, 0, -480)}, {oType:2, pos:new vector(-77, 0, -361)}, {oType:2, pos:new vector(-149, 0, -348)}];
HQ.obstacleGroups_array[10] = [{oType:6, pos:new vector(-73, 0, -650)}, {oType:0, pos:new vector(-143, 0, -300)}, {oType:7, pos:new vector(130, 0, -525)}, {oType:7, pos:new vector(130, 0, -391)}, {oType:7, pos:new vector(130, 0, -283)}, {oType:7, pos:new vector(130, 0, -182)}, {oType:1, pos:new vector(0, 0, -543)}, {oType:1, pos:new vector(0, 0, -387)}, {oType:1, pos:new vector(0, 0, -238)}, {oType:1, pos:new vector(0, 0, -101)}];
HQ.obstacleGroups_array[11] = [{oType:7, pos:new vector(-125, 0, -526)}, {oType:2, pos:new vector(128, 0, -472)}, {oType:2, pos:new vector(167, 0, -342)}, {oType:7, pos:new vector(108, 0, -409)}, {oType:7, pos:new vector(-18, 0, -334)}, {oType:7, pos:new vector(-143, 0, -255)}, {oType:5, pos:new vector(-185, 0, -374)}, {oType:3, pos:new vector(-22, 0, -147)}];
HQ.obstacleGroups_array[12] = [{oType:7, pos:new vector(95, 0, -501)}, {oType:7, pos:new vector(-123, 0, -433)}, {oType:7, pos:new vector(87, 0, -200)}, {oType:5, pos:new vector(75, 0, -55)}, {oType:7, pos:new vector(-89, 0, -337)}, {oType:1, pos:new vector(-25, 0, -370)}, {oType:1, pos:new vector(-155, 0, -297)}, {oType:2, pos:new vector(207, 0, -354)}, {oType:7, pos:new vector(258, 0, -316)}, {oType:4, pos:new vector(172, 0, -253)}];
HQ.obstacleGroups_array[13] = [{oType:3, pos:new vector(-106, 0, -533)}, {oType:7, pos:new vector(-178, 0, -583)}, {oType:7, pos:new vector(-89, 0, -728)}, {oType:7, pos:new vector(63, 0, -769)}, {oType:7, pos:new vector(213, 0, -653)}, {oType:7, pos:new vector(250, 0, -502)}, {oType:7, pos:new vector(202, 0, -375)}, {oType:7, pos:new vector(289, 0, -286)}, {oType:7, pos:new vector(-143, 0, -449)}, {oType:7, pos:new vector(-70, 0, -340)}, {oType:7, pos:new vector(-58, 0, -205)}, {oType:1, pos:new vector(48, 0, -396)}, {oType:1, pos:new vector(322, 0, -416)}, {oType:1, pos:new vector(-179, 0, -299)}];
HQ.obstacleGroups_array[14] = [{oType:7, pos:new vector(89, 0, -36)}, {oType:7, pos:new vector(196, 0, -265)}, {oType:7, pos:new vector(140, 0, -410)}, {oType:6, pos:new vector(71, 0, -571)}, {oType:1, pos:new vector(-136, 0, -306)}, {oType:0, pos:new vector(-88, 0, -344)}, {oType:2, pos:new vector(301, 0, -388)}, {oType:2, pos:new vector(64, 0, -304)}, {oType:5, pos:new vector(117, 0, -129)}];
HQ.obstacleGroups_array[15] = [{oType:2, pos:new vector(121, 0, -301)}, {oType:6, pos:new vector(90, 0, -572)}, {oType:6, pos:new vector(86, 0, -463)}, {oType:1, pos:new vector(-49, 0, -206)}, {oType:1, pos:new vector(135, 0, -146)}, {oType:0, pos:new vector(-1, 0, -245)}];
HQ.obstacleGroups_array[16] = [{oType:1, pos:new vector(27, 0, -409)}, {oType:3, pos:new vector(-103, 0, -525)}, {oType:7, pos:new vector(124, 0, -906)}, {oType:7, pos:new vector(-16, 0, -781)}, {oType:7, pos:new vector(316, 0, -375)}, {oType:7, pos:new vector(322, 0, -333)}, {oType:7, pos:new vector(-148, 0, -341)}, {oType:7, pos:new vector(-203, 0, -305)}];
function setDepth(posVect) {
var _local2 = Math.round(posVect.x - HQ.player.position.x);
var _local1 = 10000 + _local2;
if (_local1 == 10000) {
_local1 = 10001;
}
if (_local1 == 9999) {
_local1 = 9998;
}
return(_local1);
}
Dock_class = function () {
var _local1 = this;
_local1.reset = function () {
var _local1 = this;
_local1.name = "dock";
_local1.clip = field_mc.objects_mc.attachMovie("obstacle_dock", _local1.name, 15000);
_local1.defaultPos = new vector(-56, 0, 367);
_local1.position = _local1.defaultPos.vectorCopy();
HQ.player.isWaiting = true;
HQ.player.clip.gotoAndStop("crash");
HQ.player.shadowClip.gotoAndStop("wait");
HQ.player.wakeClip.gotoAndStop("wait");
field_mc.boatWake.gotoAndStop("wait");
HQ.player.position = _local1.position.vectorCopy();
HQ.obstacleList[_local1.name] = _local1;
};
_local1.update = function () {
var _local1 = this;
_local1.position.z = _local1.position.z + HQ.gamespeed;
var _local2 = HQ.iso.isoToScreen(_local1.position);
_local1.clip._x = _local2.x;
_local1.clip._y = _local2.y;
if (_local1.position.z > 700) {
_local1.clip.removeMovieClip();
delete HQ.obstacleList[_local1.name];
}
};
_local1.inTube = function () {
HQ.player.isWaiting = false;
HQ.player.clip.gotoAndStop("idle");
HQ.player.shadowClip.gotoAndStop("idle");
HQ.player.wakeClip.gotoAndPlay("land");
field_mc.boatWake.gotoAndPlay("land");
HQ.gameSpeed = HQ.levelGameSpeed;
HQ.gameSound.playMusic("surfMusic", "surf_music");
};
};
Boat_class = function () {
var _local1 = this;
_local1.wakeClip = field_mc.boatWake;
_local1.position = new vector(0, 0, -100);
_local1.screenPos = new point(0, 0);
_local1.velocity = new vector(0, 0, 0);
_local1.playerCrashed = false;
_local1.maxZ = -10;
_local1.minZ = -400;
_local1.maxX = 300;
_local1.minX = -200;
_local1.slide = function (dir) {
if (dir == "left") {
this.velocity.x = this.velocity.x + 2;
} else if (dir == "right") {
this.velocity.x = this.velocity.x - 2;
}
};
_local1.accelerate = function (dir) {
if (dir == "brake") {
this.velocity.z = this.velocity.z + 2;
} else if (dir == "accel") {
this.velocity.z = this.velocity.z - 2;
}
};
_local1.update = function () {
if (!HQ.boat.playerCrashed) {
HQ.boat.velocity.x = HQ.boat.velocity.x * HQ.friction;
HQ.boat.velocity.z = HQ.boat.velocity.z * HQ.friction;
HQ.boat.position.x = HQ.boat.position.x + HQ.boat.velocity.x;
HQ.boat.position.z = HQ.boat.position.z + HQ.boat.velocity.z;
if (HQ.boat.position.x > HQ.boat.maxX) {
HQ.boat.position.x = HQ.boat.maxX;
HQ.boat.velocity.x = 0;
} else if (HQ.boat.position.x < HQ.boat.minX) {
HQ.boat.position.x = HQ.boat.minX;
HQ.boat.velocity.x = 0;
}
if (HQ.boat.position.z > HQ.boat.maxZ) {
HQ.boat.position.z = HQ.boat.maxZ;
HQ.boat.velocity.z = 0;
} else if (HQ.boat.position.z < HQ.boat.minZ) {
HQ.boat.position.z = HQ.boat.minZ;
HQ.boat.velocity.z = 0;
}
} else {
HQ.boat.position.z = HQ.boat.position.z - 10;
}
HQ.boat.screenPos = HQ.iso.isoToScreen(HQ.boat.position);
field_mc.boatWake._x = HQ.boat.screenPos.x;
field_mc.boatWake._y = HQ.boat.screenPos.y;
};
};
Player_class = function () {
var _local1 = this;
_local1.depth = 10000;
_local1.clip = field_mc.objects_mc.attachMovie("player", "player_mc", _local1.depth);
_local1.shadowClip = field_mc.objects_mc.attachMovie("player_shadow", "player_s", _local1.depth - 1);
_local1.wakeClip = field_mc.objects_mc.attachMovie("wake", "wake", 5);
_local1.position = new vector(0, 0, 375);
_local1.velocity = new vector(0, 0, 0);
_local1.boundingRect = new rect(0, 0, 0, 0);
_local1.boundingSize = new rect(-25, 25, 25, -25);
_local1.maxBoatDist = 50;
_local1.minZ = 50;
_local1.maxZ = 500;
_local1.jumpAllowed = false;
_local1.isJumping = false;
_local1.firstBounce = true;
_local1.isCrashing = false;
_local1.isWaiting = false;
_local1.ropeLocalPos = {x:_local1.clip.rope._x, y:_local1.clip.rope._y};
_local1.ropeShadLocalPos = {x:_local1.shadowClip.ropeShadow._x, y:_local1.shadowClip.ropeShadow._y};
_local1.ropeClip = _local1.clip.rope;
_local1.ropeShadClip = _local1.shadowClip.ropeShadow;
_local1.jump = function () {
var _local1 = this;
if ((!_local1.isJumping) && (!_local1.isCrashing)) {
_local1.velocity.y = -35;
_local1.velocity.z = _local1.velocity.z + -15;
_local1.jumpAllowed = false;
_local1.isJumping = true;
HQ.gameSound.playSound("jump");
_local1.wakeClip.gotoAndPlay("jump");
_local1.shadowClip.gotoAndStop("jump");
_local1.firstBounce = true;
_local1.ropeClip.gotoAndPlay("jump");
_local1.ropeShadClip.gotoAndPlay("jump");
_local1.clip.gotoAndStop("jump");
}
};
_local1.update = function () {
if (HQ.player.position.y != 0) {
if (HQ.player.position.y < -1) {
HQ.player.velocity.y = HQ.player.velocity.y - HQ.gravity;
} else if (HQ.player.position.y >= 0) {
if (HQ.player.firstBounce) {
HQ.player.wakeClip.gotoAndPlay("land");
HQ.player.firstBounce = false;
}
HQ.player.position.y = 0;
HQ.player.velocity.y = HQ.player.velocity.y * -0.25;
} else {
HQ.player.isJumping = false;
HQ.player.firstBounce = true;
if (!HQ.player.isCrashing) {
HQ.player.clip.gotoAndStop("idle");
HQ.player.shadowClip.gotoAndStop("idle");
}
HQ.player.position.y = 0;
HQ.player.velocity.y = 0;
}
}
if (!HQ.player.isWaiting) {
var distX = (HQ.player.position.x - HQ.boat.position.x);
var distZ = (HQ.player.position.z - HQ.boat.position.z);
HQ.player.position.x = HQ.player.position.x - (distX * 0.05);
HQ.player.position.z = HQ.player.position.z - (distZ * 0.08);
HQ.player.velocity.x = HQ.player.velocity.x + (HQ.boat.velocity.x * 0.1);
HQ.player.velocity.z = HQ.player.velocity.z + 5;
HQ.player.velocity.x = HQ.player.velocity.x * HQ.friction;
HQ.player.velocity.z = HQ.player.velocity.z * HQ.friction;
var distFromBoat = (HQ.player.position.z - HQ.boat.position.z);
if (distFromBoat > HQ.player.maxBoatDist) {
HQ.player.position.z = HQ.boat.position.z + distFromBoat;
}
HQ.player.position.vectorAdd(HQ.player.velocity);
HQ.player.boundingRect.l = HQ.player.boundingSize.l + HQ.player.position.x;
HQ.player.boundingRect.r = HQ.player.boundingSize.r + HQ.player.position.x;
HQ.player.boundingRect.b = HQ.player.boundingSize.b + HQ.player.position.z;
HQ.player.boundingRect.f = HQ.player.boundingSize.f + HQ.player.position.z;
}
var _local3 = HQ.iso.isoToScreen(HQ.player.position);
HQ.player.clip._x = _local3.x;
HQ.player.clip._y = _local3.y;
if (HQ.player.isJumping) {
var shadX = (HQ.player.position.x - (HQ.player.position.y * 0.2));
} else {
var shadX = HQ.player.position.x;
}
var _local1 = HQ.iso.isoToScreen({x:shadX, y:0, z:HQ.player.position.z});
HQ.player.shadowClip._x = (HQ.player.wakeClip._x = _local1.x);
HQ.player.shadowClip._y = (HQ.player.wakeClip._y = _local1.y);
var _local2 = HQ.boat.screenPos;
var ropeWidth = ((HQ.player.ropeLocalPos.x + _local3.x) - _local2.x);
var ropeHeight = (_local2.y - (HQ.player.ropeLocalPos.y + _local3.y));
var shadWidth = ((HQ.player.ropeShadLocalPos.x + _local1.x) - _local2.x);
var shadHeight = ((_local2.y + 10) - (HQ.player.ropeShadLocalPos.y + _local1.y));
HQ.player.ropeClip._width = ropeWidth;
HQ.player.ropeClip._height = ropeHeight;
HQ.player.ropeShadClip._width = shadWidth;
HQ.player.ropeShadClip._height = shadHeight;
};
_local1.crash = function () {
var _local1 = this;
if (!HQ.player.isCrashing) {
HQ.player.isCrashing = true;
HQ.player.shadowClip.gotoAndStop("crash");
HQ.player.wakeClip.gotoAndPlay("jump");
HQ.player.clip.gotoAndStop("crash");
_local1.ropeClip.gotoAndPlay("jump");
_local1.ropeShadClip.gotoAndPlay("jump");
HQ.player.velocity = new vector(0, -30, 0);
HQ.boat.playerCrashed = true;
_local1.crashClip = field_mc.objects_mc.attachMovie("player_crash", "crash", 10001);
_local1.crashClip._x = HQ.player.clip._x;
_local1.crashClip._y = HQ.player.clip._y;
HQ.gameInterface.turnOver();
}
};
_local1.crashFinish = function () {
HQ.transition.circleOut();
HQ.gameSound.fadeOut("surfMusic");
};
};
obstacle_class = function (num, oType, posVect) {
var _local1 = this;
_local1.depth = 1000 + (num * 2);
_local1.name = "obstacle_" + num;
_local1.obstacleType = oType;
HQ.obstacleList[_local1.name] = _local1;
if ((_local1.obstacleType > 2) && (_local1.obstacleType < 6)) {
_local1.sortMe = false;
} else {
_local1.sortMe = true;
}
_local1.boundingRect = new rect(0, 0, 0, 0);
_local1.clip = field_mc.objects_mc.attachMovie("obstacle_" + HQ.obstacle_array[_local1.obstacleType].name, _local1.name, _local1.depth);
if (HQ.obstacle_array[_local1.obstacleType].item == true) {
_local1.isItem = true;
} else {
_local1.isItem = false;
}
_local1.boundingSize = HQ.obstacle_array[_local1.obstacleType].box;
_local1.position = posVect.vectorCopy();
_local1.isHit = false;
_local1.update = function () {
var _local1 = this;
_local1.position.z = _local1.position.z + HQ.gamespeed;
var playerDiff = (_local1.position.z - HQ.player.position.z);
if (Math.abs(playerDiff) < 30) {
_local1.boundingRect.l = _local1.boundingSize.l + _local1.position.x;
_local1.boundingRect.r = _local1.boundingSize.r + _local1.position.x;
_local1.boundingRect.b = _local1.boundingSize.b + _local1.position.z;
_local1.boundingRect.f = _local1.boundingSize.f + _local1.position.z;
var checkLeft = (_local1.boundingRect.l < HQ.player.boundingRect.r);
var checkRight = (_local1.boundingRect.r > HQ.player.boundingRect.l);
var _local3 = _local1.boundingRect.b > HQ.player.boundingRect.f;
var checkBottom = (_local1.boundingRect.f < HQ.player.boundingRect.b);
if ((!HQ.player.isJumping) || (_local1.isItem == true)) {
if (!_local1.isHit) {
if (checkLeft) {
if (checkRight) {
if (_local3) {
if (checkBottom) {
_local1.isHit = true;
if (_local1.obstacleType == 0) {
var distZ = (HQ.player.position.z - _local1.position.z);
var distX = (HQ.player.position.x - _local1.position.x);
if (distZ < 10) {
if (distX > 0) {
var bounceVel = 20;
} else {
var bounceVel = -20;
}
HQ.player.velocity.x = HQ.player.velocity.x + bounceVel;
HQ.gameSound.playSound("hit");
} else {
HQ.gameSound.playSound("tubeBounce");
HQ.player.jump();
}
} else if (_local1.obstacleType == 1) {
var dist = (HQ.player.position.x - _local1.position.x);
if (dist > 0) {
var bounceVel = 20;
} else {
var bounceVel = -20;
}
HQ.player.velocity.x = HQ.player.velocity.x + bounceVel;
HQ.player.velocity.z = HQ.player.velocity.z + 10;
HQ.gameSound.playSound("bell");
HQ.gameSound.playSound("hit");
HQ.gameInterface.addPoints("buoy");
_local1.clip.play();
} else if (_local1.obstacleType == 2) {
_local1.clip.play();
HQ.player.velocity.z = HQ.player.velocity.z + 5;
HQ.gameSound.playSound("hit");
HQ.gameInterface.addPoints("cattails");
} else if (_local1.obstacleType < 6) {
HQ.player.crash();
} else if (_local1.obstacleType == 6) {
if (HQ.player.position.y < -25) {
HQ.gameSound.playSound("bigStar");
_local1.gotItem("bigStar");
}
} else if (_local1.obstacleType == 7) {
if (HQ.player.position.y > -25) {
HQ.gameSound.playSound("smallStar");
_local1.gotItem("smallStar");
}
}
}
}
}
}
}
}
}
if (_local1.sortMe) {
var newDepth = setDepth(_local1.position);
_local1.clip.swapDepths(newDepth);
}
var _local2 = HQ.iso.isoToScreen(_local1.position);
_local1.clip._x = _local2.x;
_local1.clip._y = _local2.y;
if (_local1.position.z > 700) {
_local1.clip.removeMovieClip();
delete HQ.obstacleList[_local1.name];
}
};
_local1.gotItem = function (itemType) {
if (!HQ.player.isCrashing) {
HQ.gameInterface.addPoints(itemType);
this.clip.removeMovieClip();
delete HQ.obstacleList[this.name];
}
};
};
gameSound_class = function () {
var _local1 = this;
_local1.soundOn = true;
_local1.musicClip = _root.createEmptyMovieClip("musicClip", 10000);
_local1.musicClipCount = 0;
_local1.bell = new Sound();
_local1.bell.attachSound("sound_bell");
_local1.smallStar = new Sound();
_local1.smallStar.attachSound("smallStar_sound");
_local1.bigStar = new Sound();
_local1.bigStar.attachSound("bigStar_sound");
_local1.splash = new Sound();
_local1.splash.attachSound("splash_sound");
_local1.lose = new Sound();
_local1.lose.attachSound("lose_sound");
_local1.jump = new Sound();
_local1.jump.attachSound("whoohoo");
_local1.hit = new Sound();
_local1.hit.attachSound("hit_1");
_local1.tubeBounce = new Sound();
_local1.tubeBounce.attachSound("sound_tubeBounce");
_local1.playSound = function (soundName) {
if (this.soundOn) {
this[soundName].start();
}
};
_local1.playMusic = function (name, linkage) {
var _local1 = this;
var _local2 = name;
_local1.musicClipCount++;
var _local3 = _local1.musicClip.createEmptyMovieClip(_local2, _local1.musicClipCount);
_local1[_local2] = new Sound(_local3);
_local1[_local2].attachSound(linkage);
_local1[_local2].start(0, 999);
_local1[_local2].setVolume(100);
_local3.mySound = _local1[_local2];
_local3.soundVolume = 100;
};
_local1.fadeOut = function (name) {
var _local1 = this;
_local1.musicClip[name].onEnterFrame = function () {
var _local1 = this;
_local1.soundVolume = _local1.soundVolume - 6;
_local1.mySound.setVolume(_local1.soundVolume);
if (_local1.soundVolume <= 0) {
_local1.mySound.stop();
delete _local1.onEnterFrame;
}
};
};
_local1.soundButtonPressed = function () {
var _local1 = this;
_local1.soundOn = !_local1.soundOn;
if (_local1.soundOn) {
HQ.gameSound.gameLoop.start(0, 999);
} else {
stopAllSounds();
}
};
};
Transition_class = function () {
var _local1 = this;
_local1.circleOut = function () {
var _local2 = this;
var _local3 = -118;
var crashOffsetY = 89;
_local2.clip = _root.attachMovie("circle_trans", "circle", 100);
var _local1 = {x:HQ.player.crashClip._x + _local3, y:HQ.player.crashClip._y + crashOffsetY};
_local1.x = _local1.x + field_mc._x;
_local1.y = _local1.y + field_mc._y;
_local2.clip._x = _local1.x;
_local2.clip._y = _local1.y;
field_mc.setMask(_local2.clip);
_local2.clip.scaleTo(0, 2, "linear", undefined, HQ.transition.transitionDone, "out");
};
_local1.transitionDone = function (dir) {
if (dir == "out") {
cover_mc._visible = true;
if (HQ.gameInterface.turns == 0) {
HQ.gameInterface.gameOver();
} else {
HQ.state = "reset";
HQ.transition.circleIn();
}
} else if (HQ.state == "gameover") {
removeMovieClip(_root.circle);
highScores_mc.play();
}
};
_local1.circleIn = function () {
var _local1 = this;
if (_local1.clip == undefined) {
_local1.clip = _root.attachMovie("circle_trans", "circle", 100);
}
cover_mc._visible = false;
_local1.clip._xscale = (_local1.clip._yscale = 0);
_local1.clip._x = Math.round(Stage.width / 2);
_local1.clip._y = Math.round(Stage.height / 2);
field_mc.setMask(_local1.clip);
_local1.clip.scaleTo(100, 1.5, "linear", undefined, HQ.transition.transitionDone, "in");
};
};
Interface_class = function () {
var _local1 = this;
_local1.scoreClip = interface_mc.score_mc;
_local1.turnClip = interface_mc.turns_mc;
_local1.turns = 3;
_local1.pointsCounter = 0;
_local1.score = 0;
_local1.itemType_list = {smallStar:100, bigStar:250, cattails:-50, buoy:-100};
var endPos = 23;
_local1.turnClip.slideTo(undefined, endPos, 1, "easeoutelastic", 0.5);
_local1.scoreClip.slideTo(undefined, endPos, 1, "easeoutelastic", 1);
_local1.showPoints = function (pointValue, x, y) {
var _local2 = this;
var _local3 = pointValue;
_local2.pointsCounter++;
var _local1 = field_mc.attachMovie("points", "points_" + _local2.pointsCounter, _local2.pointsCounter);
if (_local3 < 0) {
_local1.points_mc.points.textColor = 16711680 /* 0xFF0000 */;
}
_local1.points_mc.points.text = _local3;
_local1.points_mc.shadow.text = _local3;
_local1._x = x;
_local1._y = y;
};
_local1.addPoints = function (itemType) {
var _local1 = this;
var _local2 = _local1.itemType_list[itemType];
if (_local2 > 0) {
_local2 = _local2 + ((HQ.gameLevel - 1) * (_local2 / 2));
} else {
_local2 = _local2 - ((HQ.gameLevel - 1) * 50);
}
_local1.score = _local1.score + _local2;
if (_local1.score < 0) {
_local1.score = 0;
}
_local1.showPoints(_local2, HQ.player.clip._x, HQ.player.clip._y);
var _local3 = HQ.formatScore(_local1.score);
_local1.scoreClip.score = _local3;
if (_local1.score >= (HQ.gameLevel * (HQ.gameLevel * 1000))) {
_local1.nextLevel();
}
};
_local1.nextLevel = function () {
HQ.gameLevel++;
var _local1 = "LEVEL " + HQ.gameLevel;
interface_mc.levelNum_mc.levelText.level_txt = _local1;
interface_mc.levelNum_mc.levelText.shadow_txt = _local1;
interface_mc.levelNum_mc.play();
if (HQ.levelGameSpeed != HQ.maxGameSpeed) {
HQ.levelGameSpeed = HQ.levelGameSpeed + HQ.gameSpeedIncrement;
}
HQ.gameSpeed = HQ.levelGameSpeed;
};
_local1.turnOver = function () {
var _local1 = this;
_local1.turnClip["hat" + _local1.turns].play();
_local1.turns--;
};
_local1.gameOver = function () {
HQ.state = "gameover";
var delay = 0.1;
var _local3 = 0;
this.gOClip = interface_mc.gameOver_mc;
var _local1 = 0;
while (_local1 <= 8) {
var _local2 = this.gOClip["c" + _local1];
_local2.slideTo(undefined, _local2._y + 250, 2, "easeoutbounce", _local3 * delay);
_local3++;
_local1++;
}
this.turnClip.slideTo(undefined, -50, 0.5, "easeinexpo");
this.scoreClip.slideTo(undefined, -50, 0.5, "easeinexpo");
HQ.intervalID = setInterval(this, "gameOverReturn", 3000);
};
_local1.gameOverReturn = function () {
clearInterval(HQ.intervalID);
var _local3 = 0;
var delay = 0.1;
var _local1 = 0;
while (_local1 <= 8) {
var _local2 = this.gOClip["c" + _local1];
_local2.slideTo(undefined, _local2._y + 500, 1, "easeinback", _local3 * delay);
_local3++;
_local1++;
}
for (var a in field_mc.objects_mc) {
field_mc.objects_mc[a].removeMovieClip();
}
HQ.intervalID = setInterval(this, "showHighScores", 1500);
};
_local1.showHighScores = function () {
clearInterval(HQ.intervalID);
field_mc.topwave_mc._visible = false;
HQ.transition.circleIn();
};
};
gameState_class = function () {
HQ.state = "init";
this.main = function () {
switch (HQ.state) {
case "play" :
if (Key.isDown(39)) {
HQ.boat.slide("left");
} else if (Key.isDown(37)) {
HQ.boat.slide("right");
}
if (Key.isDown(38)) {
HQ.boat.accelerate("brake");
} else if (Key.isDown(40)) {
HQ.boat.accelerate("accel");
}
HQ.count++;
HQ.boat.update();
HQ.player.update();
HQ.gameState.makeObstacle();
for (var _local2 in HQ.obstacleList) {
HQ.obstacleList[_local2].update();
}
return;
case "init" :
HQ.iso = new Iso_class();
HQ.player = new Player_class();
HQ.boat = new Boat_class();
HQ.gameSound = new gameSound_class();
HQ.transition = new Transition_class();
HQ.gameInterface = new Interface_class();
HQ.dock = new Dock_class();
HQ.friction = 0.9;
HQ.centerSpeed = 0.9;
HQ.gravity = -2;
HQ.gamespeed = 0;
HQ.levelGameSpeed = 10;
HQ.maxGameSpeed = 16;
HQ.gameSpeedIncrement = 1;
HQ.obstacleCount = 0;
HQ.gameLevel = 1;
HQ.obstacleList = {};
HQ.count = 0;
HQ.playedGame = true;
HQ.state = "start";
return;
case "start" :
HQ.dock.reset();
HQ.transition.circleIn();
HQ.state = "play";
return;
case "reset" :
for (var _local1 in field_mc.objects_mc) {
field_mc.objects_mc[_local1].removeMovieClip();
}
HQ.player = new Player_class();
HQ.boat = new Boat_class();
HQ.gamespeed = 0;
HQ.obstacleCount = 0;
HQ.obstacleList = {};
HQ.count = 0;
HQ.state = "start";
return;
case "gameover" :
}
};
this.makeObstacle = function () {
if (!HQ.player.isCrashing) {
var maxCount = Math.max(80, 300 - (HQ.gameSpeed * 15));
if (HQ.count >= maxCount) {
var rand = random(HQ.obstacleGroups_array.length);
var _local2 = HQ.obstacleGroups_array[rand];
var _local1 = 0;
while (_local1 < _local2.length) {
HQ.obstacleCount++;
var _local3 = new obstacle_class(HQ.obstacleCount, _local2[_local1].oType, _local2[_local1].pos);
_local1++;
}
HQ.count = 0;
}
}
};
};
stop();
_quality = "low";
HQ.gameState = new gameState_class();
this.onEnterFrame = HQ.gameState.main;
Symbol 18 MovieClip Frame 1
stop();
Symbol 18 MovieClip Frame 10
stop();
Symbol 60 MovieClip Frame 1
var i = 1;
while (i <= 3) {
this["trail" + i].gotoAndPlay((i * 6) + 1);
i++;
}
Symbol 74 MovieClip [wake] Frame 1
wake_left.gotoAndPlay(5);
Symbol 74 MovieClip [wake] Frame 15
stop();
Symbol 74 MovieClip [wake] Frame 26
stop();
Symbol 89 MovieClip Frame 1
var delay1 = 0.5;
var delay2 = 2;
star1._alpha = 0;
star2._alpha = 0;
star1._rotation = 180;
star2._rotation = -180;
star1.tween(["_xscale", "_yscale", "_rotation", "_alpha"], [20, 20, 0, 100], 2, "easeOutExpo", 1);
star2.tween(["_xscale", "_yscale", "_rotation", "_alpha"], [20, 20, 0, 100], 2, "easeOutExpo", 1);
var pos = title_mc._y;
title_mc._y = title_mc._y - 150;
title_mc._alpha = 0;
title_mc.alphaTo(100, 0.5, "linear", delay1);
title_mc.slideTo(undefined, pos, 1.5, "easeoutbounce", delay1);
HQ.keyListener = {};
HQ.keyListener.onKeyUp = function () {
HQ.cheat_array.shift();
HQ.cheat_array.push(String.fromCharCode(Key.getAscii()));
if (HQ.cheat_array.toString() == "c,o,w,b,o,y") {
HQ.cheatsEnabled = true;
trace("cheats enabled");
Key.removeListener(HQ.keyListener);
}
};
Key.addListener(HQ.keyListener);
Symbol 89 MovieClip Frame 65
function showButton() {
if (!startButtonVisible) {
if (HQ.sectionsLoaded == true) {
startButtonVisible = true;
b_startgame.slideTo(undefined, pos, 1, "easeoutsine");
}
}
if (!scoresButtonVisible) {
if (HQ.highScoresLoaded == true) {
scoresButtonVisible = true;
b_highscores.slideTo(undefined, pos, 1, "easeoutsine");
}
}
}
function close() {
b_startgame.slideTo(undefined, pos + 100, 0.5, "easeinback");
b_highscores.slideTo(undefined, pos + 100, 0.5, "easeinback");
star1.slideTo(star1._x - 100, undefined, 0.5, "easeinsine");
star2.slideTo(star2._x + 100, undefined, 0.5, "easeinsine");
title_mc.slideTo(undefined, -300, 0.5, "easeinback");
play();
}
stop();
var startButtonVisible = false;
var scoresButtonVisible = false;
var gotoHighScores = false;
var pos = b_highscores._y;
b_highscores._y = (b_startgame._y = pos + 100);
var bRollOver = function () {
this.scaleTo(120, 1, "easeoutelastic");
};
var bRollOut = function () {
this.scaleTo(100, 1, "easeoutelastic");
};
b_highscores.onRollOver = bRollOver;
b_highscores.onRollOut = bRollOut;
b_highscores.onRelease = function () {
this._parent.gotoHighScores = true;
this._parent.close();
};
b_startgame.onRollOver = bRollOver;
b_startgame.onRollOut = bRollOut;
b_startgame.onRelease = function () {
this._parent.close();
};
showButton();
Symbol 89 MovieClip Frame 90
if (gotoHighScores == true) {
_root.gotoAndStop("highscores");
} else if (HQ.playedGame == true) {
_root.gotoAndStop("gamestart");
} else {
_root.nextFrame();
}
Symbol 95 MovieClip Frame 1
stop();
Symbol 109 MovieClip Frame 1
stop();
Symbol 149 MovieClip Frame 1
up.gotoAndStop("up");
down.gotoAndStop("down");
left.gotoAndStop("left");
right.gotoAndStop("right");
Symbol 149 MovieClip Frame 18
function close(buttonP) {
dir = buttonP;
delete this.onEnterFrame;
up.scaleTo(0, 0.5, "easeinback");
down.scaleTo(0, 0.5, "easeinback", 0.2);
left.scaleTo(0, 0.5, "easeinback", 0.3);
right.scaleTo(0, 0.5, "easeinback", 0.1);
b_next.slideTo(undefined, pos + 100, 0.5, "easeinback", 0.2);
b_back.slideTo(undefined, pos + 100, 0.5, "easeinback");
player_mc.stopTween();
player_mc.slideTo(-400, undefined, 0.5, "easeinback");
gotoAndPlay ("close");
}
var startPos = {x:240, y:400};
var frameCount = 0;
var scaleSize = 120;
stop();
this.onEnterFrame = function () {
frameCount++;
switch (frameCount) {
case 1 :
player_mc.slideTo(startPos.x, startPos.y, 1, "easeoutsine");
return;
case 40 :
up.gotoAndStop("up_glow");
up.scaleTo(scaleSize, 0.5, "easeoutelastic");
player_mc.slideTo(400, 260, 1, "easeinoutsine");
return;
case 80 :
up.gotoAndStop("up");
down.gotoAndStop("down_glow");
down.scaleTo(scaleSize, 0.5, "easeoutelastic");
up.scaleTo(100, 0.5, "easeoutelastic");
player_mc.slideTo(170, 490, 1, "easeinoutsine");
return;
case 120 :
down.gotoAndStop("down");
left.gotoAndStop("left_glow");
left.scaleTo(scaleSize, 0.5, "easeoutelastic");
down.scaleTo(100, 0.5, "easeoutelastic");
player_mc.slideTo(4, 344, 1, "easeinoutsine");
return;
case 160 :
left.gotoAndStop("left");
right.gotoAndStop("right_glow");
right.scaleTo(scaleSize, 0.5, "easeoutelastic");
left.scaleTo(100, 0.5, "easeoutelastic");
player_mc.slideTo(375, 375, 1.5, "easeinoutsine");
return;
case 200 :
frameCount = 0;
right.gotoAndStop("right");
right.scaleTo(100, 0.5, "easeoutelastic");
for (var _local1 in key_array) {
keyArray[_local1].gotoAndStop(keyArray[_local1]._name);
}
}
};
var pos = b_next._y;
b_next._y = pos + 100;
b_back._y = pos + 100;
b_next.slideTo(undefined, pos, 1, "easeoutsine");
b_back.slideTo(undefined, pos, 1, "easeoutsine");
var bRollOver = function () {
this.scaleTo(120, 1, "easeoutelastic");
};
var bRollOut = function () {
this.scaleTo(100, 1, "easeoutelastic");
};
b_next.onRollOver = bRollOver;
b_back.onRollOver = bRollOver;
b_next.onRollOut = bRollOut;
b_back.onRollOut = bRollOut;
b_next.onRelease = function () {
this._parent.close("next");
};
b_back.onRelease = function () {
this._parent.close("back");
};
Symbol 149 MovieClip Frame 42
if (dir == "next") {
_root.nextFrame();
} else {
_root.prevFrame();
}
Symbol 178 MovieClip Frame 1
buoyStartPos = {x:buoy._x, y:buoy._y};
rocksStartPos = {x:rocks._x, y:rocks._y};
cattailsStartPos = {x:cattails._x, y:cattails._y};
sandbarStartPos = {x:sandbar._x, y:sandbar._y};
var maxX = 650;
var maxY = 600;
var frameCount = 0;
this.onEnterFrame = function () {
frameCount++;
switch (frameCount) {
case 1 :
buoy._x = buoyStartPos.x;
buoy._y = buoyStartPos.y;
buoy.slideTo(buoyStartPos.x + maxX, buoyStartPos.y - maxY, 5, "linear");
return;
case 75 :
cattails._x = cattailsStartPos.x;
cattails._y = cattailsStartPos.y;
cattails.slideTo(cattailsStartPos.x + maxX, cattailsStartPos.y - maxY, 5, "linear");
return;
case 150 :
rocks._x = rocksStartPos.x;
rocks._y = rocksStartPos.y;
rocks.slideTo(rocksStartPos.x + maxX, rocksStartPos.y - maxY, 5, "linear");
return;
case 225 :
sandbar._x = sandbarStartPos.x;
sandbar._y = sandbarStartPos.y;
sandbar.slideTo(sandbarStartPos.x + maxX, sandbarStartPos.y - maxY, 5, "linear");
return;
case 300 :
frameCount = 0;
}
};
Symbol 178 MovieClip Frame 20
function close(buttonP) {
dir = buttonP;
delete this.onEnterFrame;
b_next.slideTo(undefined, pos + 100, 0.5, "easeinback", 0.2);
b_back.slideTo(undefined, pos + 100, 0.5, "easeinback");
sandbar.alphaTo(0, 0.5, "linear");
buoy.alphaTo(0, 0.5, "linear");
cattails.alphaTo(0, 0.5, "linear");
rocks.alphaTo(0, 0.5, "linear");
player_mc.slideTo(-400, undefined, 0.5, "easeinback");
gotoAndPlay ("close");
}
stop();
var pos = b_next._y;
b_next._y = pos + 100;
b_back._y = pos + 100;
b_next.slideTo(undefined, pos, 1, "easeoutsine");
b_back.slideTo(undefined, pos, 1, "easeoutsine");
var bRollOver = function () {
this.scaleTo(120, 1, "easeoutelastic");
};
var bRollOut = function () {
this.scaleTo(100, 1, "easeoutelastic");
};
b_next.onRollOver = bRollOver;
b_back.onRollOver = bRollOver;
b_next.onRollOut = bRollOut;
b_back.onRollOut = bRollOut;
b_next.onRelease = function () {
this._parent.close("next");
};
b_back.onRelease = function () {
this._parent.close("back");
};
Symbol 178 MovieClip Frame 40
if (dir == "next") {
_root.nextFrame();
} else {
_root.prevFrame();
}
Symbol 194 MovieClip Frame 30
function showButton() {
if (!buttonVisible) {
if (HQ.loadFinished) {
buttonVisible = true;
b_next.slideTo(undefined, pos, 1, "easeoutsine");
}
}
}
function close(buttonP) {
dir = buttonP;
b_next.slideTo(undefined, pos + 100, 0.5, "easeinback", 0.2);
b_back.slideTo(undefined, pos + 100, 0.5, "easeinback");
gotoAndPlay ("close");
}
stop();
var buttonVisible = false;
var pos = b_next._y;
b_next._y = pos + 100;
b_back._y = pos + 100;
b_back.slideTo(undefined, pos, 1, "easeoutsine");
var bRollOver = function () {
this.scaleTo(120, 1, "easeoutelastic");
};
var bRollOut = function () {
this.scaleTo(100, 1, "easeoutelastic");
};
b_next.onRollOver = bRollOver;
b_back.onRollOver = bRollOver;
b_next.onRollOut = bRollOut;
b_back.onRollOut = bRollOut;
b_next.onRelease = function () {
this._parent.close("next");
};
b_back.onRelease = function () {
this._parent.close("back");
};
showButton();
Symbol 194 MovieClip Frame 50
if (dir == "next") {
_root.nextFrame();
} else {
_root.prevFrame();
}
Symbol 227 MovieClip [obstacle_cattails] Frame 1
stop();
Symbol 252 MovieClip Frame 1
stop();
Symbol 252 MovieClip Frame 2
function showSubmit() {
submit_button.slideTo(undefined, submitPos, 1.5, "easeoutsine");
}
function verifyName() {
var _local3 = nameBox_mc.input_txt;
var _local2 = _local3.text;
var _local1 = true;
if (_local2 == "") {
_local1 = false;
}
if (_local2.indexOf("SHIT") != -1) {
_local1 = false;
}
if (_local2.indexOf("FUCK") != -1) {
_local1 = false;
}
if (_local2.indexOf("ASS") != -1) {
_local1 = false;
}
if (_local2.indexOf("DICK") != -1) {
_local1 = false;
}
if (_local2.indexOf("COCK") != -1) {
_local1 = false;
}
if (_local2.indexOf("PENIS") != -1) {
_local1 = false;
}
if (_local2.indexOf("PUSSY") != -1) {
_local1 = false;
}
if (_local2.indexOf("TITS") != -1) {
_local1 = false;
}
if (_local2.indexOf("SHLONG") != -1) {
_local1 = false;
}
if (_local2.indexOf("POOP") != -1) {
_local1 = false;
}
if (_local2.indexOf("TURD") != -1) {
_local1 = false;
}
if (!_local1) {
_local3.text = "NICK";
}
HQ.playerName = _local3.text;
_parent.submitHighScore();
submit_button.slideTo(undefined, 300, 0.5, "easeinexpo");
youveGot_mc.slideTo(undefined, -300, 0.5, "easeinback");
nameBox_mc.slideTo(undefined, 300, 0.5, "easeinback");
star_1.slideTo(-300, undefined, 0.5, "easeinexpo");
star_2.slideTo(300, undefined, 0.5, "easeinexpo");
}
stop();
star_1._alpha = 0;
star_2._alpha = 0;
star_1._rotation = 180;
star_2._rotation = -180;
star_1.tween(["_xscale", "_yscale", "_rotation", "_alpha"], [20, 20, 0, 100], 2, "easeOutExpo");
star_2.tween(["_xscale", "_yscale", "_rotation", "_alpha"], [20, 20, 0, 100], 2, "easeOutExpo");
var pos = youveGot_mc._y;
youveGot_mc._y = youveGot_mc._y - 150;
youveGot_mc._alpha = 0;
youveGot_mc.alphaTo(100, 0.5, "linear");
youveGot_mc.slideTo(undefined, pos, 1.5, "easeoutbounce");
var namePos = nameBox_mc._y;
nameBox_mc._y = nameBox_mc._y + 150;
nameBox_mc._alpha = 0;
nameBox_mc.alphaTo(100, 0.5, "linear");
nameBox_mc.slideTo(undefined, namePos, 1.5, "easeoutbounce");
var submitPos = submit_button._y;
submit_button._y = submit_button._y + 150;
var bRollOver = function () {
this.scaleTo(120, 1, "easeoutelastic");
};
var bRollOut = function () {
this.scaleTo(100, 1, "easeoutelastic");
};
submit_button.onRollOver = bRollOver;
submit_button.onRollOut = bRollOut;
submit_button.onRelease = verifyName;
nameBox_mc.input_txt.onSetFocus = function () {
this.text = "";
this._parent._parent.showSubmit();
};
nameBox_mc.input_txt.onChanged = function () {
this.text = this.text.toUpperCase();
};
Symbol 261 MovieClip [highscores] Frame 1
stop();
Symbol 261 MovieClip [highscores] Frame 2
function serverTimeout() {
trace("serverTimeout");
clearInterval(HQ.serverWaitInterval);
HQ.serverPresent = false;
createDefaultHighScoreList();
}
function getScores() {
var _local2 = this;
trace("get scores");
HQ.getScores_lv = new LoadVars();
HQ.getScores_lv.load(serverPath + "getScores.asp");
HQ.serverWaitInterval = setInterval(serverTimeout, HQ.serverTimeoutSec);
HQ.getScores_lv.onLoad = function () {
var _local2 = this;
if ((_local2.num_results != undefined) && (HQ.serverPresent)) {
clearInterval(HQ.serverWaitInterval);
var _local1 = 0;
while (_local1 < 10) {
HQ.highScores_array[_local1] = {username:_local2["username_" + _local1], score:_local2["scores_" + _local1]};
_local1++;
}
if (HQ.highScoresFromIntro) {
showScores();
} else {
checkForHighScore();
}
}
};
}
function createDefaultHighScoreList() {
var _local1 = [{score:999999, username:"Nick"}, {score:90000, username:"Matt"}, {score:80000, username:"Rob"}, {score:70000, username:"Chad"}, {score:60000, username:"Ben"}, {score:50000, username:"Andrew"}, {score:40000, username:"Kristin"}, {score:30000, username:"Brian"}, {score:20000, username:"JBar"}, {score:10000, username:"Michael"}];
HQ.highScores_array = _local1;
showScores();
}
function checkForHighScore() {
trace("check for highscore");
if (Number(HQ.highScores_array[9].score) < HQ.playerScore) {
nameInput_mc.play();
} else {
showScores();
}
}
function submitHighScore() {
var _local2 = this;
trace("submit high score");
HQ.serverWaitInterval = setInterval(serverTimeout, HQ.serverTimeoutSec);
HQ.sendScore_lv = new LoadVars();
HQ.receiveScores_lv = new LoadVars();
HQ.sendScore_lv.username = HQ.playerName;
HQ.sendScore_lv.scores = HQ.playerScore;
HQ.sendScore_lv.sendAndLoad(serverPath + "submitScore.asp", HQ.receiveScores_lv, "GET");
HQ.receiveScores_lv.onLoad = function () {
var _local2 = this;
if (_local2.num_results != undefined) {
clearInterval(HQ.serverWaitInterval);
if (Number(_local2.num_results) != 0) {
var _local1 = 0;
while (_local1 < 10) {
HQ.highScores_array[_local1] = {username:_local2["username_" + _local1], score:_local2["scores_" + _local1]};
_local1++;
}
}
showScores();
}
};
}
HQ.highScores_array = new Array();
HQ.isHighScore = false;
HQ.playerName = "";
HQ.serverTimeoutSec = 3000;
HQ.serverPresent = true;
HQ.playerScore = HQ.gameInterface.score;
serverPath = "http://flash.scripps.com/scrippsnetworks/tubin/";
function showScores() {
var startY = 90;
var spacing = 25;
var nameX = 160;
var scoreX = (nameX + 150);
highscore_txtmc.slideTo(undefined, 50, 2, "easeoutbounce");
var _local1 = 0;
while (_local1 < HQ.highScores_array.length) {
var curScore = HQ.highScores_array[_local1];
var _local2 = attachMovie("highscores_name", "name_" + _local1, 10 + (_local1 * 2));
var _local3 = attachMovie("highscores_name", "score_" + _local1, 9 + (_local1 * 2));
_local2.name = curScore.username;
_local3.name = HQ.formatScore(curScore.score);
var yVal = (startY + (_local1 * spacing));
_local2._x = nameX - 300;
_local3._x = scoreX + 300;
_local2._y = (_local3._y = yVal);
_local2.slideTo(nameX, undefined, 1, "easeoutexpo", (_local1 + 1) * 0.2);
_local3.slideTo(scoreX, undefined, 1, "easeoutexpo", (_local1 + 1) * 0.2);
_local1++;
}
if (HQ.highScoresFromIntro == true) {
b_back.slideTo(undefined, 375, 1, "easeoutsine");
HQ.highScoresFromIntro = false;
} else {
b_playagain.slideTo(undefined, 375, 1, "easeoutsine");
b_dreamhome.slideTo(undefined, 375, 1, "easeoutsine", 0.2);
}
var bRollOver = function () {
this.scaleTo(120, 1, "easeoutelastic");
};
var bRollOut = function () {
this.scaleTo(100, 1, "easeoutelastic");
};
b_back.onRollOver = (b_playagain.onRollOver = (b_dreamhome.onRollOver = bRollOver));
b_back.onRollOut = (b_playagain.onRollOut = (b_dreamhome.onRollOut = bRollOut));
b_back.onRelease = function () {
this._parent.close("start");
this.slideTo(undefined, 450, 1, "easeinback");
};
b_playagain.onRelease = function () {
var _local1 = this;
_local1._parent.close("playAgain");
_local1.slideTo(undefined, 450, 1, "easeinback");
_local1._parent.b_dreamhome.slideTo(undefined, 450, 1, "easeinback", 0.2);
};
b_dreamhome.onRelease = function () {
var _local1 = this;
_local1._parent.close("dreamhome");
_local1._parent.b_playagain.slideTo(undefined, 450, 1, "easeinback");
_local1.slideTo(undefined, 450, 1, "easeinback", 0.2);
};
}
function close(sec) {
gotoSection = sec;
var callBack = function () {
gotoAndPlay ("close");
};
highscore_txtmc.slideTo(undefined, -50, 0.75, "easeinexpo", 0, callBack);
var delay = 0.05;
var _local1 = 0;
while (_local1 < HQ.highScores_array.length) {
var _local2 = this["name_" + _local1];
var _local3 = this["score_" + _local1];
_local2.slideTo(-200, undefined, 0.75, "easeinexpo", _local1 * delay);
_local3.slideTo(600, undefined, 0.75, "easeinexpo", _local1 * delay);
_local1++;
}
}
_quality = "high";
getScores();
Symbol 261 MovieClip [highscores] Frame 69
stop();
Symbol 261 MovieClip [highscores] Frame 90
stop();
if (gotoSection == "start") {
_root.gotoAndStop("screen01");
} else if (gotoSection == "playAgain") {
_root.gotoAndPlay(1);
} else if (gotoSection == "dreamhome") {
getURL ("http://www.hgtv.com/hgtv/dream_home/", "_parent");
}
Symbol 300 MovieClip Frame 38
_parent.gotoAndStop("idle");
Symbol 303 MovieClip [player] Frame 1
stop();
Symbol 349 MovieClip [player_crash] Frame 37
HQ.gamespeed = 0;
Symbol 349 MovieClip [player_crash] Frame 64
stop();
HQ.player.crashFinish();
Symbol 354 MovieClip [player_shadow] Frame 1
stop();
Symbol 391 MovieClip [obstacle_buoy] Frame 1
stop();
Symbol 455 MovieClip [obstacle_dock] Frame 87
HQ.dock.inTube();
Symbol 455 MovieClip [obstacle_dock] Frame 88
stop();
Symbol 460 MovieClip [points] Frame 31
stop();
removeMovieClip(this);
Symbol 469 MovieClip Frame 1
stop();
Symbol 482 MovieClip Frame 1
stop();
Symbol 482 MovieClip Frame 25
stop();
Symbol 506 MovieClip Frame 1
stop();