Frame 1
_root.kongregateServices.connect();
MochiAd.showPreGameAd({id:"918639d304333441", res:"640x480", background:13952486, color:701891, outline:52171, no_bg:true});
function __com_mochibot__(swfid, mc, lv, trk) {
var x;
var g;
var s;
var fv;
var sb;
var u;
var res;
var mb;
var mbc;
mb = "__mochibot__";
mbc = "mochibot.com";
g = (_global ? (_global) : (_level0._root));
if (g[mb + swfid]) {
return(g[mb + swfid]);
}
s = System.security;
x = mc._root.getSWFVersion;
fv = (x ? (mc.getSWFVersion()) : ((_global ? 6 : 5)));
if (!s) {
s = {};
}
sb = s.sandboxType;
if (sb == "localWithFile") {
return(null);
}
x = s.allowDomain;
if (x) {
s.allowDomain(mbc);
}
x = s.allowInsecureDomain;
if (x) {
s.allowInsecureDomain(mbc);
}
u = (((((((((((("http://" + mbc) + "/my/core.swf?mv=7&fv=") + fv) + "&v=") + escape(getVersion())) + "&swfid=") + escape(swfid)) + "&l=") + lv) + "&f=") + mc) + (sb ? ("&sb=" + sb) : "")) + (trk ? "&t=1" : "");
lv = ((fv > 6) ? (mc.getNextHighestDepth()) : ((g[mb + "level"] ? (g[mb + "level"] + 1) : (lv))));
g[mb + "level"] = lv;
if (fv == 5) {
res = "_level" + lv;
if (!eval (res)) {
loadMovieNum (u, lv);
}
} else {
res = mc.createEmptyMovieClip(mb + swfid, lv);
res.loadMovie(u);
}
return(res);
}
__com_mochibot__("7fa88e4c", this, 10301, true);
urlStart = _url.indexOf("://") + 3;
urlEnd = _url.indexOf("/", urlStart);
domain = _url.substring(urlStart, urlEnd);
LastDot = domain.lastIndexOf(".") - 1;
domEnd = domain.lastIndexOf(".", LastDot) + 1;
domain = domain.substring(domEnd, domain.length);
var highScore = [0, 0, 0];
Frame 2
function start() {
_root.gotoAndStop(2);
}
function quit() {
GameManager.getInstance().gameDone();
}
function reset() {
_root.gotoAndStop(2);
}
stop();
Key.removeListener(keyListener);
Mouse.removeListener(mouseListener);
_root.play_btn.onRelease = function () {
this.gotoAndStop(2);
};
var allBalls = new Array();
var ballCounter = 1;
var mouseListener = new Object();
var keyListener = new Object();
var shooting = false;
var totalmov;
var bx;
var by;
var bhset;
var bholeactive = false;
var bdx;
var bdy;
var blen;
var bvx;
var bvy;
var level;
var duration = 150;
var slowtimer;
var flytimer;
var healthtimer;
var slowmo = false;
var pupactive = false;
var truelevel;
var screenlevel;
var lives;
var recovering;
var fly;
var randpup;
var puptimer = 0;
var bholetimer = 0;
var sucktimer;
var litBalls = 0;
var gametime = 0;
var glowCounter = 1;
var gamePaused = false;
var mute;
var hscoredif;
var newScore;
var sound = new Sound(this);
var score = 0;
var pscore = 0;
var ttlgametime = 0;
var ttlBActivated = 0;
var ttlbActivatedFly = 0;
var ttlbActivatedSlow = 0;
if (hscoredif != undefined) {
_root.mainmenu_mc.gotoAndStop(92);
}
Frame 3
function newBall(howMany) {
var _local3 = 0;
while (_local3 < howMany) {
allBalls.push(_root.attachMovie("Ball", "ball_" + (ballCounter++), 1000 + ballCounter, getStartPositionBalls()).init(allBalls.length, this));
_root.attachMovie("Ball_glow", "ball_glow" + (_root.glowCounter++), 100 + _root.glowCounter);
_local3++;
}
}
function newPlayer(howMany) {
allBalls.push(_root.attachMovie("Player", "player_0", 911, getStartPositionPlayer()).init(allBalls.length, this));
}
function newPowerUp() {
if (!pupactive) {
randpup = Math.floor(Math.random() * 3);
if (randpup == 0) {
allBalls.push(_root.attachMovie("SlowMo", "ball_" + (ballCounter++), this.getNextHighestDepth(), getStartPositionPUp()).init(allBalls.length, this));
} else if (randpup == 1) {
allBalls.push(_root.attachMovie("Fly", "ball_" + (ballCounter++), this.getNextHighestDepth(), getStartPositionPUp()).init(allBalls.length, this));
} else if (randpup == 2) {
allBalls.push(_root.attachMovie("Health", "ball_" + (ballCounter++), this.getNextHighestDepth(), getStartPositionPUp()).init(allBalls.length, this));
}
pupactive = true;
}
}
function setTotalMov() {
totalmov = 0;
var _local2 = 1;
while (_local2 < allBalls.length) {
totalmov = totalmov + Math.abs(this.allBalls[_local2].xmov);
totalmov = totalmov + Math.abs(this.allBalls[_local2].ymov);
_local2++;
}
}
function getStartPositionBalls() {
var _local1 = 65;
return({_x:random(Stage.width), _y:random(Stage.height - 50), _width:_local1, _height:_local1});
}
function getStartPositionPUp() {
var _local1 = random(5) + 25;
return({_x:random(Stage.width), _y:random(Stage.height), _width:_local1, _height:_local1});
}
function getStartPositionPlayer() {
var _local1 = 25;
return({_x:random(10) + (Stage.width / 2), _y:random(10) + (Stage.height / 2), _width:_local1, _height:_local1});
}
function gameEnd() {
sound.stop();
sound.attachSound("gameover");
sound.start();
gamePaused = true;
_root.pausemenu.removeMovieClip();
_root.life_mc.life.text = "x0";
_root.fly = false;
_root.slowmo = false;
_root.player_0.gotoAndStop(3).player_death.play();
}
function checkHighScores() {
if (highScore[_root.hscoredif] < score) {
highScore[_root.hscoredif] = score;
newscore = true;
}
}
function updateHighScores() {
if (highScore[_root.hscoredif] == 0) {
_root.hscore.text = "-";
} else {
_root.hscore.text = highScore[_root.hscoredif];
}
newscore = false;
}
function slowMotion() {
slowtimer++;
if ((duration * 2) > slowtimer) {
level = -16;
var _local3 = 1;
while (_local3 < _root.allBalls.length) {
_root["ball_" + _local3].ball_slow.play();
_local3++;
}
_root.player_0.hspeed = 23;
_root.player_0.mass = _root.player_0.mass / 2;
if (_root.player_0.hit) {
_root.player_0.spring(_root.targets._x, _root.targets._y, 0.9, 0.013);
}
} else {
_root.kongregateStats.submit("BActivatedSlow", ttlBActivatedSlow);
slowmo = false;
level = truelevel;
_root.player_0.hspeed = 15;
_root.player_0.mass = player_0.radius;
if (!_root.mute) {
_root.sound.setVolume(100);
}
if (_root.pupactive) {
var _local3 = 0;
while (_local3 < (this.allBalls.length - 1)) {
_root["ball_" + _local3].gotoAndStop(12).ball_slow.gotoAndStop(1);
_local3++;
}
} else {
var _local3 = 0;
while (_local3 < this.allBalls.length) {
_root["ball_" + _local3].gotoAndStop(12).ball_slow.gotoAndStop(1);
_local3++;
}
}
}
}
function lifeRecover() {
healthtimer++;
if ((duration / 2.5) < healthtimer) {
recovering = false;
}
}
function flying() {
flytimer++;
if ((duration * 1.5) > flytimer) {
player_0.spring(_xmouse, _ymouse, 0.98, 0.003);
_root.player_0.gotoAndStop(2).player_fly.play();
} else {
_root.kongregateStats.submit("BActivatedFly", ttlBActivatedFly);
fly = false;
_root.player_0.gotoAndStop(1);
_root.targets._visible = false;
}
shooting = false;
if (!_root.shooting) {
_root.player_0.resetSpring();
_root.player_0.mass = _root.player_0.radius;
_root.player_0.varset = true;
_root.player_0.hit = false;
}
}
function blackHole(ball) {
if (!bhset) {
bx = random(Stage.width - 50) + 50;
by = random(Stage.height - 150) + 60;
bhole._x = bx;
bhole._y = by;
player_0.mass = player_0.mass * 2;
bhset = true;
} else {
this.bvy = by - ball._y;
this.bvx = bx - ball._x;
this.blen = Math.sqrt((this.bvx * this.bvx) + (this.bvy * this.bvy));
this.bdx = bvx / blen;
this.bdy = bvy / blen;
ball.xmov = ball.xmov + (bdx / 3);
ball.ymov = ball.ymov + (bdy / 3);
if (ball.hitTest(bx, by, true)) {
if (!recovering) {
_root.player_0.player_life.play();
_root.sound.attachSound("lifesfx");
_root.attachMovie("hit_mc", "hit_mc", this.getNextHighestDepth());
if (_root.lives != -1) {
_root.life_mc.play();
}
_root.lives--;
_root.life_mc.life.text = "x" + lives;
_root.recovering = true;
_root.sucktimer = 0;
}
}
}
}
function hookBounds() {
if (targets._x > 650) {
player_0.resetSpring();
player_0.mass = player_0.radius;
player_0.varset = true;
player_0.hit = false;
shooting = false;
targets._visible = false;
} else if (targets._x < -10) {
player_0.resetSpring();
player_0.mass = player_0.radius;
player_0.varset = true;
player_0.hit = false;
shooting = false;
targets._visible = false;
} else if (targets._y > 438) {
player_0.resetSpring();
player_0.mass = player_0.radius;
player_0.varset = true;
player_0.hit = false;
shooting = false;
targets._visible = false;
} else if (targets._y < -10) {
player_0.resetSpring();
player_0.mass = player_0.radius;
player_0.varset = true;
player_0.hit = false;
shooting = false;
targets._visible = false;
}
}
function levelUp() {
_root.kongregateStats.submit("BActivated", ttlBActivated);
trace(ttlBActivated);
this.score = this.score + pscore;
this.level++;
this.truelevel++;
this.screenlevel++;
_root.level_mc.lev.text = this.score;
_root.pscore_txt._x = 127 + (_root.level_mc.lev.length * 10);
_root.level_mc.play();
_root.attachMovie("levelup_mc", "levelup_mc", 1234);
if ((this.screenlevel % 2) == 0) {
if (!this.pupactive) {
newBall(1);
} else {
_root.pupactive = false;
_root.ballCounter--;
_root.pup_glow._visible = false;
_root["ball_" + _root.ballCounter].gotoAndPlay(3);
_root.allBalls.pop();
newBall(1);
}
}
}
function checkTotalActive() {
if (!pupactive) {
if (this.litBalls == (this.allBalls.length - 1)) {
levelUp();
litBalls = 0;
var _local3 = 1;
while (_local3 < this.allBalls.length) {
_root["ball_" + _local3].deactivateBall();
_local3++;
}
}
} else if (this.litBalls == (this.allBalls.length - 2)) {
levelUp();
litBalls = 0;
var _local3 = 1;
while (_local3 < (this.allBalls.length - 1)) {
_root["ball_" + _local3].deactivateBall();
_local3++;
}
}
}
stop();
GameManager.getInstance().disableConsole();
_root.level_mc.lev.text = score;
this.pscore = (100 * (screenlevel * 0.3)) + 70;
_root.pscore_txt.text = "+" + pscore;
_root.pscore_txt._x = 127 + (_root.level_mc.lev.length * 10);
sound.attachSound("gameplay");
sound.start(0, 100);
if (mute) {
_root.mute_mc.gotoAndStop(2);
} else {
_root.mute_mc.gotoAndStop(1);
}
_root.life_mc.life.text = "x" + _root.lives;
newPlayer(1);
newBall(5);
setTotalMov();
updateHighScores();
mouseListener.onMouseDown = function () {
shooting = !shooting;
targets._visible = true;
if (!shooting) {
player_0.resetSpring();
player_0.mass = player_0.radius;
player_0.varset = true;
player_0.hit = false;
targets._visible = false;
}
};
_root.mute_mc.mute_btn.onPress = function () {
shooting = false;
targets._visible = false;
mute = !mute;
if (_root.mute) {
_root.mute_mc.gotoAndStop(2);
sound.setVolume(0);
} else {
_root.mute_mc.gotoAndStop(1);
sound.setVolume(100);
}
};
_root.pause_btn.onPress = function () {
shooting = false;
targets._visible = false;
gamePaused = !gamePaused;
if (gamePaused) {
_root.attachMovie("PMenu", "pausemenu", 1230);
} else {
_root.pausemenu.removeMovieClip();
}
};
keyListener.onKeyDown = function () {
if (Key.isDown(77)) {
mute = !mute;
if (mute) {
_root.mute_mc.gotoAndStop(2);
sound.setVolume(0);
} else {
_root.mute_mc.gotoAndStop(1);
sound.setVolume(100);
}
}
if (Key.isDown(80)) {
gamePaused = !gamePaused;
if (gamePaused) {
_root.attachMovie("PMenu", "pausemenu", 1230);
} else {
_root.pausemenu.removeMovieClip();
}
}
};
Key.addListener(keyListener);
Mouse.addListener(mouseListener);
onEnterFrame = function () {
hookBounds();
if (!gamePaused) {
gametime = gametime + 0.0025;
if (totalmov > (((level * 1.2) + 30) + gametime)) {
var _local3 = 1;
while (_local3 < this.allBalls.length) {
this.allBalls[_local3].slowDown();
_local3++;
}
} else if (totalmov < (((level * 1.2) + 28) + gametime)) {
var _local3 = 1;
while (_local3 < this.allBalls.length) {
this.allBalls[_local3].speedUp();
_local3++;
}
}
setTotalMov();
_root.player_0.rotatePlayer();
_root.player_glow._x = _root.player_0._x;
_root.player_glow._y = _root.player_0._y;
if (pupactive) {
_root.pup_glow._visible = true;
_root.pup_glow._x = _root["ball_" + (_root.ballCounter - 1)]._x;
_root.pup_glow._y = _root["ball_" + (_root.ballCounter - 1)]._y;
} else {
_root.pup_glow._visible = false;
}
var _local3 = 0;
while (_local3 < this.glowCounter) {
_root["ball_glow" + _local3]._y = _root["ball_" + _local3]._y;
_root["ball_glow" + _local3]._x = _root["ball_" + _local3]._x;
_local3++;
}
_local3 = 0;
while (_local3 < this.allBalls.length) {
this.allBalls[_local3].moveMe();
_local3++;
}
ttlgametime++;
if ((ttlgametime % 5) == 0) {
_root.pscore_txt.text = "+" + pscore;
if (pscore > 0) {
pscore--;
}
}
if (lives == -1) {
gameEnd();
}
if (shooting) {
player_0.shoot();
player_0.hookOnBallCollision();
player_0.drawSpring(_root.targets._x, _root.targets._y);
}
_root.bholetimer++;
if (bholetimer > (2000 - (screenlevel * 2))) {
_root.bhole.play();
if (bholeactive) {
blackHole(player_0);
}
if (bholetimer > (2150 + (screenlevel * 3))) {
_root.bhole.gotoAndPlay(220);
bholetimer = 0;
bhset = false;
bholeactive = false;
player_0.mass = player_0.mass / 2;
}
}
_root.puptimer++;
if (puptimer > (350 - (screenlevel * 7))) {
puptimer = 0;
if (!pupactive) {
newPowerUp();
} else {
if (player_0.hookball == ("ball_" + (_root.ballCounter - 1))) {
_root.shooting = false;
_root.player_0.varset = true;
_root.player_0.hit = false;
_root.player_0.resetSpring();
_root.player_0.mass = _root.player_0.radius;
_root.targets._visible = false;
}
_root.pupactive = false;
_root.ballCounter--;
_root["ball_" + _root.ballCounter].gotoAndPlay(3);
_root.allBalls.pop();
_root.flytimer = 0;
_root.slowtimer = 0;
}
}
if (fly) {
flying();
}
if (slowmo) {
slowMotion();
}
if (recovering) {
lifeRecover();
}
_local3 = 0;
while (_local3 < this.allBalls.length) {
this.allBalls[_local3].renderMe();
_local3++;
}
if (shooting) {
player_0.drawSpring(_root.targets._x, _root.targets._y);
}
}
};
Frame 4
stop();
_root.gameover_mc.lev_score.text = _root.score;
GameManager.getInstance().enableConsole();
if (newscore) {
_root.gameover_mc.highscore_mc._visible = true;
if (_root.hscoredif == 0) {
_root.kongregateStats.submit("HScoreEasy", _root.score);
} else if (_root.hscoredif == 1) {
_root.kongregateStats.submit("HScoreMed", _root.score);
} else {
_root.kongregateStats.submit("HScoreHard", _root.score);
}
} else {
_root.gameover_mc.highscore_mc._visible = false;
}
Symbol 8 MovieClip Frame 1
stop();
Symbol 10 MovieClip Frame 1
stop();
Symbol 12 MovieClip Frame 1
stop();
Symbol 12 MovieClip Frame 20
stop();
Symbol 13 MovieClip [Ball] Frame 1
#initclip 11
Object.registerClass("Ball", Ball);
#endinitclip
Symbol 13 MovieClip [Ball] Frame 12
stop();
Symbol 16 MovieClip Frame 15
stop();
Symbol 20 MovieClip Frame 10
_root.pup_glow._visible = false;
this._parent.removeMovieClip();
Symbol 23 MovieClip [SlowMo] Frame 1
#initclip 7
Object.registerClass("SlowMo", SlowMo);
#endinitclip
stop();
Symbol 23 MovieClip [SlowMo] Frame 12
_root.pup_glow._visible = false;
this.removeMovieClip();
Symbol 25 MovieClip Frame 15
stop();
Symbol 26 MovieClip Frame 10
_root.pup_glow._visible = false;
this._parent.removeMovieClip();
Symbol 27 MovieClip [Health] Frame 1
#initclip 8
Object.registerClass("Health", Health);
#endinitclip
stop();
Symbol 27 MovieClip [Health] Frame 12
_root.pup_glow._visible = false;
this.removeMovieClip();
Symbol 30 MovieClip Frame 15
stop();
Symbol 33 MovieClip Frame 10
_root.pup_glow._visible = false;
this._parent.removeMovieClip();
Symbol 36 MovieClip [Fly] Frame 1
#initclip 9
Object.registerClass("Fly", Fly);
#endinitclip
stop();
Symbol 36 MovieClip [Fly] Frame 10
_root.pup_glow._visible = false;
this.removeMovieClip();
Symbol 44 Button
on (release) {
_root.gamePaused = false;
_root.pausemenu.removeMovieClip();
}
Symbol 47 Button
on (release) {
_root.gameEnd();
_root.pausemenu.removeMovieClip();
}
Symbol 49 Button
on (release) {
_root.attachMovie("inst_mc", "inst_mc", 1245);
}
Symbol 54 MovieClip Frame 1
stop();
Symbol 56 MovieClip Frame 20
_root.attachMovie("gamefade_mc", "gamefade", 999299);
Symbol 56 MovieClip Frame 30
stop();
Symbol 57 MovieClip [Player] Frame 1
#initclip 10
Object.registerClass("Player", Player);
#endinitclip
stop();
Symbol 61 Button
on (release) {
getURL ("http://www.kongregate.com/?gamereferral=bounce");
}
Symbol 62 MovieClip [PMenu] Frame 10
stop();
Symbol 67 Button
on (release) {
this.play();
}
Symbol 71 Button
on (release) {
this.removeMovieClip();
}
Symbol 73 MovieClip [inst_mc] Frame 8
stop();
Symbol 73 MovieClip [inst_mc] Frame 16
this.removeMovieClip();
Symbol 76 MovieClip [gamefade_mc] Frame 25
if (_root.pupactive) {
_root.pupactive = false;
_root.ballCounter--;
_root["ball_" + _root.ballCounter].removeMovieClip();
_root.allBalls.pop();
_root.timer = 0;
}
var i = 1;
while (i < _root.allBalls.length) {
_root["ball_" + i].removeMovieClip();
_root["ball_glow" + i].removeMovieClip();
i++;
}
_root.checkHighScores();
_root.gotoAndStop(4);
_root.line_mc.removeMovieClip();
_root.recovering = false;
_root.slowmo = false;
_root.fly = false;
_root.player_0.removeMovieClip();
this.removeMovieClip();
Symbol 82 MovieClip [ready_mc] Frame 15
_root.gotoAndStop(3);
Symbol 82 MovieClip [ready_mc] Frame 16
_root.gamePaused = true;
this.swapDepths(99999);
var i = 0;
while (i < _root.allBalls.length) {
_root.allBalls[i].moveMe();
i++;
}
var i = 0;
while (i < _root.allBalls.length) {
_root.allBalls[i].renderMe();
i++;
}
_root.player_glow._x = _root.player_0._x;
_root.player_glow._y = _root.player_0._y;
if (pupactive) {
_root.pup_glow._visible = true;
_root.pup_glow._visible = true;
_root.pup_glow._x = _root["ball_" + (_root.ballCounter - 1)]._x;
_root.pup_glow._y = _root["ball_" + (_root.ballCounter - 1)]._y;
} else {
_root.pup_glow._visible = false;
_root.pup_glow._visible = false;
}
var i = 0;
while (i < _root.glowCounter) {
_root["ball_glow" + i]._y = _root["ball_" + i]._y;
_root["ball_glow" + i]._x = _root["ball_" + i]._x;
i++;
}
Symbol 82 MovieClip [ready_mc] Frame 77
_root.gamePaused = false;
Symbol 82 MovieClip [ready_mc] Frame 80
this.removeMovieClip();
Symbol 84 MovieClip [hit_mc] Frame 9
this.removeMovieClip();
Symbol 91 MovieClip [levelup_mc] Frame 5
this.scorefade.scorefade_txt.text = "+" + _root.pscore;
_root.pscore = (100 * (_root.screenlevel * 0.3)) + 70;
Symbol 91 MovieClip [levelup_mc] Frame 20
this.removeMovieClip();
Symbol 199 MovieClip [__Packages.MochiAd] Frame 0
class MochiAd
{
function MochiAd () {
}
static function getVersion() {
return("2.1");
}
static function showPreGameAd(options) {
var _local27 = {clip:_root, ad_timeout:3000, fadeout_time:250, regpt:"o", method:"showPreloaderAd", color:16747008, background:16777161, outline:13994812, ad_started:function () {
this.clip.stop();
}, ad_finished:function () {
this.clip.play();
}};
options = _parseOptions(options, _local27);
var clip = options.clip;
var _local23 = 11000;
var _local26 = options.ad_timeout;
delete options.ad_timeout;
var fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!load(options)) {
options.ad_finished();
return(undefined);
}
options.ad_started();
var mc = clip._mochiad;
mc.onUnload = function () {
options.ad_finished();
};
var _local14 = _getRes(options);
var _local4 = _local14[0];
var _local13 = _local14[1];
mc._x = _local4 * 0.5;
mc._y = _local13 * 0.5;
var chk = mc.createEmptyMovieClip("_mochiad_wait", 3);
chk._x = _local4 * -0.5;
chk._y = _local13 * -0.5;
var _local7 = chk.createEmptyMovieClip("_mochiad_bar", 4);
_local7._x = 10;
_local7._y = _local13 - 20;
var _local22 = options.color;
delete options.color;
var _local19 = options.background;
delete options.background;
var _local24 = options.outline;
delete options.outline;
var _local5 = _local7.createEmptyMovieClip("_outline", 1);
_local5.beginFill(_local19);
_local5.moveTo(0, 0);
_local5.lineTo(_local4 - 20, 0);
_local5.lineTo(_local4 - 20, 10);
_local5.lineTo(0, 10);
_local5.lineTo(0, 0);
_local5.endFill();
var _local3 = _local7.createEmptyMovieClip("_inside", 2);
_local3.beginFill(_local22);
_local3.moveTo(0, 0);
_local3.lineTo(_local4 - 20, 0);
_local3.lineTo(_local4 - 20, 10);
_local3.lineTo(0, 10);
_local3.lineTo(0, 0);
_local3.endFill();
_local3._xscale = 0;
var _local6 = _local7.createEmptyMovieClip("_outline", 3);
_local6.lineStyle(0, _local24, 100);
_local6.moveTo(0, 0);
_local6.lineTo(_local4 - 20, 0);
_local6.lineTo(_local4 - 20, 10);
_local6.lineTo(0, 10);
_local6.lineTo(0, 0);
chk.ad_msec = _local23;
chk.ad_timeout = _local26;
chk.started = getTimer();
chk.showing = false;
chk.last_pcnt = 0;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function () {
var _local2 = 100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time));
if (_local2 > 0) {
this._parent._alpha = _local2;
} else {
var _local3 = this._parent._parent;
MochiAd.unload(_local3);
delete this.onEnterFrame;
}
};
mc.lc.adLoaded = function (width, height) {
};
mc.lc.adjustProgress = function (msec) {
var _local2 = this.mc._mochiad_wait;
_local2.server_control = true;
_local2.started = getTimer();
_local2.ad_msec = msec;
};
chk.onEnterFrame = function () {
var _local6 = this._parent._parent;
var _local12 = this._parent._mochiad_ctr;
var _local5 = getTimer() - this.started;
var _local3 = false;
var _local4 = _local6.getBytesTotal();
var _local8 = _local6.getBytesLoaded();
var _local10 = (100 * _local8) / _local4;
var _local11 = (100 * _local5) / chk.ad_msec;
var _local9 = this._mochiad_bar._inside;
var _local2 = Math.min(100, Math.min(_local10 || 0, _local11));
_local2 = Math.max(this.last_pcnt, _local2);
this.last_pcnt = _local2;
_local9._xscale = _local2;
if (!chk.showing) {
var _local7 = _local12.getBytesTotal();
if ((_local7 > 0) || (typeof(_local7) == "undefined")) {
chk.showing = true;
chk.started = getTimer();
} else if (_local5 > chk.ad_timeout) {
_local3 = true;
}
}
if (_local5 > chk.ad_msec) {
_local3 = true;
}
if (((_local4 > 0) && (_local8 >= _local4)) && (_local3)) {
if (this.server_control) {
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = chk.fadeFunction;
}
}
};
}
static function showInterLevelAd(options) {
var _local13 = {clip:_root, ad_timeout:2000, fadeout_time:250, regpt:"o", method:"showTimedAd", ad_started:function () {
this.clip.stop();
}, ad_finished:function () {
this.clip.play();
}};
options = _parseOptions(options, _local13);
var clip = options.clip;
var _local10 = 11000;
var _local12 = options.ad_timeout;
delete options.ad_timeout;
var fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!load(options)) {
options.ad_finished();
return(undefined);
}
options.ad_started();
var mc = clip._mochiad;
mc.onUnload = function () {
options.ad_finished();
};
var _local5 = _getRes(options);
var _local14 = _local5[0];
var _local11 = _local5[1];
mc._x = _local14 * 0.5;
mc._y = _local11 * 0.5;
var chk = mc.createEmptyMovieClip("_mochiad_wait", 3);
chk.ad_msec = _local10;
chk.ad_timeout = _local12;
chk.started = getTimer();
chk.showing = false;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function () {
var _local2 = 100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time));
if (_local2 > 0) {
this._parent._alpha = _local2;
} else {
var _local3 = this._parent._parent;
MochiAd.unload(_local3);
delete this.onEnterFrame;
}
};
mc.lc.adLoaded = function (width, height) {
};
mc.lc.adjustProgress = function (msec) {
var _local2 = this.mc._mochiad_wait;
_local2.server_control = true;
_local2.started = getTimer();
_local2.ad_msec = msec - 250;
};
chk.onEnterFrame = function () {
var _local5 = this._parent._mochiad_ctr;
var _local4 = getTimer() - this.started;
var _local2 = false;
if (!chk.showing) {
var _local3 = _local5.getBytesTotal();
if ((_local3 > 0) || (typeof(_local3) == "undefined")) {
chk.showing = true;
chk.started = getTimer();
} else if (_local4 > chk.ad_timeout) {
_local2 = true;
}
}
if (_local4 > chk.ad_msec) {
_local2 = true;
}
if (_local2) {
if (this.server_control) {
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = this.fadeFunction;
}
}
};
}
static function showTimedAd(options) {
showInterLevelAd(options);
}
static function showPreloaderAd(options) {
showPreGameAd(options);
}
static function _allowDomains(server) {
var _local1 = server.split("/")[2].split(":")[0];
if (System.security) {
if (System.security.allowDomain) {
System.security.allowDomain("*");
System.security.allowDomain(_local1);
}
if (System.security.allowInsecureDomain) {
System.security.allowInsecureDomain("*");
System.security.allowInsecureDomain(_local1);
}
}
return(_local1);
}
static function _loadCommunicator(options) {
var _local26 = {clip:_root, com_server:"http://x.mochiads.com/com/1/", method:"loadCommunicator", depth:10337, id:"_UNKNOWN_"};
options = _parseOptions(options, _local26);
options.swfv = options.clip.getSWFVersion() || 6;
options.mav = getVersion();
var _local18 = options.clip;
var _local20 = "_mochiad_com_" + options.id;
if (!_isNetworkAvailable()) {
return(null);
}
if (_local18[_local20]) {
return(_local18[_local20].lc);
}
var _local21 = options.com_server + options.id;
_allowDomains(_local21);
delete options.id;
delete options.com_server;
var _local25 = options.depth;
delete options.depth;
var _local17 = _local18.createEmptyMovieClip(_local20, _local25);
var _local11 = _local17.createEmptyMovieClip("_mochiad_com", 1);
for (var _local15 in options) {
_local11[_local15] = options[_local15];
}
var _local6 = new LocalConnection();
var _local16 = ["", Math.floor(new Date().getTime()), random(999999)].join("_");
_local6.mc = _local17;
_local6.name = _local16;
_local6.allowDomain = function (d) {
return(true);
};
_local6.allowInsecureDomain = _local6.allowDomain;
_local6.connect(_local16);
_local17.lc = _local6;
_local11.lc = _local16;
_local6._id = 0;
_local6._queue = [];
_local6.rpcResult = function (cb_arg) {
var _local8 = parseInt(cb_arg);
var _local4 = this._callbacks[_local8];
if (!_local4) {
return(undefined);
}
delete this._callbacks[_local8];
var _local5 = [];
var _local3 = 2;
while (_local3 < _local4.length) {
_local5.push(_local4[_local3]);
_local3++;
}
_local3 = 1;
while (_local3 < arguments.length) {
_local5.push(arguments[_local3]);
_local3++;
}
var _local6 = _local4[1];
var _local7 = _local4[0];
if (_local7 && (typeof(_local6) == "string")) {
_local6 = _local7[_local6];
}
if (_local6) {
_local6.apply(_local7, _local5);
}
};
_local6._didConnect = function (endpoint) {
this._endpoint = endpoint;
var _local4 = this._queue;
delete this._queue;
var _local5 = this.doSend;
var _local2 = 0;
while (_local2 < _local4.length) {
var _local3 = _local4[_local2];
_local5.apply(this, _local3);
_local2++;
}
};
_local6.doSend = function (args, cbobj, cbfn) {
if (this._endpoint == null) {
var _local4 = [];
var _local3 = 0;
while (_local3 < arguments.length) {
_local4.push(arguments[_local3]);
_local3++;
}
this._queue.push(_local4);
return(undefined);
}
this._id = this._id + 1;
var _local5 = this._id;
if ((cbfn === undefined) || (cbfn === null)) {
cbfn = cbobj;
}
this._callbacks[_local5] = [cbobj, cbfn];
var _local7 = new LocalConnection();
var _local9 = _local7.send(this._endpoint, "rpc", _local5, args);
};
_local6._callbacks = {};
_local6._callbacks[0] = [_local6, "_didConnect"];
_local11.st = getTimer();
_local11.loadMovie(_local21 + ".swf", "POST");
return(_local6);
}
static function fetchHighScores(options, callbackObj, callbackMethod) {
var _local1 = _loadCommunicator({id:options.id});
if (!_local1) {
return(false);
}
var _local4 = ["fetchHighScores", options];
_local1.doSend(["fetchHighScores", options], callbackObj, callbackMethod);
return(true);
}
static function sendHighScore(options, callbackObj, callbackMethod) {
var _local1 = _loadCommunicator({id:options.id});
if (!_local1) {
return(false);
}
var _local4 = ["sendHighScore", options];
_local1.doSend(["sendHighScore", options], callbackObj, callbackMethod);
return(true);
}
static function load(options) {
var _local13 = {clip:_root, server:"http://x.mochiads.com/srv/1/", method:"load", depth:10333, id:"_UNKNOWN_"};
options = _parseOptions(options, _local13);
options.swfv = options.clip.getSWFVersion() || 6;
options.mav = getVersion();
var _local9 = options.clip;
if (!_isNetworkAvailable()) {
return(null);
}
if (_local9._mochiad_loaded) {
return(null);
}
var _local12 = options.depth;
delete options.depth;
var _local6 = _local9.createEmptyMovieClip("_mochiad", _local12);
var _local11 = _getRes(options);
options.res = (_local11[0] + "x") + _local11[1];
options.server = options.server + options.id;
delete options.id;
_local9._mochiad_loaded = true;
var _local4 = _local6.createEmptyMovieClip("_mochiad_ctr", 1);
for (var _local7 in options) {
_local4[_local7] = options[_local7];
}
var _local10 = _local4.server;
delete _local4.server;
var _local14 = _allowDomains(_local10);
_local6.onEnterFrame = function () {
if (this._mochiad_ctr._url != this._url) {
this.onEnterFrame = function () {
if (!this._mochiad_ctr) {
delete this.onEnterFrame;
MochiAd.unload(this._parent);
}
};
}
};
var _local5 = new LocalConnection();
var _local8 = ["", Math.floor(new Date().getTime()), random(999999)].join("_");
_local5.mc = _local6;
_local5.name = _local8;
_local5.hostname = _local14;
_local5.allowDomain = function (d) {
return(true);
};
_local5.allowInsecureDomain = _local5.allowDomain;
_local5.connect(_local8);
_local6.lc = _local5;
_local4.lc = _local8;
_local4.st = getTimer();
_local4.loadMovie(_local10 + ".swf", "POST");
return(_local6);
}
static function unload(clip) {
if (typeof(clip) == "undefined") {
clip = _root;
}
if (clip.clip && (clip.clip._mochiad)) {
clip = clip.clip;
}
if (!clip._mochiad) {
return(false);
}
clip._mochiad.removeMovieClip();
delete clip._mochiad_loaded;
delete clip._mochiad;
return(true);
}
static function _isNetworkAvailable() {
if (System.security) {
var _local1 = System.security;
if (_local1.sandboxType == "localWithFile") {
return(false);
}
}
return(true);
}
static function _getRes(options) {
var _local3 = options.clip.getBounds();
var _local2 = 0;
var _local1 = 0;
if (typeof(options.res) != "undefined") {
var _local4 = options.res.split("x");
_local2 = parseFloat(_local4[0]);
_local1 = parseFloat(_local4[1]);
} else {
_local2 = _local3.xMax - _local3.xMin;
_local1 = _local3.yMax - _local3.yMin;
}
if ((_local2 == 0) || (_local1 == 0)) {
_local2 = Stage.width;
_local1 = Stage.height;
}
return([_local2, _local1]);
}
static function _parseOptions(options, defaults) {
var _local4 = {};
for (var _local8 in defaults) {
_local4[_local8] = defaults[_local8];
}
if (options) {
for (var _local8 in options) {
_local4[_local8] = options[_local8];
}
}
if (_root.mochiad_options) {
var _local5 = _root.mochiad_options.split("&");
var _local2 = 0;
while (_local2 < _local5.length) {
var _local3 = _local5[_local2].split("=");
_local4[unescape(_local3[0])] = unescape(_local3[1]);
_local2++;
}
}
return(_local4);
}
}
Symbol 200 MovieClip [__Packages.Ball] Frame 0
class Ball extends MovieClip
{
var bid, parent_mc, xmov, ymov, tempx, _x, tempy, _y, radius, _width, mass, reference;
function Ball () {
super();
}
function init(bid, parent_mc) {
this.bid = bid;
this.parent_mc = parent_mc;
xmov = random(10) - 5;
ymov = random(10) - 5;
tempx = _x;
tempy = _y;
radius = _width / 2;
mass = radius;
reference = "ball_" + (_root.ballCounter - 1);
checkForWalls();
checkSpawn();
return(this);
}
function activateBall() {
if (!ballactive) {
_root.ttlBActivated++;
if (_root.fly) {
_root.ttlBActivatedFly++;
_root[reference].ball_inneractiv.gotoAndPlay(2);
} else if (_root.slow) {
_root.ttlBActivatedSlow++;
} else {
_root[reference].ball_inneractiv.gotoAndPlay(2);
_root.ttlBActvatedSlow = 0;
_root.ttlBActvatedFly = 0;
}
_root.litBalls++;
ballactive = true;
_root[reference].ball_activ.gotoAndStop(2);
_root.sound.attachSound("ballsfx");
_root.sound.start();
_root.checkTotalActive();
}
}
function deactivateBall() {
ballactive = false;
_root[reference].ball_activ.gotoAndStop(1);
_root[reference].ball_inneractiv.gotoAndStop(1);
}
function speedUp() {
xmov = xmov * 1.1;
ymov = ymov * 1.1;
_root.setTotalMov();
}
function slowDown() {
xmov = xmov * 0.9;
ymov = ymov * 0.9;
_root.setTotalMov();
}
function moveMe() {
tempx = _x;
tempy = _y;
tempx = tempx + xmov;
tempy = tempy + ymov;
checkForWalls();
checkForBalls();
}
function renderMe() {
_x = tempx;
_y = tempy;
}
function checkForWalls() {
if ((tempy - radius) < 0) {
tempy = radius;
ymov = ymov * -1;
} else if ((tempy + radius) > (Stage.height - 40)) {
tempy = (Stage.height - 40) - radius;
ymov = ymov * -1;
}
if ((tempx - radius) < 0) {
tempx = radius;
xmov = xmov * -1;
} else if ((tempx + radius) > Stage.width) {
tempx = Stage.width - radius;
xmov = xmov * -1;
}
}
function checkForBalls() {
var _local4 = _root.allBalls;
var _local3 = 0;
while (_local3 < _local4.length) {
if (_local4[_local3].bid > bid) {
var _local6 = _local4[_local3].tempx - tempx;
var _local5 = _local4[_local3].tempy - tempy;
var _local7 = msqrt((_local6 * _local6) + (_local5 * _local5));
if (_local7 <= (radius + _local4[_local3].radius)) {
ballBallReaction(this, _local4[_local3], _local7, _local6, _local5);
}
}
_local3++;
}
}
function checkSpawn() {
var _local4 = _root.allBalls;
var _local3 = 0;
while (_local3 < _local4.length) {
if (_local4[_local3].bid > bid) {
var _local6 = _local4[_local3].tempx - tempx;
var _local5 = _local4[_local3].tempy - tempy;
var _local7 = msqrt((_local6 * _local6) + (_local5 * _local5));
if (_local7 <= (radius + _local4[_local3].radius)) {
_x = mran(Stage.width);
_y = mran(Stage.height);
checkSpawn();
}
}
_local3++;
}
}
function ballBallReaction(b1, b2, dist, xdiff, ydiff) {
var _local13 = mtan(ydiff, xdiff);
var _local5 = mcos(_local13);
var _local3 = msin(_local13);
var _local6 = (_local5 * b1.xmov) + (_local3 * b1.ymov);
var _local10 = (_local5 * b1.ymov) - (_local3 * b1.xmov);
var _local7 = (_local5 * b2.xmov) + (_local3 * b2.ymov);
var _local9 = (_local5 * b2.ymov) - (_local3 * b2.xmov);
var _local15 = (_local6 * b1.mass) + (_local7 * b2.mass);
var _local14 = _local6 - _local7;
_local6 = (_local15 - (b2.mass * _local14)) / (b1.mass + b2.mass);
_local7 = _local14 + _local6;
b1.xmov = (_local5 * _local6) - (_local3 * _local10);
b1.ymov = (_local5 * _local10) + (_local3 * _local6);
b2.xmov = (_local5 * _local7) - (_local3 * _local9);
b2.ymov = (_local5 * _local9) + (_local3 * _local7);
var _local11 = ((b1.radius + b2.radius) - dist) / 2;
var _local12 = _local5 * _local11;
var _local8 = _local3 * _local11;
b1.tempx = b1.tempx - _local12;
b1.tempy = b1.tempy - _local8;
b2.tempx = b2.tempx + _local12;
b2.tempy = b2.tempy + _local8;
}
function toString() {
return("[Ball]");
}
var ballactive = false;
var msqrt = Math.sqrt;
var msin = Math.sin;
var mcos = Math.cos;
var mtan = Math.atan2;
var mran = Math.random;
}
Symbol 201 MovieClip [__Packages.SlowMo] Frame 0
class SlowMo extends Ball
{
var tempx, _x, tempy, _y, xmov, ymov, checkForWalls, checkForBalls, radius;
function SlowMo () {
super();
}
function moveMe() {
tempx = _x;
tempy = _y;
tempx = tempx + xmov;
tempy = tempy + ymov;
checkForPlayer();
checkForWalls();
checkForBalls();
}
function checkForPlayer() {
var _local4 = _root.player_0.tempx - tempx;
var _local3 = _root.player_0.tempy - tempy;
var _local5 = msqrt((_local4 * _local4) + (_local3 * _local3));
if (_local5 <= (radius + _root.player_0.radius)) {
_root.slowmo = true;
_root.pupactive = false;
_root.ballCounter--;
if (!_root.mute) {
_root.sound.setVolume(40);
}
_root["ball_" + _root.ballCounter].gotoAndStop(2).slowMo_hit.play();
_root.allBalls.pop();
_root.slowtimer = 0;
if (_root.player_0.hookball == ("ball_" + _root.ballCounter)) {
_root.shooting = false;
_root.player_0.resetSpring();
_root.player_0.mass = _root.player_0.radius;
_root.player_0.varset = true;
_root.player_0.hit = false;
_root.targets._visible = false;
}
}
}
var msqrt = Math.sqrt;
}
Symbol 202 MovieClip [__Packages.Health] Frame 0
class Health extends Ball
{
var tempx, _x, tempy, _y, xmov, ymov, checkForWalls, checkForBalls, radius;
function Health () {
super();
}
function moveMe() {
tempx = _x;
tempy = _y;
tempx = tempx + xmov;
tempy = tempy + ymov;
checkForPlayer();
checkForWalls();
checkForBalls();
}
function checkForPlayer() {
var _local4 = _root.player_0.tempx - tempx;
var _local3 = _root.player_0.tempy - tempy;
var _local5 = msqrt((_local4 * _local4) + (_local3 * _local3));
if (_local5 <= (radius + _root.player_0.radius)) {
_root.lives++;
_root.life_mc.play();
_root.pupactive = false;
_root.ballCounter--;
_root["ball_" + _root.ballCounter].gotoAndStop(2).health_hit.play();
_root.allBalls.pop();
_root.life_mc.life.text = "x" + _root.lives;
if (_root.player_0.hookball == ("ball_" + _root.ballCounter)) {
_root.shooting = false;
_root.player_0.resetSpring();
_root.player_0.mass = _root.player_0.radius;
_root.player_0.varset = true;
_root.player_0.hit = false;
_root.targets._visible = false;
}
}
}
var msqrt = Math.sqrt;
}
Symbol 203 MovieClip [__Packages.Fly] Frame 0
class Fly extends Ball
{
var tempx, _x, tempy, _y, xmov, ymov, checkForWalls, checkForBalls, radius;
function Fly () {
super();
}
function moveMe() {
tempx = _x;
tempy = _y;
tempx = tempx + xmov;
tempy = tempy + ymov;
checkForPlayer();
checkForWalls();
checkForBalls();
}
function checkForPlayer() {
var _local4 = _root.player_0.tempx - tempx;
var _local3 = _root.player_0.tempy - tempy;
var _local5 = msqrt((_local4 * _local4) + (_local3 * _local3));
if (_local5 <= (radius + _root.player_0.radius)) {
_root.fly = true;
_root.pupactive = false;
_root.ballCounter--;
_root.sound.attachSound("flysfx");
_root.sound.start();
_root["ball_" + _root.ballCounter].gotoAndStop(2).fly_hit.play();
_root.allBalls.pop();
_root.flytimer = 0;
if (_root.player_0.hookball == ("ball_" + (_root.ballCounter - 1))) {
_root.shooting = false;
_root.player_0.resetSpring();
_root.player_0.mass = _root.player_0.radius;
_root.player_0.varset = true;
_root.player_0.hit = false;
_root.targets._visible = false;
}
}
}
var msqrt = Math.sqrt;
}
Symbol 204 MovieClip [__Packages.Player] Frame 0
class Player extends Ball
{
var varset, hspeed, bid, parent_mc, xmov, ymov, tempx, _x, tempy, _y, radius, _width, mass, checkSpawn, ballBallReaction, getNextHighestDepth, vy, vx, len, dx, dy, hit, ry, rx, angle, angledeg, _rotation, hookball, x, y, xtarg, ytarg;
function Player () {
super();
varset = true;
hspeed = 15;
_root.createEmptyMovieClip("line_mc", 1000);
}
function init(bid, parent_mc) {
this.bid = bid;
this.parent_mc = parent_mc;
xmov = 0;
ymov = 0;
tempx = _x;
tempy = _y;
radius = _width / 2;
mass = radius;
checkForWalls();
checkSpawn();
return(this);
}
function checkForBalls() {
var _local4 = _root.allBalls;
if (_root.pupactive) {
var _local8 = _local4.length - 1;
} else {
var _local8 = _local4.length;
}
var _local3 = 0;
while (_local3 < _local8) {
if (_local4[_local3].bid > bid) {
var _local6 = _local4[_local3].tempx - tempx;
var _local5 = _local4[_local3].tempy - tempy;
var _local7 = msqrt((_local6 * _local6) + (_local5 * _local5));
if (_local7 <= (radius + _local4[_local3].radius)) {
ballBallReaction(_root.player_0, _local4[_local3], _local7, _local6, _local5);
_root.allBalls[_local3].activateBall();
}
}
_local3++;
}
}
function checkForWalls() {
if ((tempy - radius) < 0) {
tempy = radius;
ymov = ymov * -1;
if (!_root.recovering) {
_root.player_0.player_life.play();
_root.lives--;
if (_root.lives != -1) {
_root.life_mc.play();
}
_root.life_mc.life.text = "x" + _root.lives;
_root.recovering = true;
_root.healthtimer = 0;
_root.sound.attachSound("lifesfx");
_root.sound.start();
_root.attachMovie("hit_mc", "hit_mc", getNextHighestDepth());
}
} else if ((tempy + radius) > (Stage.height - 40)) {
tempy = (Stage.height - 40) - radius;
ymov = ymov * -1;
if (!_root.recovering) {
_root.player_0.player_life.play();
_root.lives--;
if (_root.lives != -1) {
_root.life_mc.play();
}
_root.life_mc.life.text = "x" + _root.lives;
_root.recovering = true;
_root.healthtimer = 0;
_root.sound.attachSound("lifesfx");
_root.sound.start();
_root.attachMovie("hit_mc", "hit_mc", getNextHighestDepth());
}
}
if ((tempx - radius) < 0) {
tempx = radius;
xmov = xmov * -1;
if (!_root.recovering) {
_root.player_0.player_life.gotoAndPlay(2);
_root.lives--;
_root.life_mc.play();
if (_root.lives != -1) {
_root.life_mc.life.text = "x" + _root.lives;
}
_root.recovering = true;
_root.healthtimer = 0;
_root.sound.attachSound("lifesfx");
_root.sound.start();
_root.attachMovie("hit_mc", "hit_mc", getNextHighestDepth());
}
} else if ((tempx + radius) > Stage.width) {
tempx = Stage.width - radius;
xmov = xmov * -1;
if (!_root.recovering) {
_root.player_0.player_life.play();
_root.lives--;
if (_root.lives != -1) {
_root.life_mc.play();
}
_root.life_mc.life.text = "x" + _root.lives;
_root.recovering = true;
_root.healthtimer = 0;
_root.sound.attachSound("lifesfx");
_root.sound.start();
_root.attachMovie("hit_mc", "hit_mc", getNextHighestDepth());
}
}
}
function setVars() {
if (varset) {
_root.targets._y = _y;
_root.targets._x = _x;
vy = _root._ymouse - _y;
vx = _root._xmouse - _x;
len = msqrt((vx * vx) + (vy * vy));
dx = vx / len;
dy = vy / len;
}
}
function shoot() {
if (!hit) {
setVars();
_root.targets._y = _root.targets._y + (dy * hspeed);
_root.targets._x = _root.targets._x + (dx * hspeed);
varset = false;
}
}
function rotatePlayer() {
ry = _root._ymouse - _y;
rx = _root._xmouse - _x;
angle = mtan(ry, rx);
angledeg = (angle * 180) / mpi;
if (rx >= 0) {
angle = angle + 180;
}
if (rx <= 0) {
if (ry >= 0) {
angle = angle + 360;
}
}
_rotation = angledeg;
}
function hookOnBallCollision() {
if (hit) {
_root.targets._x = _root.targets._x + (_root[hookball].tempx - _root[hookball]._x);
_root.targets._y = _root.targets._y + (_root[hookball].tempy - _root[hookball]._y);
if (hookball != ("ball_" + (_root.ballCounter - 1))) {
spring(_root.targets._x, _root.targets._y, 0.95, 0.004);
} else {
spring(_root.targets._x, _root.targets._y, 0.95, 0.004);
if (_root.pupactive) {
spring(_root.targets._x, _root.targets._y, 0.85, 0.02);
}
}
} else {
var _local4 = 1;
while (_local4 < _root.allBalls.length) {
var _local3 = 0;
while (_local3 < (hspeed / 2)) {
x = _root.targets._x + (_local3 * dx);
y = _root.targets._y + (_local3 * dy);
if (_root.allBalls[_local4].hitTest(x, y, true)) {
_root.targets._x = x;
_root.targets._y = y;
hit = true;
mass = radius / 10;
spring(_root.targets._x, _root.targets._y, 0.95, 0.004);
hookball = "ball_" + _local4;
break;
}
mass = radius;
_local3++;
}
_local4++;
}
}
}
function drawSpring(targetx, targety) {
_root.line_mc.clear();
_root.line_mc.lineStyle(2, 111025);
_root.line_mc.moveTo(_x, _y);
_root.line_mc.lineTo(targetx, targety);
}
function resetSpring() {
_root.line_mc.clear();
_root.targets._x = _x;
_root.targets._y = _y;
}
function spring(targetx, targety, inertia, k) {
xtarg = (-_x) + targetx;
ytarg = (-_y) + targety;
xmov = (xmov * inertia) + (xtarg * k);
ymov = (ymov * inertia) + (ytarg * k);
super.xmov = super.xmov + xmov;
super.ymov = super.ymov + ymov;
}
var msqrt = Math.sqrt;
var mpi = Math.PI;
var mtan = Math.atan2;
}
Symbol 105 Button
on (release) {
_root.attachMovie("inst_mc", "inst_mc", 1240);
}
Symbol 108 Button
on (release) {
getURL ("http://www.kongregate.com/?gamereferral=bounce");
}
Symbol 109 Button
on (release) {
play();
}
Symbol 111 Button
on (release) {
_root.lives = 5;
_root.level = -14;
_root.truelevel = _root.level;
_root.screenlevel = _root.level + 15;
_root.hscoredif = 0;
_root.attachMovie("ready_mc", "ready_mc", 9919);
}
Symbol 113 Button
on (release) {
_root.lives = 4;
_root.level = -6;
_root.truelevel = _root.level;
_root.screenlevel = _root.level + 7;
_root.hscoredif = 1;
_root.attachMovie("ready_mc", "ready_mc", 9919);
}
Symbol 115 Button
on (release) {
_root.lives = 3;
_root.level = 0;
_root.truelevel = _root.level;
_root.screenlevel = _root.level + 1;
_root.hscoredif = 2;
_root.attachMovie("ready_mc", "ready_mc", 9919);
}
Symbol 116 MovieClip Frame 1
stop();
Symbol 116 MovieClip Frame 92
stop();
Symbol 116 MovieClip Frame 110
stop();
Symbol 125 MovieClip Frame 1
stop();
if (_root.hscoredif != undefined) {
unloadMovie (this);
}
Symbol 125 MovieClip Frame 172
_root.mainmenu_mc.play();
unloadMovie (this);
Symbol 128 Button
on (release) {
getURL ("http://kongregate.com/", "_blank");
}
Symbol 155 MovieClip Frame 1
if (_root.hscoredif == undefined) {
this.play();
} else {
unloadMovie (this);
}
Symbol 155 MovieClip Frame 151
_root.vizaintro_mc.play();
unloadMovie (this);
Symbol 168 MovieClip Frame 1
stop();
Symbol 168 MovieClip Frame 2
this._visible = true;
Symbol 168 MovieClip Frame 32
_root.bholeactive = true;
Symbol 168 MovieClip Frame 245
_root.bhole._x = -100;
this._visible = false;
Symbol 176 MovieClip Frame 1
stop();
Symbol 178 MovieClip Frame 1
stop();
Symbol 182 MovieClip Frame 1
stop();
Symbol 182 MovieClip Frame 2
stop();
Symbol 191 Button
on (release) {
this.play();
}
Symbol 198 MovieClip Frame 35
stop();
Symbol 198 MovieClip Frame 55
_root.gotoAndStop(2);