Frame 1
function startGame() {
if (MusicLoop.getBytesLoaded() == MusicLoop.getBytesTotal()) {
gotoAndStop ("game");
} else {
gotoAndStop ("musicloader");
}
}
function startLoadXML(filename, dataobject, loadedfunction, failurefunction) {
var _local1 = this;
_local1 = new XML();
_local1.onLoad = loadXML;
_local1.ignoreWhite = true;
_local1.load(filename);
_local1.loadfile = filename;
_local1.loadedfunction = loadedfunction;
_local1.failurefunction = failurefunction;
_local1.dataobject = dataobject;
}
function loadXML(success) {
var _local2 = this;
if (success) {
var _local1 = 0;
while (_local1 < _local2.firstChild.childNodes.length) {
_local2.dataobject[_local2.firstChild.childNodes[_local1].nodeName] = Number(_local2.firstChild.childNodes[_local1].childNodes[0].nodeValue);
_local1++;
}
_local2.loadedfunction();
} else {
_local2.load(_local2.loadfile);
}
}
function initSounds() {
makeSound("vo_start", "vo_start", 80);
makeSound("vo_success", "vo_success", 60);
makeSound("vo_timer", "vo_timer", 70);
makeSound("vo_danger", "vo_danger", 70);
makeSound("vo_end", "vo_end", 70);
makeSound("vo_bonus", "vo_bonus", 70);
makeSound("vo_bigbonus", "vo_bigbonus", 70);
makeSound("stick", "stick", 60);
makeSound("fire", "fire", 50);
makeSound("smash", "smash", 70);
makeSound("specialball", "specialball", 50);
makeSound("adderhit", "adderhit", 90);
makeSound("addersucceed", "addersucceed", 90);
makeSound("alarm", "alarm", 70);
makeSound("mulitplier", "mulitplier", 70);
makeSound("splat1", "splat1", 60);
makeSound("splat2", "splat2", 60);
makeSound("splat3", "splat3", 60);
makeSound("splat4", "splat4", 60);
makeSound("splat5", "splat5", 60);
makeSound("chain", "chain", 20);
makeSound("explosion", "explosion", 90);
makeSound("MusicIntro", "music_intro", 60);
makeSound("MusicLoop", "", 50);
makeSound("MusicLoop2", "", 50);
if (soundOn == undefined) {
soundOn = true;
}
if (musicOn == undefined) {
musicOn = true;
}
}
function makeSound(sname, sID, vol) {
var _local2 = this;
if (!_local2.sounds_mc) {
_local2.createEmptyMovieClip("sounds_mc", 5000);
}
if (!scount) {
scount = 0;
}
var _local3 = sounds_mc.createEmptyMovieClip(sname, scount++);
var _local1;
_local1 = new Sound(_local3);
if (sID != "") {
_local1.attachSound(sID);
}
if (vol != undefined) {
_local1.setVolume(vol);
}
_local2[sname] = _local1;
_local2.startoffset = 0;
_local2.endoffset = 0;
return(_local1);
}
function playSounds(s1, s2) {
var _local1 = s1;
var _local2 = _global;
playSound(_local1);
var soundobj = _local2.main_mc[_local1];
_local2.main_mc[_local1].nextSound = s2;
_local2.main_mc[_local1].onSoundComplete = function () {
playSound(this.nextSound);
this.onSoundComplete = false;
};
}
function toggleSound() {
soundOn = !soundOn;
}
function toggleMusic() {
if (musicOn) {
MusicIntro.setVolume(0);
MusicLoop.setVolume(0);
MusicLoop2.setVolume(0);
} else {
MusicIntro.setVolume(50);
MusicLoop.setVolume(50);
MusicLoop2.setVolume(50);
}
musicOn = !musicOn;
}
function speedUpMusic() {
if (curr_sound == MusicLoop) {
if (MusicLoop2.getBytesLoaded() == MusicLoop2.getBytesTotal()) {
currentPosition = MusicLoop.position;
newPosition = (currentPosition / 150) * 120;
MusicLoop.stop();
MusicLoop2.start(newPosition / 1000);
curr_sound = MusicLoop2;
next_sound = MusicLoop2;
}
}
}
function slowDownMusic() {
if (curr_sound == MusicLoop2) {
currentPosition = MusicLoop2.position;
newPosition = (currentPosition / 120) * 150;
MusicLoop2.stop();
MusicLoop.start(newPosition / 1000);
curr_sound = MusicLoop;
}
next_sound = MusicLoop;
}
function startMusic() {
if (!musicOn) {
MusicIntro.setVolume(0);
MusicLoop.setVolume(0);
MusicLoop2.setVolume(0);
}
MusicIntro.start(0, 1);
curr_sound = MusicIntro;
next_sound = MusicLoop;
createEmptyMovieClip("sync_mc", 100);
sync = new Sound(sync_mc);
sync.attachSound("sync.wav");
sync.setVolume(0);
sync.onSoundComplete = function () {
this.start(0, 1);
var _local1 = curr_sound.duration;
if (curr_sound.endoffset) {
_local1 = _local1 - curr_sound.endoffset;
}
if ((curr_sound.position + 100) > _local1) {
next_sound.start((0.1 + (next_sound.startoffset / 1000)) - ((_local1 - curr_sound.position) / 1000), 1);
curr_sound = next_sound;
}
};
sync.start(0, 1);
}
function stopMusic() {
curr_sound.stop();
}
stop();
_global.rootlevel = this;
var gs = new BustaGameSettings(false);
_global.rootlevel = this;
entryclip_mc._visible = false;
frame_mc._visible = false;
configloaded = false;
configSettings = {};
var musicFolder = "";
if (_level0.musicFolder != undefined) {
musicFolder = _level0.musicFolder;
}
this.onEnterFrame = function () {
var _local1 = this;
if ((_local1.getBytesLoaded() == _local1.getBytesTotal()) && (_local1.configloaded)) {
MusicLoop.loadSound(musicFolder + "musicslow.mp3");
MusicLoop.onLoad = function () {
var _local1 = this;
_local1.startoffset = 50;
_local1.endoffset = 80;
_local1.setVolume(60);
MusicLoop2.loadSound(musicFolder + "musicfast.mp3");
MusicLoop2.onLoad = function () {
MusicLoop2.startoffset = 50;
MusicLoop2.endoffset = 90;
MusicLoop2.setVolume(60);
};
};
entryclip_mc._visible = true;
frame_mc._visible = true;
delete _local1.onEnterFrame;
testurl();
}
};
_global.startGame = startGame;
initSounds();
mainclip = this;
sounds = Array();
configLoader = function (success) {
var _local2 = _global;
configloaded = true;
_local2.rootlevel._xscale = (configSettings.width / 512) * 100;
_local2.rootlevel._yscale = (configSettings.height / 288) * 100;
_local2.rootlevel._x = (512 - configSettings.width) / 2;
_local2.rootlevel._y = (288 - configSettings.height) / 2;
gs.gameTime = configSettings.gametime * 1000;
var _local1 = 0;
while (_local1 < gs.updateFreqs.length) {
gs.updateFreqs[_local1] = gs.updateFreqs[_local1] * (configSettings.speed / 5);
_local1++;
}
gs.preRenderedBitmaps = configSettings.bitmaps;
};
configLoadFailed = function () {
};
if (gs.tvVersion) {
_quality = "MEDIUM";
fscommand ("fullscreen", true);
fscommand ("allowscale", false);
startLoadXML("config.xml", configSettings, configLoader, null);
keyListener = new Object();
keyListener.clip = this;
keyListener.onKeyDown = function () {
if ((Key.getCode() == 13) && (this.clip._currentframe == 1)) {
this.clip.gotoAndStop("game");
}
};
Key.addListener(keyListener);
} else {
configloaded = true;
}
splatcount = 0;
playSound = function (sname, vol, pan, loops) {
var _local1 = sname;
if (_local1 == "splat") {
splatcount = (splatcount + 1) % 5;
_local1 = _local1 + (splatcount + 1);
sounds.push(_local1);
while (sounds.length > 3) {
mainclip[sounds.shift()].stop();
}
}
var _local2 = mainclip[_local1];
if (soundOn) {
if (vol != undefined) {
_local2.setVolume(vol);
}
if (pan != undefined) {
_local2.setPan(pan);
}
_local2.start(0, loops);
}
};
stopSound = function (sname) {
var _local1 = this[sname];
_local1.stop();
};
_global.playSound = playSound;
_global.newGame = function () {
_global.rootlevel.gotoAndStop("entry");
stopMusic();
};
Frame 2
this.onEnterFrame = function () {
var _local1 = this;
if (_local1.MusicLoop.getBytesLoaded() == _local1.MusicLoop.getBytesTotal()) {
gotoAndStop ("game");
delete _local1.onEnterFrame;
} else {
if (!counter) {
counter = 1;
}
load_txt = ("LOADING PIES... " + Math.round((_local1.MusicLoop.getBytesLoaded() / _local1.MusicLoop.getBytesTotal()) * 100)) + "%";
}
};
Frame 3
var game;
stop();
if (!gs.tvVersion) {
startMusic();
}
game = new BustaGame(game_mc, gs, this);
Symbol 53 MovieClip [BallTest2] Frame 1
stop();
Symbol 67 MovieClip [BallTest1] Frame 1
stop();
Symbol 67 MovieClip [BallTest1] Frame 5
gotoAndStop (1);
Symbol 67 MovieClip [BallTest1] Frame 9
stop();
Symbol 79 MovieClip [BallTest0] Frame 1
stop();
Symbol 79 MovieClip [BallTest0] Frame 5
gotoAndStop (1);
Symbol 79 MovieClip [BallTest0] Frame 9
stop();
Symbol 119 MovieClip [Ball5_BM] Frame 1
stop();
Symbol 119 MovieClip [Ball5_BM] Frame 5
gotoAndStop (1);
Symbol 119 MovieClip [Ball5_BM] Frame 13
stop();
Symbol 146 MovieClip [Ball4_BM] Frame 1
stop();
Symbol 146 MovieClip [Ball4_BM] Frame 5
gotoAndStop (1);
Symbol 146 MovieClip [Ball4_BM] Frame 13
stop();
Symbol 171 MovieClip [Ball3_BM] Frame 1
stop();
Symbol 171 MovieClip [Ball3_BM] Frame 5
gotoAndStop (1);
Symbol 171 MovieClip [Ball3_BM] Frame 13
stop();
Symbol 198 MovieClip [Ball2_BM] Frame 1
stop();
Symbol 198 MovieClip [Ball2_BM] Frame 5
gotoAndStop (1);
Symbol 198 MovieClip [Ball2_BM] Frame 13
stop();
Symbol 225 MovieClip [Ball1_BM] Frame 1
stop();
Symbol 225 MovieClip [Ball1_BM] Frame 5
gotoAndStop (1);
Symbol 225 MovieClip [Ball1_BM] Frame 13
stop();
Symbol 260 MovieClip [Ball0_BM] Frame 1
stop();
Symbol 260 MovieClip [Ball0_BM] Frame 5
gotoAndStop (1);
Symbol 260 MovieClip [Ball0_BM] Frame 13
stop();
Symbol 293 MovieClip [Ball5] Frame 1
stop();
Symbol 293 MovieClip [Ball5] Frame 5
gotoAndStop (1);
Symbol 293 MovieClip [Ball5] Frame 13
stop();
Symbol 307 MovieClip [Ball4] Frame 1
stop();
Symbol 307 MovieClip [Ball4] Frame 5
gotoAndStop (1);
Symbol 307 MovieClip [Ball4] Frame 13
stop();
Symbol 322 MovieClip [Ball3] Frame 1
stop();
Symbol 322 MovieClip [Ball3] Frame 5
gotoAndStop (1);
Symbol 322 MovieClip [Ball3] Frame 13
stop();
Symbol 337 MovieClip [Ball2] Frame 1
stop();
Symbol 337 MovieClip [Ball2] Frame 5
gotoAndStop (1);
Symbol 337 MovieClip [Ball2] Frame 13
stop();
Symbol 352 MovieClip [Ball1] Frame 1
stop();
Symbol 352 MovieClip [Ball1] Frame 5
gotoAndStop (1);
Symbol 352 MovieClip [Ball1] Frame 13
stop();
Symbol 366 MovieClip [Ball0] Frame 1
stop();
Symbol 366 MovieClip [Ball0] Frame 5
gotoAndStop (1);
Symbol 366 MovieClip [Ball0] Frame 13
stop();
Symbol 387 Button
on (release) {
_parent.startGame();
}
Symbol 395 Button
on (release) {
play();
}
Symbol 643 MovieClip Frame 1
counter = 0;
playing = true;
this.onEnterFrame = function () {
var _local1 = this;
if (playing) {
if ((counter % 2) == 0) {
if (_local1._currentframe == _local1._totalframes) {
gotoAndStop (1);
} else {
_local1.nextFrame();
_local1.nextFrame();
}
} else {
stop();
}
counter++;
}
};
Symbol 659 MovieClip Frame 1
stop();
Symbol 662 MovieClip Frame 1
this.onEnterFrame = function () {
if (x3) {
x3_mc._visible = true;
} else {
x3_mc._visible = false;
}
if (x2) {
x2_mc._visible = true;
} else {
x2_mc._visible = false;
}
};
stop();
Symbol 673 MovieClip Frame 1
function updateBallColour(col) {
nextBall = col;
}
function setX2(state) {
nextX2 = state;
}
function setX3(state) {
nextX3 = state;
}
this.onEnterFrame = function () {
if (breechballguide_mc) {
breechball_mc._x = Math.round(breechballguide_mc._x);
breechball_mc._y = Math.round(breechballguide_mc._y);
breechballguide_mc._visible = false;
breechball_mc._visible = true;
} else {
breechball_mc._visible = false;
}
if ((!ballColour) && (nextBall)) {
ballColour = nextBall;
breechball_mc.gotoAndStop(ballColour);
}
if (this._currentframe == 1) {
ballColour = nextBall;
breechball_mc.gotoAndStop(ballColour);
breechball_mc.x2 = nextX2;
breechball_mc.x3 = nextX3;
}
};
stop();
Symbol 696 MovieClip Frame 1
function setX2() {
nextX2 = true;
}
function setX3() {
nextX3 = true;
}
function clearMultipliers() {
nextX2 = false;
nextX3 = false;
}
loadball_mc.gotoAndStop(nextBallColour);
loadball_mc.x2 = nextX2;
loadball_mc.x3 = nextX3;
stop();
Symbol 697 MovieClip Frame 1
music_bt.tabEnabled = false;
sfx_bt.tabEnabled = false;
Symbol 698 MovieClip Frame 1
demo_mc._accProps = new Object();
demo_mc._accProps.silent = true;
Symbol 707 Button
on (release) {
nextPage();
}
Symbol 737 MovieClip Frame 1
stop();
Symbol 739 MovieClip Frame 1
music_bt.tabEnabled = false;
sfx_bt.tabEnabled = false;
Symbol 758 MovieClip Frame 1
function updateBallColour(col) {
ballColour = col;
carryball_mc.gotoAndStop(ballColour);
}
ballColour = "";
this.onEnterFrame = function () {
updateBallColour(ballColour);
};
Symbol 761 Button
on (release) {
_global.startGame();
}
Symbol 762 MovieClip Frame 1
function nextPage() {
nextFrame();
}
stop();
game_mc.demo_mc.guncontainer_mc.lever_mc.lookinghead_mc._visible = false;
game_mc.demo_mc.guncontainer_mc.lever_mc.scaredhead_mc._visible = false;
game_mc.demo_mc.guncontainer_mc.lever_mc.stop();
game_mc.demo_mc.nevshadow_mc.stop();
Symbol 762 MovieClip Frame 3
game_mc.demo_mc.guncontainer_mc.lever_mc.lookinghead_mc._visible = false;
game_mc.demo_mc.guncontainer_mc.lever_mc.scaredhead_mc._visible = false;
game_mc.demo_mc.guncontainer_mc.lever_mc.stop();
game_mc.demo_mc.guncontainer_mc.gunbarrel_mc._rotation = 50;
game_mc.demo_mc.guncontainer_mc.cog_mc._rotation = 50;
game_mc.demo_mc.nevshadow_mc.stop();
Symbol 762 MovieClip Frame 4
game_mc.demo_mc.guncontainer_mc.lever_mc.lookinghead_mc._visible = false;
game_mc.demo_mc.guncontainer_mc.lever_mc.scaredhead_mc._visible = false;
game_mc.demo_mc.guncontainer_mc.lever_mc.stop();
game_mc.demo_mc.nevshadow_mc.stop();
Symbol 762 MovieClip Frame 6
chain_mc.gotoAndStop(2);
Symbol 765 MovieClip Frame 1
stop();
Symbol 765 MovieClip Frame 53
stop();
Symbol 901 MovieClip [__Packages.BustaGameSettings] Frame 0
class BustaGameSettings
{
function BustaGameSettings (tvVersion) {
var _local1 = this;
_local1.tvVersion = tvVersion;
_local1.accumulatorCount = 5;
_local1.specialBallFrequency = 1500;
_local1.specialBallOffset = 750;
_local1.specialBallSpeed = 3;
_local1.adderBallFrequency = 1500;
_local1.adderBallOffset = 0;
_local1.preRenderedBitmaps = true;
_local1.explodeScore = 1;
_local1.dropScore = 2;
_local1.showDebugInfo = false;
_local1.speeds = Array(8, 2, 2);
_local1.updateFreqs = Array(5, 10, 20);
_local1.multiplierFreq = 20;
_local1.dangerLevel1 = 70;
_local1.dangerLevel1IncFreq = 200;
if (tvVersion) {
_local1.stepGun = true;
_local1.timedGame = true;
_local1.gameTime = 45000;
_local1.multiplierFreq = 0;
_local1.specialBallOffset = -600;
_local1.specialBallFrequency = 1000;
_local1.dangerLevel1 = 90;
}
}
}
Symbol 902 MovieClip [__Packages.BustaGame] Frame 0
class BustaGame
{
var ballFirer, gunMoving, clip, ballClip, playBottom, ySpacing, frameCounter, rows, fallFunction, ballCount, fireBallSpeed, specialBall, adderBall, playRight, playLeft, gs, ballVariations, ballDiam, ballCollisionSpacer, particleManager, smashAccumulator, gamePlaying, dangerLevel, musicClip;
function BustaGame (myclip, gs, musicclip) {
var _local1 = this;
var _local2 = gs;
_local1.clip = myclip;
_local1.musicClip = musicclip;
_local1.x2Active = false;
_local1.x3Active = false;
_local1.clip.x2_mc._visible = false;
_local1.clip.x3_mc._visible = false;
_local1.clip.gameover_mc._visible = false;
_local1.rows = new Array();
_local1.ballVariations = 3;
if (!_local2.tvVersion) {
_local1.ballClips = Array("Ball0", "Ball5", "Ball3", "Ball1", "Ball4", "Ball2");
} else {
_local1.ballClips = Array("Ball0", "Ball3", "Ball1", "Ball4", "Ball2");
}
_local1.shuffleArray(_local1.ballClips);
_local1.ballDiam = 27;
_local1.ballCollisionSpacer = 2;
_local1.ySpacing = _local1.ballDiam * 0.87;
_local1.fireBallSpeed = 20;
_local1.targetSpace = new net.pluginmedia.PIM_Vector2D(-1, -1);
_local1.sideSpace = 3;
_local1.playWidth = _local1.ballDiam * 8;
_local1.playLeft = 147 + _local1.sideSpace;
_local1.playBottom = -15;
_local1.playRight = (_local1.playLeft + _local1.playWidth) - (_local1.sideSpace * 2);
_local1.judder = 0;
_local1.ballCount = 0;
_local1.numOfCols = 8;
_local1.ballClip = _local1.clip.balls_mc;
_local1.gs = _local2;
_local1.smashAccumulator = 0;
_local1.showPointers = true;
_local1.gunMoving = true;
_local1.specialBall = new BustaSpecialBall(_local1.clip.specialball_mc, _local1);
_local1.adderBall = new BustaAdderBall(_local1.clip.adderball_mc, _local1);
_local1.ballFirer = new BustaBallFirer(_local1, _local1.clip);
_local1.dangerCounter = -1;
_local1.dangerLevel = 0;
_local1.frameCounter = 0;
_local1.clip.createEmptyMovieClip("particles_mc", 500);
_local1.particleManager = new net.pluginmedia.PIM_ParticleManager(_local1.clip.particles_mc);
_local1.score = 0;
_local1.lightsClip = _local1.clip.scorelights_mc;
_local1.lightsClip.stop();
_local1.lightsClip._visible = false;
_local1.alarmClip = _local1.clip.alarm_mc;
_local1.alarmClip.stop();
_local1.alarmClip._visible = false;
_local1.clip.pause_mc._visible = false;
_local1.clip.pause_mc.stop();
_local1.timerClip = _local1.clip.timer_mc;
_local1.timerClip.stop();
_local1.outOfTime = false;
_local1.clip.explode_mc.stop();
_local1.clip.explode_mc._visible = false;
_local1.clip.sfx_on_mc._visible = _local1.musicClip.soundOn;
_local1.clip.music_on_mc._visible = _local1.musicClip.musicOn;
_local1.clip.music_bt.tabEnabled = false;
_local1.clip.sfx_bt.tabEnabled = false;
if (_local2.tvVersion) {
_local1.clip.music_bt._visible = false;
_local1.clip.sfx_bt._visible = false;
_local1.voiceOverStart = 0;
_local1.gameStartFrame = 1;
_local1.clip.jammakers_mc.cacheAsBitmap = true;
_local1.clip.sides_mc.cacheAsBitmap = true;
} else {
_local1.clip.music_bt.gameObject = _local1;
_local1.clip.sfx_bt.gameObject = _local1;
_local1.clip.sfx_bt.onRelease = function () {
var _local1 = this;
_local1.gameObject.getMusicClip().toggleSound();
_local1.gameObject.getClip().sfx_on_mc._visible = _local1.gameObject.getMusicClip().soundOn;
};
_local1.clip.music_bt.onRelease = function () {
var _local1 = this;
_local1.gameObject.getMusicClip().toggleMusic();
_local1.gameObject.getClip().music_on_mc._visible = _local1.gameObject.getMusicClip().musicOn;
};
_local1.voiceOverStart = 45;
_local1.gameStartFrame = 70;
}
_local1.dangerLevel1 = _local2.dangerLevel1;
_local1.clip.gameObj = _local1;
_local1.clip.onEnterFrame = function () {
this.gameObj.gameLoop();
};
_local1.keyListener = new Object();
_local1.keyListener.gameObject = _local1;
_local1.keyListener.onKeyDown = function () {
var _local1 = this;
if (_local1.gameObject.isGamePlaying() && (_local1.frameCounter >= _local1.gameStartFrame)) {
if (Key.getCode() == 32) {
_local1.gameObject.fireBall();
} else if (_local1.gameObject.gs.stepGun) {
if (Key.getCode() == 37) {
_local1.gameObject.stepLeft();
} else if (Key.getCode() == 39) {
_local1.gameObject.stepRight();
}
}
}
if (_local1.gameObject.gs.tvVersion) {
if (Key.getCode() == 13) {
if (_local1.gameObject.outOfTime) {
_local1.gameObject.getMusicClip().stopMusic();
_local1.gameObject.getClip()._parent.gotoAndStop(1);
delete _local1.gameObject;
} else if (!_local1.gameObject.gamePlaying) {
_local1.gameObject.gamePlaying = true;
_local1.gameObject.gameStartTime = getTimer();
}
} else if (Key.getCode() == 82) {
_local1.gameObject.getMusicClip().stopMusic();
_local1.gameObject.getClip()._parent.gotoAndStop(1);
delete _local1.gameObject;
}
} else if (Key.getCode() == 80) {
_local1.gameObject.togglePause();
}
};
Key.addListener(_local1.keyListener);
_local1.scrollSpeed = 1;
if (_local2.tvVersion) {
_local1.gamePlaying = false;
_local1.clip.start_mc._visible = false;
_local1.clip.start_mc.stop();
} else {
_local1.gamePlaying = true;
_local1.gamePaused = false;
}
_local1.gameStartTime = getTimer();
if (!_local2.showDebugInfo) {
_local1.clip.debug_mc._visible = false;
_local1.clip.framecounter_mc._visible = false;
}
_local1.fallFunction = function () {
var _local1 = this;
if (_local1.playDelay > 0) {
_local1.playDelay--;
_local1._y = _local1._y + _local1.scrollSpeed;
return(false);
}
if (_local1.playDelay == 0) {
_local1.gotoAndPlay("explode");
_local1.playDelay = -1;
if (_local1.soundon) {
_global.playSound("splat");
}
_local1.parentGame.addToScore(1);
}
if (_local1.life > 0) {
_local1.life--;
}
if (_local1.life == 0) {
_local1.removeMovieClip();
}
if (_local1.fallDelay == 0) {
_local1.parentGame.addToScore(1);
}
if (_local1.fallDelay <= 0) {
if (!_local1.yVel) {
_local1.yVel = 4;
}
_local1.yVel = _local1.yVel * 1.1;
_local1._y = _local1._y + _local1.yVel;
if (_local1._y > 300) {
_local1.removeMovieClip();
}
} else {
_local1.fallDelay--;
_local1._y = _local1._y + _local1.scrollSpeed;
}
return(undefined);
};
}
function fireBall() {
var _local1 = this;
if (!_local1.ballFirer.getBallFired()) {
_local1.musicClip.playSound("fire");
_local1.ballFirer.fireBall(_local1.fireBallSpeed);
}
}
function gameLoop() {
var _local1 = this;
if (_local1.gamePlaying) {
if (_local1.frameCounter == _local1.voiceOverStart) {
_local1.musicClip.playSound("vo_start");
} else if (_local1.frameCounter >= _local1.gameStartFrame) {
_local1.checkKeys();
var lastDangerLevel = _local1.dangerLevel;
var _local3 = _local1.dangerLevel1 + ((210 - _local1.dangerLevel1) / 2);
var dangerLevel3 = (_local3 + ((210 - _local3) / 2));
var gameOverLevel = 205;
var _local2 = _local1.getBottomRowPos();
if (_local2 < _local1.dangerLevel1) {
_local1.scrollSpeed = _local1.gs.speeds[0];
_local1.updateFreq = _local1.gs.updateFreqs[0];
_local1.dangerLevel = 0;
} else if (_local2 < _local3) {
_local1.scrollSpeed = _local1.gs.speeds[1];
_local1.updateFreq = _local1.gs.updateFreqs[1];
if (_local1.dangerLevel > 1) {
_local1.musicClip.slowDownMusic();
}
_local1.dangerLevel = 1;
} else if (_local2 < dangerLevel3) {
_local1.scrollSpeed = _local1.gs.speeds[2];
_local1.updateFreq = _local1.gs.updateFreqs[2];
_local1.dangerLevel = 2;
} else if (_local2 < gameOverLevel) {
if (_local1.dangerLevel < 3) {
_local1.musicClip.speedUpMusic();
_local1.musicClip.playSound("vo_timer");
}
_local1.dangerLevel = 3;
}
if (_local2 >= gameOverLevel) {
if (_local1.dangerLevel < 4) {
_local1.scrollSpeed = 0;
_local1.updateFreq = 10;
_local1.dangerCounter = 0;
_local1.setAlarm();
} else {
_local1.dangerCounter++;
if (_local1.dangerCounter > 80) {
_local1.triggerGameOver();
}
}
_local1.dangerLevel = 4;
}
if (_local1.gs.timedGame && ((getTimer() - _local1.gameStartTime) > (_local1.gs.gameTime - 4000))) {
if (!_local1.outOfTime) {
_local1.outOfTime = true;
_local1.setAlarm();
}
if ((getTimer() - _local1.gameStartTime) > _local1.gs.gameTime) {
_local1.clip.gameover_mc._visible = true;
_local1.gamePlaying = false;
}
}
if ((_local1.dangerLevel != 4) && (lastDangerLevel == 4)) {
_local1.clearAlarm();
}
if (_local1.dangerLevel < 2) {
_local1.musicClip.slowDownMusic();
}
if ((_local1.frameCounter % _local1.gs.dangerLevel1IncFreq) == 0) {
if (_local1.dangerLevel1 < 150) {
_local1.dangerLevel1++;
}
_local1.clip.testline_mc._y = _local1.dangerLevel1;
}
_local1.clip.testline_mc._y = _local1.dangerLevel1;
_local1.clip.testline2_mc._y = _local3;
_local1.clip.testline3_mc._y = dangerLevel3;
if ((_local1.frameCounter % _local1.updateFreq) == 0) {
_local1.playBottom = _local1.playBottom + _local1.scrollSpeed;
if ((_local1.playBottom - (_local1.rows.length * _local1.ySpacing)) > (-(_local1.ballDiam * 1.5))) {
_local1.addRow();
}
_local1.updateBalls();
}
if (_local1.frameCounter > 0) {
if (_local1.specialBall.isOnScreen()) {
_local1.specialBall.update();
} else if (((_local1.frameCounter + _local1.gs.specialBallOffset) % _local1.gs.specialBallFrequency) == 0) {
_local1.specialBall.activate();
}
if (_local1.adderBall.isActive()) {
_local1.adderBall.update();
} else if ((((_local1.frameCounter + _local1.gs.adderBallOffset) % _local1.gs.adderBallFrequency) == 0) && (_local1.ballVariations < _local1.ballClips.length)) {
_local1.adderBall.activate();
}
}
if (_local1.ballFirer.getBallFired()) {
_local1.ballFirer.updateFiredBall();
}
if (_local1.showPointers && ((!_local1.gs.stepGun) || ((_local1.frameCounter % _local1.updateFreq) == 0))) {
if (_local1.gunMoving || ((_local1.frameCounter % _local1.updateFreq) == 1)) {
var hitdetails = _local1.predictCollisionPos();
if (_local1.gs.stepGun) {
_local1.targetSpace = _local1.getNearestAvailableSpace(hitdetails);
_local1.clip.xmarker_mc._x = _local1.getColXPos(_local1.targetSpace.x, _local1.targetSpace.y);
_local1.clip.xmarker_mc._y = _local1.getRowYPos(_local1.targetSpace.y);
_local1.clip.xmarker_mc._visible = true;
} else {
_local1.clip.xmarker_mc._x = hitdetails.hitPoint.x;
_local1.clip.xmarker_mc._y = hitdetails.hitPoint.y;
_local1.clip.xmarker_mc._visible = true;
}
}
}
if (_local1.gs.stepGun) {
_local1.ballFirer.updateLever();
}
_local1.updateMultipliers();
_local1.updateTimer();
_local1.updateJudder();
}
_local1.frameCounter++;
}
}
function checkKeys() {
var _local1 = this;
if (!_local1.gs.stepGun) {
_local1.gunMoving = false;
if (Key.isDown(37)) {
_local1.ballFirer.moveLeft();
_local1.gunMoving = true;
} else if (Key.isDown(39)) {
_local1.ballFirer.moveRight();
_local1.gunMoving = true;
}
_local1.ballFirer.updateLever();
}
}
function stepLeft() {
stepGun(-3);
ballFirer.jumpLeverLeft();
}
function stepRight() {
stepGun(3);
ballFirer.jumpLeverRight();
}
function stepGun(moveAngle) {
var _local1 = this;
var lastTargetSpace = _local1.targetSpace.getClone();
var counter = 0;
var lastBounces = _local1.predictPoints.length;
var angleMaxed = false;
while (((lastTargetSpace.equals(_local1.targetSpace) && (lastBounces == _local1.predictPoints.length)) && (counter < 500)) && (!angleMaxed)) {
angleMaxed = _local1.ballFirer.setFireAngle(_local1.ballFirer.getFireAngle() + moveAngle);
var hitdetails = _local1.predictCollisionPos();
_local1.targetSpace = _local1.getNearestAvailableSpace(hitdetails);
counter++;
}
_local1.clip.xmarker_mc._x = _local1.getColXPos(_local1.targetSpace.x, _local1.targetSpace.y);
_local1.clip.xmarker_mc._y = _local1.getRowYPos(_local1.targetSpace.y);
_local1.clip.xmarker_mc._visible = true;
var _local3 = _local1.ballFirer.getFirePos().getClone();
_local1.clip.balls_mc.lineStyle(1, 16711680, 100);
var _local2 = 1;
while (_local2 < (_local1.predictPoints.length - 1)) {
_local3.x = _local3.x + (2 * (_local1.predictPoints[_local2].x - _local3.x));
_local2++;
}
var targetPos = (new net.pluginmedia.PIM_Vector2D(_local1.getColXPos(_local1.targetSpace.x, _local1.targetSpace.y), _local1.getRowYPos(_local1.targetSpace.y)));
targetPos.subtract(_local3);
var newangle = (targetPos.angle() + 90);
if (newangle > 90) {
newangle = newangle - 360;
}
if ((_local1.predictPoints.length % 2) == 1) {
newangle = -newangle;
}
_local1.drawPath();
_local1.gunMoving = true;
_local1.ballFirer.updateFirer();
}
function updateTimer() {
var _local2 = this;
var _local1;
_local1 = getTimer() - _local2.gameStartTime;
_local1 = _local2.timerClip._totalframes * (_local1 / _local2.gs.gameTime);
_local2.timerClip.gotoAndStop(Math.floor(_local1));
}
function isGunMoving() {
return(gunMoving);
}
function getClip() {
return(clip);
}
function getBallClip() {
return(ballClip);
}
function initBalls() {
var _local2 = this;
var _local3;
var _local1;
var rowCount = 1;
var colCount;
var ball;
var row;
_local3 = 0;
while (_local3 < rowCount) {
colCount = _local2.numOfCols - (_local3 % 2);
row = new BustaRow(_local2, _local3);
_local2.rows.push(row);
_local1 = 0;
while (_local1 < colCount) {
ball = row.addBall((Math.random() * _local2.ballVariations) >> 0, _local1);
_local2.updateBallPosition(ball);
_local2.updateTouchingBalls(ball, _local1, _local3);
_local1++;
}
_local3++;
}
}
function addRow() {
var _local2 = this;
var rownum;
var _local1;
var colCount;
var row;
var _local3;
rownum = _local2.rows.length;
colCount = _local2.numOfCols - (rownum % 2);
row = new BustaRow(_local2, rownum);
_local2.rows.push(row);
_local1 = 0;
while (_local1 < colCount) {
if (_local2.ballCount == 6) {
_local3 = row.addBall(0, _local1);
} else {
_local3 = row.addBall((Math.random() * _local2.ballVariations) >> 0, _local1);
}
_local2.updateBallPosition(_local3);
_local2.updateTouchingBalls(_local3);
_local1++;
}
}
function addRowsBelow() {
var _local2 = this;
_local2.rows.splice(0, 0, new BustaRow(_local2, 0), new BustaRow(_local2, 1));
_local2.rows[0].initBalls(_local2.rows[2].getColCount());
_local2.rows[1].initBalls(_local2.rows[3].getColCount());
var _local1 = 0;
while (_local1 < _local2.rows.length) {
_local2.rows[_local1].setRowNum(_local1);
_local1++;
}
_local2.playBottom = _local2.playBottom + (_local2.ySpacing * 2);
}
function updateBallPosition(ball) {
var _local1 = ball;
var _local3 = _local1.getCol();
var _local2 = _local1.getRow();
_local1.getPos().x = getColXPos(_local3, _local2);
_local1.getPos().y = getRowYPos(_local2);
_local1.render();
}
function getColXPos(col, row) {
var _local1 = row;
var _local2 = this;
while (_local1 < 0) {
_local1 = _local1 + 2;
}
return(((((col * _local2.ballDiam) + _local2.playLeft) + (((_local1 % 2) * _local2.ballDiam) >> 1)) + (_local2.ballDiam >> 1)) - _local2.sideSpace);
}
function getRowYPos(rownum) {
return((-(rownum * ySpacing)) + playBottom);
}
function getBottomRowPos() {
var _local2 = this;
var returncode;
var _local1 = 0;
while (_local2.rows[_local1].isRowEmpty() && (_local1 < _local2.rows.length)) {
_local1++;
}
return(_local2.getRowYPos(_local1));
}
function updateBalls() {
var rownum;
var _local1;
var _local3;
var _local2;
if ((frameCounter % 5) == 0) {
rownum = (Math.random() * rows.length) >> 0;
_local2 = rows[rownum].getBall((Math.random() * rows[rownum].getBallCount()) >> 0);
_local2.getClip().play();
}
rownum = 0;
while (rownum < rows.length) {
_local3 = rows[rownum];
_local1 = 0;
while (_local1 < _local3.getBallCount()) {
_local2 = _local3.getBall(_local1);
if (_local2) {
updateBallPosition(_local2);
}
_local1++;
}
rownum++;
}
}
function updateTouchingBalls(ball, colnum, rownum) {
var _local2 = ball;
var _local3 = colnum;
if (_local3 == null) {
_local3 = _local2.getCol();
}
if (rownum == null) {
rownum = _local2.getRow();
}
var rowAbove;
var rowBelow;
var cRow;
var offset;
cRow = rows[rownum];
offset = rownum % 2;
if ((rownum + 1) < rows.length) {
rowAbove = rows[rownum + 1];
} else {
rowAbove = null;
}
if ((rownum - 1) >= 0) {
rowBelow = rows[rownum - 1];
} else {
rowBelow = null;
}
if ((_local3 + 1) < cRow.getBallCount()) {
_local2.setTouching(0, cRow.getBall(_local3 + 1));
}
if ((_local3 - 1) >= 0) {
_local2.setTouching(3, cRow.getBall(_local3 - 1));
}
if (rowAbove) {
if (((_local3 - 1) + offset) >= 0) {
_local2.setTouching(4, rowAbove.getBall((_local3 - 1) + offset));
}
if ((_local3 + offset) < rowAbove.getBallCount()) {
_local2.setTouching(5, rowAbove.getBall(_local3 + offset));
}
}
if (rowBelow) {
if (((_local3 - 1) + offset) >= 0) {
_local2.setTouching(2, rowBelow.getBall((_local3 - 1) + offset));
}
if ((_local3 + offset) < rowBelow.getBallCount()) {
_local2.setTouching(1, rowBelow.getBall(_local3 + offset));
}
}
var _local1 = 0;
while (_local1 < 6) {
_local2.getTouching(_local1).setTouching((_local1 + 3) % 6, _local2);
_local1++;
}
}
function attachBalls(hitball, firedball, position) {
var _local1 = this;
var colnum = hitball.getCol();
var _local2 = hitball.getRow();
var _local3;
var rowBelow;
var cRow;
cRow = _local1.rows[_local2];
if ((_local2 + 1) < _local1.rows.length) {
_local3 = _local2 + 1;
} else {
_local3 = null;
}
rowBelow = _local2 - 1;
if ((rowBelow < 0) && ((position == 1) || (position == 2))) {
_local1.addRowsBelow();
_local3 = _local3 + 2;
rowBelow = rowBelow + 2;
_local2 = _local2 + 2;
_local1.updateBalls();
}
var newPos = _local1.getRowColForBallPos(hitball, position);
var newCol = newPos.x;
var newRow = newPos.y;
firedball.setCol(newCol);
firedball.setParent(_local1.rows[newRow]);
_local1.rows[newRow].setBall(firedball, newCol);
_local1.updateTouchingBalls(firedball);
}
function getRowColForBallPos(ball, position) {
var _local3 = ball.getCol();
var rownum = ball.getRow();
var _local1;
var _local2;
var offset = (rownum % 2);
var rowAbove = (rownum + 1);
var rowBelow = (rownum - 1);
switch (position) {
case 0 :
_local1 = _local3 + 1;
_local2 = rownum;
break;
case 3 :
_local1 = _local3 - 1;
_local2 = rownum;
break;
case 4 :
_local1 = (_local3 - 1) + offset;
_local2 = rowAbove;
break;
case 5 :
_local1 = _local3 + offset;
_local2 = rowAbove;
break;
case 2 :
_local1 = (_local3 - 1) + offset;
_local2 = rowBelow;
break;
case 1 :
_local1 = _local3 + offset;
_local2 = rowBelow;
}
return(new net.pluginmedia.PIM_Vector2D(_local1, _local2));
}
function checkHitBall(bc, firedball) {
var _local3 = this;
var hitball = bc.hitBall;
var _local2;
var ballclip;
var diff = firedball.getPos().subtractNew(hitball.getPos());
var angleBetween = diff.angle();
var position = Math.round(angleBetween / 60);
while (position < 0) {
position = position + 6;
}
if ((position < 0) || (position > 5)) {
}
if (hitball.getTouching(position)) {
_local3.clip.moveTo(firedball.getPos().x, firedball.getPos().y);
_local3.clip.lineTo(hitball.getPos().x, hitball.getPos().y);
_local3.particleManager.particleObjects = Array();
firedball.deleteBall();
} else {
firedball.getPos().set(_local3.ballDiam, 0);
firedball.getPos().rotate(position * 60);
firedball.getPos().plus(hitball.getPos());
_local3.attachBalls(hitball, firedball, position);
firedball.render();
_local2 = _local3.getSameColourGroup(firedball);
if (_local2.length >= 3) {
if ((_local2.length > 5) && (Math.random() < 0.2)) {
_local3.musicClip.playSound("vo_success");
}
var _local1 = 0;
while (_local1 < _local2.length) {
if (_local2[_local1].getRow() < (_local3.rows.length - 1)) {
if (_local2.length < 8) {
_local2[_local1].setExplode(_local1, (_local1 % 2) == 0);
} else {
_local2[_local1].setExplode((_local1 / (_local2.length >> 3)) >> 0, (_local1 % 3) == 0);
}
}
_local1++;
}
_local3.checkFloaters();
_local3.removeBottomRows();
_local3.smashAccumulator++;
if (_local3.smashAccumulator == (_local3.gs.accumulatorCount - 1)) {
_local3.musicClip.playSound("vo_bonus");
_local3.addToScore(5);
}
if (_local3.smashAccumulator == _local3.gs.accumulatorCount) {
_local3.addToScore(10);
_local3.ballFirer.setSmashBall();
_local3.musicClip.playSound("vo_bigbonus");
_local3.smashAccumulator = 0;
}
} else {
_local3.smashAccumulator = 0;
_local3.musicClip.playSound("stick");
}
}
}
function explodeColour(colour) {
var ballcount = 1;
var _local3;
var rownum;
var _local2;
var _local1;
var counter = 0;
rownum = 0;
while (rownum < (rows.length - 1)) {
_local3 = rows[rownum];
_local2 = 0;
while (_local2 < _local3.getBallCount()) {
_local1 = _local3.getBall(_local2);
if (_local1 && (_local1.getColour() == colour)) {
_local1.setExplode((ballcount++) << 1, (counter % 3) == 0);
counter++;
}
_local2++;
}
rownum++;
}
checkFloaters();
removeBottomRows();
}
function checkFloaters() {
var _local3;
var _local2 = getFloaters();
var _local1 = 0;
while (_local1 < _local2.length) {
_local3 = _local2[_local1].getClip();
_local2[_local1].deleteBall(true);
_local3.fallDelay = (_local1 / (_local2.length >> 2)) >> 0;
_local3.life = -1;
_local3.onEnterFrame = fallFunction;
_local1++;
}
return(_local2.length);
}
function getNearestAvailableSpace(hitdetails) {
var _local1 = hitdetails;
var _local2 = _local1.hitPoint.subtractNew(_local1.hitBall.getPos());
var angle = _local2.angle();
var _local3 = Math.round(angle / 60);
return(getRowColForBallPos(_local1.hitBall, _local3));
}
function removeBottomRows() {
var _local2 = this;
while (_local2.rows[0].isRowEmpty() && (_local2.rows[1].isRowEmpty())) {
delete eval (_local2.rows.shift());
delete eval (_local2.rows.shift());
var _local1 = 0;
while (_local1 < _local2.rows.length) {
_local2.rows[_local1].setRowNum(_local1);
_local1++;
}
_local2.playBottom = _local2.playBottom - (_local2.ySpacing * 2);
}
}
function getSameColourGroup(ball) {
setBallsCheckFlag(false);
var _local1 = new Array();
_local1 = recursiveColourCheck(ball);
return(_local1);
}
function getFloaters() {
var _local3 = this;
var _local2;
_local3.setBallsCheckFlag(true);
_local2 = _local3.rows[_local3.rows.length - 1];
var _local1 = 0;
while (_local1 < _local2.getBallCount()) {
_local3.recursiveProximityFlag(_local2.getBall(_local1));
_local1++;
}
return(_local3.getBallsCheckFlag(true));
}
function recursiveProximityFlag(ball) {
var _local3 = ball;
var _local2;
if (_local3.getCheckFlag()) {
_local3.setCheckFlag(false);
var _local1 = 0;
while (_local1 < 6) {
_local2 = _local3.getTouching(_local1);
if (_local2) {
if (_local2.getCheckFlag()) {
recursiveProximityFlag(_local2);
}
}
_local1++;
}
}
}
function recursiveColourCheck(ball, foundArray) {
var _local3 = foundArray;
if (!_local3) {
_local3 = new Array(ball);
ball.setCheckFlag(true);
}
var _local1;
var _local2 = 0;
while (_local2 < 6) {
_local1 = ball.getTouching(_local2);
if (_local1) {
if (!_local1.getCheckFlag()) {
_local1.setCheckFlag(true);
if ((_local1.getColour() == ball.getColour()) && (_local1.getRow() != (rows.length - 1))) {
_local3.push(_local1);
_local3 = recursiveColourCheck(_local1, _local3);
}
}
}
_local2++;
}
return(_local3);
}
function incrementBallCount() {
return(ballCount++);
}
function getBallCount() {
return(ballCount);
}
function setBallsCheckFlag(state) {
var _local2 = this;
var _local3 = state;
var _local1 = 0;
while (_local1 < _local2.rows.length) {
_local2.rows[_local1].setBallsCheckFlag(_local3);
_local1++;
}
}
function getBallsCheckFlag(state, reset) {
var _local3 = this;
var returnarray = new Array();
var _local2 = 0;
while (_local2 < _local3.rows.length) {
var _local1 = 0;
while (_local1 < _local3.rows[_local2].getBallCount()) {
if (_local3.rows[_local2].getBall(_local1).getCheckFlag() == state) {
returnarray.push(_local3.rows[_local2].getBall(_local1));
}
if (reset) {
_local3.rows[_local2].getBall(_local1).setCheckFlag(false);
}
_local1++;
}
_local2++;
}
return(returnarray);
}
function predictCollisionPos() {
var _local1 = this;
var startpos = _local1.ballFirer.getFirePos().getClone();
var _local3 = new net.pluginmedia.PIM_Vector2D(0, -50);
_local3.rotate(_local1.ballFirer.getFireAngle());
_local1.predictPoints = new Array();
var _local2 = _local1.predictCollisionTime(startpos, _local3);
_local1.predictPoints.push(_local2.hitPoint);
return(_local2);
}
function drawPath() {
var _local2 = this;
var startoffset = 0;
_local2.clip.balls_mc.lineStyle(_local2.ballDiam - 2, 14540287, 100);
_local2.clip.balls_mc.moveTo(_local2.predictPoints[0].x, _local2.predictPoints[0].y);
var _local1 = 1;
while (_local1 < _local2.predictPoints.length) {
_local2.clip.balls_mc.lineTo(_local2.predictPoints[_local1].x + 1, _local2.predictPoints[_local1].y);
_local1++;
}
}
function drawBallLine(startpos, endpos, startoffset) {
var v = endpos.subtractNew(startpos);
var _local3 = v.getMagnitude();
var _local2 = startoffset;
var stepdistance = 40;
var _local1 = new net.pluginmedia.PIM_Vector2D(0, 0);
clip.balls_mc.lineStyle(10, 16777215, 100);
while (_local2 < _local3) {
_local1 = v.multiplyNew(_local2 / _local3);
_local1.plus(startpos);
clip.balls_mc.moveTo(_local1.x - 0.2, _local1.y);
clip.balls_mc.lineTo(_local1.x + 0.2, _local1.y);
_local2 = _local2 + stepdistance;
}
return(_local2 - _local3);
}
function predictCollisionTime(startpos, vel) {
var _local1 = this;
var _local2;
var collision;
var _local3 = new BustaCollision();
var a = vel.angle();
_local3.hitDistance = 0;
_local3.hitBall = null;
_local1.predictPoints.push(startpos);
var wallhitpointY = 0;
if (vel.x != 0) {
var m = (vel.y / vel.x);
var wallx;
if (vel.x < 0) {
wallx = (_local1.playLeft - startpos.x) + (_local1.getBallCollisionDiam() / 2);
} else if (vel.x > 0) {
wallx = (_local1.playRight - startpos.x) - (_local1.getBallCollisionDiam() / 2);
}
wallhitpointY = (m * wallx) + startpos.y;
}
if ((_local1.playBottom + _local1.getBallCollisionDiam()) > wallhitpointY) {
var i = 0;
while (i < _local1.rows.length) {
if ((_local1.getRowYPos(i) + _local1.getBallCollisionDiam()) > wallhitpointY) {
var j = 0;
while (j < _local1.rows[i].getBallCount()) {
_local2 = _local1.rows[i].getBall(j);
if (_local2 && (!_local2.getLandLocked())) {
if (_local1.willBallCollide(startpos, vel, a, _local2.getPos())) {
collision = _local1.ballFirer.getCollisionTime(startpos, vel, _local2.getPos(), _local1.getBallCollisionDiam() / 2);
if (!isNaN(collision)) {
if ((!_local3.hitBall) || (collision < _local3.hitDistance)) {
_local3.hitBall = _local2;
_local3.hitDistance = collision;
}
}
}
}
j++;
}
}
i++;
}
}
if (_local3.hitDistance != 0) {
_local3.hitPoint.set(0, -_local3.hitDistance);
_local3.hitPoint.rotate(a + 90);
_local3.hitPoint.plus(startpos);
}
if (vel.x > 0) {
var wallx = ((_local1.playRight - startpos.x) - (_local1.getBallCollisionDiam() / 2));
collision = wallx / _global.pim_Math.cos(a);
if ((!_local3.hitBall) || (collision < _local3.hitDistance)) {
_local3.hitPoint = new net.pluginmedia.PIM_Vector2D(0, -collision);
_local3.hitPoint.rotate(a + 90);
_local3.hitPoint.plus(startpos);
startpos = _local3.hitPoint.getClone();
vel.x = -vel.x;
if (startpos.y > 0) {
_local3 = _local1.predictCollisionTime(startpos, vel);
}
}
} else if (vel.x < 0) {
var wallx = ((_local1.playLeft - startpos.x) + (_local1.getBallCollisionDiam() / 2));
collision = wallx / _global.pim_Math.cos(a);
if ((!_local3.hitBall) || (collision < _local3.hitDistance)) {
_local3.hitPoint = new net.pluginmedia.PIM_Vector2D(0, -collision);
_local3.hitPoint.rotate(a + 90);
_local3.hitPoint.plus(startpos);
startpos = _local3.hitPoint.getClone();
vel.x = -vel.x;
if (startpos.y > 0) {
_local3 = _local1.predictCollisionTime(startpos, vel);
}
}
}
return(_local3);
}
function willBallCollide(startpos, vel, a, ballpos) {
var _local1 = ballpos;
a = a + 90;
_local1 = _local1.getClone();
_local1.subtract(startpos);
var m = (vel.y / vel.x);
var lineXPos = (_local1.y / m);
var _local3 = _local1.x - lineXPos;
var _local2 = _global.pim_Math.cos(a) * _local3;
if (Math.abs(_local2) < 30) {
return(true);
}
return(false);
}
function getCollisionBall(firedball, vel) {
var pos = firedball.getPos();
var _local3;
var _local1;
var left;
var right;
var top;
var bottom;
var radius = (getBallCollisionDiam() / 2);
var _local2 = new BustaCollision();
if (vel.x >= 0) {
left = pos.x - radius;
right = (pos.x + vel.x) + radius;
} else {
left = (pos.x + vel.x) - radius;
right = pos.x + radius;
}
if (vel.y >= 0) {
top = pos.y - radius;
bottom = (pos.y + vel.y) + radius;
} else {
top = (pos.y + vel.y) - radius;
bottom = pos.y + radius;
}
var i = 0;
while (i < rows.length) {
var j = 0;
while (j < rows[i].getBallCount()) {
_local1 = rows[i].getBall(j);
_local1.showDebugText("", true);
if (_local1 && (!_local1.getLandLocked())) {
_local1.showDebugText("***");
if (ballOverlapsRect(_local1, left, right, top, bottom)) {
_local3 = ballFirer.getCollisionTime(pos, vel, _local1.getPos(), radius);
_local1.showDebugText(String(_local3));
if ((!isNaN(_local3)) && (_local3 < Math.abs(fireBallSpeed))) {
_local2.hitBalls.push(_local1);
if ((!_local2.hitBall) || (_local3 < _local2.hitDistance)) {
_local2.hitBall = _local1;
_local2.hitDistance = _local3;
}
}
}
}
j++;
}
i++;
}
if (specialBall.isOnScreen()) {
_local1 = specialBall;
_local3 = ballFirer.getCollisionTime(pos, vel, _local1.getPos(), radius);
if (((!isNaN(_local3)) && (_local3 < Math.abs(fireBallSpeed))) && (_local3 > 0)) {
_local2.hitBalls.push(_local1);
if ((!_local2.hitBall) || (_local3 < _local2.hitDistance)) {
_local2.hitBall = _local1;
_local2.hitDistance = _local3;
}
}
}
if (adderBall.isOnScreen()) {
_local1 = adderBall;
_local3 = ballFirer.getCollisionTime(pos, vel, _local1.getPos(), radius);
if (((!isNaN(_local3)) && (_local3 < Math.abs(fireBallSpeed))) && (_local3 > 0)) {
_local2.hitBalls.push(_local1);
if ((!_local2.hitBall) || (_local3 < _local2.hitDistance)) {
_local2.hitBall = _local1;
_local2.hitDistance = _local3;
}
}
}
var ballx = (firedball.getPos().x + vel.x);
var velx = vel.x;
if (velx > 0) {
if ((ballx + radius) > playRight) {
var dx = ((playRight - (ballx - velx)) - radius);
_local3 = (dx / velx) * fireBallSpeed;
if ((_local2.hitDistance == null) || ((_local3 < _local2.hitDistance) && (_local3 > 0))) {
_local2.hitRightWall = true;
_local2.hitBall = null;
_local2.hitDistance = _local3;
_local2.hitTime = _local3 / fireBallSpeed;
var diffVec = vel.multiplyNew(_local2.hitTime);
_local2.newPos.copyFrom(firedball.getPos());
_local2.newPos.plus(diffVec);
_local2.newVel.copyFrom(vel);
_local2.newVel.x = -_local2.newVel.x;
}
}
} else if (velx < 0) {
if ((ballx - radius) < playLeft) {
var dx = ((ballx - velx) - (playLeft + radius));
_local3 = (dx / (-velx)) * fireBallSpeed;
if ((_local2.hitDistance == null) || ((_local3 < _local2.hitDistance) && (_local3 > 0))) {
_local2.hitLeftWall = true;
_local2.hitBall = null;
_local2.hitDistance = _local3;
_local2.hitTime = _local3 / fireBallSpeed;
var diffVec = vel.multiplyNew(_local2.hitTime);
_local2.newPos.copyFrom(firedball.getPos());
_local2.newPos.plus(diffVec);
_local2.newVel.copyFrom(vel);
_local2.newVel.x = -_local2.newVel.x;
}
}
}
if (_local2.hitBall) {
_local2.hitTime = _local2.hitDistance / fireBallSpeed;
var diffVec = vel.multiplyNew(_local2.hitTime);
firedball.getPos().plus(diffVec);
_local2.newPos.copyFrom(firedball.getPos());
firedball.render();
}
if (gs.showDebugInfo) {
var debuginfo = _local2.toString();
debuginfo = ((debuginfo + "firedball = ") + firedball) + newline;
debuginfo = ((debuginfo + "firedballvel = ") + ballFirer.getBallFiredVel()) + newline;
clip.debug_mc.debug_txt = debuginfo;
}
return(_local2);
}
function updateJudder() {
var _local1 = this;
if (_local1.judder > 0) {
if ((_local1.judder % 2) == 0) {
_local1.clip._x = -_local1.judder;
} else {
_local1.clip._x = _local1.judder;
}
_local1.judder--;
}
}
function getRowCount() {
return(rows.length);
}
function ballOverlapsRect(ball, left, right, top, bottom) {
var _local1 = ball.getPos();
var _local2 = getBallCollisionDiam() / 2;
if (!(((_local1.y + _local2) < top) || ((_local1.y - _local2) > bottom))) {
if (!(((_local1.x + _local2) < left) || ((_local1.x - _local2) > right))) {
return(true);
}
}
return(false);
}
function getNextBallColour() {
return((Math.random() * ballVariations) >> 0);
}
function getBallDiam() {
return(ballDiam);
}
function getBallCollisionDiam() {
return(ballDiam - ballCollisionSpacer);
}
function getBallClips(colnum) {
var _local1 = this;
if (_local1.gs.preRenderedBitmaps) {
return(_local1.ballClips[colnum] + "_BM");
}
return(_local1.ballClips[colnum]);
}
function addToScore(amount) {
var _local1 = this;
var _local2 = amount;
if (_local1.x2Active) {
_local1.score = _local1.score + (_local2 * 2);
} else if (_local1.x3Active) {
_local1.score = _local1.score + (_local2 * 3);
} else {
_local1.score = _local1.score + _local2;
}
_local1.clip.score_txt = _local1.score;
_local1.clip.explode_mc.score_txt = _local1.score;
}
function shuffleArray(myarr) {
var _local1 = function (element1, element2) {
if (Math.random() < 0.5) {
return(-1);
}
return(1);
};
myarr.sort(_local1);
}
function makeParticle(clipname) {
return(particleManager.addParticle(clipname));
}
function getBallVariations() {
return(ballVariations);
}
function incBallVariations() {
ballVariations++;
}
function resetSmashAccumulator() {
smashAccumulator = 0;
}
function getSpecialBall() {
return(specialBall);
}
function getAdderBall() {
return(adderBall);
}
function isGamePlaying() {
return(gamePlaying);
}
function getDangerLevel() {
return(dangerLevel);
}
function updateMultipliers() {
var _local1 = this;
if (_local1.x2Active) {
_local1.x2Timer--;
if (_local1.x2Timer == 0) {
_local1.clip.x2_mc._visible = false;
_local1.x2Active = false;
_local1.lightsClip._visible = false;
_local1.lightsClip.stop();
}
}
if (_local1.x3Active) {
_local1.x3Timer--;
if (_local1.x3Timer == 0) {
_local1.clip.x3_mc._visible = false;
_local1.x3Active = false;
_local1.lightsClip._visible = false;
_local1.lightsClip.stop();
}
}
}
function x2Activate() {
var _local1 = this;
if (_local1.x3Active) {
_local1.clip.x3_mc._visible = false;
_local1.x3Active = false;
}
_local1.lightsClip._visible = true;
_local1.lightsClip.play();
_local1.x2Active = true;
_local1.x2Timer = 300;
_local1.clip.x2_mc._visible = true;
}
function x3Activate() {
var _local1 = this;
if (_local1.x2Active) {
_local1.clip.x2_mc._visible = false;
_local1.x2Active = false;
}
_local1.lightsClip._visible = true;
_local1.lightsClip.play();
_local1.x3Active = true;
_local1.x3Timer = 300;
_local1.clip.x3_mc._visible = true;
}
function setMusicClip(mc) {
musicClip = mc;
}
function getMusicClip() {
return(musicClip);
}
function setAlarm() {
var _local1 = this;
_local1.alarmClip.play();
_local1.alarmClip._visible = true;
_local1.musicClip.playSound("alarm", undefined, undefined, 2);
_local1.musicClip.playSound("vo_danger");
if (!_local1.outOfTime) {
_local1.clip.explode_mc.playing = true;
_local1.clip.explode_mc.play();
_local1.clip.explode_mc._visible = true;
_local1.clip.jammakers_mc._visible = false;
}
}
function clearAlarm() {
var _local1 = this;
_local1.musicClip.stopSound("alarm");
_local1.alarmClip.stop();
_local1.alarmClip._visible = false;
_local1.clip.explode_mc.playing = false;
_local1.clip.explode_mc._visible = false;
_local1.clip.jammakers_mc._visible = true;
}
function triggerGameOver() {
var _local1 = this;
_local1.musicClip.playSound("vo_danger2");
_local1.gamePlaying = false;
_local1.musicClip.slowDownMusic();
_local1.clip.explode_mc.explode = true;
_local1.outOfTime = true;
}
function togglePause() {
var _local1 = this;
_local1.gamePaused = !_local1.gamePaused;
if (_local1.gamePaused) {
_local1.gamePlaying = false;
_local1.specialBall.getClip().stop();
_local1.clip.xmarker_mc.stop();
_local1.clip.jammakers_mc.jam1_mc.playing = false;
_local1.clip.jammakers_mc.jam2_mc.playing = false;
_local1.clip.pause_mc._visible = true;
_local1.clip.pause_mc.gotoAndPlay(1);
} else {
_local1.gamePlaying = true;
_local1.specialBall.getClip().play();
_local1.clip.xmarker_mc.play();
_local1.clip.jammakers_mc.jam1_mc.playing = true;
_local1.clip.jammakers_mc.jam2_mc.playing = true;
_local1.clip.pause_mc._visible = false;
_local1.clip.pause_mc.stop();
}
}
}
Symbol 903 MovieClip [__Packages.BustaBallFirer] Frame 0
class BustaBallFirer
{
var ballFired, gunClip, currentBall, firedBall, ballFiredVel, firePos, fireAngle;
function BustaBallFirer (parentgame, firerclip) {
var _local1 = this;
_local1.parentGame = parentgame;
_local1.firePos = new net.pluginmedia.PIM_Vector2D(256, 255);
_local1.ballFiredVel = new net.pluginmedia.PIM_Vector2D(0, 0);
_local1.clip = _local1.parentGame.getClip().guncontainer_mc;
_local1.clip.stop();
_local1.fireAngle = 0;
_local1.ballFired = false;
_local1.gunClip = _local1.clip.gunbarrel_mc;
_local1.cogClip = _local1.clip.cog_mc;
_local1.cogDriver1 = _local1.clip.cogdriver1_mc;
_local1.cogDriver2 = _local1.clip.cogdriver2_mc;
_local1.leverClip = _local1.clip.lever_mc;
_local1.leverClip.currenthead = _local1.leverClip.normalhead_mc;
_local1.leverClip.onEnterFrame = function () {
var _local1 = this;
_local1.scaredhead_mc._visible = false;
_local1.lookinghead_mc._visible = false;
_local1.normalhead_mc._visible = false;
_local1.currenthead._visible = true;
};
_local1.leverShadow = _local1.parentGame.getClip().nevshadow_mc;
_local1.gunClip.stop();
_local1.cogClip.stop();
_local1.cogDriver1.stop();
_local1.cogDriver2.stop();
_local1.leverClip.gotoAndStop(15);
_local1.leverShadow.gotoAndStop(15);
_local1.targetLeverFrame = 15;
_local1.nextBall = new BustaBall(_local1.parentGame, null, _local1.parentGame.getNextBallColour());
_local1.currentBall = new BustaBall(_local1.parentGame, null, 0);
_local1.rotateSpeed = 3;
_local1.maxAngle = 80;
_local1.currentBall.getPos().x = _local1.firePos.x;
_local1.currentBall.getPos().y = _local1.firePos.y;
_local1.currentBall.showBall();
_local1.nextBall.hideBall();
_local1.currentBall.hideBall();
_local1.clip.nextBallColour = _local1.nextBall.getBallColourString();
_local1.gunClip.nextBall = _local1.currentBall.getBallColourString();
_local1.firedBallCount = 0;
_local1.drawBeam();
}
function getBallFired() {
return(ballFired);
}
function setSmashBall() {
gunClip.updateBallColour("smash");
currentBall.setSmash();
}
function fireBall(speed) {
var _local1 = this;
_local1.parentGame.getClip().guides_mc.clear();
_local1.clip.play();
_local1.gunClip.gotoAndPlay(2);
_local1.ballFired = true;
_local1.ballFiredVel.set(0, -speed);
_local1.ballFiredVel.rotate(_local1.fireAngle);
_local1.firedBall = _local1.currentBall;
_local1.firedBall.hideBall();
_local1.firedCounter = 0;
_local1.currentBall = _local1.nextBall;
_local1.nextBall = new BustaBall(_local1.parentGame, null, _local1.parentGame.getNextBallColour());
_local1.gunClip.updateBallColour(_local1.currentBall.getBallColourString());
_local1.gunClip.setX2(_local1.currentBall.getX2());
_local1.gunClip.setX3(_local1.currentBall.getX3());
_local1.clip.nextBallColour = _local1.nextBall.getBallColourString();
if ((_local1.firedBallCount % _local1.parentGame.gs.multiplierFreq) == 0) {
if ((_local1.parentGame.getBallCount() % (_local1.parentGame.gs.multiplierFreq * 4)) == 0) {
_local1.nextBall.makeX3();
_local1.clip.setX3();
} else {
_local1.nextBall.makeX2();
_local1.clip.setX2();
}
} else {
_local1.clip.clearMultipliers();
}
_local1.currentBall.getPos().x = _local1.firePos.x;
_local1.currentBall.getPos().y = _local1.firePos.y;
_local1.currentBall.hideBall();
_local1.nextBall.hideBall();
_local1.firedBallCount++;
_local1.updateFiredBall();
}
function updateFiredBall() {
var _local1 = this;
_local1.firedCounter++;
if (_local1.firedCounter == 5) {
_local1.firedBall.showBall();
}
var _local3 = _local1.parentGame.getCollisionBall(_local1.firedBall, _local1.ballFiredVel);
if (_local3.hitBall) {
if (_local1.firedBall.getSmash()) {
if (!_local1.firedBall.smashSoundStarted) {
_local1.parentGame.getMusicClip().playSound("smash");
_local1.firedBall.smashSoundStarted = true;
}
_local1.firedBall.getPos().x = _local1.firedBall.getPos().x + _local1.ballFiredVel.x;
_local1.firedBall.getPos().y = _local1.firedBall.getPos().y + _local1.ballFiredVel.y;
_local1.firedBall.render();
_local1.firedBall.getClip._visible = true;
var _local2 = 0;
while (_local2 < _local3.hitBalls.length) {
_local3.hitBalls[_local2].setExplode(0);
_local1.parentGame.addToScore(_local1.parentGame.gs.explodeScore);
_local2++;
}
_local1.parentGame.getMusicClip().playSound("splat");
_local1.parentGame.checkFloaters();
_local1.parentGame.removeBottomRows();
_local1.parentGame.judder = 10;
} else {
_local1.firedBall.showBall();
if ((_local3.hitBall == _local1.parentGame.getSpecialBall()) || (_local3.hitBall == _local1.parentGame.getAdderBall())) {
_local1.firedBall.setExplode(0);
_local3.hitBall.setExplode(0);
} else {
_local1.parentGame.checkHitBall(_local3, _local1.firedBall);
}
_local1.ballFired = false;
}
} else if (_local3.hitRightWall || (_local3.hitLeftWall)) {
_local1.firedBall.getPos().copyFrom(_local3.newPos);
_local1.ballFiredVel.copyFrom(_local3.newVel);
_local1.firedBall.render();
} else {
_local1.firedBall.getPos().x = _local1.firedBall.getPos().x + _local1.ballFiredVel.x;
_local1.firedBall.getPos().y = _local1.firedBall.getPos().y + _local1.ballFiredVel.y;
_local1.firedBall.render();
if (_local1.parentGame.gs.showDebugInfo) {
var trailpart = _local1.parentGame.makeParticle("ballTrail");
trailpart.Position.x = _local1.firedBall.getPos().x;
trailpart.Position.y = _local1.firedBall.getPos().y;
trailpart.Fade = 0.6;
}
}
if (_local1.firedBall.getPos().y < -50) {
_local1.firedBall.deleteBall();
_local1.ballFired = false;
}
}
function moveLeft() {
var _local1 = this;
_local1.fireAngle = _local1.fireAngle - _local1.rotateSpeed;
if (_local1.fireAngle < (-_local1.maxAngle)) {
_local1.fireAngle = -_local1.maxAngle;
}
_local1.updateFirer();
_local1.moveLeverLeft();
}
function moveRight() {
var _local1 = this;
_local1.fireAngle = _local1.fireAngle + _local1.rotateSpeed;
if (_local1.fireAngle > _local1.maxAngle) {
_local1.fireAngle = _local1.maxAngle;
}
_local1.updateFirer();
_local1.moveLeverRight();
}
function moveLeverLeft() {
var _local1 = this;
if (_local1.leverClip._currentframe < 31) {
_local1.leverClip.gotoAndStop(61 - _local1.leverClip._currentframe);
}
_local1.targetLeverFrame = 60;
_local1.leverShadow.gotoAndStop(_local1.leverClip._currentframe);
}
function moveLeverRight() {
var _local1 = this;
if (_local1.leverClip._currentframe > 31) {
_local1.leverClip.gotoAndStop(61 - _local1.leverClip._currentframe);
}
_local1.targetLeverFrame = 30;
_local1.leverShadow.gotoAndStop(_local1.leverClip._currentframe);
}
function jumpLeverLeft() {
var _local1 = this;
if (_local1.leverClip._currentframe < 31) {
_local1.leverClip.gotoAndStop(61 - _local1.leverClip._currentframe);
}
_local1.targetLeverFrame = 15;
_local1.leverShadow.gotoAndStop(_local1.leverClip._currentframe);
}
function jumpLeverRight() {
var _local1 = this;
if (_local1.leverClip._currentframe > 31) {
_local1.leverClip.gotoAndStop(61 - _local1.leverClip._currentframe);
}
_local1.targetLeverFrame = 45;
_local1.leverShadow.gotoAndStop(_local1.leverClip._currentframe);
}
function updateLever() {
var _local1 = this;
if (_local1.parentGame.gs.stepGun) {
if (_local1.leverClip._currentframe < (_local1.targetLeverFrame - 1)) {
_local1.leverClip.nextFrame();
_local1.leverClip.nextFrame();
} else if (_local1.leverClip._currentframe > _local1.targetLeverFrame) {
if (_local1.leverClip._currentframe >= (_local1.leverClip._totalframes - 1)) {
_local1.leverClip.gotoAndStop(1);
} else {
_local1.leverClip.nextFrame();
_local1.leverClip.nextFrame();
}
}
} else {
if (_local1.leverClip._currentframe < _local1.targetLeverFrame) {
_local1.leverClip.nextFrame();
} else if (_local1.leverClip._currentframe > _local1.targetLeverFrame) {
_local1.leverClip.prevFrame();
if (_local1.leverClip._currentframe > _local1.targetLeverFrame) {
_local1.leverClip.prevFrame();
}
}
if (!_local1.parentGame.isGunMoving()) {
if ((_local1.leverClip._currentframe > 0) && (_local1.leverClip._currentframe <= 31)) {
_local1.targetLeverFrame = 16;
}
if (_local1.leverClip._currentframe > 31) {
_local1.targetLeverFrame = 45;
}
}
}
_local1.leverShadow.gotoAndStop(_local1.leverClip._currentframe);
if (_local1.parentGame.getDangerLevel() <= 1) {
_local1.leverClip.currenthead = _local1.leverClip.normalhead_mc;
} else if (_local1.parentGame.getDangerLevel() == 2) {
_local1.leverClip.currenthead = _local1.leverClip.lookinghead_mc;
} else {
_local1.leverClip.currenthead = _local1.leverClip.scaredhead_mc;
}
}
function updateFirer() {
var _local1 = this;
var _local3 = new net.pluginmedia.PIM_Vector2D(0, -100);
_local3.rotate(_local1.fireAngle);
_local1.gunClip._rotation = Math.round(_local1.fireAngle);
_local1.gunClip.breechball_mc._rotation = -_local1.gunClip._rotation;
_local1.cogClip._rotation = _local1.fireAngle;
var _local2 = ((_local1.fireAngle / _local1.rotateSpeed) % _local1.cogDriver1._totalframes) >> 0;
if (_local2 < 0) {
_local2 = _local2 + _local1.cogDriver1._totalframes;
}
_local1.cogDriver1.gotoAndStop(_local2);
_local1.cogDriver2.gotoAndStop(_local2);
_local1.drawBeam();
}
function drawBeam() {
var _local2 = this;
var _local1 = _local2.firePos.getClone();
var drawclip = _local2.parentGame.getClip().balls_mc;
drawclip.clear();
var m;
var newx;
var newy;
var radius = (_local2.parentGame.getBallCollisionDiam() / 2);
var _local3 = new net.pluginmedia.PIM_Vector2D(0, -50);
_local3.rotate(_local2.fireAngle);
var linealpha = 100;
drawclip.moveTo(_local1.x, _local1.y);
do {
m = _local3.y / _local3.x;
newx = ((-_local1.y) / m) + _local1.x;
newy = 0;
if (newx < (_local2.parentGame.playLeft + radius)) {
newy = ((_local2.parentGame.playLeft - _local1.x) + radius) * m;
newy = newy + _local1.y;
newx = _local2.parentGame.playLeft + radius;
_local3.x = -_local3.x;
} else if (newx > (_local2.parentGame.playRight - radius)) {
newy = ((_local2.parentGame.playRight - _local1.x) - radius) * m;
newy = newy + _local1.y;
newx = _local2.parentGame.playRight - radius;
_local3.x = -_local3.x;
}
_local1.x = newx;
_local1.y = newy;
drawclip.lineStyle(_local2.parentGame.getBallCollisionDiam(), 15658751, (linealpha = linealpha - 20));
drawclip.lineTo(_local1.x, _local1.y);
} while ((_local1.y > 0) && (linealpha > 0));
}
function getCollisionTime(startpos, vel, ballpos, radius) {
var checkpos = ballpos.subtractNew(startpos);
var collision;
var _local1 = checkpos.getMagnitude();
var _local3 = radius * 2;
var a = checkpos.angleBetween(vel);
var _local2 = (2 * _local1) * _global.pim_Math.cos(a);
var twoDcosAsqrd = (_local2 * _local2);
var sqrtSection = Math.sqrt(twoDcosAsqrd - (4 * ((_local1 * _local1) - (_local3 * _local3))));
var collision1 = (((-_local2) + sqrtSection) / 2);
if (collision1 == 27) {
}
return(-collision1);
}
function getFiredBall() {
return(firedBall);
}
function getBallFiredVel() {
return(ballFiredVel);
}
function getFirePos() {
return(firePos);
}
function getFireAngle() {
return(fireAngle);
}
function setFireAngle(num) {
var _local1 = this;
_local1.fireAngle = num;
if (_local1.fireAngle > _local1.maxAngle) {
_local1.fireAngle = _local1.maxAngle;
return(true);
}
if (_local1.fireAngle < (-_local1.maxAngle)) {
_local1.fireAngle = -_local1.maxAngle;
return(true);
}
return(false);
}
}
Symbol 904 MovieClip [__Packages.net.pluginmedia.PIM_Vector2D] Frame 0
class net.pluginmedia.PIM_Vector2D
{
var x, y;
function PIM_Vector2D (x, y, pimath) {
var _local1 = this;
var _local2 = _global;
_local1.x = x;
_local1.y = y;
_local1.pim_Math = pimath;
if (!_local1.pim_Math) {
if (!_local2.pim_Math) {
_local2.pim_Math = new net.pluginmedia.PIM_Math();
}
_local1.pim_Math = _local2.pim_Math;
}
}
function toString() {
var _local2 = Math.round(x * 1000) / 1000;
var _local1 = Math.round(y * 1000) / 1000;
return(((("[" + _local2) + ", ") + _local1) + "]");
}
function getClone() {
return(new net.pluginmedia.PIM_Vector2D(x, y));
}
function copyTo(v) {
v.x = x;
v.y = y;
}
function copyFrom(v) {
x = v.x;
y = v.y;
}
function getMagnitude() {
var _local1 = this;
return(Math.sqrt((_local1.x * _local1.x) + (_local1.y * _local1.y)));
}
function normalise() {
var _local1 = this;
var _local2 = _local1.getMagnitude();
_local1.x = _local1.x / _local2;
_local1.y = _local1.y / _local2;
}
function reverse() {
var _local1 = this;
_local1.x = -_local1.x;
_local1.y = -_local1.y;
}
function plus(v) {
with (this) {
x = x + v.x;
y = y + v.y;
}
}
function plusNew(v) {
with (this) {
return(new net.pluginmedia.PIM_Vector2D(x + v.x, y + v.y));
}
}
function subtract(v) {
with (this) {
x = x - v.x;
y = y - v.y;
}
}
function subtractNew(v) {
return(new net.pluginmedia.PIM_Vector2D(x - v.x, y - v.y));
}
function multiply(value) {
if (value instanceof net.pluginmedia.PIM_Vector2D) {
with (this) {
x = x * value.x;
y = y * value.y;
}
} else if (typeof(value) == "number") {
with (this) {
x = x * Number(value);
y = y * Number(value);
}
}
}
function multiplyNew(v) {
var _local1 = getClone();
_local1.multiply(v);
return(_local1);
}
function divide(value) {
if (value instanceof net.pluginmedia.PIM_Vector2D) {
with (this) {
x = x / value.x;
y = y / value.y;
}
} else if (typeof(value) == "number") {
with (this) {
x = x / Number(value);
y = y / Number(value);
}
}
}
function divideNew(v) {
var _local1 = getClone();
_local1.divide(v);
return(_local1);
}
function cross(v) {
return((x * v.y) - (y * v.x));
}
function dot() {
with (this) {
return(((x * v.x) + (y * v.y)) + (z * v.z));
}
}
function equals(v) {
with (this) {
return((x == v.x) && (y == v.y));
}
}
function isCloseTo(v, distance) {
var _local2 = this;
if (_local2.equals(v)) {
return(true);
}
var _local1 = new net.pluginmedia.PIM_Vector2D(0, 0, _local2.pim_Math);
_local1 = _local2.subtractNew(v);
var _local3 = (_local1.x * _local1.x) + (_local1.y * _local1.y);
if (_local3 < (distance * distance)) {
return(true);
}
return(false);
}
function angle() {
with (this) {
var returncode = pim_Math.radiansToDegrees(Math.atan(y / x));
if (x < 0) {
returncode = returncode + 180;
}
return(returncode);
}
}
function set(x, y) {
this.x = x;
this.y = y;
}
function angleBetween(v) {
var _local1 = (angle() - v.angle()) % 360;
if (_local1 > 180) {
_local1 = _local1 - 360;
} else if (_local1 < -180) {
_local1 = _local1 + 360;
}
return(_local1);
}
function rotate(angle) {
var _local2 = this;
var _local3 = _local2.pim_Math.cos(angle);
var sinRY = _local2.pim_Math.sin(angle);
var _local1;
_local1 = _local2.getClone();
_local2.x = (_local1.x * _local3) - (_local1.y * sinRY);
_local2.y = (_local1.x * sinRY) + (_local1.y * _local3);
}
}
Symbol 905 MovieClip [__Packages.net.pluginmedia.PIM_Math] Frame 0
class net.pluginmedia.PIM_Math
{
function PIM_Math (accuracy) {
var _local1 = this;
var _local3 = accuracy;
var _local2;
if (!_local3) {
_local3 = 10;
}
_local1.ACCURACY = _local3;
_local1.sinLookUp = new Array();
_local1.cosLookUp = new Array();
_local1.tanLookUp = new Array();
var timer = getTimer();
_local2 = 0;
while (_local2 <= (360 * _local1.ACCURACY)) {
_local1.sinLookUp[_local2] = Math.sin(_local1.degreesToRadians(_local2 / _local1.ACCURACY));
_local2++;
}
_local2 = 0;
while (_local2 <= (360 * _local1.ACCURACY)) {
_local1.cosLookUp[_local2] = Math.cos(_local1.degreesToRadians(_local2 / _local1.ACCURACY));
_local2++;
}
_local2 = 0;
while (_local2 <= (360 * _local1.ACCURACY)) {
_local1.tanLookUp[_local2] = Math.tan(_local1.degreesToRadians(_local2 / _local1.ACCURACY));
_local2++;
}
_local1.performance = Math.round(((getTimer() - timer) / 3.6) / _local1.ACCURACY);
}
function degreesToRadians(deg) {
return((deg * Math.PI) / 180);
}
function radiansToDegrees(rad) {
return((rad * 180) / Math.PI);
}
function cos(a) {
var _local2 = this;
var _local1 = Math.round(a * _local2.ACCURACY);
_local1 = _local1 % (360 * _local2.ACCURACY);
if (_local1 < 0) {
_local1 = _local1 + (360 * _local2.ACCURACY);
}
return(_local2.cosLookUp[_local1]);
}
function sin(a) {
var _local2 = this;
var _local1 = Math.round(a * _local2.ACCURACY);
_local1 = _local1 % (360 * _local2.ACCURACY);
if (_local1 < 0) {
_local1 = _local1 + (360 * _local2.ACCURACY);
}
return(_local2.sinLookUp[_local1]);
}
function tan(a) {
return(Math.tan(degreesToRadians(a)));
}
function atan(s) {
return(radiansToDegrees(Math.atan(s)));
}
function acos(s) {
return(radiansToDegrees(Math.acos(s)));
}
function normaliseAngle(angle) {
var _local1 = angle;
_local1 = _local1 % 360;
if (_local1 < 0) {
_local1 = _local1 + 360;
}
return(_local1);
}
function getBezierPoint(p1, p2, c1, c2, t) {
var _local1 = t;
var _local2 = this;
var _local3 = p1;
if (_local3 instanceof net.pluginmedia.PIM_Vector3D) {
var x = ((((_local3.x * _local2.B1(_local1)) + (c1.x * _local2.B2(_local1))) + (c2.x * _local2.B3(_local1))) + (p2.x * _local2.B4(_local1)));
var y = ((((_local3.y * _local2.B1(_local1)) + (c1.y * _local2.B2(_local1))) + (c2.y * _local2.B3(_local1))) + (p2.y * _local2.B4(_local1)));
var z = ((((_local3.z * _local2.B1(_local1)) + (c1.z * _local2.B2(_local1))) + (c2.z * _local2.B3(_local1))) + (p2.z * _local2.B4(_local1)));
return(new net.pluginmedia.PIM_Vector3D(x, y, z));
}
if (_local3 instanceof net.pluginmedia.PIM_Vector3D) {
var x = ((((_local3.x * _local2.B1(_local1)) + (c1.x * _local2.B2(_local1))) + (c2.x * _local2.B3(_local1))) + (p2.x * _local2.B4(_local1)));
var y = ((((_local3.y * _local2.B1(_local1)) + (c1.y * _local2.B2(_local1))) + (c2.y * _local2.B3(_local1))) + (p2.y * _local2.B4(_local1)));
return(new net.pluginmedia.PIM_Vector2D(x, y));
}
return(undefined);
}
function B4(t) {
var _local1 = t;
return((_local1 * _local1) * _local1);
}
function B3(t) {
var _local1 = t;
return(((3 * _local1) * _local1) * (1 - _local1));
}
function B2(t) {
var _local1 = t;
return(((3 * _local1) * (1 - _local1)) * (1 - _local1));
}
function B1(t) {
var _local1 = t;
return(((1 - _local1) * (1 - _local1)) * (1 - _local1));
}
var TWOPI = (Math.PI*2);
}
Symbol 906 MovieClip [__Packages.net.pluginmedia.PIM_Vector3D] Frame 0
class net.pluginmedia.PIM_Vector3D
{
function PIM_Vector3D () {
}
}
Symbol 907 MovieClip [__Packages.BustaBall] Frame 0
class BustaBall
{
var smashBall, touchingBalls, parentGame, ballColour, clip, checkFlag, parentRow, landLocked, pos, colnum, hidden, x2, x3;
function BustaBall (parentGame, parentrow, colour, col) {
var _local1 = this;
var _local2 = parentGame;
_local1.parentRow = parentrow;
_local1.ballColour = colour;
_local1.colnum = col;
_local1.touchingBalls = new Array();
_local1.parentGame = _local2;
_local1.checkFlag = false;
_local1.ballNum = _local2.incrementBallCount();
var _local3 = _local2.getBallClips(colour);
_local1.clip = _local2.getBallClip().attachMovie(_local3, "ball" + _local1.ballNum, 100000 - _local1.ballNum);
_local1.clip.ballObject = _local1;
_local1.pos = new net.pluginmedia.PIM_Vector2D(0, 0);
_local1.clip.debug_txt = "";
_local1.smashBall = false;
_local1.hidden = false;
_local1.ballDiam = _local2.getBallDiam();
if (_local2.gs.showDebugInfo) {
_local1.clip.attachMovie("debugText", "debugtext", 100);
}
}
function setSmash() {
var _local1 = this;
var _local2 = _local1.parentGame.getBallClip().attachMovie("BallSmash", "smashball" + _local1.ballNum, 100000);
_local2._x = _local1.clip._x;
_local2._y = _local1.clip._y;
_local2._visible = false;
_local1.clip.removeMovieClip();
_local1.clip = _local2;
_local1.smashBall = true;
_local1.x2 = false;
_local1.x3 = false;
}
function getSmash() {
return(smashBall);
}
function setExplode(delay, soundon) {
var _local3 = this;
_local3.clip.life = 9;
_local3.clip.playDelay = delay;
_local3.clip.onEnterFrame = _local3.parentGame.fallFunction;
_local3.clip.soundon = soundon;
_local3.clip.parentGame = _local3.parentGame;
if (_local3.x2 || (_local3.x3)) {
_local3.parentGame.getMusicClip().playSound("mulitplier");
var clipname;
if (_local3.x2) {
_local3.parentGame.x2Activate();
clipname = "x2_BM";
} else if (_local3.x3) {
_local3.parentGame.x3Activate();
clipname = "x3_BM";
}
var _local1;
var _local2 = 0;
while (_local2 < 20) {
_local1 = _local3.parentGame.makeParticle(clipname);
_local1.Velocity.set(0, (Math.random() * 20) + 20);
_local1.DragVec.set(0.9, 0.9);
_local1.Velocity.rotate(Math.random() * 360);
_local1.Position.plus(_local3.pos);
_local1.Gravity.y = 0.5;
_local1.LifeExpectancy = 45;
_local1.Delay = _local2;
_local2++;
}
}
_local3.deleteBall(true);
}
function toString() {
var _local2 = this;
var _local1 = "";
_local1 = (_local1 + "[clip:") + _local2.clip;
_local1 = ((((_local1 + ",ballNum:") + _local2.ballNum) + ", pos:") + _local2.pos) + "]";
return(_local1);
}
function setTouching(index, ball) {
touchingBalls[index] = ball;
updateLandLockedState();
}
function getTouching(index) {
return(touchingBalls[index]);
}
function getBallColourString() {
return(parentGame.getBallClips(ballColour));
}
function updateLandLockedState() {
var _local2 = this;
_local2.landLocked = true;
var _local3 = Array();
if (_local2.colnum == 0) {
_local3[3] = true;
if ((_local2.getRow() % 2) == 0) {
_local3[2] = true;
_local3[4] = true;
}
}
if (_local2.colnum == (_local2.parentRow.getBallCount() - 1)) {
_local3[0] = true;
if ((_local2.getRow() % 2) == 0) {
_local3[1] = true;
_local3[5] = true;
}
}
if (_local2.getRow() == (_local2.parentGame.getRowCount() - 1)) {
_local3[4] = true;
_local3[5] = true;
}
var _local1 = 0;
while ((_local1 < 6) && (_local2.landLocked)) {
if ((!_local3[_local1]) && (_local2.getTouching(_local1) == null)) {
_local2.landLocked = false;
}
_local1++;
}
}
function render() {
var _local1 = this;
if (((!_local1.hidden) && (!_local1.clip._visible)) && (_local1.pos.y >= ((-_local1.ballDiam) >> 1))) {
_local1.clip._visible = true;
} else if (_local1.clip._visible && (_local1.pos.y < ((-_local1.ballDiam) >> 1))) {
_local1.clip._visible = false;
}
_local1.clip._x = _local1.pos.x;
_local1.clip._y = _local1.pos.y;
_local1.clip.debug_txt = (_local1.colnum + ",") + _local1.getRow();
}
function getClip() {
return(clip);
}
function makeX2() {
var _local1 = this;
if (_local1.parentGame.gs.preRenderedBitmaps) {
_local1.clip.attachMovie("x2_BM", "x2", 100);
} else {
_local1.clip.attachMovie("x2", "x2", 100);
_local1.clip.x3._xscale = 60;
_local1.clip.x3._yscale = 60;
}
_local1.x2 = true;
}
function makeX3() {
var _local1 = this;
if (_local1.parentGame.gs.preRenderedBitmaps) {
_local1.clip.attachMovie("x3_BM", "x3", 100);
} else {
_local1.clip.attachMovie("x3", "x3", 100);
_local1.clip.x3._xscale = 60;
_local1.clip.x3._yscale = 60;
}
_local1.x3 = true;
}
function setCheckFlag(state) {
var _local1 = this;
_local1.checkFlag = state;
if (state) {
_local1.clip.num_txt = "*";
} else {
_local1.clip.num_txt = "";
}
}
function getCheckFlag() {
return(checkFlag);
}
function getColour() {
return(ballColour);
}
function setColour(index) {
ballColour = index;
}
function getParent() {
return(parentRow);
}
function setParent(row) {
parentRow = row;
}
function getParentGame() {
return(parentGame);
}
function getLandLocked() {
return(landLocked);
}
function setLandLocked(state) {
landLocked = state;
}
function deleteBall(keepClip) {
var _local2 = this;
var _local1 = 0;
while (_local1 < 6) {
_local2.touchingBalls[_local1].setTouching((_local1 + 3) % 6, null);
_local1++;
}
_local2.clip.ballObject = null;
if (!keepClip) {
_local2.clip.removeMovieClip();
}
_local2.parentRow.deleteBall(_local2);
}
function getPos() {
return(pos);
}
function getCol() {
return(colnum);
}
function setCol(num) {
colnum = num;
}
function getRow() {
return(parentRow.getRowNum());
}
function hideBall() {
clip._visible = false;
hidden = true;
}
function showBall() {
clip._visible = true;
hidden = false;
}
function showDebugText(mystr, clear) {
var _local1 = this;
if (clear) {
_local1.clip.debugtext.text = mystr;
} else {
_local1.clip.debugtext.text = (_local1.clip.debugtext.text + newline) + mystr;
}
}
function getX2() {
return(x2);
}
function getX3() {
return(x3);
}
}
Symbol 908 MovieClip [__Packages.BustaRow] Frame 0
class BustaRow
{
var parentGame, ballArray, rowNum;
function BustaRow (parent, rownum) {
var _local1 = this;
_local1.ballArray = Array();
_local1.parentGame = parent;
_local1.rowNum = rownum;
}
function addBall(colour, col) {
var _local2 = this;
var _local1 = new BustaBall(_local2.parentGame, _local2, colour, col);
_local2.ballArray.push(_local1);
return(_local1);
}
function initBalls(count) {
var _local2 = this;
var _local3 = count;
var _local1 = 0;
while (_local1 < _local3) {
_local2.ballArray[_local1] = null;
_local1++;
}
}
function getParentGame() {
return(parentGame);
}
function getBallCount() {
return(ballArray.length);
}
function getBall(index) {
if (index > ballArray.length) {
}
return(ballArray[index]);
}
function setBall(ball, index) {
ballArray[index] = ball;
ball.setCol(index);
}
function setBallsCheckFlag(state) {
var _local2 = this;
var _local3 = state;
var _local1 = 0;
while (_local1 < _local2.ballArray.length) {
_local2.ballArray[_local1].setCheckFlag(_local3);
_local1++;
}
}
function deleteBall(ball) {
var _local2 = this;
var _local3 = ball;
var _local1 = 0;
while (_local1 < _local2.ballArray.length) {
if (_local2.ballArray[_local1] == _local3) {
_local2.ballArray[_local1] = null;
return;
}
_local1++;
}
}
function isRowEmpty() {
var _local2 = this;
var _local1 = 0;
while (_local1 < _local2.ballArray.length) {
if ((_local2.ballArray[_local1] != null) && (_local2.ballArray[_local1].getClip() != null)) {
return(false);
}
_local1++;
}
return(true);
}
function getRowNum() {
return(rowNum);
}
function setRowNum(num) {
rowNum = num;
}
}
Symbol 909 MovieClip [__Packages.net.pluginmedia.PIM_Particle2D] Frame 0
class net.pluginmedia.PIM_Particle2D
{
var ExtraClips, Delay, Clip, Position, Scale;
function PIM_Particle2D (symbolIdentifier, targetClip, pim_Math) {
var _local1 = this;
var _local2 = _global;
var _local3 = pim_Math;
if (targetClip == null) {
targetClip = _root;
}
if (!_local2.particleCounter) {
_local2.particleCounter = 1000;
}
_local2.particleCounter++;
depth = _local2.particleCounter;
if (typeof(symbolIdentifier) == "string") {
_local1.Type = symbolIdentifier;
_local1.Clip = targetClip.attachMovie(symbolIdentifier, "particle" + depth, depth);
_local1.Position = new net.pluginmedia.PIM_Vector2D(0, 0);
} else if (symbolIdentifier instanceof MovieClip) {
_local1.Type = symbolIdentifier._name;
_local1.Clip = symbolIdentifier;
_local1.Position = new net.pluginmedia.PIM_Vector2D(_local1.Clip._x, _local1.Clip._y);
}
_local1.Scale = 1;
_local1.MaxScale = null;
_local1.Velocity = new net.pluginmedia.PIM_Vector2D(0, 0);
_local1.DragVec = new net.pluginmedia.PIM_Vector2D(0.98, 0.98);
_local1.Gravity = new net.pluginmedia.PIM_Vector2D(0, 0);
_local1.Spin = 0;
_local1.Life = 0;
_local1.LifeExpectancy = null;
_local1.Shrink = null;
_local1.Fade = null;
_local1.Ground = null;
_local1.Delay = 0;
_local1.KeepAlive = false;
_local1.Delete = false;
_local1.RotateAroundY = 0;
_local1.pim_Math = _local3;
_local1.ShowBeforeStart = false;
_local1.ExtraClips = new Array();
if (!_local3) {
if (!_local2.pim_Math) {
_local2.pim_Math = new net.pluginmedia.PIM_Math();
}
_local3 = _local2.pim_Math;
}
if (!_local3) {
}
}
function addExtraClip(symbolIdentifier, targetClip) {
_global.particleCounter++;
depth = _global.particleCounter;
ExtraClips.push(targetClip.attachMovie(symbolIdentifier, "particle" + depth, depth));
}
function setPosition() {
if (Delay > 0) {
Clip._visible = false;
} else {
Clip._visible = true;
}
Clip._x = Position.x;
Clip._y = Position.y;
Clip._xscale = Scale * 100;
Clip._yscale = Scale * 100;
var _local3 = 0;
while (_local3 < ExtraClips.length) {
var _local1 = ExtraClips[_local3];
var _local2 = Clip;
_local1._x = _local2._x;
_local1._y = _local2._y;
_local1._rotation = _local2._rotation;
_local1._xscale = _local2._xscale;
_local1._yscale = _local2._yscale;
_local1._alpha = _local2._alpha;
_local1._visible = _local2._visible;
_local3++;
}
}
function deleteParticle() {
var _local2 = this;
_local2.Clip._visible = false;
if (!KeepClip) {
removeMovieClip(_local2.Clip);
var _local1 = 0;
while (_local1 < _local2.ExtraClips.length) {
removeMovieClip(_local2.ExtraClips[_local1]);
_local1++;
}
_local2.ExtraClips = new Array();
}
}
}
Symbol 910 MovieClip [__Packages.BustaCollision] Frame 0
class BustaCollision
{
function BustaCollision () {
var _local1 = this;
_local1.hitBall = null;
_local1.hitLeftWall = false;
_local1.hitRightWall = false;
_local1.newPos = new net.pluginmedia.PIM_Vector2D(0, 0);
_local1.hitPoint = new net.pluginmedia.PIM_Vector2D(0, 0);
_local1.newVel = new net.pluginmedia.PIM_Vector2D(0, 0);
_local1.hitTime = null;
_local1.hitDistance = null;
_local1.hitBalls = new Array();
}
function toString() {
var _local2 = this;
var _local1 = ("hitBall = " + _local2.hitBall) + newline;
_local1 = ((_local1 + "hitLeftWall = ") + _local2.hitLeftWall) + newline;
_local1 = ((_local1 + "hitRightWall = ") + _local2.hitRightWall) + newline;
_local1 = ((_local1 + "hitTime = ") + _local2.hitTime) + newline;
_local1 = ((_local1 + "hitDistance = ") + _local2.hitDistance) + newline;
_local1 = ((_local1 + "newPos = ") + _local2.newPos) + newline;
_local1 = ((_local1 + "newVel = ") + _local2.newVel) + newline;
_local1 = ((_local1 + "hitPoint = ") + _local2.hitPoint) + newline;
_local1 = ((_local1 + "hitBalls = ") + _local2.hitBalls) + newline;
return(_local1);
}
}
Symbol 911 MovieClip [__Packages.net.pluginmedia.PIM_ParticleManager] Frame 0
class net.pluginmedia.PIM_ParticleManager
{
var particleObjects;
function PIM_ParticleManager (targetClip, pim_math) {
var _local1 = this;
var _local2 = _global;
_local1.pim_Math = pim_math;
if (!_local1.pim_Math) {
if (!_local2.pim_Math) {
_local2.pim_Math = new net.pluginmedia.PIM_Math();
}
_local1.pim_Math = _local2.pim_Math;
}
if (!_local1.pim_Math) {
}
_local1.particleObjects = new Array();
_local1.updateClip = targetClip.createEmptyMovieClip("ParticleUpdater", 1);
_local1.updateClip.particleManager = _local1;
_local1.updateClip.onEnterFrame = function () {
this.particleManager.updateParticles();
};
_local1.particleClip = targetClip;
}
function addParticle(symbolIdentifier, targetClip) {
var _local1 = this;
var _local2 = targetClip;
if (!_local2) {
_local2 = _local1.particleClip;
}
_local1.particleObjects.push(new net.pluginmedia.PIM_Particle2D(symbolIdentifier, _local2, _local1.pim_Math));
return(_local1.particleObjects[_local1.particleObjects.length - 1]);
}
function updateParticles() {
var _local1;
var _local3;
var _local2 = 0;
while (_local2 < particleObjects.length) {
_local3 = false;
_local1 = particleObjects[_local2];
if (_local1.Delay > 0) {
_local1.Delay--;
if (!_local1.ShowBeforeStart) {
_local1.Clip._visible = false;
}
} else {
_local1.Clip._visible = true;
_local1.Velocity.multiply(_local1.DragVec);
_local1.Velocity.plus(_local1.Gravity);
_local1.Position.plus(_local1.Velocity);
_local1.Clip._rotation = _local1.Clip._rotation + _local1.Spin;
if (_local1.Ground) {
if (_local1.Position.y > _local1.Ground) {
_local1.Velocity.y = -_local1.Velocity.y;
_local1.Position.y = _local1.Ground - (_local1.Position.y - _local1.Ground);
}
}
if (_local1.Shrink) {
_local1.Scale = _local1.Scale * _local1.Shrink;
if (_local1.MaxScale != null) {
if (_local1.Scale > _local1.MaxScale) {
_local1.Scale = _local1.MaxScale;
}
}
}
if (_local1.Fade) {
_local1.Clip._alpha = _local1.Clip._alpha * _local1.Fade;
}
_local1.Life++;
_local1.setPosition();
if (_local1.Clip._alpha <= 3) {
_local3 = true;
}
if (_local1.Scale <= 0.05) {
_local3 = true;
}
if (_local1.Life > _local1.LifeExpectancy) {
_local3 = true;
}
if (_local3) {
_local2 = deleteParticle(_local2);
}
}
_local2++;
}
}
function deleteParticle(pnum) {
var _local1 = pnum;
var _local2 = particleObjects[_local1];
_local2.deleteParticle();
particleObjects.splice(_local1, 1);
if (_local1 > 0) {
_local1--;
}
return(_local1);
}
function deleteAllParticles() {
var _local2 = this;
var _local1 = 0;
while (_local1 < _local2.particleObjects.length) {
_local2.particleObjects[_local1].deleteParticle();
delete _local2.particleObjects[_local1];
_local1++;
}
_local2.particleObjects = Array();
}
}
Symbol 912 MovieClip [__Packages.BustaSpecialBall] Frame 0
class BustaSpecialBall extends BustaBall
{
var clip, parentGame, ballColour, onScreen, pos;
function BustaSpecialBall (clip, parentgame) {
var _local1 = this;
var _local2 = clip;
super();
_local1.clip = _local2;
_local1.onScreen = false;
_local1.parentGame = parentgame;
_local1.ballOffset = new net.pluginmedia.PIM_Vector2D(-_local2.carryball_mc._x, -_local2.carryball_mc._y);
_local1.pos = new net.pluginmedia.PIM_Vector2D(_local2._x - _local1.ballOffset.x, _local2._y - _local1.ballOffset.y);
_local1.vel = new net.pluginmedia.PIM_Vector2D(-2, 0);
_local2._visible = false;
_local2.stop();
_local1.onScreen = false;
_local1.startPos = new net.pluginmedia.PIM_Vector2D(_local2._x, _local2._y);
}
function update() {
var _local1 = this;
_local1.pos.plus(_local1.vel);
_local1.render();
if ((_local1.pos.x + _local1.clip._width) < 0) {
_local1.deActivate();
}
}
function deActivate() {
var _local1 = this;
_local1.onScreen = false;
_local1.clip.stop();
_local1.clip._visible = false;
}
function activate() {
var _local1 = this;
_local1.onScreen = true;
_local1.clip._visible = true;
_local1.pos.x = _local1.startPos.x;
_local1.clip.play();
_local1.render();
_local1.ballColour = _local1.parentGame.getNextBallColour();
_local1.clip.ballColour = _local1.parentGame.getBallClips(_local1.ballColour);
}
function setExplode(delay) {
var _local2 = this;
_local2.parentGame.getMusicClip().playSound("specialball");
_local2.parentGame.explodeColour(_local2.ballColour);
_local2.parentGame.resetSmashAccumulator();
var _local1;
var hitpart = _local2.parentGame.makeParticle("specialBallHit");
hitpart.Position.copyFrom(_local2.pos);
hitpart.Position.plus(_local2.ballOffset);
hitpart.Velocity.x = -5;
hitpart.Velocity.y = -5;
hitpart.Gravity.y = 0.4;
hitpart.LifeExpectancy = 55;
hitpart.Spin = -5;
var featherDir;
var ballNum = _local2.parentGame.incrementBallCount();
var libname = _local2.parentGame.getBallClips(_local2.ballColour);
var pieclip = _local2.parentGame.getBallClip().attachMovie(libname, "ball" + ballNum, 100000 - ballNum);
pieclip._x = _local2.pos.x + _local2.ballOffset.x;
pieclip._y = _local2.pos.y + _local2.ballOffset.y;
pieclip.life = 9;
pieclip.playDelay = 0;
pieclip.onEnterFrame = _local2.parentGame.fallFunction;
var _local3 = 0;
while (_local3 < 5) {
_local1 = _local2.parentGame.makeParticle("specialBallDebris");
_local1.Position.set(0, Math.random() * 15);
_local1.Velocity.set(0, Math.random() * 20);
_local1.DragVec.set(0.95, 0.95);
featherDir = Math.random() * 360;
_local1.Position.rotate(featherDir);
_local1.Velocity.rotate(featherDir);
_local1.Position.plus(_local2.pos);
_local1.Spin = (Math.random() * 40) - 20;
_local1.Gravity.y = 0.5;
_local1.Shrink = 0.98;
_local1.LifeExpectancy = 45;
_local3++;
}
_local2.deActivate();
}
function toString() {
var _local1 = "";
_local1 = ((_local1 + "[clip:") + clip) + "]";
return(_local1);
}
function getBallColourString() {
return(parentGame.getBallClips(ballColour));
}
function isOnScreen() {
return(onScreen);
}
function render() {
var _local1 = this;
_local1.clip._x = _local1.pos.x + _local1.ballOffset.x;
_local1.clip._y = _local1.pos.y + _local1.ballOffset.y;
}
function getClip() {
return(clip);
}
function getPos() {
return(pos);
}
}
Symbol 913 MovieClip [__Packages.BustaAdderBall] Frame 0
class BustaAdderBall extends BustaBall
{
var clip, parentGame, ballColour, onScreen, active, pos;
function BustaAdderBall (clip, parentgame) {
var _local2 = clip;
var _local3 = this;
super();
_local3.clip = _local2;
_local3.onScreen = false;
_local3.active = false;
_local3.parentGame = parentgame;
_local3.ballOffset = new net.pluginmedia.PIM_Vector2D(-_local2.carryball_mc._x, -_local2.carryball_mc._y);
_local3.rootPos = new net.pluginmedia.PIM_Vector2D(_local2._x, _local2._y);
_local3.startPos = _local3.rootPos.getClone();
_local3.vel = new net.pluginmedia.PIM_Vector2D(0, 0);
_local2._visible = false;
_local2.stop();
_local3.currentRotation = 0;
_local3.maxRotation = 14;
_local3.chainClips = new Array();
var _local1 = 0;
while (_local2.chain_mc[("chain" + _local1) + "_mc"]) {
_local3.chainClips.push(_local2.chain_mc[("chain" + _local1) + "_mc"]);
_local2.chain_mc[("chain" + _local1) + "_mc"]._visible = false;
_local1++;
}
origMoveUpSpeed = 3;
_local3.origSwingSpeed = 4;
_local3.moveDownSpeed = 10;
_local3.moveUpSpeed = origMoveUpSpeed;
_local3.swingSpeed = _local3.origSwingSpeed;
}
function update() {
var _local1 = this;
if ((_local1.swingCounter % 2) == 0) {
var _local2 = 0;
while (_local2 < _local1.chainClips.length) {
if (((_local1.chainClips[_local2]._y + _local1.clip._y) + _local1.chainClips[_local2]._height) > -120) {
_local1.chainClips[_local2]._visible = true;
} else {
_local1.chainClips[_local2]._visible = false;
}
_local2++;
}
_local1.rootPos.plus(_local1.vel);
_local1.clip._rotation = _global.pim_Math.sin(_local1.swingCounter * _local1.swingSpeed) * _local1.currentRotation;
if (_local1.onScreen) {
_local1.clip.head_mc._rotation = _global.pim_Math.sin((_local1.swingCounter * _local1.swingSpeed) - 95) * 10;
_local1.clip.arm_mc._rotation = _global.pim_Math.sin((_local1.swingCounter * _local1.swingSpeed) - 100) * 40;
_local1.clip.body_mc._rotation = _global.pim_Math.sin((_local1.swingCounter * _local1.swingSpeed) - 90) * 30;
_local1.clip.arm_mc.ball_mc._visible = false;
var _local3 = new net.pluginmedia.PIM_Vector2D(_local1.clip.arm_mc.ball_mc._x, _local1.clip.arm_mc.ball_mc._y);
_local3.rotate(_local1.clip.arm_mc._rotation);
_local3.x = _local3.x + _local1.clip.arm_mc._x;
_local3.y = _local3.y + _local1.clip.arm_mc._y;
_local1.clip.ball_mc._x = _local3.x;
_local1.clip.ball_mc._y = _local3.y;
_local1.clip.ball_mc._rotation = -_local1.clip._rotation;
_local1.pos.copyFrom(_local3);
_local1.pos.rotate(_local1.clip._rotation);
_local1.pos.plus(_local1.rootPos);
if ((_local1.rootPos.y < -300) && ((_local1.rootPos.y - _local1.vel.y) >= -300)) {
_local1.parentGame.getMusicClip().playSound("addersucceed");
}
}
_local1.render();
if ((_local1.vel.y > 0) && (_local1.rootPos.y > -80)) {
_local1.vel.y = -_local1.moveUpSpeed;
_local1.clip.gotoAndStop(2);
_local1.onScreen = true;
_local1.clip.ball_mc.gotoAndStop(_local1.parentGame.getBallClips(_local1.ballColour));
} else if (_local1.vel.y < 0) {
if ((_local1.maxRotation - _local1.currentRotation) > 0.1) {
var diff = (_local1.maxRotation - _local1.currentRotation);
_local1.currentRotation = _local1.currentRotation + (diff * 0.1);
} else {
_local1.currentRotation = _local1.maxRotation;
}
if (_local1.rootPos.y < _local1.startPos.y) {
if (_local1.onScreen) {
_local1.parentGame.incBallVariations();
_local1.moveUpSpeed = origMoveUpSpeed;
_local1.swingSpeed = _local1.origSwingSpeed;
}
_local1.deActivate();
}
}
}
_local1.swingCounter++;
}
function deActivate() {
var _local1 = this;
_local1.onScreen = false;
_local1.active = false;
_local1.clip.stop();
_local1.clip._visible = false;
_local1.parentGame.getMusicClip().stopSound("chain");
}
function activate() {
var _local1 = this;
_local1.vel.set(0, _local1.moveDownSpeed);
_local1.onScreen = false;
_local1.active = true;
_local1.clip._visible = true;
_local1.pos.copyFrom(_local1.startPos);
_local1.clip._rotation = 0;
_local1.currentRotation = 5;
_local1.swingCounter = 0;
_local1.render();
_local1.ballColour = _local1.parentGame.getBallVariations();
_local1.clip.ballColour = _local1.parentGame.getBallClips(_local1.ballColour);
_local1.clip.gotoAndStop(1);
_local1.parentGame.getMusicClip().playSound("chain", undefined, undefined, 30);
}
function setExplode(delay) {
var _local1 = this;
_local1.parentGame.resetSmashAccumulator();
_local1.parentGame.getMusicClip().stopSound("addersucceed");
_local1.parentGame.getMusicClip().playSound("adderhit");
_local1.parentGame.addToScore(5);
_local1.moveUpSpeed = _local1.moveUpSpeed + 0.5;
_local1.swingSpeed = _local1.swingSpeed + 0.5;
var _local2 = _local1.parentGame.makeParticle("adderBallHit");
_local2.Position.set(_local1.clip.body_mc._x, _local1.clip.body_mc._y);
_local2.Position.rotate(_local1.clip._rotation);
_local2.Position.plus(_local1.rootPos);
_local2.Velocity.x = -5;
_local2.Velocity.y = -5;
_local2.Gravity.y = 0.4;
_local2.LifeExpectancy = 55;
_local2.Spin = -10;
var ballNum = _local1.parentGame.incrementBallCount();
var libname = _local1.parentGame.getBallClips(_local1.ballColour);
var _local3 = _local1.parentGame.getBallClip().attachMovie(libname, "ball" + ballNum, 100000 - ballNum);
_local3._x = _local1.pos.x;
_local3._y = _local1.pos.y;
_local3.life = 9;
_local3.playDelay = 0;
_local3.onEnterFrame = _local1.parentGame.fallFunction;
_local1.onScreen = false;
_local1.clip.gotoAndStop(1);
}
function toString() {
var _local1 = "";
_local1 = ((_local1 + "[clip:") + clip) + "]";
return(_local1);
}
function getBallColourString() {
return(parentGame.getBallClips(ballColour));
}
function isOnScreen() {
return(onScreen);
}
function isActive() {
return(active);
}
function render() {
var _local1 = this;
_local1.clip._x = _local1.rootPos.x;
_local1.clip._y = _local1.rootPos.y;
}
function getClip() {
return(clip);
}
function getPos() {
return(pos);
}
}
Symbol 776 MovieClip Frame 1
function updateBallColour(col) {
ballColour = col;
carryball_mc.gotoAndStop(ballColour);
}
ballColour = "";
this.onEnterFrame = function () {
updateBallColour(ballColour);
};
Symbol 792 MovieClip Frame 1
Symbol 796 MovieClip Frame 1
stop();
Symbol 856 MovieClip Frame 1
counter = 0;
this.onEnterFrame = function () {
_global.playSound("splat", 100);
};
Symbol 856 MovieClip Frame 25
delete this.onEnterFrame;
Symbol 856 MovieClip Frame 125
_global.playSound("vo_end");
stop();
Symbol 874 Button
on (release) {
_global.newGame();
}
Symbol 877 MovieClip Frame 1
if (!playing) {
stop();
}
Symbol 877 MovieClip Frame 8
if (!explode) {
gotoAndPlay (1);
}
Symbol 877 MovieClip Frame 9
_global.playSound("explosion");
Symbol 877 MovieClip Frame 16
_global.playSound("smash");
_global.stopMusic();
Symbol 877 MovieClip Frame 180
_global.playSound("splat");
stop();
Symbol 893 MovieClip Frame 69
stop();
this._visible = false;
Symbol 900 MovieClip Frame 1
music_bt.tabEnabled = true;
sfx_bt.tabEnabled = true;