Frame 4
nz.co.resn.stats.FlashStat.googleAnalyticsEnabled = false;
nz.co.resn.stats.FlashStat.resnStatsEnabled = true;
nz.co.resn.stats.FlashStat.statFolderPath = "http://www.resncreative.com/stats/liamfinn/";
if (System.capabilities.playerType == "External") {
nz.co.resn.stats.FlashStat.debug = true;
}
nz.co.resn.stats.FlashStat.hit("/loading");
if (getBytesLoaded() >= getBytesTotal()) {
gotoAndPlay ("start");
}
Frame 5
minStartTime = getTimer() + 2000;
Frame 7
if ((getBytesLoaded() < getBytesTotal()) || (getTimer() < minStartTime)) {
gotoAndPlay(_currentframe - 1);
}
Frame 30
nz.co.resn.stats.FlashStat.hit("/home");
Instance of Symbol 355 MovieClip "game" in Frame 30
/* no clip actions */
Frame 99
stop();
game.screens.gotoScreen("start");
Symbol 4 MovieClip Frame 11
if (_parent.getBytesLoaded() >= _parent.getBytesTotal()) {
gotoAndStop (1);
}
Symbol 4 MovieClip Frame 32
stop();
Symbol 8 MovieClip Frame 1
if (!inited) {
inited = true;
this.onEnterFrame = function () {
gotoAndStop(Math.ceil(Math.random() * _totalframes));
};
}
Symbol 9 MovieClip Frame 10
stop();
Symbol 10 MovieClip Frame 1
stop();
Symbol 11 MovieClip Frame 14
if (_parent.getBytesLoaded() >= _parent.getBytesTotal()) {
gotoAndStop (1);
}
Symbol 11 MovieClip Frame 15
this.onEnterFrame = function () {
loadProgress = _parent.getBytesLoaded() / _parent.getBytesTotal();
curLoaderFrame = Math.floor(loader._totalframes * loadProgress);
if (curLoaderFrame < 1) {
curLoaderFrame = 1;
}
loader.gotoAndStop(curLoaderFrame);
};
Symbol 11 MovieClip Frame 30
stop();
Symbol 356 MovieClip [__Packages.nz.co.resn.stats.FlashStat] Frame 0
class nz.co.resn.stats.FlashStat
{
function FlashStat () {
}
static function hit(hitPath) {
if (debug) {
trace("FlashStat.hit: " + hitPath);
}
if (resnStatsEnabled) {
var _local1 = new LoadVars();
_local1.sendAndLoad(statFolderPath + hitPath, _local1, "POST");
}
if (googleAnalyticsEnabled) {
getURL (("javascript:urchinTracker('" + hitPath) + "');");
}
}
static var resnStatsEnabled = true;
static var googleAnalyticsEnabled = false;
static var statFolderPath = "/stats/";
static var debug = false;
}
Symbol 357 MovieClip [__Packages.nz.co.resn.game_utils.HighScores] Frame 0
class nz.co.resn.game_utils.HighScores
{
var highScores, a, b, cb;
function HighScores () {
highScores = new XML();
highScores.ignoreWhite = true;
highScores.onLoad = nz.co.resn.util.Proxy.create(this, onHighScoresLoaded);
}
function setScore(score) {
if ((score << 0) != score) {
trace("HighScores.setScore: score must be an integer");
}
a = Math.round(Math.random() * 2147483647) + 123456789;
b = score ^ a;
}
function getScore() {
return(b ^ a);
}
function getHighScores(gameID, limit, options, callBack) {
cb = callBack;
var _local3 = new LoadVars();
_local3.game = gameID;
_local3.limit = limit;
if (options != null) {
for (var _local4 in options) {
_local3[("options[" + _local4) + "]"] = options[_local4];
}
}
_local3.sendAndLoad(highScorePath, highScores, "POST");
}
function saveHighScore(gameID, name, email, other, callBack) {
var _local2 = new LoadVars();
_local2.game = gameID;
_local2.x = (getScore() * 4) ^ 2147483647;
_local2.z = getScore();
_local2.name = name;
_local2.email = email;
_local2.other = other;
_local2.onLoad = callBack;
_local2.sendAndLoad(highScorePath, _local2, "POST");
}
function isLoading() {
return(!highScores.loaded);
}
function onHighScoresLoaded(success) {
if (cb != null) {
cb(highScores);
}
}
static var highScorePath = "highscores.php";
}
Symbol 358 MovieClip [__Packages.nz.co.resn.util.Proxy] Frame 0
class nz.co.resn.util.Proxy
{
function Proxy () {
}
static function create(oTarget, fFunction) {
var aParameters = new Array();
var _local2 = 2;
while (_local2 < arguments.length) {
aParameters[_local2 - 2] = arguments[_local2];
_local2++;
}
var _local4 = function () {
var _local2 = arguments.concat(aParameters);
fFunction.apply(oTarget, _local2);
};
return(_local4);
}
}
Symbol 16 MovieClip Frame 4
if (_parent.getBytesLoaded() >= _parent.getBytesTotal()) {
gotoAndStop (1);
}
Symbol 16 MovieClip Frame 54
stop();
Symbol 24 Button
on (rollOver, dragOver) {
over = true;
}
on (rollOut, dragOut) {
over = false;
}
on (release) {
if (_parent.isIntro) {
nz.co.resn.stats.FlashStat.hit("/loading/resn");
} else {
nz.co.resn.stats.FlashStat.hit("/game/over/resn");
}
getURL ("http://www.resn.co.nz", "_blank");
}
Symbol 25 MovieClip Frame 1
if (!inited) {
inited = true;
this.onEnterFrame = function () {
if (over) {
nextFrame();
} else {
prevFrame();
}
};
}
Symbol 26 MovieClip Frame 1
isIntro = true;
Symbol 26 MovieClip Frame 5
if (_parent.getBytesLoaded() >= _parent.getBytesTotal()) {
gotoAndStop (1);
}
Symbol 26 MovieClip Frame 26
stop();
Symbol 33 MovieClip Frame 1
function init() {
idleTrackClip = this.createEmptyMovieClip("idleTrackClip", this.getNextHighestDepth());
idleTrack = new Sound(idleTrackClip);
idleTrack.attachSound("idleTrack");
idleTrack.setVolume(curIdleVolume);
idleTrack.start(0, 9999);
tracks = [];
ti = 1;
while (ti <= numTracks) {
curTrack = new Sound();
curTrack.attachSound("track" + ti);
curTrack.isLoaded = true;
curTrack.trackNum = ti;
tracks[ti] = curTrack;
ti++;
}
ti = 1;
while (ti <= numTracks) {
curTrack = tracks[ti];
if (ti < numTracks) {
curTrack.nextTrack = tracks[ti + 1];
} else {
curTrack.nextTrack = tracks[1];
}
ti++;
}
gameIsPaused = true;
startIdleLoop();
this.onEnterFrame = step;
}
function step() {
if ((((((curTrack.finished && (!leveledUp)) && (curTrack.nextTrack != undefined)) && (curTrack.nextTrack.isLoaded)) && (_parent.game != undefined)) && (!_parent.game.gameIsOver)) && (!_parent.game.gameIsPaused)) {
if (_parent.game.gameStarted) {
leveledUp = true;
if (_parent.game.curLevelNum < _parent.game.numLevels) {
_parent.game.levelUp();
} else {
startTrack(curTrack.nextTrack.trackNum);
}
} else {
startTrack(curTrack.trackNum);
}
}
curIdleVolume = curIdleVolume + ((targetIdleVolume - curIdleVolume) * 0.1);
idleTrack.setVolume(curIdleVolume);
}
function startTrack(newTrackNum) {
trace("startTrack " + newTrackNum);
curTrackNum = newTrackNum;
curTrack = tracks[curTrackNum];
curTrackName = trackNames[curTrackNum];
nz.co.resn.stats.FlashStat.hit("/game/tracks/" + curTrackName);
prevTrack.stop();
curTrack.start();
curTrack.finished = false;
curTrack.onSoundComplete = trackFinished;
curTrack.pause();
prevTrack = curTrack;
}
function startIdleLoop() {
trace("startIdleLoop");
idleLooping = true;
targetIdleVolume = 100;
idleTrack.stop();
idleTrack.start(0, 9999);
}
function endIdleLoop() {
trace("endIdleLoop");
idleLooping = false;
targetIdleVolume = 0;
}
function pauseTrack() {
trace("pauseTrack " + trackPaused);
if (!trackPaused) {
trackPaused = true;
pauseTime = curTrack.position;
curTrack.stop();
}
}
function resumeTrack() {
trace("resumeTrack " + trackPaused);
if (trackPaused) {
trackPaused = false;
if (_parent.game.gameStarted) {
trace("pauseTime: " + pauseTime);
curTrack.start(pauseTime / 1000);
}
}
}
function gamePaused() {
trace("gamePaused isPaused? " + gameIsPaused);
if (!gameIsPaused) {
gameIsPaused = true;
trace("gamePaused");
pauseTrack();
startIdleLoop();
}
}
function gameResumed() {
trace("gameResumed isPaused? " + gameIsPaused);
if (gameIsPaused) {
gameIsPaused = false;
trace("gameResumed");
resumeTrack();
endIdleLoop();
}
}
function deactivateGame() {
trace("deactivateGame");
gameIsPaused = true;
trace("gameIsPaused: " + gameIsPaused);
pauseTrack();
}
function loadTrack(targetTrack, nextTrackNum) {
trace((("loadTrack " + targetTrack) + ",") + nextTrackNum);
if (nextTrackNum <= numTracks) {
nextTrack = tracks[nextTrackNum];
targetTrack.nextTrack = nextTrack;
if (!nextTrack.isLoaded) {
if (nextTrackNum == numTracks) {
nextTrack.nextTrack = tracks[1];
}
newTrackUrl = (trackUrlPrefix + nextTrackNum) + trackUrlAffix;
trace("load track " + newTrackUrl);
nextTrack.loadSound(newTrackUrl, false);
nextTrack.onLoad = nextTrackLoaded;
}
}
}
function trackFinished() {
curTrack.finished = true;
leveledUp = false;
}
function nextTrackLoaded() {
this.isLoaded = true;
loadTrack(this, this.trackNum + 1);
}
stop();
numTracks = 3;
trackUrlPrefix = "http://www.resncreative.com/games/liamfinn/audio/track";
trackUrlAffix = ".mp3";
curIdleVolume = (targetIdleVolume = 0);
trackNames = [];
trackNames[1] = "gather-to-the-chapel";
trackNames[2] = "second-chance";
trackNames[3] = "better-to-be";
init();
Symbol 48 MovieClip Frame 1
stop();
Symbol 48 MovieClip Frame 10
play();
Symbol 48 MovieClip Frame 40
gotoAndStop ("hidden");
Symbol 51 MovieClip Frame 1
stop();
Symbol 51 MovieClip Frame 21
stop();
Symbol 56 MovieClip Frame 1
stop();
Symbol 56 MovieClip Frame 10
play();
Symbol 56 MovieClip Frame 71
stop();
_parent._parent.hideComet();
Symbol 57 MovieClip Frame 1
stop();
Symbol 108 MovieClip Frame 1
startX = head._x;
Symbol 154 MovieClip Frame 1
stop();
Symbol 158 MovieClip Frame 1
function reset() {
ready = true;
if (!inited) {
arm.hand.charge._alpha = 0;
arm.upperArm.charge._alpha = 0;
arm.hand.chargeGlow._alpha = 0;
inited = true;
}
idle();
}
function walk(walkDirection) {
if ((ready && (inited)) && (!moving)) {
moving = true;
direction = walkDirection;
gotoAndPlay(direction);
_parent.updatePlayer();
}
}
function electrocute() {
if ((ready && (inited)) && (!_parent.electrocuting)) {
moving = true;
walking = false;
_parent.electrocuting = true;
gotoAndPlay ("electrocute");
_parent.updatePlayer();
}
}
function idleLoop() {
if (ready) {
ready = false;
gotoAndPlay ("playGuitar");
}
}
function idle() {
if (ready && (inited)) {
moving = false;
walking = false;
_parent.electrocuting = false;
gotoAndStop ("norm");
_parent.updatePlayer();
if (_parent.gameIsPaused || (_parent.gameIsOver)) {
idleLoop();
}
}
}
Symbol 158 MovieClip Frame 118
if (_parent.gameStarted) {
gotoAndPlay ("skipToNorm");
}
Symbol 158 MovieClip Frame 140
play();
Symbol 158 MovieClip Frame 167
if (((!_parent.gameStarted) || (_parent.gameIsPaused)) || (_parent.gameIsOver)) {
gotoAndPlay ("playGuitarLoop");
}
Symbol 158 MovieClip Frame 179
stop();
reset();
Symbol 158 MovieClip Frame 184
play();
Symbol 158 MovieClip Frame 194
gotoAndPlay ("playGuitarLoop");
Symbol 158 MovieClip Frame 206
stop();
reset();
Symbol 158 MovieClip Frame 209
stop();
Symbol 158 MovieClip Frame 215
play();
Symbol 158 MovieClip Frame 216
walking = true;
Symbol 158 MovieClip Frame 242
walking = false;
Symbol 158 MovieClip Frame 245
idle();
Symbol 158 MovieClip Frame 250
play();
Symbol 158 MovieClip Frame 251
walking = true;
Symbol 158 MovieClip Frame 277
walking = false;
Symbol 158 MovieClip Frame 280
idle();
Symbol 158 MovieClip Frame 285
play();
Symbol 158 MovieClip Frame 304
_parent.electrocuting = false;
Symbol 158 MovieClip Frame 309
idle();
Symbol 165 MovieClip Frame 1
stop();
Symbol 169 MovieClip Frame 1
stop();
Symbol 172 MovieClip Frame 1
textHint.text = _parent.curHintText;
Symbol 173 MovieClip Frame 1
function updateHint() {
if (curHint == undefined) {
curHint = startHint;
game.hint_restartHints = false;
} else {
if (resumeHint != undefined) {
curHint = resumeHint;
resumeHint = undefined;
}
if (game.hint_electrocuted) {
game.hint_testElectrocuted = false;
game.hint_electrocuted = false;
game.hint_shownElectrocuted = true;
resumeHint = curHint;
curHint = "hint_electrocute";
} else {
switch (curHint) {
case "hint_intro" :
curHint = "hint_idea";
break;
case "hint_idea" :
curHint = "hint_aim";
break;
case "hint_aim" :
curHint = "hint_charge";
break;
case "hint_charge" :
curHint = "hint_fire";
break;
case "hint_fire" :
if (!game.hint_shownElectrocuted) {
curHint = "hint_electrocute";
} else {
curHint = "hint_bounce";
game.hint_testElectrocuted = false;
game.hint_electrocuted = false;
}
break;
case "hint_electrocute" :
curHint = "hint_bounce";
break;
case "hint_bounce" :
curHint = "hint_shortest";
break;
case "hint_shortest" :
curHint = "hint_score";
break;
case "hint_score" :
curHint = "hint_higherscore";
break;
case "hint_higherscore" :
curHint = undefined;
break;
case "hint_gameover" :
curHint = undefined;
}
}
}
afterHintDelay = 0;
switch (curHint) {
case "hint_intro" :
curHintDelay = 6000;
break;
case "hint_idea" :
curHintDelay = 5000;
break;
case "hint_aim" :
curHintDelay = 4000;
game.hint_testMouseMoved = true;
game.hint_mouseMoved = false;
game.hint_mouseMoveSensitivity = 200;
break;
case "hint_charge" :
curHintDelay = 3000;
game.hint_testMousePress = true;
game.hint_mousePressed = false;
game.hint_testMouseRelease = true;
game.hint_mouseReleased = false;
game.hint_testElectrocuted = true;
game.hint_electrocuted = false;
break;
case "hint_fire" :
curHintDelay = 1000;
break;
case "hint_electrocute" :
curHintDelay = 6000;
afterHintDelay = 1000;
break;
case "hint_bounce" :
curHintDelay = 6000;
afterHintDelay = 1500;
break;
case "hint_shortest" :
curHintDelay = 6500;
afterHintDelay = 2000;
break;
case "hint_score" :
curHintDelay = 7000;
afterHintDelay = 2500;
break;
case "hint_higherscore" :
curHintDelay = 7500;
afterHintDelay = 3000;
break;
case "hint_gameover" :
curHintDelay = 8000;
afterHintDelay = 3500;
break;
default :
gotoAndStop ("none");
}
curHintText = hints[curHint];
if (curHintText == undefined) {
gotoAndStop ("none");
} else {
gotoAndPlay ("show");
}
}
game = _parent;
game.hint_testElectrocuted = true;
startHint = "hint_intro";
hints = [];
hints.hint_intro = "Keep the stars in the sky by energising them with your lightning";
hints.hint_idea = "Let too many stars drop and its game over";
hints.hint_aim = "Move the mouse left to right to move and line up a good shot";
hints.hint_charge = "Hold the left mouse button to charge up and aim";
hints.hint_fire = "Release the mouse button to fire";
hints.hint_electrocute = "Be careful not to overcharge or you'll get shocked!";
hints.hint_bounce = "Hitting a comet will add a star to your lives (Max 5 stars)";
hints.hint_shortest = "The longer you charge the faster and further your lightning will go";
hints.hint_score = "The more stars you hit in a row the more each star is worth!";
hints.hint_higherscore = "You get more points for energising dying stars";
Symbol 173 MovieClip Frame 3
if (!_parent.gameStarted) {
gotoAndPlay(_currentframe - 1);
}
Symbol 173 MovieClip Frame 4
waitDelay = 1000;
waitTime = getTimer() + waitDelay;
Symbol 173 MovieClip Frame 6
if (getTimer() < waitTime) {
gotoAndPlay(_currentframe - 1);
}
Symbol 173 MovieClip Frame 7
updateHint();
Symbol 173 MovieClip Frame 12
play();
Symbol 173 MovieClip Frame 42
curHintTime = getTimer() + curHintDelay;
Symbol 173 MovieClip Frame 44
if (game.gameIsOver) {
game.hint_restartHints = true;
} else if (!game.hint_electrocuted) {
switch (curHint) {
case "hint_intro" :
case "hint_idea" :
if (getTimer() < curHintTime) {
gotoAndPlay(_currentframe - 1);
}
break;
case "hint_aim" :
if (!game.hint_mouseMoved) {
gotoAndPlay(_currentframe - 1);
curHintDelay = 1000;
curHintTime = getTimer() + curHintDelay;
} else if (getTimer() < curHintTime) {
gotoAndPlay(_currentframe - 1);
}
break;
case "hint_charge" :
if (!game.hint_mousePressed) {
gotoAndPlay(_currentframe - 1);
}
break;
case "hint_fire" :
if (!game.hint_mouseReleased) {
gotoAndPlay(_currentframe - 1);
} else if (getTimer() < curHintTime) {
gotoAndPlay(_currentframe - 1);
}
break;
case "hint_electrocute" :
game.hint_testElectrocuted = false;
game.hint_electrocuted = false;
default :
if (getTimer() >= curHintTime) {
break;
}
gotoAndPlay(_currentframe - 1);
}
}
Symbol 173 MovieClip Frame 65
afterHintTime = getTimer() + afterHintDelay;
Symbol 173 MovieClip Frame 67
if (game.gameIsPaused || (game.gameIsOver)) {
gotoAndPlay ("gameOver");
} else if (getTimer() < afterHintTime) {
gotoAndPlay(_currentframe - 1);
}
Symbol 173 MovieClip Frame 68
updateHint();
Symbol 173 MovieClip Frame 70
stop();
Symbol 173 MovieClip Frame 78
play();
Symbol 173 MovieClip Frame 79
if (game.gameIsPaused || (game.gameIsOver)) {
gotoAndPlay(_currentframe - 1);
}
Symbol 173 MovieClip Frame 80
waitDelay = 5000;
waitTime = getTimer() + waitDelay;
Symbol 173 MovieClip Frame 82
if (getTimer() < waitTime) {
gotoAndPlay(_currentframe - 1);
}
Symbol 173 MovieClip Frame 83
updateHint();
Symbol 177 MovieClip Frame 1
stop();
minStarGlow = 20;
starFlickerMultiplier = 0;
freq = 0.001 + (Math.random() * 0.008);
phase = (Math.random() * Math.PI) * 2;
startAlphaVel = 0;
star.star._alpha = 0;
star.starCentre._alpha = 0;
star.glow._alpha = 0;
this.onEnterFrame = function () {
if (!avaliable) {
star.star._alpha = 0;
star.starCentre._alpha = 0;
star.glow._alpha = 0;
} else if (dead) {
starTargetGlow = minStarGlow;
starFlickerMultiplier = starFlickerMultiplier * 0.98;
starGlowOffset = (Math.random() - 0.5) * starFlickerMultiplier;
star.star._alpha = star.star._alpha + (((starTargetGlow - star.star._alpha) * 0.1) + starGlowOffset);
targetGlow = 0;
star.glow._alpha = star.glow._alpha + ((targetGlow - star.glow._alpha) * 0.05);
star.starCentre._alpha = star.glow._alpha;
} else {
starTargetGlow = 100;
starGlowOffset = 0;
star.star._alpha = star.star._alpha + (((starTargetGlow - star.star._alpha) * 0.3) + starGlowOffset);
starFlickerMultiplier = 1;
targetGlow = 70 + (Math.sin((getTimer() * freq) + phase) * 30);
star.glow._alpha = star.glow._alpha + ((targetGlow - star.glow._alpha) * 0.7);
star.starCentre._alpha = star.glow._alpha;
}
};
Symbol 180 Button
on (rollOver, dragOver) {
over = true;
}
on (rollOut, dragOut) {
over = false;
}
Symbol 183 MovieClip Frame 1
if (!inited) {
inited = true;
hs.useHandCursor = false;
this.onEnterFrame = function () {
if (over) {
nextFrame();
} else {
prevFrame();
}
};
}
Symbol 186 MovieClip Frame 1
if (!inited) {
inited = true;
hs.useHandCursor = false;
this.onEnterFrame = function () {
if (over) {
nextFrame();
} else {
prevFrame();
}
};
}
Symbol 189 MovieClip Frame 1
if (!inited) {
inited = true;
hs.useHandCursor = false;
this.onEnterFrame = function () {
if (over) {
nextFrame();
} else {
prevFrame();
}
};
}
Symbol 193 Button
on (rollOver, dragOver) {
over = true;
}
on (rollOut, dragOut) {
over = false;
}
on (release) {
nz.co.resn.stats.FlashStat.hit("/game/dash/get-music");
_parent._parent.getMusic();
}
Symbol 194 MovieClip Frame 1
if (!inited) {
inited = true;
this.onEnterFrame = function () {
if (over) {
nextFrame();
} else {
prevFrame();
}
};
}
Symbol 198 Button
on (rollOver, dragOver) {
over = true;
}
on (rollOut, dragOut) {
over = false;
}
on (release) {
nz.co.resn.stats.FlashStat.hit("/game/dash/visit-liams-site");
_parent._parent.visitLiamsSite();
}
Symbol 199 MovieClip Frame 1
if (!inited) {
inited = true;
this.onEnterFrame = function () {
if (over) {
nextFrame();
} else {
prevFrame();
}
};
}
Symbol 203 Button
on (rollOver, dragOver) {
over = true;
}
on (rollOut, dragOut) {
over = false;
}
on (release) {
nz.co.resn.stats.FlashStat.hit("/game/dash/restart");
_parent._parent.replayGame();
}
Symbol 206 MovieClip Frame 1
if (!inited) {
inited = true;
this.onEnterFrame = function () {
if (over) {
nextFrame();
} else {
prevFrame();
}
};
}
Symbol 210 Button
on (rollOver, dragOver) {
over = true;
}
on (rollOut, dragOut) {
over = false;
}
on (release) {
nz.co.resn.stats.FlashStat.hit("/game/dash/instructions");
_parent._parent.showInstructions();
}
Symbol 213 MovieClip Frame 1
if (!inited) {
inited = true;
this.onEnterFrame = function () {
if (over) {
nextFrame();
} else {
prevFrame();
}
};
}
Symbol 214 MovieClip Frame 1
stop();
livesHs.useHandCursor = false;
scoreHs.useHandCursor = false;
levelHs.useHandCursor = false;
Symbol 217 MovieClip [sparkle] Frame 1
stop();
Symbol 218 MovieClip Frame 1
stop();
Symbol 222 Button
on (rollOver, dragOver) {
over = true;
}
on (rollOut, dragOut) {
over = false;
}
on (release) {
_parent._parent.playGame("easy");
}
Symbol 223 MovieClip Frame 1
if (!inited) {
inited = true;
this.onEnterFrame = function () {
if (over) {
nextFrame();
} else {
prevFrame();
}
};
}
Symbol 229 Button
on (rollOver, dragOver) {
over = true;
}
on (rollOut, dragOut) {
over = false;
}
on (release) {
_parent._parent.playGame("hard");
}
Symbol 230 MovieClip Frame 1
if (!inited) {
inited = true;
this.onEnterFrame = function () {
if (over) {
nextFrame();
} else {
prevFrame();
}
};
}
Symbol 234 Button
on (rollOver, dragOver) {
over = true;
}
on (rollOut, dragOut) {
over = false;
}
on (release) {
nz.co.resn.stats.FlashStat.hit("/home/instructions");
_parent._parent.gotoScreen("instructions");
}
Symbol 235 MovieClip Frame 1
if (!inited) {
inited = true;
this.onEnterFrame = function () {
if (over) {
nextFrame();
} else {
prevFrame();
}
};
}
Symbol 238 Button
on (rollOver, dragOver) {
over = true;
}
on (rollOut, dragOut) {
over = false;
}
on (release) {
trace("/home/highscores");
nz.co.resn.stats.FlashStat.hit("/home/highscores");
_parent._parent._parent.showHighscores();
}
Symbol 239 MovieClip Frame 1
if (!inited) {
inited = true;
this.onEnterFrame = function () {
if (over) {
nextFrame();
} else {
prevFrame();
}
};
}
Symbol 240 MovieClip Frame 1
_parent.started = true;
Symbol 240 MovieClip Frame 30
stop();
Symbol 240 MovieClip Frame 32
play();
Symbol 240 MovieClip Frame 57
stop();
_parent.updateScreen();
Symbol 252 Button
on (release) {
playGame();
}
Symbol 259 Button
on (rollOver, dragOver) {
over = true;
}
on (rollOut, dragOut) {
over = false;
}
on (release) {
_parent.returnToGame();
}
Symbol 260 MovieClip Frame 1
if (!inited) {
inited = true;
this.onEnterFrame = function () {
if (over) {
nextFrame();
} else {
prevFrame();
}
};
}
Symbol 264 Button
on (rollOver, dragOver) {
over = true;
}
on (rollOut, dragOut) {
over = false;
}
on (release) {
_parent._parent._parent.returnToMenu();
}
Symbol 265 MovieClip Frame 1
if (!inited) {
inited = true;
this.onEnterFrame = function () {
if (over) {
nextFrame();
} else {
prevFrame();
}
};
}
Symbol 266 MovieClip Frame 1
function returnToGame() {
_parent.returnToGame();
}
stop();
if ((!_parent._parent._parent.gameStarted) || (_parent._parent._parent.gameIsOver)) {
gotoAndStop (2);
}
Symbol 267 Button
on (release) {
playGame();
}
Instance of Symbol 245 MovieClip in Symbol 268 MovieClip Frame 1
on (release) {
playGame();
}
Instance of Symbol 251 MovieClip in Symbol 268 MovieClip Frame 9
on (release) {
playGame();
}
Symbol 268 MovieClip Frame 25
function returnToGame() {
if ((!_parent._parent.gameStarted) || (_parent._parent.gameIsOver)) {
_parent.returnToMenu();
} else {
_parent.returnToGame();
}
}
stop();
Symbol 268 MovieClip Frame 29
play();
Instance of Symbol 245 MovieClip in Symbol 268 MovieClip Frame 39
on (release) {
playGame();
}
Instance of Symbol 251 MovieClip in Symbol 268 MovieClip Frame 47
on (release) {
playGame();
}
Symbol 268 MovieClip Frame 57
stop();
_parent.updateScreen();
Symbol 275 MovieClip Frame 1
if (!inited) {
intited = true;
gotoAndStop(_parent._parent._parent.curLevelNum);
}
Symbol 276 MovieClip Frame 13
waitDelay = 2000;
waitTime = getTimer() + waitDelay;
Symbol 276 MovieClip Frame 15
if (getTimer() < waitTime) {
gotoAndPlay(_currentframe - 1);
}
Symbol 276 MovieClip Frame 16
_parent.nextLevel();
Symbol 276 MovieClip Frame 17
play();
Symbol 276 MovieClip Frame 30
_parent.curAction = "nextLevel";
_parent.updateScreen();
Symbol 282 MovieClip Frame 16
stop();
Symbol 283 MovieClip Frame 20
score = _parent._parent.score;
score.loadHighscores();
Symbol 283 MovieClip Frame 21
waitDelay = 2000;
waitTime = getTimer() + waitDelay;
Symbol 283 MovieClip Frame 23
if (getTimer() < waitTime) {
gotoAndPlay(_currentframe - 1);
}
Symbol 283 MovieClip Frame 25
if (score.loadingHighscores) {
gotoAndPlay(_currentframe - 1);
}
Symbol 283 MovieClip Frame 26
_parent.checkHighscore();
Symbol 283 MovieClip Frame 27
play();
Symbol 283 MovieClip Frame 41
_parent.updateScreen();
Symbol 289 MovieClip Frame 1
curScore = _parent._parent._parent.score.getScore();
textScore.text = curScore;
Symbol 295 Button
on (rollOver, dragOver) {
over = true;
}
on (rollOut, dragOut) {
over = false;
}
on (release) {
_parent.submit();
}
Symbol 296 MovieClip Frame 1
if (!inited) {
inited = true;
this.onEnterFrame = function () {
if (over) {
nextFrame();
} else {
prevFrame();
}
};
}
Symbol 298 MovieClip Frame 1
function onKeyDown() {
if (Key.getCode() == 13) {
_parent.submit();
}
}
_parent.defaultPlayerName = textPlayerName.text;
textPlayerName.onSetFocus = function () {
if (textPlayerName.text == _parent.defaultPlayerName) {
textPlayerName.text = "";
}
};
Key.addListener(this);
Symbol 299 MovieClip Frame 20
function submit() {
if (!submitted) {
playerName = playerNameClip.textPlayerName.text;
if ((playerName.length > 0) && (playerNameClip.textPlayerName.text != defaultPlayerName)) {
submitted = true;
score = _parent._parent.score;
scoreStats = _parent._parent.scoreStats;
statsString = "";
for (statsParamName in scoreStats) {
statsParamValue = scoreStats[statsParamName];
trace((("stat " + statsParamName) + " = ") + statsParamValue);
if (statsString != "") {
statsString = statsString + "&";
}
statsString = statsString + ((statsParamName + "=") + statsParamValue);
}
trace("score object: " + score);
trace("stats: " + scoreStats);
trace("statsString: " + statsString);
score.loadingHighscores = true;
score.saveHighScore(1, playerName, "", statsString, score.loadHighscores);
nz.co.resn.stats.FlashStat.hit("/game/over/highscore/submit");
_parent.gotoScreen("highscores");
}
}
}
stop();
Symbol 299 MovieClip Frame 23
play();
Symbol 299 MovieClip Frame 40
stop();
_parent.updateScreen();
Symbol 307 MovieClip [highscoreItem] Frame 2
if ((count++) < delay) {
gotoAndPlay(_currentframe - 1);
}
Symbol 307 MovieClip [highscoreItem] Frame 10
stop();
Symbol 308 MovieClip Frame 1
score = _parent._parent._parent.score;
Symbol 308 MovieClip Frame 2
if (score.loadingHighscores) {
gotoAndPlay(_currentframe - 1);
}
Symbol 308 MovieClip Frame 3
stop();
maxNumHighscores = 20;
itemSpacingY = 20;
itemSpacingX = 200;
curX = 0;
curY = 0;
appearSpeed = 2;
highscores = score.highscores;
trace("highscores.length: " + highscores.length);
if ((highscores == undefined) || (highscores.length <= 0)) {
trace("no highscores! try again");
_parent._parent._parent.loadHighscores();
gotoAndPlay (1);
}
curPos = 0;
while ((curPos < highscores.length) && (curPos < maxNumHighscores)) {
curHighscore = highscores[curPos];
if (curPos == (maxNumHighscores / 2)) {
curX = itemSpacingX;
curY = 0;
}
curY = curY + itemSpacingY;
curDepth = this.getNextHighestDepth();
curHighscoreClip = this.attachMovie("highscoreItem", "highscoreItem" + curDepth, curDepth);
curHighscoreClip.highscore.textPosition.text = curPos + 1;
curHighscoreClip.highscore.textPlayerName.text = curHighscore.name;
curHighscoreClip.highscore.textScore.text = curHighscore.score;
curHighscoreClip._x = curX;
curHighscoreClip._y = curY;
curHighscoreClip.count = 0;
curHighscoreClip.delay = curPos * appearSpeed;
curPos++;
}
Symbol 312 Button
on (rollOver, dragOver) {
over = true;
}
on (rollOut, dragOut) {
over = false;
}
on (release) {
nz.co.resn.stats.FlashStat.hit("/game/over/restart");
_parent._parent._parent.replayGame();
}
Symbol 313 MovieClip Frame 1
if (!inited) {
inited = true;
this.onEnterFrame = function () {
if (over) {
nextFrame();
} else {
prevFrame();
}
};
}
Symbol 314 MovieClip Frame 1
stop();
if (!_parent._parent._parent.gameIsOver) {
gotoAndStop (2);
}
Symbol 318 Button
on (rollOver, dragOver) {
over = true;
}
on (rollOut, dragOut) {
over = false;
}
on (release) {
nz.co.resn.stats.FlashStat.hit("/game/over/get-music");
_parent._parent._parent._parent.getMusic();
}
Symbol 319 MovieClip Frame 1
if (!inited) {
inited = true;
this.onEnterFrame = function () {
if (over) {
nextFrame();
} else {
prevFrame();
}
};
}
Symbol 320 MovieClip Frame 1
stop();
if (_parent._parent._parent.gameIsOver) {
gotoAndStop (2);
}
Symbol 322 MovieClip Frame 1
stop();
if (!_parent._parent._parent.gameIsOver) {
gotoAndStop (2);
}
Symbol 323 MovieClip Frame 1
play();
Symbol 323 MovieClip Frame 39
stop();
Symbol 323 MovieClip Frame 41
play();
Symbol 323 MovieClip Frame 63
stop();
_parent.updateScreen();
Symbol 329 Button
on (rollOver, dragOver) {
over = true;
}
on (rollOut, dragOut) {
over = false;
}
on (release) {
_parent.getMusic("itunes");
}
Symbol 330 MovieClip Frame 1
if (!inited) {
inited = true;
this.onEnterFrame = function () {
if (over) {
nextFrame();
} else {
prevFrame();
}
};
}
Symbol 333 Button
on (rollOver, dragOver) {
over = true;
}
on (rollOut, dragOut) {
over = false;
}
on (release) {
_parent.getMusic("real-groovy");
}
Symbol 334 MovieClip Frame 1
if (!inited) {
inited = true;
this.onEnterFrame = function () {
if (over) {
nextFrame();
} else {
prevFrame();
}
};
}
Symbol 335 MovieClip Frame 1
function getMusic(link) {
nz.co.resn.stats.FlashStat.hit("/game/get-music/" + link);
_parent._parent.deactivateGame();
curLink = links[link];
getURL (curLink, "_blank");
}
links = [];
links.itunes = "http://ax.phobos.apple.com.edgesuite.net/WebObjects/MZStore.woa/wa/browserRedirect?url=itms%253A%252F%252Fax.phobos.apple.com.edgesuite.net%252FWebObjects%252FMZStore.woa%252Fwa%252FviewAlbum%253Fi%253D260119550%2526id%253D260119508%2526s%253D143461";
links["real-groovy"] = "http://www.realgroovy.co.nz/support.aspx?searchtype=rgcid&contributor=848476";
Symbol 335 MovieClip Frame 47
function returnToGame() {
if ((!_parent._parent.gameStarted) || (_parent._parent.gameIsOver)) {
_parent.returnToMenu();
} else {
_parent.returnToGame();
}
}
stop();
Symbol 335 MovieClip Frame 51
play();
Symbol 335 MovieClip Frame 73
stop();
_parent.updateScreen();
Symbol 339 Button
on (rollOver, dragOver) {
over = true;
}
on (rollOut, dragOut) {
over = false;
}
on (release) {
_parent.resumeGame();
}
Symbol 340 MovieClip Frame 1
if (!inited) {
inited = true;
this.onEnterFrame = function () {
if (over) {
nextFrame();
} else {
prevFrame();
}
};
}
Symbol 344 MovieClip Frame 20
function resumeGame() {
_parent.returnToGame();
}
stop();
Symbol 344 MovieClip Frame 23
play();
Symbol 344 MovieClip Frame 37
stop();
_parent.updateScreen();
Symbol 345 MovieClip Frame 1
function gotoScreen(screenName, action, argument) {
if (screenName != curScreen) {
curScreen = screenName;
curAction = action;
curArgument = argument;
if (screen != undefined) {
screen.gotoAndPlay("out");
} else {
updateScreen();
}
}
}
function updateScreen(playOut) {
if (curScreen != undefined) {
gotoAndStop(curScreen);
} else {
gotoAndStop ("none");
}
if (curAction != undefined) {
switch (curAction) {
case "playGame" :
_parent.playGame(curArgument);
break;
case "returnToGame" :
trace("returnToGame");
_parent.returnToGame();
break;
case "nextLevel" :
_parent.nextLevel();
}
}
if (((curAction == "nextLevel") && (curScreen != "none")) && (!_parent.gameIsPaused)) {
_parent.pauseGame();
}
curAction = undefined;
curArgument = undefined;
}
function exitScreen(action, argument) {
gotoScreen(undefined, action, argument);
}
function playGame(difficulty) {
gotoScreen("none", "playGame", difficulty);
}
function returnToMenu() {
gotoScreen("start");
}
function returnToGame() {
gotoScreen("none", "returnToGame");
}
function nextLevel() {
gotoScreen("none", "nextLevel");
}
function replayGame() {
gotoScreen("start");
}
function checkHighscore() {
score = _parent.score;
curScore = score.getScore();
highscores = score.highscores;
if (curScore >= highscores[highscores.length - 1].score) {
nz.co.resn.stats.FlashStat.hit("/game/over/highscore/");
_parent.scoreStats.numHighscores++;
gotoScreen("highscore");
} else {
gotoScreen("highscores");
}
}
stop();
Symbol 347 Button
on (rollOver, dragOver) {
over = true;
}
on (rollOut, dragOut) {
over = false;
}
on (release) {
nz.co.resn.stats.FlashStat.hit("/game/logo/visit-site");
getURL ("http://www.liamfinn.tv", "_blank");
}
Symbol 351 MovieClip Frame 1
if (!inited) {
inited = true;
this.onEnterFrame = function () {
if (over) {
nextFrame();
} else {
prevFrame();
}
};
}
Symbol 355 MovieClip Frame 1
function init() {
initAll();
initScore();
}
function initScore() {
nz.co.resn.game_utils.HighScores.highScorePath = "http://www.liamfinn.co.nz/highscores.php";
highscoresAreLoaded = false;
score = new nz.co.resn.game_utils.HighScores();
score.loadHighscores = loadHighscores;
score.highscoresLoaded = highscoresLoaded;
numHighscores = 20;
dummyNames = ["jeff", "salami", "Bully", "I AM GREAT!", "L.J.", "never never land", "hopeful", "Nice One", "TC", "watch it", "1up", "I LIKES IT!", "Eric C.", "noddy", "sweet as", "stargazer", "Sally", "angela", "sparkle motion", "twinkle toes"];
}
function initAll() {
music = _parent.music;
autoQuality = true;
nextQualityChangeTime = 0;
nextQualityChangeDelay = 5000;
lowFps = 18;
medFps = 24;
hideMouse = true;
cursorOn = true;
if (hideMouse) {
Mouse.hide();
}
cursorAlpha = 100;
cursorFadeStartY = 150;
cursorFadeDist = 100;
cursorFadeY = 350;
cursorFloatY = 350;
minMouseMoveSensitivityY = 1;
mouseMoveSensitivityY = 15;
cursorFadeTime = 0;
cursorFadeDelay = 200;
cursorFadeAmount = 5;
minCursorAlpha = 20;
lastXMouse = (xMouse = _xmouse);
lastYMouse = (yMouse = _ymouse);
cursorTargetVelY = 0;
cursorTargetX = xMouse;
cursorTargetY = yMouse;
trajectoryOpacity = 1;
trajectoryOpacityDec = 0.05;
trajectoryShown = true;
numTrajectoryPoints = 12;
difficulty = "";
electrocution = liam.electrocution;
electrocutionFront = liam.electrocutionFront;
viewWidth = 450;
viewHeight = 550;
viewMidX = viewWidth / 2;
liamVel = 0;
liamPosVel = 0.02;
liamAccel = 0.2;
liamDecel = 0.3;
liamStartX = liam._x;
liamStartY = liam._y;
gravity = 3;
maxLiamPos = 150;
marginLeft = 0;
marginRight = viewWidth;
marginTop = 0;
marginBottom = viewHeight;
liamPosMargin = 20;
minLiamPos = marginLeft + liamPosMargin;
maxLiamPos = marginRight - liamPosMargin;
targetLiamPos = 0;
lightningMarginHoriz = 50;
lightningMarginVert = 100;
maxLightningX = marginRight + lightningMarginHoriz;
minLightningX = -lightningMarginHoriz;
minLightningY = -lightningMarginVert;
maxLightningY = marginBottom + lightningMarginHoriz;
cometStartTop = 100;
cometStartHeight = 80;
cometEndMargin = 200;
cometStartMargin = 20;
cometRegionMargin = 20;
cometMarginLeft = marginLeft - cometEndMargin;
cometMarginRight = marginRight + cometEndMargin;
cometStartLeft = marginLeft - cometStartMargin;
cometStartRight = marginRight + cometStartMargin;
cometRegionLeft = marginLeft + cometRegionMargin;
cometRegionRight = marginRight - cometRegionMargin;
cometVelX = 3;
cometVelY = -1.5;
cometGravity = 0.02;
curCometDirection = 1;
nextCometDelayBase = 1000;
nextCometDelayVariation = 3000;
nextCometDelayExtraBase = 30000;
nextCometDelayExtraVariation = 40000;
starMarginHoriz = 30;
starMarginVert = 20;
starMarginLeft = starMarginHoriz;
starMarginRight = viewWidth - starMarginHoriz;
starMarginTop = starMarginVert;
starMarginBottom = 495;
starMarginBottomVariation = 25;
reflectedStarMarginBottom = marginBottom + 20;
minStarDist = 1000;
numLightningBoltPoints = 40;
minLightningSpeed = 25;
lightningSpeed = 0.25;
lightningLife = 4000;
lightningMomentum = 0.2;
lightningAccuracyVariation = 1.5;
numLightningSubPoints = 6;
armShootVelX = 0;
armShootVelY = 0;
liamWalkDist = 60;
liamWalkMaxDist = 62;
liamWalkFrames = 26;
liamWalkSpeed = liamWalkDist / liamWalkFrames;
chargeMultiplier = 3;
curChargeVel = 0;
curChargeDecay = 0.9;
minCharge = 1;
minFireCharge = 50;
maxFireCharge = 200;
maxFireChargeThreshold = 20;
minTrajectoryCharge = 30;
electrocutionDelay = 1500;
chargeBounceReduction = 100;
chargeBounceReductionReduction = 0.3;
fireDelay = 1000;
fireFadeDelay = 500;
liamPos = 0;
liamArmRotation = -90;
liamArmRotationVel = 4;
liamArmRotationMouseDist = 150;
liamArmMoveMouseDist = 80;
maxArmAngle = 90;
starDropDelayMultiplier = (starDropDelayMultiplierBase = 1);
starDropDelayDecay = 0.995;
starDropStartDelay = 1000;
starDropDelayBase = 6000;
starDropDelayVariation = 4000;
starDropSpeedMultiplier = (starDropSpeedMultiplierBase = 1E-6);
starDropSpeedMultiplierVariation = 2E-6;
starDropSpeedMultiplierInc = 5E-9;
starDropSpeedMultiplierIncVariation = 4E-8;
starDropSpeedMultiplierIncInc = (starDropSpeedMultiplierIncIncBase = 2E-6);
starDecay = (starDecayBase = 0.25);
starDecayVariation = 2;
starDecayDecay = 0.97;
starDecayDecayVariation = 0;
starDecayDecayNormalise = 0.01;
starFallThreshold = 75;
starRevitaliseTime = 6000;
maxRevitaliseAmount = 1000;
starAttractionTime = 2000;
maxScoreValue = 400;
starScoreValueInc = 0.05;
starScoreValueDyingInc = 0.15;
levelUpScore = 1000;
followScoreMultiplier = 0.4;
scoreAchievements = [500, 1000, 2000, 3000, 5000, 7500, 10000, 15000, 20000, 25000, 30000, 35000, 40000, 45000, 50000, 55000, 60000, 65000, 70000, 75000, 80000, 85000, 90000, 95000, 100000];
starSparkleVel = 0.2;
starTrailSparkleDist = 4;
maxDeadStars = 3;
deadStarAlpha = 20;
rechargeTime = 0;
rechargeDelay = 400;
restartDelay = 2000;
decay = 0.98;
baseStarLife = 2000;
starLifeVariation = 50000;
normalHealth = 100;
superHealth = 200;
maxLives = 5;
defaultLives = 3;
numLives = defaultLives;
reflectionX = 0;
reflectionWidth = viewWidth;
reflectionY = 450;
reflectionHeight = viewHeight - reflectionY;
starClips = [];
starReflectionClips = [];
curLevelNum = 1;
numLevels = 3;
chargeMultiplierEasy = 3;
chargeMultiplierHard = 5;
stars.comet.isComet = true;
starReflections.comet.isComet = true;
ln = 1;
while (ln <= numLevels) {
stars.gotoAndStop(ln);
for (curStarName in stars) {
curStar = stars[curStarName];
if (!curStar.isComet) {
if (ln == 1) {
starClips.push(curStar);
curStar.starPositions = [];
}
curStar.starPositions[ln] = {x:curStar._x, y:curStar._y};
}
}
ln++;
}
stars.gotoAndStop(1);
for (curStarName in stars) {
curStar = stars[curStarName];
if (!curStar.isComet) {
curStar.accelX = 0;
curStar.accelY = 0;
curStar.startX = (curStar.targetX = curStar._x);
curStar.startY = (curStar.targetY = curStar._y);
curStar.velX = 0;
curStar.velY = 0;
curStar.targetVelX = 0;
curStar.targetVelY = 0;
targetStar.nextAttractionTime = 0;
curStar.phase = (Math.random() * Math.PI) * 2;
curStar.scaleMutliplier = 0.75 + (Math.random() * 0.5);
curStar.star._xscale = (curStar.star._yscale = curStar.scaleMutliplier * 100);
curStar.starMarginBottom = starMarginBottom + (((curStar.star._xscale / 100) - 1) * starMarginBottomVariation);
curStar.health = 100;
}
}
for (curStarName in starReflections) {
reflectedStar = starReflections[curStarName];
if (!reflectedStar.isComet) {
starReflectionClips.push(reflectedStar);
}
}
si = 0;
while (si < starClips.length) {
curStar = starClips[si];
reflectedStar = starReflectionClips[si];
curStar.reflectedStar = reflectedStar;
reflectedStar.star._xscale = (reflectedStar.star._yscale = curStar.star._xscale);
si++;
}
levels = [];
curLevel = new Object();
curLevel.duration = 120000 /* 0x01D4C0 */;
curLevel.difficulty = 1;
levels[1] = curLevel;
curLevel = new Object();
curLevel.duration = 120000 /* 0x01D4C0 */;
curLevel.difficulty = 2;
levels[2] = curLevel;
curLevel = new Object();
curLevel.duration = undefined;
curLevel.difficulty = 4;
levels[3] = curLevel;
comet = stars.comet;
comet.active = false;
comet.scoreValue = 100;
comet._visible = false;
starReflections.comet._visible = false;
ticks = 0;
curFps = (fps = 32);
targetTimeMultiplier = 1000 / fps;
lastGameTime = (gameStartTime = getTimer());
curFollowScore = (curScore = 0);
score.setScore(0);
totalStartTime = getTimer();
scoreStats = new Object();
resetStats(true);
resetGraphics();
this.onEnterFrame = step;
this.onMouseDown = OnMouseDown;
this.onMouseUp = OnMouseUp;
}
function resetStats(fullReset) {
if (fullReset) {
scoreStats.userId = Math.round(Math.random() * 10000000);
scoreStats.restarts = 0;
scoreStats.viewInstructions = 0;
scoreStats.numGameStarts = 0;
scoreStats.numCompleteGames = 0;
scoreStats.numHighscores = 0;
scoreStats.totalElectrocutions = 0;
scoreStats.totalGameTime = 0;
}
scoreStats.gameTime = 0;
scoreStats.maxStarValue = 0;
scoreStats.lifesLost = 0;
scoreStats.lifesRegained = 0;
scoreStats.maxLifes = defaultLives;
scoreStats.electrocutions = 0;
scoreStats.difficulty = "";
scoreStats.levelsAchieved = 1;
scoreStats.totalShots = 0;
scoreStats.starsHit = 0;
scoreStats.cometsHit = 0;
scoreStats.aveShotBounces = 0;
scoreStats.maxShotBounces = 0;
trace("scoreStats: " + scoreStats);
}
function resetGame() {
curLevelNum = 1;
curFollowScore = (curScore = 0);
score.setScore(0);
curScoreAchievement = 0;
nextScoreAchievementIndex = 0;
nextScoreAchievement = scoreAchievements[nextScoreAchievementIndex];
numLives = defaultLives;
resetStats();
roundStartTime = getTimer();
nextLevel();
}
function resetGraphics() {
lives = numLives;
electrocuting = false;
liveI = 1;
while (liveI <= maxLives) {
curLiveGraphic = stats.lives["life" + liveI];
curLiveGraphic.dead = false;
if (liveI <= lives) {
curLiveGraphic.avaliable = true;
} else {
curLiveGraphic.avaliable = false;
}
liveI++;
}
updateScore();
}
function resetLevel() {
curLevel = levels[curLevelNum];
nz.co.resn.stats.FlashStat.hit("/game/level/" + curLevelNum);
curLevelDifficulty = curLevel.difficulty;
invLevelDifficulty = 1 / curLevelDifficulty;
scoreStats.difficulty = difficulty;
gameIsOver = false;
starsDead = 0;
music.startTrack(curLevelNum);
startMusic = true;
nextCometTime = undefined;
starDropDelayMultiplier = starDropDelayMultiplierBase;
starDropSpeedMultiplier = starDropSpeedMultiplierBase;
starDropSpeedMultiplierIncInc = starDropSpeedMultiplierIncIncBase;
starDecay = starDecayBase;
starDropDelayMultiplier = starDropDelayMultiplierBase * invLevelDifficulty;
starDropSpeedMultiplier = starDropSpeedMultiplierBase * invLevelDifficulty;
starDropSpeedMultiplierIncInc = starDropSpeedMultiplierIncIncBase * curLevelDifficulty;
electrocuting = false;
firing = false;
fired = false;
curCharge = 0;
curChargeVel = 0;
for (curStarName in stars) {
curStar = stars[curStarName];
if (!curStar.isComet) {
curStar._visible = true;
curStar.ticks = 0;
curStar.targetX = (curStar.startX = curStar.starPositions[curLevelNum].x);
curStar.targetY = (curStar.startY = curStar.starPositions[curLevelNum].y);
curStar.seekingTarget = true;
curStar.accelX = 0;
curStar.accelY = 0;
curStar.velX = 0;
curStar.velY = 0;
curStar.targetVelX = 0;
curStar.targetVelY = 0;
curStar.revitaliseAmount = maxRevitaliseAmount;
curStar.dead = false;
curStar.dying = false;
curStar.dyingStartTime = undefined;
curStar.score.gotoAndStop("hidden");
curStar.nextDropTime = 0;
curStar.nextAttractionTime = 0;
curStar.scoreValue = 0;
curStar.phase = (Math.random() * Math.PI) * 2;
curStar.health = normalHealth;
reflectedStar = curStar.reflectedStar;
reflectedStar.star._xscale = (reflectedStar.star._yscale = curStar.star._xscale);
}
}
liam.idle();
nextStarDropTime = getTimer() + starDropStartDelay;
resetGraphics();
step();
}
function step() {
ticks++;
gameTime = getTimer() - gameStartTime;
timeMultiplier = (gameTime - lastGameTime) / targetTimeMultiplier;
lastGameTime = gameTime;
curFps = curFps + (((fps / timeMultiplier) - curFps) * 0.01);
textOutput.text = Math.round(curFps);
if (autoQuality && (getTimer() > nextQualityChangeTime)) {
if (curFps < lowFps) {
_root._quality = "LOW";
} else {
_root._quality = "MEDIUM";
}
nextQualityChangeTime = getTimer() + nextQualityChangeDelay;
}
updateMouse();
if (gameStarted) {
if (((!gameIsPaused) && (!gameIsOver)) && (getTimer() > nextStarDropTime)) {
dropStar();
}
updatePlayer();
updateLightning();
updateStars();
updateComet();
updateSparkles();
updateScore();
} else {
updateStars();
updateSparkles();
}
updateReflections();
}
function updateMouse() {
xMouse = _xmouse;
yMouse = _ymouse;
if ((ticks % 20) == 0) {
Mouse.hide();
}
cursor._x = cursor._x + ((xMouse - cursor._x) * 0.6);
cursor._y = cursor._y + ((yMouse - cursor._y) * 0.6);
mouseDeltaX = xMouse - lastXMouse;
mouseDeltaY = yMouse - lastYMouse;
mouseDelta = (mouseDeltaX * mouseDeltaX) + (mouseDeltaY * mouseDeltaY);
if (((!gameStarted) || (gameIsPaused)) || (gameIsOver)) {
targetCursorAlpha = 100;
} else {
targetCursorAlpha = minCursorAlpha + (((_ymouse - cursorFadeStartY) / cursorFadeDist) * (100 - minCursorAlpha));
targetCursorAlpha = targetCursorAlpha + (mouseDelta * 10);
if (targetCursorAlpha < minCursorAlpha) {
targetCursorAlpha = minCursorAlpha;
} else if (targetCursorAlpha > 100) {
targetCursorAlpha = 100;
}
}
cursorAlpha = cursorAlpha + ((targetCursorAlpha - cursorAlpha) * 0.1);
cursor._alpha = cursorAlpha;
if (hint_testMouseMoved) {
if (mouseDelta > hint_mouseMoveSensitivity) {
hint_mouseMoved = true;
hint_testMouseMoved = false;
}
}
lastXMouse = xMouse;
lastYMouse = yMouse;
}
function updatePlayer() {
liamArm = liam.arm;
liamHand = liamArm.hand;
liamHand2 = liamArm.hand2;
liamForeArm = liamArm.foreArm;
liamHandCharge = liamHand.charge;
liamHandChargeGlow = liamHand.chargeGlow;
liamHand2Charge = liamHand2.charge;
liamForeArmCharge = liamForeArm.charge;
liamHead = liam.head;
firePoint = liamArm.shootPoint;
if (((!electrocuting) && (!gameIsPaused)) && (!gameIsOver)) {
targetliamArmRotation = (liam._xmouse / liamArmRotationMouseDist) * 90;
liamHeadTargetRotation = (-Math.sin(liamHead._xmouse * 0.011)) * 15;
liamHead.head._rotation = liamHead.head._rotation + ((liamHeadTargetRotation - liamHead.head._rotation) * 0.2);
liamHead.head._x = liamHead.head._x + (((liamHead.startX + (liamHeadTargetRotation * 0.11)) - liamHead.head._x) * 0.2);
}
targetLiamPos = _xmouse;
if (targetLiamPos < minLiamPos) {
targetLiamPos = minLiamPos;
} else if (targetLiamPos > maxLiamPos) {
targetLiamPos = maxLiamPos;
}
if (liam.moving) {
if (((!electrocuting) && (!gameIsPaused)) && (!gameIsOver)) {
if (liam.walking) {
if (liam.direction == "right") {
liam._x = liam._x + liamWalkSpeed;
} else {
liam._x = liam._x - liamWalkSpeed;
}
}
}
} else if ((liam._xmouse > liamArmMoveMouseDist) || (liam._xmouse < (-liamArmMoveMouseDist))) {
if ((!gameIsPaused) && (!gameIsOver)) {
if ((liam._x + liamWalkMaxDist) < targetLiamPos) {
liam.walk("right");
} else if ((liam._x - liamWalkMaxDist) > targetLiamPos) {
liam.walk("left");
}
}
}
if (targetliamArmRotation > maxArmAngle) {
targetliamArmRotation = maxArmAngle;
} else if (targetliamArmRotation < (-maxArmAngle)) {
targetliamArmRotation = -maxArmAngle;
}
if (liam.inited) {
if (firing) {
liamArmRotationVel = liamArmRotationVel + ((targetliamArmRotation - liamArmRotation) * 0.9);
liamArmRotation = liamArmRotation + liamArmRotationVel;
liamArmRotationVel = liamArmRotationVel * 0.3;
} else {
liamArmRotationVel = liamArmRotationVel + ((targetliamArmRotation - liamArmRotation) * 0.1);
liamArmRotation = liamArmRotation + liamArmRotationVel;
liamArmRotationVel = liamArmRotationVel * 0.6;
}
}
liamArmFrame = (Math.round(liamArmRotation) * 2) + 180;
liamArmFrame = Math.min(360, Math.max(1, liamArmFrame));
liamArm.gotoAndStop(liamArmFrame);
if (electrocuting) {
liam.unelectrocuted = false;
updateElectrocution((Math.random() * Math.random()) * 100);
} else if (!liam.unelectrocuted) {
liam.unelectrocuted = true;
updateElectrocution(0);
}
if (((((!electrocuting) && (!gameIsPaused)) && (!gameIsOver)) && (firing)) && (!fired)) {
curCharge = curCharge + (chargeMultiplier * timeMultiplier);
if (curCharge > maxFireCharge) {
curCharge = maxFireCharge;
if (hint_testElectrocuted) {
hint_electrocuted = true;
}
scoreStats.electrocutions++;
scoreStats.totalElectrocutions++;
liam.electrocute();
firing = false;
electrocuting = true;
electrocutionTime = getTimer() + electrocutionDelay;
}
} else if ((!electrocuting) && (firePoint != undefined)) {
if ((!fired) && (curCharge >= minFireCharge)) {
fire();
}
curCharge = curCharge * 0.8;
} else {
curCharge = curCharge * 0.3;
}
if (getTimer() > rechargeTime) {
fired = false;
}
maxCurCharge = Math.min(100, curCharge);
armChargeAlpha = maxCurCharge;
if (curCharge > minCharge) {
chargeFlickerMultiplier = (maxCurCharge * maxCurCharge) * 0.0001;
if (firing) {
armChargeAlpha = armChargeAlpha + 10;
}
armChargeAlpha = armChargeAlpha + (((Math.random() - 0.5) * 50) * chargeFlickerMultiplier);
liamArm.hand.chargeGlow._alpha = armChargeAlpha * 0.8;
liamArm.hand2.chargeGlow._alpha = armChargeAlpha * 0.8;
} else {
liamArm.hand.chargeGlow._alpha = 0;
liamArm.hand2.chargeGlow._alpha = 0;
}
if (armChargeAlpha > 60) {
liamForeArmCharge._alpha = armChargeAlpha - 60;
} else {
liamForeArmCharge._alpha = 0;
}
liamArm.hand.charge._alpha = armChargeAlpha;
liamArm.hand2.charge._alpha = armChargeAlpha;
if (trajectoryShown) {
if (curCharge > minTrajectoryCharge) {
if (firing) {
simulateTrajectory();
} else {
trajectoryClip._visible = false;
}
} else {
trajectoryClip._visible = false;
}
}
liamArm.hand.chargeGlow._xscale = (liamArm.hand.chargeGlow._yscale = 50 + (curCharge * 0.25));
liamArm.hand2.chargeGlow._xscale = (liamArm.hand2.chargeGlow._yscale = 50 + (curCharge * 0.25));
}
function updateLightning() {
for (curLightningClipName in lightning) {
curLightningClip = lightning[curLightningClipName];
if (curLightningClip.velX != undefined) {
curLightningClipBlast = curLightningClip.blast;
if (!curLightningClip.absorbed) {
curLightningClipBlast._x = curLightningClipBlast._x + curLightningClip.velX;
curLightningClipBlast._y = curLightningClipBlast._y + curLightningClip.velY;
curLightningBoltX = (startLightningBoltX = curLightningClipBlast._x);
curLightningBoltY = (startLightningBoltY = curLightningClipBlast._y);
curLightningClip.velY = curLightningClip.velY + gravity;
lightningBlastGlobal = {x:curLightningClipBlast._x, y:curLightningClipBlast._y};
curLightningClip.localToGlobal(lightningBlastGlobal);
hitStar = undefined;
if ((((lightningBlastGlobal.y > maxLightningY) || (lightningBlastGlobal.y < minLightningY)) || (lightningBlastGlobal.x > maxLightningX)) || (lightningBlastGlobal.x < minLightningX)) {
curLightningClip.nowAbsorbed = true;
} else {
closestStar = undefined;
for (targetStarName in stars) {
targetStar = stars[targetStarName];
if ((((!targetStar.dead) && ((!targetStar.isComet) || (targetStar.active))) && (targetStar != curLightningClip.lastStarHit)) && (targetStar.hs.hitTest(lightningBlastGlobal.x, lightningBlastGlobal.y))) {
targetStarDeltaX = targetStar._x - curLightningClip.x;
targetStarDeltaY = targetStar._y - curLightningClip.y;
targetStarDist = (targetStarDeltaX * targetStarDeltaX) + (targetStarDeltaY * targetStarDeltaY);
targetStar.targetDist = targetStarDist;
if ((closestStar.targetDist == undefined) || (targetStar.targetDist < closestStar.targetDist)) {
closestStar = targetStar;
}
}
}
if ((closestStar != undefined) && (!gameIsOver)) {
shootStar(closestStar);
}
}
} else {
curLightningClipBlast._visible = false;
}
if (getTimer() > curLightningClip.life) {
if (curLightningClip.numHits > scoreStats.maxShotBounces) {
scoreStats.maxShotBounces = curLightningClip.numHits;
if (scoreStats.aveShotBounces == 0) {
scoreStats.aveShotBounces = scoreStats.maxShotBounces;
} else {
scoreStats.aveShotBounces = (scoreStats.aveShotBounces + scoreStats.maxShotBounces) / 2;
}
}
curLightningClip.removeMovieClip();
} else {
curLightningBolt = curLightningClip.bolt;
curLightningPoints = curLightningClip.lightningPoints;
if (!curLightningClip.absorbed) {
curLightningPoint = new Object();
if (hitStar == undefined) {
curLightningPointVelX = (Math.random() - 0.5) * 10;
curLightningPointVelY = (Math.random() - 0.5) * 10;
curLightningPointX = curLightningBoltX;
curLightningPointY = curLightningBoltY;
curLightningPointStatic = false;
} else {
curLightningPointVelX = 0;
curLightningPointVelY = 0;
hitStarPoint = {x:hitStar._x, y:hitStar._y};
stars.localToGlobal(hitStarPoint);
curLightningClip.globalToLocal(hitStarPoint);
curLightningPointX = hitStarPoint.x;
curLightningPointY = hitStarPoint.y;
curLightningPointStatic = true;
curLightningPoint.fixedObject = hitStar;
}
curLightningPoint.x = curLightningPointX;
curLightningPoint.y = curLightningPointY;
curLightningPoint.velX = curLightningPointVelX;
curLightningPoint.velY = curLightningPointVelY;
curLightningPoint.staticPoint = curLightningPointStatic;
curLightningPoints.unshift(curLightningPoint);
} else {
curLightningPoints.pop();
}
curPointIndex = 0;
curLightningBolt.clear();
curLightningBolt.lineStyle(2, 16777215, 100);
if (curLightningPoints.length > 5) {
curLightningPoints.pop();
}
lpi = 0;
while (lpi < curLightningPoints.length) {
curLightningPoint = curLightningPoints[lpi];
if (curLightningPoint.fixedObject != undefined) {
curFixedObject = curLightningPoint.fixedObject;
fixedPoint = {x:curFixedObject._x, y:curFixedObject._y};
curFixedObject._parent.localToGlobal(fixedPoint);
curLightningClip.globalToLocal(fixedPoint);
curLightningPoint.x = fixedPoint.x;
curLightningPoint.y = fixedPoint.y;
}
lpi++;
}
curLightningClipBlast._x = curLightningPoints[0].x;
curLightningClipBlast._y = curLightningPoints[0].y;
curLightningPointIndex = 0;
totalLightningPoints = numLightningSubPoints * (curLightningPoints.length - 1);
lpi = 0;
while (lpi < (curLightningPoints.length - 1)) {
curLightningPoint = curLightningPoints[lpi];
nextLightningPoint = curLightningPoints[lpi + 1];
curLightningBoltX = curLightningPoint.x;
curLightningBoltY = curLightningPoint.y;
if (lpi == 0) {
curLightningBolt.moveTo(curLightningBoltX, curLightningBoltY);
}
nextLightningBoltX = nextLightningPoint.x;
nextLightningBoltY = nextLightningPoint.y;
subLightningBoltX = curLightningBoltX;
subLightningBoltY = curLightningBoltY;
if (lpi == (curLightningPoints.length - 2)) {
curLightningBolt.lineStyle(1, 16777215, 50);
}
spi = 0;
while (spi < numLightningSubPoints) {
subPointMultiplier = spi / (numLightningSubPoints - 1);
targetSubLightningBoltX = curLightningBoltX + ((nextLightningBoltX - curLightningBoltX) * subPointMultiplier);
targetSubLightningBoltY = curLightningBoltY + ((nextLightningBoltY - curLightningBoltY) * subPointMultiplier);
offsetSubPointMultiplier = (spi + 1) / numLightningSubPoints;
returnSubPointMultiplier = Math.sin(offsetSubPointMultiplier * Math.PI);
subLightningBoltX = targetSubLightningBoltX + (((Math.random() - 0.5) * 10) * returnSubPointMultiplier);
subLightningBoltY = targetSubLightningBoltY + (((Math.random() - 0.5) * 10) * returnSubPointMultiplier);
curLightningBolt.lineTo(subLightningBoltX, subLightningBoltY);
curLightningPointIndex++;
spi++;
}
lpi++;
}
lpi = 0;
while (lpi < curLightningPoints.length) {
curLightningPoint = curLightningPoints[lpi];
if (!curLightningPoint.staticPoint) {
curLightningPoint.velX = curLightningPoint.velX + ((Math.random() - 0.5) * 10);
curLightningPoint.velY = curLightningPoint.velY + ((Math.random() - 0.5) * 10);
curLightningPoint.velX = curLightningPoint.velX * 0.9;
curLightningPoint.velY = curLightningPoint.velY * 0.9;
curLightningPoint.x = curLightningPoint.x + curLightningPoint.velX;
curLightningPoint.y = curLightningPoint.y + curLightningPoint.velY;
}
lpi++;
}
curLightningClip.absorbed = curLightningClip.nowAbsorbed;
}
}
}
}
function updateStars() {
curStar.ticks++;
for (curStarName in stars) {
curStar = stars[curStarName];
if (!curStar.isComet) {
if (!curStar.dead) {
if (gameIsPaused) {
curStar.velY = 0;
curStar.velX = 0;
} else {
if (curStar.dying) {
curStar.scoreValue = curStar.scoreValue + starScoreValueDyingInc;
curStar.health = curStar.health - curStar.decay;
curStar.decay = curStar.decay * curStar.decayDecay;
curStar.decayDecay = curStar.decayDecay + ((1 - curStar.decayDecay) * starDecayDecayNormalise);
if (curStar.health < starFallThreshold) {
if (curStar.health < 0) {
curStar.health = 0;
}
curStar.accelY = curStar.accelY + (((100 - curStar.health) * starDropSpeedMultiplier) * timeMultiplier);
curStar.dropSpeedMultiplier = curStar.dropSpeedMultiplier + curStar.dropSpeedMultiplierInc;
curStar.accelY = curStar.accelY + (((100 - curStar.health) * curStar.dropSpeedMultiplier) * timeMultiplier);
curStar.velY = curStar.velY + curStar.accelY;
curStar.velX = curStar.velX + ((Math.sin((getTimer() * 0.001) + curStar.dyingStartTime) * (50 - curStar.health)) * 0.002);
}
} else {
curStar.scoreValue = curStar.scoreValue + starScoreValueInc;
curStarTargetDeltaX = curStar.targetX - curStar._x;
curStarTargetDeltaY = curStar.targetY - curStar._y;
curStarTargetDelta = (curStarTargetDeltaX * curStarTargetDeltaX) + (curStarTargetDeltaY * curStarTargetDeltaY);
curStarTargetVelX = curStarTargetDeltaX * 0.01;
curStarTargetVelY = curStarTargetDeltaY * 0.01;
if (curStarTargetDelta < 100) {
curStar.seekingTarget = false;
}
if ((curStar.revitaliseAmount < maxRevitaliseAmount) && (Math.abs(curStar.velY) > starSparkleVel)) {
createStarTrail(curStar, curStar.revitaliseAmount);
curStar.revitaliseAmount = curStar.revitaliseAmount + curStar.restoreAmount;
}
curStar.velX = curStar.velX + curStarTargetVelX;
curStar.velY = curStar.velY + curStarTargetVelY;
}
if (curStar.scoreValue > maxScoreValue) {
curStar.scoreValue = maxScoreValue;
}
}
if (!curStar.dying) {
if (curStar.health > normalHealth) {
curStar.health = curStar.health + ((normalHealth - curStar.health) * 0.2);
} else {
curStar.health = normalHealth;
}
}
curStar.velX = curStar.velX * 0.7;
curStar.velY = curStar.velY * 0.6;
curStar._x = curStar._x + curStar.targetVelX;
curStar._y = curStar._y + curStar.targetVelY;
if (curStar._x < starMarginLeft) {
curStar.velX = curStar.velX + ((starMarginLeft - curStar._x) * 0.01);
} else if (curStar._x > starMarginRight) {
curStar.velX = curStar.velX - ((curStar._x - starMarginRight) * 0.01);
}
if (curStar._y < starMarginTop) {
curStar.velY = curStar.velY + ((starMarginTop - curStar._y) * 0.01);
}
curStar._x = curStar._x + curStar.velX;
curStar._y = curStar._y + curStar.velY;
if (curStar._y >= curStar.starMarginBottom) {
killStar(curStar);
curStar._y = curStar.starMarginBottom;
}
if (curStar.dying && (curStar.velY > starSparkleVel)) {
createStarTrail(curStar);
}
curStar.star.glow._alpha = 80 + (Math.sin((getTimer() * 0.01) + curStar.phase) * 20);
curStar.star.star._alpha = 30 + (curStar.health * 0.7);
if (curStar.health < normalHealth) {
curStar.star.glow._alpha = curStar.star.glow._alpha * (curStar.health * 0.01);
starFlickerMultiplier = (normalHealth - curStar.health) * 0.2;
curStar.star.star._alpha = curStar.star.star._alpha + (10 + ((Math.random() - 0.5) * starFlickerMultiplier));
}
} else {
curStar.star.star._alpha = curStar.star.star._alpha + ((deadStarAlpha - curStar.star.star._alpha) * 0.2);
curStar.star.glow._alpha = curStar.star.glow._alpha + ((deadStarAlpha - curStar.star.glow._alpha) * 0.2);
curStar._x = curStar.deadX + (Math.sin((getTimer() - curStar.deadTime) * 0.0004) * curStar.deadWobble);
}
if (curStar.health <= normalHealth) {
starScaleMultiplier = 1;
} else {
starScaleMultiplier = 1 + ((curStar.health - normalHealth) / (superHealth - normalHealth));
}
curStar.star._xscale = (curStar.star._yscale = (curStar.scaleMutliplier * starScaleMultiplier) * 100);
reflectedStar = curStar.reflectedStar;
reflectedStar._y = curStar.starMarginBottom + (curStar.starMarginBottom - curStar._y);
if (reflectedStar._y < reflectedStarMarginBottom) {
reflectedStar._visible = true;
reflectedStar.star.star._alpha = curStar.star.star._alpha;
reflectedStar.star.glow._alpha = curStar.star.glow._alpha;
reflectedStar._x = curStar._x;
} else {
reflectedStar._visible = false;
}
}
}
}
function updateComet() {
if (!comet.isVisible) {
if ((!gameIsPaused) && (!gameIsOver)) {
if (nextCometTime == undefined) {
if ((lives < numLives) || (numLives < maxLives)) {
getNextCometTime();
}
} else if (getTimer() > nextCometTime) {
sendComet();
}
}
} else {
if (!comet.dead) {
comet._x = comet._x + comet.velX;
comet._y = comet._y + comet.velY;
comet.velY = comet.velY + cometGravity;
comet.head._alpha = 50 + ((Math.random() * Math.random()) * 50);
}
if ((comet._x > cometRegionLeft) && (comet._x < cometRegionRight)) {
comet.active = true;
} else {
comet.active = false;
}
if (!comet.dead) {
createCometTrail();
}
if ((comet._x < cometStartLeft) || (comet._x > cometStartRight)) {
hideComet();
}
}
}
function updateSparkles() {
for (curSparkleName in sparkles) {
curSparkle = sparkles[curSparkleName];
if (!curSparkle.dead) {
curSparkle.life = curSparkle.life - curSparkle.lifeDecay;
if (curSparkle.life > 0) {
curSparkle.velX = curSparkle.velX + curSparkle.accelX;
curSparkle.velY = curSparkle.velY + curSparkle.accelY;
curSparkle.velX = curSparkle.velX * curSparkle.decayX;
curSparkle.velY = curSparkle.velY * curSparkle.decayY;
curSparkle._x = curSparkle._x + curSparkle.velX;
curSparkle._y = curSparkle._y + curSparkle.velY;
if (curSparkle.life < curSparkle.minLife) {
curSparkle._alpha = (curSparkle.life * 2) * curSparkle.alphaMultiplier;
} else if (curSparkle.alphaMultiplier != undefined) {
curSparkle._alpha = 100 * curSparkle.alphaMultiplier;
}
} else {
curSparkle.removeMovieClip();
}
}
}
}
function updateScore() {
textFormat = new TextFormat();
textFormat.kerning = true;
textFormat.letterSpacing = 2;
stats.textScore.setNewTextFormat(textFormat);
curScore = score.getScore();
if (curFollowScore < curScore) {
curFollowScore = curFollowScore + Math.ceil((curScore - curFollowScore) * followScoreMultiplier);
}
if (curFollowScore > curScore) {
curFollowScore = curScore;
}
stats.textScore.text = curFollowScore;
stats.textLevel.text = curLevelNum;
}
function updateReflections() {
for (curClipName in reflections) {
reflections[curClipName].removeMovieClip();
}
curReflectionDepth = 0;
curReflectionImage = new flash.display.BitmapData(reflectionWidth, reflectionHeight, true, 0);
curReflectionMatrix = new flash.geom.Matrix();
curReflectionMatrix.scale(1, -1);
curReflectionMatrix.translate(liam._x, 0);
curReflectionImage.draw(liam, curReflectionMatrix);
curReflectionClip = reflections.createEmptyMovieClip("reflection" + curReflectionDepth, curReflectionDepth++);
curReflectionClip._y = reflectionY;
curReflectionClip.attachBitmap(curReflectionImage, 0);
}
function simulateTrajectory() {
trajectoryClip._visible = true;
for (curClipName in trajectoryClip) {
trajectoryClip[curClipName].removeMovieClip();
}
firePointGlobal = {x:firePoint._x, y:firePoint._y};
liamArm.localToGlobal(firePointGlobal);
curTrajectoryX = firePointGlobal.x;
curTrajectoryY = firePointGlobal.y;
curLightningSpeed = minLightningSpeed + (lightningSpeed * (curCharge - minFireCharge));
curTrajectoryVelX = (Math.sin((firePoint._rotation / 180) * Math.PI) * curLightningSpeed) * (1 + (((maxFireCharge - curCharge) / (maxFireCharge - minFireCharge)) * 0.5));
curTrajectoryVelY = (-Math.cos((firePoint._rotation / 180) * Math.PI)) * curLightningSpeed;
pi = 0;
while (pi < numTrajectoryPoints) {
if (pi > ((curCharge - minTrajectoryCharge) * 0.3)) {
break;
}
curTrajectoryX = curTrajectoryX + curTrajectoryVelX;
curTrajectoryY = curTrajectoryY + curTrajectoryVelY;
if ((((curTrajectoryX > marginRight) || (curTrajectoryX < marginLeft)) || (curTrajectoryY > marginBottom)) || (curTrajectoryY < marginTop)) {
break;
}
curTrajectoryMarker = trajectoryClip.attachMovie("trajectoryMarker", "trajectoryMarker" + pi, pi);
curTrajectoryVelY = curTrajectoryVelY + gravity;
curTrajectoryMarker._x = curTrajectoryX;
curTrajectoryMarker._y = curTrajectoryY;
trajectoryAlphaMultiplier = ((((curCharge - minTrajectoryCharge) * 0.3) - pi) * 0.04) + 0.2;
if (trajectoryAlphaMultiplier < 1) {
curTrajectoryMarker._alpha = curTrajectoryMarker._alpha * trajectoryAlphaMultiplier;
}
pi++;
}
}
function OnMouseDown() {
if (stats.hitTest(_root._xmouse, _root._ymouse)) {
return(undefined);
}
if (hint_testMousePress) {
hint_mousePressed = true;
}
firing = true;
}
function OnMouseUp() {
if (stats.hitTest(_root._xmouse, _root._ymouse)) {
return(undefined);
}
if (hint_testMouseRelease) {
hint_mouseReleased = true;
}
firing = false;
}
function fire() {
if (firePoint != undefined) {
fired = true;
getRechargeTime();
scoreStats.totalShots++;
trajectoryOpacity = trajectoryOpacity - trajectoryOpacityDec;
curLightingDepthIndex = lightning.getNextHighestDepth();
curLightningClip = lightning.attachMovie("lightning", "lightning" + curLightingDepthIndex, curLightingDepthIndex);
firePointGlobal = {x:firePoint._x, y:firePoint._y};
liamArm.localToGlobal(firePointGlobal);
curLightningClip._x = firePointGlobal.x;
curLightningClip._y = firePointGlobal.y;
curLightningSpeed = minLightningSpeed + (lightningSpeed * (curCharge - minFireCharge));
curLightningClip.velX = (Math.sin((firePoint._rotation / 180) * Math.PI) * curLightningSpeed) * (1 + (((maxFireCharge - curCharge) / (maxFireCharge - minFireCharge)) * 0.8));
curLightningClip.velY = (-Math.cos((firePoint._rotation / 180) * Math.PI)) * curLightningSpeed;
curLightningClip.numHits = 0;
curLightningClip.charge = Math.ceil(((curCharge - minFireCharge) * 0.05) + 0.001);
curLightningClip.chargeBounceReduction = chargeBounceReduction;
curLightningClip.life = getTimer() + lightningLife;
curLightningClip.lightningPoints = [];
curLightningPoint = new Object();
curLightningPoint.x = 0;
curLightningPoint.y = 0;
curLightningPoint.velX = (Math.random() - 0.5) * 10;
curLightningPoint.velY = (Math.random() - 0.5) * 10;
curLightningPoint.staticPoint = true;
curLightningPoint.fixedObject = firePoint;
curLightningClip.lightningPoints.push(curLightningPoint);
}
}
function bounceLightning(bounceDirection) {
curLightningBoltSpeed = Math.sqrt((curLightningClip.velX * curLightningClip.velX) + (curLightningClip.velY * curLightningClip.velY));
hitStar.lastLightningStrike = curLightningClip;
curLightningClip.lastStarHit = hitStar;
hitStarOffsetX = hitStar._x;
hitStarOffsetY = hitStar._y;
closestStar = undefined;
for (curStarName in stars) {
targetStar = stars[curStarName];
if (targetStar.lastLightningStrike != curLightningClip) {
targetStarDeltaX = targetStar._x - hitStarOffsetX;
targetStarDeltaY = targetStar._y - hitStarOffsetY;
targetStarDist = (targetStarDeltaX * targetStarDeltaX) + (targetStarDeltaY * targetStarDeltaY);
targetStar.targetDist = targetStarDist;
if ((closestStar.targetDist == undefined) || (targetStar.targetDist < closestStar.targetDist)) {
closestStar = targetStar;
}
}
}
if (closestStar != undefined) {
closestStarDeltaX = closestStar._x - hitStar._x;
closestStarDeltaY = closestStar._y - hitStar._y;
targetLightningRotation = Math.atan2(closestStarDeltaX, closestStarDeltaY);
} else {
targetLightningRotation = ((Math.random() - 0.5) * Math.PI) * 1.3;
}
curLightningClip.velX = Math.sin(targetLightningRotation) * curLightningBoltSpeed;
curLightningClip.velY = Math.cos(targetLightningRotation) * curLightningBoltSpeed;
}
function shootStar(curStar) {
curLightningClip.numHits++;
curStarScore = Math.ceil((curStar.scoreValue * 0.1) + 0.001);
curScoreInc = (curStarScore * curLightningClip.numHits) * 10;
if (curScoreInc > scoreStats.maxStarValue) {
scoreStats.maxStarValue = curScoreInc;
}
curStar.score.score.textScore.text = curScoreInc;
curStar.score.gotoAndPlay("show");
score.setScore(score.getScore() + curScoreInc);
curScore = score.getScore();
if ((nextScoreAchievement != undefined) && (curScore >= nextScoreAchievement)) {
curScoreAchievement = nextScoreAchievement;
nz.co.resn.stats.FlashStat.hit("/game/score/" + curScoreAchievement);
nextScoreAchievementIndex++;
nextScoreAchievement = scoreAchievements[nextScoreAchievementIndex];
}
if (!curStar.isComet) {
curStar.scoreValue = 0;
scoreStats.starsHit++;
curStar.targetX = (curStar.startX + ((Math.random() - 0.5) * 10)) + (curLightningClip.velX * 0.4);
curStar.targetY = (curStar.startY + ((Math.random() - 0.5) * 10)) + (curLightningClip.velY * 0.4);
curStar.seekingTarget = true;
curStar.velX = curStar.velX + (curLightningClip.velX * 0.2);
curStar.velY = curStar.velY + (curLightningClip.velY * 0.2);
curStar.accelY = 0;
if (curStar.dying) {
curStar.revitaliseAmount = curStar.health;
curStar.restoreAmount = 10;
}
curStar.nextDropTime = getTimer() + starRevitaliseTime;
curStar.nextAttractionTime = getTimer() + starAttractionTime;
curSparkleBurstSize = 25 - (curStar.health * 0.15);
curSparkleBurstSize = curSparkleBurstSize + (curLightningClip.numHits * 3);
curSparkleBurstSize = curSparkleBurstSize * curStar.scaleMutliplier;
createSparkleBurst(curStar, 20 - (curStar.health * 0.15), curSparkleBurstSize);
curStar.health = superHealth;
curStar.dying = false;
curStar.dyingStartTime = undefined;
} else {
curStar.dead = true;
comet.gotoAndPlay("die");
scoreStats.cometsHit++;
createSparkleBurst(comet, 10, 10);
if (lives < numLives) {
lives++;
scoreStats.lifesRegained++;
curLiveGraphic = stats.lives["life" + lives];
curLiveGraphic.dead = false;
createLifeSparkleBurst(curLiveGraphic);
trialIndex = 0;
targetStar = undefined;
do {
targetStar = starClips[Math.floor(Math.random() * starClips.length)];
} while ((!targetStar.dead) && ((trialIndex++) < 200));
if (targetStar.dead) {
targetStar.dead = false;
targetStar.dying = false;
targetStar.dyingStartTime = undefined;
targetStar.revitaliseAmount = 0;
targetStar.restoreAmount = 25;
targetStar.nextDropTime = 0;
targetStar.nextAttractionTime = 0;
targetStar.targetX = targetStar.startX;
targetStar.targetY = targetStar.startY;
targetStar.seekingTarget = true;
targetStar.accelX = 0;
targetStar.accelY = 0;
targetStar.velX = 0;
targetStar.velY = 0;
targetStar.targetVelX = 0;
targetStar.targetVelY = 0;
targetStar.scoreValue = 0;
targetStar.phase = (Math.random() * Math.PI) * 2;
targetStar.health = 100;
}
} else if (numLives < maxLives) {
lives++;
numLives++;
if (numLives > scoreStats.maxLifes) {
scoreStats.maxLifes = numLives;
}
curLiveGraphic = stats.lives["life" + lives];
curLiveGraphic.avaliable = true;
curLiveGraphic.dead = false;
createLifeSparkleBurst(curLiveGraphic);
}
}
curLightningClip.charge--;
if (curLightningClip.charge <= 0) {
curLightningClip.nowAbsorbed = true;
}
hitStar = curStar;
bounceLightning();
}
function createLifeSparkleBurst(curLiveGraphic) {
curLivePoint = {x:curLiveGraphic._x, y:curLiveGraphic._y, point:true};
curLiveGraphic._parent.localToGlobal(curLivePoint);
createSparkleBurst(curLivePoint, 20, 5);
}
function getNextStarDropTime() {
nextStarDropTime = (getTimer() + (starDropDelayBase * starDropDelayMultiplier)) + ((Math.random() * starDropDelayVariation) * starDropDelayMultiplier);
starDropDelayMultiplier = starDropDelayMultiplier * starDropDelayDecay;
}
function getRechargeTime() {
rechargeTime = getTimer() + rechargeDelay;
}
function dropStar() {
targetStar == undefined;
trialIndex = 0;
do {
targetStar = starClips[Math.floor(Math.random() * starClips.length)];
} while (((targetStar.seekingTarget || (getTimer() < targetStar.nextDropTime)) || (targetStar.dying)) && ((trialIndex++) < 100));
if (trialIndex >= 100) {
trace("no stars avaliable to drop!");
return(undefined);
}
if (targetStar != undefined) {
targetStar.dyingStartTime = getTimer();
targetStar.dying = true;
targetStar.nextSparkleTime = getTimer();
targetStar.decay = starDecay + (Math.random() * starDecayVariation);
targetStar.decayDecay = starDecayDecay;
starDropSpeedMultiplier = starDropSpeedMultiplier + starDropSpeedMultiplierIncInc;
targetStar.dropSpeedMultiplier = starDropSpeedMultiplier + (Math.random() * starDropSpeedMultiplierVariation);
targetStar.dropSpeedMultiplierInc = starDropSpeedMultiplierInc + (Math.random() * starDropSpeedMultiplierIncVariation);
getNextStarDropTime();
}
}
function gameOver() {
if (!gameIsOver) {
nz.co.resn.stats.FlashStat.hit("/game/over");
scoreStats.numCompleteGames++;
scoreStats.gameTime = Math.round((getTimer() - roundStartTime) / 1000);
scoreStats.totalGameTime = Math.round((getTimer() - totalStartTime) / 1000);
music.gamePaused();
liam.idle();
gameIsOver = true;
liam.idle();
gameRestartTime = getTimer() + restartDelay;
screens.gotoScreen("gameOver");
}
}
function killStar(curStar) {
curStar.dead = true;
stats.lives["life" + lives].dead = true;
curStar.deadX = curStar._x;
curStar.deadTime = getTimer();
curStar.deadWobble = 10 + (Math.random() * 10);
if (curStar.velX < 0) {
curStar.deadWobble = curStar.deadWobble * -1;
}
lives--;
scoreStats.lifesLost++;
getNextCometTime();
if (lives <= 0) {
gameOver();
}
}
function nextLevel() {
trace("game.nextLevel");
gameIsPaused = false;
resetLevel();
getNextLevelTime();
}
function getNextLevelTime() {
levelStartTime = getTimer();
if (curLevel.duration == undefined) {
nextLevelTime = undefined;
} else {
nextLevelTime = levelStartTime + curLevel.duration;
}
}
function levelUp() {
trace("game.levelUp");
gameIsPaused = true;
liam.idle();
curLevelNum++;
scoreStats.levelsAchieved++;
score.setScore(score.getScore() + levelUpScore);
screens.gotoScreen("levelUp");
}
function getNextCometTime() {
if (lives < numLives) {
nextCometTime = (getTimer() + nextCometDelayBase) + (Math.random() * nextCometDelayVariation);
} else {
nextCometTime = (getTimer() + nextCometDelayExtraBase) + (Math.random() * nextCometDelayExtraVariation);
}
}
function sendComet() {
curCometDirection = -curCometDirection;
comet.active = true;
comet.isVisible = true;
comet._visible = true;
nextCometTime = undefined;
comet.dead = false;
comet.gotoAndStop("show");
comet._alpha = 100;
if (curCometDirection > 0) {
comet._x = cometStartLeft;
comet.velX = cometVelX;
} else {
comet._x = cometStartRight;
comet.velX = -cometVelX;
}
comet._y = cometStartTop + (Math.random() * cometStartHeight);
comet.velY = cometVelY;
}
function hideComet() {
comet._visible = false;
comet.active = false;
comet.isVisible = false;
}
function createSparkleBurst(targetObject, numStars, size) {
cp = 0;
while (cp < numStars) {
curSparkle = createSparkle();
velMultiplier = 0;
speedMultiplier = 1;
if (targetObject.point) {
curSparkle._x = targetObject.x;
curSparkle._y = targetObject.y;
curSparkle._xscale = (curSparkle._yscale = 100 + (Math.random() * 50));
curSparkle.lifeDecay = 2 + (Math.random() * 2);
curSparkle.velY = -2;
curSparkle.accelY = 0.08;
curSparkle.decayX = 0.99;
curSparkle.decayY = 0.99;
} else {
curSparkle._x = targetObject._x;
curSparkle._y = targetObject._y;
if (targetObject == comet) {
curSparkle._xscale = (curSparkle._yscale = 100 + (Math.random() * 50));
velMultiplier = 0.5;
speedMultiplier = 1;
curSparkle.gotoAndStop(2);
curSparkle.lifeDecay = 2 + (Math.random() * 2);
curSparkle.accelY = 0.08;
curSparkle.decayX = 0.99;
curSparkle.decayY = 0.99;
} else {
curSparkle._xscale = (curSparkle._yscale = 50 + (Math.random() * 50));
velMultiplier = 0.2;
speedMultiplier = 0.5;
curSparkle.lifeDecay = 3 + (Math.random() * 3);
curSparkle.accelY = 0.05;
curSparkle.decayX = 0.995;
curSparkle.decayY = 0.995;
}
curSparkle.velX = targetObject.velX * velMultiplier;
curSparkle.velY = targetObject.velY * velMultiplier;
}
curSparkle.velX = curSparkle.velX + ((((Math.random() - 0.5) * size) * 0.3) * speedMultiplier);
curSparkle.velY = curSparkle.velY + ((((Math.random() - 0.5) * size) * 0.3) * speedMultiplier);
cp++;
}
}
function createStarTrail(curStar, revitaliseAmount) {
if (getTimer() > curStar.nextSparkleTime) {
if (revitaliseAmount != undefined) {
curStar.nextSparkleTime = getTimer() + revitaliseAmount;
} else {
curStar.nextSparkleTime = (getTimer() + 50) + ((Math.random() * 800) / (Math.abs(curStar.velY) + 1));
}
curSparkle = createSparkle();
curSparkle._x = curStar._x;
curSparkle._y = curStar._y;
if (revitaliseAmount != undefined) {
curSparkle.velX = ((-curStar.velX) * 0.1) + ((Math.random() - 0.5) * curStar.velY);
} else {
curSparkle.velX = ((-curStar.velX) * 0.1) + ((Math.random() - 0.5) * 0.4);
}
curSparkle.velY = (((-curStar.velY) * 0.15) - 0.3) + ((Math.random() - 0.5) * 0.3);
curSparkle._xscale = (curSparkle._yscale = 50 + (Math.random() * 50));
curSparkle.lifeDecay = 2 + (Math.random() * 2);
curSparkle.alphaMultiplier = (curStar._alpha * 0.01) * 0.5;
curSparkle.curStar = curStar;
curSparkle.accelY = 0;
curSparkle.decayX = 0.95;
curSparkle.decayY = 0.95;
}
}
function createCometTrail() {
curSparkle = createSparkle();
curSparkle._x = comet._x;
curSparkle._y = comet._y;
curSparkle.velX = ((-comet.velX) * 0.3) + ((Math.random() - 0.5) * 2);
curSparkle.velY = ((-comet.velY) * 0.3) + ((Math.random() - 0.5) * 2);
curSparkle._xscale = (curSparkle._yscale = 50 + (Math.random() * 50));
curSparkle.gotoAndStop(2);
curSparkle.lifeDecay = 2 + (Math.random() * 4);
curSparkle.accelY = 0.05;
curSparkle.decayX = 0.95;
curSparkle.decayY = 0.95;
}
function createSparkle() {
newSparkleDepth = sparkles.getNextHighestDepth();
curSparkle = sparkles.attachMovie("sparkle", "sparkle" + newSparkleDepth, newSparkleDepth);
curSparkle.alphaMultiplier = 1;
curSparkle.minLife = 50;
curSparkle.velX = 0;
curSparkle.velY = 0;
curSparkle.accelX = 0;
curSparkle.accelY = 0.1;
curSparkle.decayX = 0.99;
curSparkle.decayY = 0.99;
curSparkle.life = 100;
curSparkle.lifeDecay = 4;
return(curSparkle);
}
function showInstructions() {
scoreStats.viewInstructions++;
pauseGame();
screens.gotoScreen("instructions");
}
function playGame(newDifficulty) {
difficulty = newDifficulty;
scoreStats.numGameStarts++;
if (difficulty == "easy") {
nz.co.resn.stats.FlashStat.hit("/home/play/beginner");
trajectoryShown = true;
chargeMultiplier = chargeMultiplierEasy;
} else {
nz.co.resn.stats.FlashStat.hit("/home/play/advanced");
trajectoryShown = false;
chargeMultiplier = chargeMultiplierHard;
}
resumeGame();
gameStarted = true;
stats.gotoAndPlay("start");
resetGame();
}
function replayGame() {
scoreStats.restarts++;
pauseGame();
liam.idle();
gameStarted = false;
screens.gotoScreen("start");
}
function returnToGame() {
resumeGame();
}
function getMusic() {
pauseGame();
screens.gotoScreen("getMusic");
}
function updateElectrocution(curAlpha) {
liamBody = liam;
liamArm = liamBody.arm;
liamArm.hand.shock._alpha = curAlpha;
liamArm.hand2.shock._alpha = curAlpha;
liamArm.foreArm.shock._alpha = curAlpha;
liamArm.upperArm.shock._alpha = curAlpha;
if (curAlpha > 0) {
liamArm.hand2.shock._alpha = (liamArm.hand.shock._alpha = 30 + (curAlpha * 0.7));
liamArm.foreArm.shock._alpha = 20 + (curAlpha * 0.8);
liamArm.upperArm.shock._alpha = 10 + (curAlpha * 0.9);
}
liamBody.bodyShock.shock._alpha = curAlpha;
liamBody.head.head.shock._alpha = curAlpha;
liamBody.legUpperLeft.shock._alpha = curAlpha;
liamBody.legLowerLeft.shock._alpha = curAlpha;
liamBody.legFootLeft.shock._alpha = curAlpha;
liamBody.legUpperRight.shock._alpha = curAlpha;
liamBody.legLowerRight.shock._alpha = curAlpha;
liamBody.legFootRight.shock._alpha = curAlpha;
liamBody.armUpperRight.shock._alpha = curAlpha;
liamBody.armLowerRight.shock._alpha = curAlpha;
}
function pauseGame() {
if (!gameIsOver) {
gameIsPaused = true;
music.gamePaused();
liam.idle();
}
}
function resumeGame() {
gameIsPaused = false;
music.gameResumed();
}
function showHighscores() {
trace("showHighscores");
score.loadHighscores();
screens.gotoScreen("highscores");
}
function loadHighscores() {
trace("loadHighscores");
score.loadingHighscores = true;
newStartDate = (new Date().getTime() / 1000) - 86400;
trace("newStartDate: " + Math.round(newStartDate));
score.getHighScores(1, 20, {order:"desc", startDate:Math.round(newStartDate)}, highscoresLoaded);
}
function highscoresLoaded(xmlData) {
trace("highscoresLoaded");
highscoresAreLoaded = true;
this.loadingHighscores = false;
highscores = (this.highscores = []);
curHighscore = undefined;
pi = 0;
while ((pi < xmlData.firstChild.childNodes.length) && (pi < numHighscores)) {
xmlNode = xmlData.firstChild.childNodes[pi];
curHighscorePosition = pi + 1;
curHighscoreName = xmlNode.firstChild.firstChild.nodeValue;
curHighscoreScore = xmlNode.attributes.score;
curHighscore = new Object();
curHighscore.position = curHighscorePosition;
curHighscore.name = curHighscoreName;
curHighscore.score = curHighscoreScore;
trace((((curHighscore.position + ", ") + curHighscore.name) + ", ") + curHighscore.score);
highscores.push(curHighscore);
pi++;
}
if (curHighscore != undefined) {
curDummyScore = curHighscore.score;
} else {
curDummyScore = 3060 + (Math.ceil(Math.random() * 8) * 20);
}
si = highscores.length;
while (si < numHighscores) {
curDummyScore = curDummyScore - (Math.ceil((curDummyScore * (0.1 + (Math.random() * 0.1))) / 10) * 10);
if (curDummyScore < 10) {
curDummyScore = 10;
}
xmlNode = xmlData.firstChild.childNodes[pi];
curHighscorePosition = pi + 1;
curHighscoreName = dummyNames[si];
curHighscoreScore = curDummyScore;
curHighscore = new Object();
curHighscore.position = curHighscorePosition;
curHighscore.name = curHighscoreName;
curHighscore.score = curHighscoreScore;
trace((((curHighscore.position + ", ") + curHighscore.name) + ", ") + curHighscore.score);
highscores.push(curHighscore);
pi++;
si++;
}
trace(highscores.length);
}
function deactivateGame() {
if ((gameStarted && (!gameIsPaused)) && (!gameIsOver)) {
gameIsPaused = true;
music.deactivateGame();
liam.idle();
screens.gotoScreen("paused");
} else {
music.endIdleLoop();
}
}
function visitLiamsSite() {
deactivateGame();
getURL ("http://www.liamfinn.tv/", "_blank");
}
init();
Instance of Symbol 158 MovieClip "liam" in Symbol 355 MovieClip Frame 1
/* no clip actions */