Frame 1
stop();
Frame 2
Instance of Symbol 116 MovieClip [noteblack] in Frame 3
onClipEvent (load) {
stop();
}
Instance of Symbol 116 MovieClip [noteblack] in Frame 3
onClipEvent (load) {
stop();
}
Instance of Symbol 113 MovieClip [notewhitecentre] in Frame 3
onClipEvent (load) {
stop();
}
Instance of Symbol 110 MovieClip [notewhiteright] in Frame 3
onClipEvent (load) {
stop();
}
Instance of Symbol 107 MovieClip [notewhiteleft] "highC" in Frame 3
onClipEvent (load) {
stop();
}
Frame 4
Frame 112
gotoAndStop ("FRAME_TITLE");
Symbol 87 MovieClip Frame 107
stop();
Symbol 122 MovieClip Frame 1
bytesLoaded = _root.getBytesLoaded();
bytesTotal = _root.getBytesTotal();
percentSetup = (bytesLoaded / bytesTotal) * 100;
percentage = int(percentSetup) + "%";
setProperty("_root.DropIn.LoaderBar", _xscale , percentSetup);
if (bytesLoaded == bytesTotal) {
_root.gotoAndPlay("FRAME_SPLASH");
}
Symbol 122 MovieClip Frame 2
if (bytesLoaded < bytesTotal) {
_root.DropIn.gotoAndPlay(1);
}
Symbol 173 MovieClip [__Packages.Engine] Frame 0
class Engine
{
static var dog, scoreText, score, levelText, finger, bustCount, livesLost, gameOver, gameComplete, gotoEndScreen, tuneId, dogTurn, scoreColourCool, levelColourCool;
function Engine () {
}
static function init() {
var _local3;
var _local10;
var _local4;
var _local2 = 0;
while (_local2 < 12) {
_local3 = _local2 * 4;
switch (noteData[_local3 + 2]) {
case NOTE_WHITE_LEFT :
_local4 = "notewhiteleft";
break;
case NOTE_WHITE_CENTRE :
_local4 = "notewhitecentre";
break;
case NOTE_WHITE_RIGHT :
_local4 = "notewhiteright";
break;
case NOTE_BLACK :
_local4 = "noteblack";
}
var _local8 = new Note(_local2, _local4, noteData[_local3], noteData[_local3 + 1], noteData[_local3 + 3]);
notes.push(_local8);
_local2++;
}
_local2 = BUST_COUNT;
while (_local2-- , _local2 >= 0) {
var _local6 = _root.attachMovie("bust" + _local2, "bust" + _local2, _root.getNextHighestDepth());
_local6._x = bustCoords[_local2 << 1];
_local6._y = bustCoords[(_local2 << 1) + 1] - 5;
}
dog = new Dog();
var _local9 = new TextFormat();
_local9.bold = true;
_local9.font = "font";
_local9.size = TEXT_SIZE;
_local9.color = 16777215 /* 0xFFFFFF */;
Text.init(_local9);
scoreText = _root.createTextField("scoreText", _root.getNextHighestDepth(), 2, 2, 530, 100);
scoreText.setNewTextFormat(_local9);
scoreText.embedFonts = true;
scoreText.selectable = false;
score = 0;
levelText = _root.createTextField("levelText", _root.getNextHighestDepth(), 280, 2, 530, 100);
levelText.setNewTextFormat(_local9);
levelText.embedFonts = true;
levelText.selectable = false;
_local2 = 0;
while (_local2 < MOVING_SYMBOL_COUNT) {
var _local7 = new MovingSymbol();
movingSymbols.push(_local7);
_local2++;
}
_local2 = LIFE_COUNT;
while (_local2-- , _local2 >= 0) {
var _local5 = _root.attachMovie("lanternClip", "life" + _local2, 800 + _local2);
_local5._x = 125 - (_local2 * 45);
_local5._y = LIFE_Y;
lives.push(_local5);
}
finger = new Finger();
reset();
}
static function reset() {
dog.state = Dog.STATE_INACTIVE;
dog.setFrame(1);
showAll(true);
bustCount = 0;
var _local2 = BUST_COUNT;
while (_local2-- , _local2 >= 0) {
_root["bust" + _local2]._alpha = 0;
}
_local2 = LIFE_COUNT;
while (_local2-- , _local2 >= 0) {
lives[_local2]._y = LIFE_Y;
}
livesLost = 0;
gameOver = false;
gameComplete = false;
gotoEndScreen = false;
tuneId = FIRST_TUNE;
if (PRACTICE) {
if (PRACTICE) {
finger.enter(tunes[0]);
}
} else {
finger.exit();
dog.playTune(tunes[tuneId]);
}
Text.floobyText("READY MAESTRO?", WIDTH / 2, TEXT_Y, Text.CENTRE, 120);
}
static function getNoteAt(x) {
var _local2;
var _local3;
var _local1 = 0;
while (_local1 < 12) {
_local2 = _local1 * 4;
_local3 = noteData[_local2];
if ((x >= _local3) && (x < (_local3 + noteWidth[noteData[_local2 + 2]]))) {
return(_local1);
}
_local1++;
}
return(-1);
}
static function dogFinishedTune(tune) {
finger.enter(tune);
dogTurn = false;
}
static function playerFinishedTune() {
if (bustLevels[bustCount] == tuneId) {
_root["bust" + bustCount]._alpha = 1;
Text.floobyText(("YOU WON " + composerName[bustCount]) + "!", WIDTH / 2, TEXT_Y, Text.CENTRE, 200);
bustCount++;
if (tuneId == LAST_TUNE) {
gameComplete = true;
return(undefined);
}
} else {
Text.floobyText("BRAVO!", WIDTH / 2, TEXT_Y, Text.CENTRE, 100);
}
dogTurn = true;
tuneId++;
if (tuneId >= tunes.length) {
tuneId = 0;
}
dog.bark();
}
static function playerFailedTune() {
dogTurn = true;
dog.despair();
lostLife();
}
static function addPoints(points) {
score = score + points;
scoreText.text = "SCORE: " + score;
scoreText.textColor = 16776960 /* 0xFFFF00 */;
scoreColourCool = 0;
}
static function lostLife() {
if (gameOver) {
return(undefined);
}
lives[livesLost]._y++;
livesLost++;
if (livesLost == LIFE_COUNT) {
Text.floobyText("GAME OVER", WIDTH / 2, TEXT_Y, Text.CENTRE, 200);
gameOver = true;
} else {
Text.floobyText("OH DEAR!", WIDTH / 2, TEXT_Y, Text.CENTRE, 100);
}
}
static function notifyTextFinished(text) {
if (gameComplete) {
gotoEndScreen = true;
} else if (text == "GAME OVER") {
gotoEndScreen = true;
}
}
static function showAll(flag) {
dog.graphic._visible = flag;
var _local2 = 0;
while (_local2 < 12) {
notes[_local2].graphic._visible = flag;
_local2++;
}
_local2 = BUST_COUNT;
while (_local2-- , _local2 >= 0) {
_root["bust" + _local2]._visible = flag;
}
_local2 = LIFE_COUNT;
while (_local2-- , _local2 >= 0) {
lives[_local2]._visible = flag;
}
}
static function mousePressed() {
}
static function requestMovingSymbol(name, x, y, scale) {
var _local2;
var _local1 = 0;
while (_local1 < MOVING_SYMBOL_COUNT) {
_local2 = movingSymbols[_local1];
if (!_local2.active) {
_local2.init(name, x, y, scale);
return(_local2);
}
_local1++;
}
return(undefined);
}
static function update() {
if (gotoEndScreen) {
gotoEndScreen = false;
showAll(false);
_root.gotoAndStop("FRAME_END");
if (gameComplete) {
_root.dogEnd.gotoAndStop(2);
Text.floobyText("BELLA!", 142, 60, Text.CENTRE, 0);
} else {
_root.dogEnd.gotoAndStop(1);
Text.floobyText("ENCORE!", 142, 60, Text.CENTRE, 0);
}
gameComplete = false;
}
var _local2;
var _local3 = BUST_COUNT;
while (_local3-- , _local3 >= 0) {
_local2 = _root["bust" + _local3];
if ((_local2._alpha > 0) && (_local2._alpha < 100)) {
_local2._alpha = _local2._alpha + BUST_FADE_IN_SPEED;
if (_local2._alpha > 100) {
_local2._alpha = 100;
}
}
}
_local3 = LIFE_COUNT;
while (_local3-- , _local3 >= 0) {
if ((lives[_local3]._y > LIFE_Y) && (lives[_local3]._y < 1000)) {
lives[_local3]._y = lives[_local3]._y + 2;
}
}
if (scoreColourCool < 255) {
scoreColourCool = scoreColourCool + 8;
if (scoreColourCool > 255) {
scoreColourCool = 255;
}
scoreText.textColor = 16776960 + scoreColourCool;
}
if (levelColourCool < 255) {
levelColourCool = levelColourCool + 8;
if (levelColourCool > 255) {
levelColourCool = 255;
}
levelText.textColor = 16776960 + levelColourCool;
}
countTo360 = countTo360 + 0.1;
if (countTo360 > 360) {
countTo360 = countTo360 - 360;
}
Text.update();
}
static function keyPressed(keyCode) {
}
static var FIRST_TUNE = 0;
static var LAST_TUNE = 32;
static var PRACTICE = false;
static var TEXT_Y = 120;
static var TEXT_SIZE = 30;
static var WIDTH = Stage.width;
static var HEIGHT = Stage.height;
static var HALFWIDTH = WIDTH / 2;
static var HALFHEIGHT = HEIGHT / 2;
static var TO_RADIANS = (Math.PI/180);
static var LIFE_COUNT = 3;
static var MOVING_SYMBOL_COUNT = 5;
static var LIFE_Y = HEIGHT - 50;
static var BUST_COUNT = 9;
static var BUST_FADE_IN_SPEED = 1;
static var countTo360 = 0;
static var lives = new Array();
static var movingSymbols = new Array();
static var playedIntro = false;
static var notes = new Array();
static var NOTE_WHITE_LEFT = 0;
static var NOTE_WHITE_CENTRE = 1;
static var NOTE_WHITE_RIGHT = 2;
static var NOTE_BLACK = 3;
static var CROTCHET = 0;
static var QUAVER = 1;
static var bustCoords = new Array(4, 4, 50, 6, 106, 8, 160, 4, 218, 10, 279, 4, 346, 9, 394, 5, 455, 8);
static var noteWidth = new Array(33, 20.3, 33, 26.4);
static var noteData = new Array(176.8, 215.4, NOTE_WHITE_LEFT, 5, 211.8, 192.89, NOTE_BLACK, 0, 240.6, 215.4, NOTE_WHITE_CENTRE, 6, 262, 192.9, NOTE_BLACK, 1, 289.8, 215.4, NOTE_WHITE_RIGHT, 7, 328.3, 215.4, NOTE_WHITE_LEFT, 8, 363.3, 192.9, NOTE_BLACK, 2, 392.1, 215.4, NOTE_WHITE_CENTRE, 9, 413.4, 192.9, NOTE_BLACK, 3, 442.6, 215.4, NOTE_WHITE_CENTRE, 10, 463.6, 192.9, NOTE_BLACK, 4, 491.7, 215.4, NOTE_WHITE_RIGHT, 11);
static var C = 0;
static var Db = 1;
static var D = 2;
static var Eb = 3;
static var E = 4;
static var F = 5;
static var Gb = 6;
static var G = 7;
static var Ab = 8;
static var A = 9;
static var Bb = 10;
static var B = 11;
static var composerName = new Array("LISZT", "SCHUBERT", "WAGNER", "TCHAIKOVSKY", "HANDEL", "BACH", "MOZART", "CHOPIN", "BEETHOVEN");
static var bustLevels = new Array(3, 6, 9, 16, 23, 26, 28, 30, 32);
static var tunes = new Array(new Array(A, QUAVER, B, QUAVER), new Array(A, QUAVER, B, QUAVER, A, QUAVER, G, QUAVER), new Array(A, QUAVER, B, QUAVER, A, QUAVER, G, QUAVER, A, QUAVER, B, QUAVER), new Array(A, QUAVER, B, QUAVER, A, QUAVER, G, QUAVER, A, QUAVER, B, QUAVER, A, QUAVER, G, QUAVER), new Array(E, QUAVER, E, QUAVER, D, QUAVER, E, QUAVER), new Array(E, QUAVER, E, QUAVER, D, QUAVER, E, QUAVER, G, QUAVER, A, QUAVER), new Array(E, QUAVER, E, QUAVER, D, QUAVER, E, QUAVER, G, QUAVER, A, QUAVER, G, QUAVER, A, CROTCHET), new Array(A, QUAVER, B, QUAVER, A, QUAVER, G, QUAVER, A, QUAVER, B, QUAVER, A, QUAVER, G, QUAVER), new Array(A, QUAVER, B, QUAVER, A, QUAVER, G, QUAVER, A, QUAVER, B, QUAVER, A, QUAVER, G, QUAVER, E, QUAVER, E, QUAVER, D, QUAVER, E, QUAVER), new Array(A, QUAVER, B, QUAVER, A, QUAVER, G, QUAVER, A, QUAVER, B, QUAVER, A, QUAVER, G, QUAVER, E, QUAVER, E, QUAVER, D, QUAVER, E, QUAVER, G, QUAVER, A, QUAVER, G, QUAVER, A, CROTCHET), new Array(G, QUAVER, A, QUAVER, G, QUAVER, E, QUAVER, D, QUAVER), new Array(G, QUAVER, A, QUAVER, G, QUAVER, E, QUAVER, D, QUAVER, E, QUAVER, G, CROTCHET), new Array(E, QUAVER, D, QUAVER, G, QUAVER, G, QUAVER), new Array(E, QUAVER, D, QUAVER, G, QUAVER, G, QUAVER, B, QUAVER, A, CROTCHET), new Array(G, QUAVER, A, QUAVER, G, QUAVER, E, QUAVER, D, QUAVER, E, QUAVER, G, CROTCHET), new Array(G, QUAVER, A, QUAVER, G, QUAVER, E, QUAVER, D, QUAVER, E, QUAVER, G, CROTCHET, E, QUAVER, D, QUAVER, G, QUAVER, G, QUAVER), new Array(G, QUAVER, A, QUAVER, G, QUAVER, E, QUAVER, D, QUAVER, E, QUAVER, G, CROTCHET, E, QUAVER, D, QUAVER, G, QUAVER, G, QUAVER, B, QUAVER, A, CROTCHET), new Array(E, CROTCHET, D, QUAVER, C, QUAVER, D, QUAVER), new Array(E, CROTCHET, D, QUAVER, C, QUAVER, D, QUAVER, E, QUAVER, D, QUAVER, E, CROTCHET), new Array(D, QUAVER, G, QUAVER, G, QUAVER), new Array(D, QUAVER, G, QUAVER, G, QUAVER, B, QUAVER, A, CROTCHET), new Array(E, CROTCHET, D, QUAVER, C, QUAVER, D, QUAVER, E, QUAVER, D, QUAVER, E, CROTCHET), new Array(E, CROTCHET, D, QUAVER, C, QUAVER, D, QUAVER, E, QUAVER, D, QUAVER, E, CROTCHET, D, QUAVER, G, QUAVER, G, QUAVER), new Array(E, CROTCHET, D, QUAVER, C, QUAVER, D, QUAVER, E, QUAVER, D, QUAVER, E, CROTCHET, D, QUAVER, G, QUAVER, G, QUAVER, B, QUAVER, A, CROTCHET), new Array(E, CROTCHET, E, CROTCHET, D, QUAVER, C, QUAVER, D, QUAVER, E, QUAVER, D, QUAVER, E, CROTCHET, D, QUAVER, G, QUAVER, G, QUAVER, B, QUAVER, A, CROTCHET), new Array(A, QUAVER, B, QUAVER, A, QUAVER, G, QUAVER, A, QUAVER, B, QUAVER, A, QUAVER, G, QUAVER), new Array(A, QUAVER, B, QUAVER, A, QUAVER, G, QUAVER, A, QUAVER, B, QUAVER, A, QUAVER, G, QUAVER, E, QUAVER, E, QUAVER, D, QUAVER, E, QUAVER, G, QUAVER, A, QUAVER, G, QUAVER, A, CROTCHET), new Array(G, QUAVER, A, QUAVER, G, QUAVER, E, QUAVER, D, QUAVER, E, QUAVER, G, CROTCHET), new Array(G, QUAVER, A, QUAVER, G, QUAVER, E, QUAVER, D, QUAVER, E, QUAVER, G, CROTCHET, E, QUAVER, D, QUAVER, G, QUAVER, G, QUAVER, B, QUAVER, A, CROTCHET), new Array(E, CROTCHET, D, QUAVER, C, QUAVER, D, QUAVER, E, QUAVER, D, QUAVER, E, CROTCHET), new Array(E, CROTCHET, D, QUAVER, C, QUAVER, D, QUAVER, E, QUAVER, D, QUAVER, E, CROTCHET, D, QUAVER, G, QUAVER, G, QUAVER, B, QUAVER, A, CROTCHET), new Array(G, QUAVER, A, QUAVER, G, QUAVER, E, QUAVER, D, QUAVER, E, QUAVER, G, CROTCHET, E, QUAVER, D, QUAVER, G, QUAVER, G, QUAVER, B, QUAVER, A, CROTCHET, E, CROTCHET, D, QUAVER, C, QUAVER, D, QUAVER, E, QUAVER, D, QUAVER, E, CROTCHET, D, QUAVER, G, QUAVER, G, QUAVER, B, QUAVER, A, CROTCHET, E, QUAVER, E, QUAVER, D, QUAVER, C, QUAVER, D, QUAVER, E, QUAVER, D, QUAVER, E, CROTCHET, D, QUAVER, G, QUAVER, G, QUAVER, B, QUAVER, A, CROTCHET), new Array(A, QUAVER, B, QUAVER, A, QUAVER, G, QUAVER, A, QUAVER, B, QUAVER, A, QUAVER, G, QUAVER, E, QUAVER, E, QUAVER, D, QUAVER, E, QUAVER, G, QUAVER, A, QUAVER, G, QUAVER, A, CROTCHET, G, QUAVER, A, QUAVER, G, QUAVER, E, QUAVER, D, QUAVER, E, QUAVER, G, CROTCHET, E, QUAVER, D, QUAVER, G, QUAVER, G, QUAVER, B, QUAVER, A, CROTCHET, E, CROTCHET, D, QUAVER, C, QUAVER, D, QUAVER, E, QUAVER, D, QUAVER, E, CROTCHET, D, QUAVER, G, QUAVER, G, QUAVER, B, QUAVER, A, CROTCHET, E, CROTCHET, E, CROTCHET, D, QUAVER, C, QUAVER, D, QUAVER, E, QUAVER, D, QUAVER, E, CROTCHET, D, QUAVER, G, QUAVER, G, QUAVER, B, QUAVER, A, CROTCHET));
}
Symbol 174 MovieClip [__Packages.Dog] Frame 0
class Dog
{
var graphic, x, y, currentNote, direction, state, frameCount, barkSound, growlSound, noteIndex, tune, noteType, heightCount, dHeightCount, dx, dy, jumpStepCount, changeDirection, totalJumpSteps, targetX, targetNote, frame, targetY;
function Dog () {
graphic = _root.attachMovie("dog", "dog", _root.getNextHighestDepth());
graphic._x = (x = STARTX);
graphic._y = (y = STARTY);
setFrame(1);
currentNote = -1;
var self = this;
direction = RIGHT;
state = STATE_INACTIVE;
frameCount = 0;
graphic.onEnterFrame = function () {
self.update();
};
barkSound = new Sound();
barkSound.attachSound("bark");
growlSound = new Sound();
growlSound.attachSound("growl");
graphic.onPress = function () {
self.pressed();
};
}
function pressed() {
if (state == STATE_INACTIVE) {
wince();
growlSound.start();
}
}
function nextNote() {
jumpToNote(tune[noteIndex << 1], tune[(noteIndex << 1) + 1]);
noteIndex++;
if ((noteIndex << 1) > tune.length) {
jumpToNote(-1, -1);
}
}
function bark() {
state = STATE_BARKING;
}
function update() {
if (!Engine.dogTurn) {
Mouse.hide();
}
Engine.update();
switch (state) {
case STATE_BARKING :
frameCount++;
if (frameCount == 30) {
barkSound.start();
}
if (frameCount == 35) {
setFrame(12);
} else if (frameCount == 45) {
setFrame(1);
playTune(Engine.tunes[Engine.tuneId]);
}
break;
case STATE_DESPAIRING :
frameCount--;
if (frameCount == 0) {
graphic.stop();
if (!Engine.gameOver) {
Text.floobyText("TRY AGAIN", Engine.WIDTH / 2, Engine.TEXT_Y, Text.CENTRE, 150);
setFrame(1);
playTune(tune);
}
}
break;
case STATE_WINCING :
frameCount--;
if (frameCount == 0) {
state = STATE_INACTIVE;
setFrame(1);
}
break;
case STATE_RESTING :
frameCount--;
if (frameCount == 0) {
nextNote();
}
break;
case STATE_STARTING :
frameCount++;
if (frameCount > TIME_START) {
frameCount = 0;
nextNote();
}
break;
case STATE_LANDING :
frameCount++;
if (frameCount > TIME_LAND) {
switch (noteType) {
case Engine.QUAVER :
nextNote();
break;
case Engine.CROTCHET :
frameCount = REST_TIME;
state = STATE_RESTING;
}
} else if (frameCount > 5) {
setFrame(6);
}
break;
case STATE_JUMPING :
frameCount++;
if (frameCount == TIME_PREPARE_JUMP) {
setFrame(4);
Engine.notes[currentNote].released(false);
} else {
if (frameCount <= TIME_PREPARE_JUMP) {
break;
}
heightCount = heightCount + dHeightCount;
x = x + dx;
y = y + dy;
if ((--jumpStepCount) <= 0) {
land();
}
if (!changeDirection) {
break;
}
if (jumpStepCount < ((totalJumpSteps * 1) / 3)) {
if (direction == RIGHT) {
direction = LEFT;
} else {
direction = RIGHT;
}
setFrame(4);
changeDirection = false;
} else {
if (jumpStepCount >= ((totalJumpSteps * 2) / 3)) {
break;
}
setFrame(3);
}
}
}
graphic._x = x;
graphic._y = y;
if (state == STATE_JUMPING) {
graphic._y = graphic._y - (Math.sin(heightCount) * MAX_HEIGHT);
}
}
function land() {
setFrame(6);
x = targetX;
state = STATE_LANDING;
frameCount = 0;
currentNote = targetNote;
if (currentNote == -1) {
setFrame(1);
state = STATE_INACTIVE;
Engine.dogFinishedTune(tune);
Text.floobyText("REPEAT", Engine.WIDTH / 2, Engine.TEXT_Y, Text.CENTRE, 150);
} else {
Engine.notes[currentNote].pressed(false);
Engine.requestMovingSymbol("noteGood", Engine.notes[currentNote].graphic._x + 15, Engine.notes[currentNote].graphic._y, 1);
}
}
function wince() {
state = STATE_WINCING;
setFrame(10);
frameCount = TIME_WINCE;
}
function despair() {
state = STATE_DESPAIRING;
setFrame(11);
frameCount = TIME_DESPAIR;
}
function setFrame(num) {
frame = num;
if (((direction == LEFT) && (num > 3)) && (num < 10)) {
num = num + 3;
}
graphic.gotoAndStop(num);
}
function playTune(t) {
tune = t;
noteIndex = 0;
state = STATE_STARTING;
frameCount = 0;
Engine.dogTurn = true;
}
function jumpToNote(num, type) {
targetNote = num;
noteType = type;
if (currentNote == -1) {
setFrame(2);
} else {
setFrame(6);
}
if (num == -1) {
targetX = STARTX;
targetY = STARTY;
} else {
var _local2 = num * 4;
switch (Engine.noteData[_local2 + 2]) {
case Engine.NOTE_BLACK :
targetX = Engine.noteData[_local2] + 15;
targetY = 250;
break;
case Engine.NOTE_WHITE_LEFT :
targetX = Engine.noteData[_local2] + 20;
targetY = 330;
break;
case Engine.NOTE_WHITE_CENTRE :
targetX = (Engine.noteData[_local2] + 20) - 13.3;
targetY = 330;
break;
case Engine.NOTE_WHITE_RIGHT :
targetX = (Engine.noteData[_local2] + 20) - 12;
targetY = 330;
}
}
jumpStepCount = (totalJumpSteps = JUMP_STEPS_MIN);
dx = (targetX - x) / jumpStepCount;
dy = (targetY - y) / jumpStepCount;
dHeightCount = Math.PI / jumpStepCount;
changeDirection = false;
if (((direction == RIGHT) && (dx < 0)) || ((direction == LEFT) && (dx > 0))) {
changeDirection = true;
}
frameCount = 0;
state = STATE_JUMPING;
heightCount = 0;
}
static var STARTX = 100;
static var STARTY = 300;
static var STATE_STARTING = 0;
static var STATE_JUMPING = 1;
static var STATE_LANDING = 2;
static var STATE_RESTING = 3;
static var STATE_INACTIVE = 4;
static var STATE_WINCING = 5;
static var STATE_DESPAIRING = 6;
static var STATE_BARKING = 7;
static var TIME_PREPARE_JUMP = 3;
static var TIME_LAND = 7;
static var TIME_START = 100;
static var TIME_WINCE = 30;
static var TIME_DESPAIR = 100;
static var MAX_HEIGHT = 40;
static var JUMP_STEPS_MIN = 5;
static var REST_TIME = (JUMP_STEPS_MIN + TIME_PREPARE_JUMP) + TIME_LAND;
static var LEFT = 0;
static var RIGHT = 1;
}
Symbol 175 MovieClip [__Packages.Text] Frame 0
class Text
{
static var textFormat, textList;
function Text () {
}
static function init(format) {
textFormat = format;
textList = new Vector();
}
static function floobyText(text, x, y, handle, time) {
if (textList.length > 0) {
textList[0].destroy();
textList.pop();
}
text = new FloobyText(text, x, y, textFormat, handle, time);
textList.push(text);
}
static function update() {
var _local1 = textList.length;
while (_local1-- , _local1 >= 0) {
if (!textList[_local1].update()) {
textList.removeElementAt(_local1);
}
}
}
static var LEFT = 0;
static var CENTRE = 1;
static var RIGHT = 2;
}
Symbol 176 MovieClip [__Packages.Vector] Frame 0
class Vector extends Array
{
var length, pop;
function Vector () {
super();
}
function removeElementAt(i) {
var _local2 = length;
if (i == (_local2 - 1)) {
pop();
return(undefined);
}
var _local4 = this[_local2 - 1];
this[_local2 - 1] = this[i];
this[i] = _local4;
pop();
return(undefined);
}
function removeElement(object) {
var _local3 = length;
var _local2 = _local3;
while (_local2-- , _local2 >= 0) {
if (this[_local2] == object) {
var _local4 = this[_local3 - 1];
this[_local3 - 1] = this[_local2];
this[_local2] = _local4;
pop();
return(undefined);
}
}
}
}
Symbol 177 MovieClip [__Packages.FloobyText] Frame 0
class FloobyText
{
var textFields, text, deathTime, size, startX, startY, angleDiv, lifeTime;
function FloobyText (t, x, y, textFormat, handle, time) {
textFields = new Array();
text = t;
var _local5;
var _local3;
deathTime = time;
size = textFormat.size;
var _local4 = 0;
while (_local4 < text.length) {
_local5 = text.charAt(_local4);
_local3 = _root.createTextField("t" + _local5, _root.getNextHighestDepth(), x + (_local4 * size), y, size, size);
_local3.setNewTextFormat(textFormat);
_local3.embedFonts = true;
_local3.selectable = false;
_local3.textColor = 16777215 /* 0xFFFFFF */;
_local3.text = _local5;
textFields.push(_local3);
_local3._alpha = 0;
_local4++;
}
var _local9 = ((text.length - 1) * size) + textFields[textFields.length - 1].textWidth;
startX = x;
startY = y;
if (handle == Text.RIGHT) {
startX = startX - _local9;
} else if (handle == Text.CENTRE) {
startX = startX - (_local9 / 2);
}
_local4 = 0;
while (_local4 < text.length) {
textFields[_local4]._x = startX + (_local4 * size);
_local4++;
}
angleDiv = 360 / text.length;
lifeTime = 0;
}
function update() {
var _local6;
var _local8;
var _local5;
var _local9;
var _local7;
var _local3;
var _local2;
var _local4 = textFields.length;
while (_local4-- , _local4 >= 0) {
_local5 = (lifeTime / 8) + ((_local4 * angleDiv) * Engine.TO_RADIANS);
_local6 = Math.sin(_local5);
_local8 = Math.cos(_local5);
_local2 = textFields[_local4];
_local2._xscale = 100 + (_local6 * 20);
_local2._yscale = 100 + (_local8 * 20);
_local9 = (_local2._xscale * _local2.textWidth) / 100;
_local7 = (_local2._yscale * _local2.textHeight) / 100;
_local3 = _local2.textWidth - _local9;
_local2._x = (startX + (_local4 * size)) + (_local3 / 2);
_local3 = _local2.textHeight - _local7;
_local2._y = startY + (_local3 / 2);
if ((deathTime != 0) && (lifeTime >= (deathTime - FADE_OUT_TIME))) {
_local3 = ((lifeTime - (deathTime - FADE_OUT_TIME)) * 100) / FADE_OUT_TIME;
_local2._alpha = 100 - _local3;
} else {
_local3 = ((100 * lifeTime) / FADE_IN_TIME) - (_local4 * 5);
if (_local3 > 100) {
_local3 = 100;
}
_local2._alpha = _local3;
}
}
lifeTime++;
if ((deathTime != 0) && (lifeTime > deathTime)) {
destroy();
return(false);
}
return(true);
}
function destroy() {
var _local2 = textFields.length;
while (_local2-- , _local2 >= 0) {
textFields[_local2].removeTextField();
}
Engine.notifyTextFinished(text);
}
static var FADE_IN_TIME = 50;
static var FADE_OUT_TIME = 30;
}
Symbol 178 MovieClip [__Packages.Finger] Frame 0
class Finger
{
var graphic, state, tune, noteIndex, lastNotePressed, wrongNote;
function Finger () {
graphic = _root.attachMovie("finger", "pointer", _root.getNextHighestDepth());
graphic._y = 500;
state = STATE_HIDDEN;
var self = this;
graphic.onEnterFrame = function () {
self.update();
};
graphic.onMouseDown = function () {
self.press();
};
graphic.onMouseUp = function () {
self.release();
};
graphic.stop();
exit();
}
function press() {
graphic.gotoAndStop(2);
}
function release() {
graphic.gotoAndStop(1);
if (((tune != undefined) && ((noteIndex << 1) >= tune.length)) && (!Engine.dogTurn)) {
exit();
Engine.playerFinishedTune();
Engine.notes[lastNotePressed].released();
}
}
function notePressed(id) {
if (!Engine.PRACTICE) {
lastNotePressed = id;
if (id == tune[noteIndex << 1]) {
noteIndex++;
wrongNote = false;
Engine.requestMovingSymbol("noteGood", Engine.notes[id].graphic._x + 15, Engine.notes[id].graphic._y, 1);
} else if (wrongNote) {
exit();
Engine.playerFailedTune();
Engine.requestMovingSymbol("noteBad", Engine.notes[id].graphic._x + 15, Engine.notes[id].graphic._y, 1);
} else {
Engine.dog.wince();
wrongNote = true;
Text.floobyText("CAREFUL!", Engine.WIDTH / 2, Engine.TEXT_Y, Text.CENTRE, 100);
Engine.requestMovingSymbol("noteBad", Engine.notes[id].graphic._x + 15, Engine.notes[id].graphic._y, 1);
}
}
}
function enter(t) {
tune = t;
noteIndex = 0;
Mouse.hide();
graphic._visible = true;
wrongNote = false;
}
function exit() {
Mouse.show();
graphic._visible = false;
}
function update() {
graphic._x = _root._xmouse;
graphic._y = _root._ymouse;
}
static var STATE_HIDDEN = 0;
static var STATE_ENTERING = 1;
static var STATE_ACTIVE = 2;
static var BLACK_Y = 250;
static var WHITE_Y = 300;
static var X_MIN = 200;
static var X_MAX = 510;
}
Symbol 179 MovieClip [__Packages.Note] Frame 0
class Note
{
var id, graphic, sound;
function Note (i, movieClipName, x, y, depth) {
id = i;
graphic = _root.attachMovie(movieClipName, "note" + i, depth);
graphic._x = x;
graphic._y = y;
graphic.gotoAndStop(1);
var self = this;
graphic.onPress = function () {
self.pressed(true);
};
graphic.onRelease = function () {
self.released(true);
};
graphic.onReleaseOutside = function () {
self.released(true);
};
graphic.onDragOut = function () {
self.released(true);
};
sound = new Sound();
sound.attachSound("n" + id);
}
function pressed(mouse) {
if (mouse && (Engine.dogTurn)) {
return(undefined);
}
sound.start();
graphic.gotoAndStop(2);
if (mouse) {
Engine.finger.notePressed(id);
}
}
function released(mouse) {
graphic.gotoAndStop(1);
}
}
Symbol 180 MovieClip [__Packages.MovingSymbol] Frame 0
class MovingSymbol
{
var active, graphic, scale, lifetime;
function MovingSymbol () {
active = false;
}
function init(name, x, y, _scale) {
if (graphic.name != name) {
graphic = _root.attachMovie(name, name, _root.getNextHighestDepth());
}
var self = this;
graphic.onEnterFrame = function () {
self.onEnterFrame();
};
scale = _scale;
graphic._x = x;
graphic._y = y;
lifetime = 100;
active = true;
}
function onEnterFrame() {
if (!active) {
return(undefined);
}
graphic._y = graphic._y - RISE_SPEED;
lifetime = lifetime - DECAY_SPEED;
if (lifetime < 0) {
graphic.removeMovieClip();
active = false;
} else {
graphic._alpha = lifetime;
}
}
static var DECAY_SPEED = 2;
static var RISE_SPEED = 1;
}
Symbol 125 Button
on (release) {
getURL ("http://www.offthewrist.com");
}
Symbol 127 Button
on (release) {
getURL ("http://www.offthewrist.com");
}
Symbol 143 Button
on (release) {
Engine.init();
_root.gotoAndStop("FRAME_GAME");
}
Symbol 151 Button
on (release) {
getURL ("http://frenzy.morpheme.co.uk/frenzy/index.jsp?gameId=0");
}
Symbol 154 Button
on (release) {
getURL ("http://frenzy.morpheme.co.uk/frenzy/index.jsp?gameId=2");
}
Symbol 157 Button
on (release) {
getURL ("http://frenzy.morpheme.co.uk/offthewrist/bhb.jsp");
}
Symbol 160 Button
on (release) {
getURL ("http://frenzy.morpheme.co.uk/frenzy/index.jsp?gameId=1");
}
Symbol 166 Button
on (release) {
Engine.reset();
_root.gotoAndStop("FRAME_GAME");
}