Frame 1
com.novelgames.flashgames.common.MainDevelopment.initialize(this);
Symbol 26 MovieClip [fruit] Frame 1
#initclip 17
Object.registerClass("fruit", com.novelgames.flashgames.fruits.Fruit);
#endinitclip
Symbol 35 MovieClip [gameOverDialog] Frame 1
#initclip 11
Object.registerClass("gameOverDialog", com.novelgames.flashgames.fruits.GameOverDialog);
#endinitclip
Symbol 35 MovieClip [gameOverDialog] Frame 20
showFinished();
Symbol 39 MovieClip [muteButton] Frame 1
#initclip 12
Object.registerClass("muteButton", com.novelgames.flashgames.common.MuteButton);
#endinitclip
Symbol 42 MovieClip [lifeBar] Frame 1
#initclip 13
Object.registerClass("lifeBar", com.novelgames.flashgames.fruits.LifeBar);
#endinitclip
Symbol 46 MovieClip [mat] Frame 1
#initclip 14
Object.registerClass("mat", com.novelgames.flashgames.fruits.Mat);
#endinitclip
Symbol 52 MovieClip Frame 30
gotoAndPlay (1);
Symbol 58 MovieClip [game] Frame 1
#initclip 15
Object.registerClass("game", com.novelgames.flashgames.fruits.Game);
#endinitclip
Symbol 63 MovieClip [background] Frame 1
#initclip 16
Object.registerClass("background", com.novelgames.flashgames.fruits.Background);
#endinitclip
Symbol 74 MovieClip [__Packages.com.novelgames.flashgames.common.MainDevelopment] Frame 0
class com.novelgames.flashgames.common.MainDevelopment extends MovieClip
{
var gotoAndStop, startButton, highScoresButton, moreGamesButton;
function MainDevelopment () {
super();
}
static function initialize(movieClip) {
movieClip.__proto__ = com.novelgames.flashgames.common.MainDevelopment.prototype;
movieClip.gotoTitlePage();
}
function gotoTitlePage() {
gotoAndStop("title");
startButton.onRelease = function () {
this._parent.gotoInstructionsPage();
};
highScoresButton.onRelease = function () {
this._parent.showHighScores();
};
moreGamesButton.onRelease = function () {
this._parent.getURL("http://www.novelgames.com", "_blank");
};
}
function gotoInstructionsPage() {
gotoAndStop("instructions");
startButton.onRelease = function () {
this._parent.gotoGamePage();
};
}
function gotoGamePage() {
gotoAndStop("game");
}
function showHighScores() {
trace("showHighScores()");
}
function showEnterHighScore(score) {
trace(("showEnterHighScore(" + score) + ")");
}
}
Symbol 75 MovieClip [__Packages.com.novelgames.flashgames.fruits.GameOverDialog] Frame 0
class com.novelgames.flashgames.fruits.GameOverDialog extends MovieClip
{
var stop, gotoAndPlay, playAgainButton, _parent;
function GameOverDialog () {
super();
stop();
}
function show() {
gotoAndPlay("show");
}
function showFinished() {
stop();
playAgainButton.onRelease = function () {
this._parent._parent._parent.gotoTitlePage();
};
_parent.showEnterHighScore();
}
}
Symbol 76 MovieClip [__Packages.com.novelgames.flashgames.common.MuteButton] Frame 0
class com.novelgames.flashgames.common.MuteButton extends MovieClip
{
var gotoAndStop;
function MuteButton () {
super();
if (com.novelgames.flashgames.common.NewSound.getIsMuteAll()) {
showOff();
} else {
showOn();
}
}
function onPress() {
if (com.novelgames.flashgames.common.NewSound.getIsMuteAll()) {
com.novelgames.flashgames.common.NewSound.unmuteAll();
showOn();
} else {
com.novelgames.flashgames.common.NewSound.muteAll();
showOff();
}
}
function showOff() {
gotoAndStop("off");
}
function showOn() {
gotoAndStop("on");
}
}
Symbol 77 MovieClip [__Packages.com.novelgames.flashgames.common.NewSound] Frame 0
class com.novelgames.flashgames.common.NewSound extends Sound
{
var attachSound, setVolume, target, symbolName;
function NewSound (target, symbolName) {
super(target);
var _local3;
attachSound(symbolName);
setVolume(volumeAll);
this.target = target;
this.symbolName = symbolName;
sounds.push(this);
_local3 = 0;
while (_local3 < sounds.length) {
if (sounds[_local3] == this) {
} else if ((sounds[_local3].target == target) && (sounds[_local3].symbolName == symbolName)) {
sounds.splice(_local3, 1);
_local3--;
}
_local3++;
}
}
static function setVolumeAll(volume) {
var _local1;
volumeAll = volume;
_local1 = 0;
while (_local1 < sounds.length) {
sounds[_local1].setVolume(volume);
_local1++;
}
}
static function muteAll() {
setVolumeAll(0);
}
static function unmuteAll() {
setVolumeAll(100);
}
static function getIsMuteAll() {
return(volumeAll == 0);
}
static var sounds = new Array();
static var volumeAll = 100;
}
Symbol 78 MovieClip [__Packages.com.novelgames.flashgames.fruits.LifeBar] Frame 0
class com.novelgames.flashgames.fruits.LifeBar extends MovieClip
{
var stop, gotoAndStop;
function LifeBar () {
super();
stop();
}
function setLife(life) {
gotoAndStop(6 - life);
}
}
Symbol 79 MovieClip [__Packages.com.novelgames.flashgames.fruits.Mat] Frame 0
class com.novelgames.flashgames.fruits.Mat extends MovieClip
{
var showingUp, stop, startDrag, _y, upTime, gotoAndStop;
function Mat () {
super();
showingUp = false;
stop();
startDrag(true, com.novelgames.flashgames.fruits.Config.MAT_MINX, _y, com.novelgames.flashgames.fruits.Config.MAT_MAXX, _y);
}
function showUp() {
showingUp = true;
upTime = getTimer();
gotoAndStop("up");
}
function update() {
if (!showingUp) {
return(undefined);
}
if ((getTimer() - upTime) >= com.novelgames.flashgames.fruits.Config.MAT_UPTIME) {
showingUp = false;
gotoAndStop("normal");
}
}
}
Symbol 80 MovieClip [__Packages.com.novelgames.flashgames.fruits.Config] Frame 0
class com.novelgames.flashgames.fruits.Config
{
function Config () {
}
static var FRUIT_TOTALTYPES = 10;
static var FRUIT_INITIALMINX = 40;
static var FRUIT_INITIALMAXX = 60;
static var FRUIT_INITIALMINY = 180;
static var FRUIT_INITIALMAXY = 200;
static var FRUIT_MINSPEEDX = 80;
static var FRUIT_MAXSPEEDX = 120;
static var FRUIT_INITIALMINSPEEDY = -350;
static var FRUIT_INITIALMAXSPEEDY = -200;
static var FRUIT_MINROTATESPEED = 180;
static var FRUIT_MAXROTATESPEED = 720;
static var FRUIT_ACCELERATION = 500;
static var FRUIT_EXPLODETIME = 300;
static var FRUIT_INITIALGENERATEINTERVAL = 5000;
static var FRUIT_GENERATERATEINCREASEINTERVAL = 10000;
static var FRUIT_GENERATEINTERVALDECREASE = 400;
static var FRUIT_MINGENERATEINTERVAL = 1000;
static var MAT_MINX = 50;
static var MAT_MAXX = 500;
static var MAT_WIDTH = 80;
static var MAT_UPTIME = 200;
static var LIFE = 5;
static var SCORE_BOUNCE = 100;
static var SCORE_BASKET = 1000;
}
Symbol 81 MovieClip [__Packages.com.novelgames.flashgames.fruits.Game] Frame 0
class com.novelgames.flashgames.fruits.Game extends MovieClip
{
var life, score, basket, tree, fruits, soundAppear, soundBounce, soundBasket, soundExplode, soundGameOver, startTime, generateInterval, generateTime, intervalID, mat, lifeBar, gameOverDialog, _parent, fruitsHolder;
function Game () {
super();
life = com.novelgames.flashgames.fruits.Config.LIFE;
score = 0;
basket.cacheAsBitmap = true;
tree.cacheAsBitmap = true;
fruits = new Array();
soundAppear = new com.novelgames.flashgames.common.NewSound(this, "soundAppear");
soundBounce = new com.novelgames.flashgames.common.NewSound(this, "soundBounce");
soundBasket = new com.novelgames.flashgames.common.NewSound(this, "soundBasket");
soundExplode = new com.novelgames.flashgames.common.NewSound(this, "soundExplode");
soundGameOver = new com.novelgames.flashgames.common.NewSound(this, "soundGameOver");
startTime = getTimer();
generateInterval = com.novelgames.flashgames.fruits.Config.FRUIT_INITIALGENERATEINTERVAL;
generateTime = getTimer() - generateInterval;
intervalID = setInterval(this, "onTime", 1);
}
function fruitHitMat() {
mat.showUp();
score = score + com.novelgames.flashgames.fruits.Config.SCORE_BOUNCE;
soundBounce.start();
}
function fruitHitBasket(fruit) {
removeFruit(fruit);
score = score + com.novelgames.flashgames.fruits.Config.SCORE_BASKET;
soundBasket.start();
}
function fruitHitGround(fruit) {
fruit.explode();
soundExplode.start();
life--;
lifeBar.setLife(life);
if (life <= 0) {
clearInterval(intervalID);
mat.stopDrag();
gameOverDialog.show();
soundGameOver.start();
}
}
function fruitExplodeFinished(fruit) {
removeFruit(fruit);
}
function showEnterHighScore() {
_parent.showEnterHighScore(score);
}
function onTime() {
updateGenerateInterval();
generateFruit();
moveFruits();
updateMat();
updateAfterEvent();
}
function updateGenerateInterval() {
var _local2 = Math.floor((getTimer() - startTime) / com.novelgames.flashgames.fruits.Config.FRUIT_GENERATERATEINCREASEINTERVAL);
generateInterval = com.novelgames.flashgames.fruits.Config.FRUIT_INITIALGENERATEINTERVAL - (_local2 * com.novelgames.flashgames.fruits.Config.FRUIT_GENERATEINTERVALDECREASE);
if (generateInterval < com.novelgames.flashgames.fruits.Config.FRUIT_MINGENERATEINTERVAL) {
generateInterval = com.novelgames.flashgames.fruits.Config.FRUIT_MINGENERATEINTERVAL;
}
}
function generateFruit() {
var _local4 = getTimer();
var _local2;
var _local3;
var _local5;
if ((_local4 - generateTime) < generateInterval) {
return(undefined);
}
_local2 = fruitsHolder.getNextHighestDepth();
_local3 = fruitsHolder.attachMovie("fruit", "fruit" + _local2, _local2);
_local5 = _local3;
fruits.push(_local5);
generateTime = generateTime + generateInterval;
soundAppear.start();
}
function moveFruits() {
var _local2;
_local2 = 0;
while (_local2 < fruits.length) {
fruits[_local2].move();
_local2++;
}
}
function updateMat() {
mat.update();
}
function removeFruit(fruit) {
var _local2;
_local2 = 0;
while (_local2 < fruits.length) {
if (fruits[_local2] == fruit) {
fruits.splice(_local2, 1);
break;
}
_local2++;
}
fruit.removeMovieClip();
}
}
Symbol 82 MovieClip [__Packages.com.novelgames.flashgames.fruits.Fruit] Frame 0
class com.novelgames.flashgames.fruits.Fruit extends MovieClip
{
var exploding, gotoAndStop, radius, _height, _width, _x, _y, startSpeedX, startSpeedY, startRotateSpeed, startX, startY, startAngle, startTime, explodeTime, _parent, _rotation;
function Fruit () {
super();
exploding = false;
gotoAndStop(Math.floor(Math.random() * com.novelgames.flashgames.fruits.Config.FRUIT_TOTALTYPES) + 1);
radius = (_width + _height) / 4;
_x = com.novelgames.flashgames.fruits.Config.FRUIT_INITIALMINX + (Math.random() * (com.novelgames.flashgames.fruits.Config.FRUIT_INITIALMAXX - com.novelgames.flashgames.fruits.Config.FRUIT_INITIALMINX));
_y = com.novelgames.flashgames.fruits.Config.FRUIT_INITIALMINY + (Math.random() * (com.novelgames.flashgames.fruits.Config.FRUIT_INITIALMAXY - com.novelgames.flashgames.fruits.Config.FRUIT_INITIALMINY));
startSpeedX = com.novelgames.flashgames.fruits.Config.FRUIT_MINSPEEDX + (Math.random() * (com.novelgames.flashgames.fruits.Config.FRUIT_MAXSPEEDX - com.novelgames.flashgames.fruits.Config.FRUIT_MINSPEEDX));
startSpeedY = com.novelgames.flashgames.fruits.Config.FRUIT_INITIALMINSPEEDY + (Math.random() * (com.novelgames.flashgames.fruits.Config.FRUIT_INITIALMAXSPEEDY - com.novelgames.flashgames.fruits.Config.FRUIT_INITIALMINSPEEDY));
startRotateSpeed = com.novelgames.flashgames.fruits.Config.FRUIT_MINROTATESPEED + (Math.random() * (com.novelgames.flashgames.fruits.Config.FRUIT_MAXROTATESPEED - com.novelgames.flashgames.fruits.Config.FRUIT_MINROTATESPEED));
startX = _x;
startY = _y;
startAngle = 0;
startTime = getTimer();
}
function move() {
if (!exploding) {
doMove();
} else {
doExplode();
}
}
function explode() {
exploding = true;
explodeTime = getTimer();
gotoAndStop("explode");
}
function doMove() {
var _local7 = getTimer();
var _local2 = (_local7 - startTime) / 1000;
var _local5;
var _local3;
var _local9;
var _local8;
var _local4;
var _local6;
_local5 = startX + (_local2 * startSpeedX);
_local3 = (startY + (startSpeedY * _local2)) + (((com.novelgames.flashgames.fruits.Config.FRUIT_ACCELERATION * _local2) * _local2) / 2);
_local9 = startAngle + (_local2 * startRotateSpeed);
if (((_y + radius) < _parent._parent.mat._y) && ((_local3 + radius) >= _parent._parent.mat._y)) {
_local8 = (_parent._parent.mat._y - radius) - startY;
_local4 = (Math.sqrt((startSpeedY * startSpeedY) + ((2 * com.novelgames.flashgames.fruits.Config.FRUIT_ACCELERATION) * _local8)) - startSpeedY) / com.novelgames.flashgames.fruits.Config.FRUIT_ACCELERATION;
_local6 = startX + (_local2 * startSpeedX);
if (Math.abs(_local6 - _parent._parent.mat._x) <= (com.novelgames.flashgames.fruits.Config.MAT_WIDTH / 2)) {
startX = _local6;
startY = _parent._parent.mat._y - radius;
startAngle = startAngle + (_local4 * startRotateSpeed);
startSpeedY = -(startSpeedY + (com.novelgames.flashgames.fruits.Config.FRUIT_ACCELERATION * _local4));
startTime = startTime + (_local4 * 1000);
_local2 = _local2 - _local4;
_local5 = startX + (_local2 * startSpeedX);
_local3 = (startY + (startSpeedY * _local2)) + (((com.novelgames.flashgames.fruits.Config.FRUIT_ACCELERATION * _local2) * _local2) / 2);
_parent._parent.fruitHitMat();
}
}
if (((_local3 > _y) && (_parent._parent.basket.hitTest(_local5, _local3, true))) || (_local5 >= Stage.width)) {
_parent._parent.fruitHitBasket(this);
return(undefined);
}
if (_local3 >= Stage.height) {
_parent._parent.fruitHitGround(this);
}
_x = _local5;
_y = _local3;
_rotation = _local9;
}
function doExplode() {
if ((getTimer() - explodeTime) >= com.novelgames.flashgames.fruits.Config.FRUIT_EXPLODETIME) {
_parent._parent.fruitExplodeFinished(this);
}
}
}
Symbol 83 MovieClip [__Packages.com.novelgames.flashgames.fruits.Background] Frame 0
class com.novelgames.flashgames.fruits.Background extends MovieClip
{
var cacheAsBitmap;
function Background () {
super();
cacheAsBitmap = true;
}
}