Section 1
//collectGlow_33 (breakit3_fla.collectGlow_33)
package breakit3_fla {
import flash.display.*;
public dynamic class collectGlow_33 extends MovieClip {
public function collectGlow_33(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package breakit3_fla
Section 2
//laser_turrent_g_35 (breakit3_fla.laser_turrent_g_35)
package breakit3_fla {
import flash.display.*;
public dynamic class laser_turrent_g_35 extends MovieClip {
public function laser_turrent_g_35(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package breakit3_fla
Section 3
//levelNumIndicator_22 (breakit3_fla.levelNumIndicator_22)
package breakit3_fla {
import flash.display.*;
import flash.text.*;
public dynamic class levelNumIndicator_22 extends MovieClip {
public var levelTextBox:TextField;
}
}//package breakit3_fla
Section 4
//MainTimeline (breakit3_fla.MainTimeline)
package breakit3_fla {
import flash.display.*;
public dynamic class MainTimeline extends MovieClip {
public var preloaderClip:preloader;
public function MainTimeline(){
addFrameScript(0, frame1, 3,
);
}
function frame1(){
MochiAd.showPreGameAd({clip:root, id:"734089a6d0175c9d", res:"640x480"});
}
function
(){
stop();
}
}
}//package breakit3_fla
Section 5
//mikeBarryClip_27 (breakit3_fla.mikeBarryClip_27)
package breakit3_fla {
import flash.display.*;
public dynamic class mikeBarryClip_27 extends MovieClip {
public function mikeBarryClip_27(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package breakit3_fla
Section 6
//play_clip_9 (breakit3_fla.play_clip_9)
package breakit3_fla {
import flash.display.*;
public dynamic class play_clip_9 extends MovieClip {
public function play_clip_9(){
addFrameScript(22,
);
}
function
(){
stop();
}
}
}//package breakit3_fla
Section 7
//pressSpaceMsg_18 (breakit3_fla.pressSpaceMsg_18)
package breakit3_fla {
import flash.display.*;
import flash.text.*;
public dynamic class pressSpaceMsg_18 extends MovieClip {
public var yourHighestTextBox:TextField;
}
}//package breakit3_fla
Section 8
//splitcollectGlow_34 (breakit3_fla.splitcollectGlow_34)
package breakit3_fla {
import flash.display.*;
public dynamic class splitcollectGlow_34 extends MovieClip {
public function splitcollectGlow_34(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package breakit3_fla
Section 9
//storageClip_4 (breakit3_fla.storageClip_4)
package breakit3_fla {
import flash.display.*;
public dynamic class storageClip_4 extends MovieClip {
public function storageClip_4(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package breakit3_fla
Section 10
//Quadratic (fl.motion.easing.Quadratic)
package fl.motion.easing {
public class Quadratic {
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
return ((((-(_arg3) * _arg1) * (_arg1 - 2)) + _arg2));
}
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
return ((((_arg3 * _arg1) * _arg1) + _arg2));
}
public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return (((((_arg3 / 2) * _arg1) * _arg1) + _arg2));
};
--_arg1;
return ((((-(_arg3) / 2) * ((_arg1 * (_arg1 - 2)) - 1)) + _arg2));
}
}
}//package fl.motion.easing
Section 11
//ballClass (terrypaton.ballClass)
package terrypaton {
import flash.display.*;
import flash.events.*;
public class ballClass extends Sprite {
public var crazyball:Boolean;
public var flame:Boolean;
public var stickOffset:int;
public var lastBrickHit:Sprite;
public var clip:Sprite;
public var by:Number;
public var bx:Number;
public var speed:Number;
public var stickyBat:Boolean;
private var
:Number;
public var xVal:Number;
public var defaultSpeed:int;
public var hitBricksInRow:int;
public var
:Boolean;
public var isBallStuck:Boolean;
public var rot:Number;
public var yVal:Number;
private var
:Number;
public static const ballPastShield:String = "ball past shield";
public static const ballLost:String = "ball lost";
public static const wallSound:String = "hit wall";
public function ballClass(_arg1:int, _arg2:int, _arg3:Number, _arg4:Sprite, _arg5:Number, _arg6:Number){
xVal = _arg1;
yVal = _arg2;
clip = _arg4;
defaultSpeed = _arg5;
speed = _arg6;
rot = _arg3;
= false;
stickyBat = false;
isBallStuck = false;
stickOffset = 0;
hitBricksInRow = 0;
= (Math.PI / 180);
();
trace("ball created");
}
private function ():void{
= (rot *
);
bx = (speed * Math.cos(
));
by = (speed * Math.sin(
));
}
public function hitBat(_arg1:Number){
if (_arg1 < 0){
rot = (270 - (_arg1 * 2));
} else {
rot = (270 - (_arg1 * 2));
};
();
}
public function updateBallPosition(){
if (crazyball){
rot = (rot + ((Math.random() * 16) - 8));
};
();
xVal = (xVal + bx);
yVal = (yVal + by);
if (yVal < (25 + 7)){
yVal = (25 + 7);
deflectBall("top", false);
dispatchEvent(new Event(ballClass.wallSound));
} else {
if (xVal > ((640 - 25) - 7)){
xVal = ((640 - 25) - 7);
deflectBall("right", false);
dispatchEvent(new Event(ballClass.wallSound));
} else {
if (xVal < (25 + 7)){
xVal = (25 + 7);
deflectBall("left", false);
dispatchEvent(new Event(ballClass.wallSound));
};
};
};
if (rot > 360){
rot = (rot - 360);
();
} else {
if (rot < 0){
rot = (rot + 360);
();
} else {
if ((((rot < 4)) || ((rot > 354)))){
rot = (rot + 5);
();
} else {
if ((((rot < 185)) && ((rot > 175)))){
rot = (rot - 5);
();
};
};
};
};
}
public function deflectBall(_arg1:String, _arg2:Boolean){
if (((!(flame)) || (!(_arg2)))){
switch (_arg1){
case "top":
if (rot > 270){
rot = (360 - rot);
} else {
rot = (180 - Math.abs((180 - rot)));
};
break;
case "bottom":
if (rot < 90){
rot = (360 - rot);
} else {
rot = (180 + Math.abs((180 - rot)));
};
break;
case "left":
if (rot > 180){
rot = (180 + Math.abs((360 - rot)));
} else {
rot = (180 - rot);
};
break;
case "right":
if (rot > 270){
rot = (180 + Math.abs((360 - rot)));
} else {
rot = (180 - rot);
};
break;
case "top left":
if (rot > 270){
rot = (360 - rot);
} else {
rot = (180 - Math.abs((180 - rot)));
};
break;
case "top right":
if (rot > 270){
rot = (180 + Math.abs((360 - rot)));
} else {
rot = (180 - rot);
};
break;
case "bottom left":
if (rot < 90){
rot = (360 - rot);
} else {
rot = (180 + Math.abs((180 - rot)));
};
break;
case "bottom right":
if (rot < 90){
rot = (360 - rot);
} else {
rot = (180 + Math.abs((180 - rot)));
};
break;
};
};
();
}
}
}//package terrypaton
Section 12
//batClass (terrypaton.batClass)
package terrypaton {
import flash.display.*;
public class batClass {
public var :Number;
public var speed:Number;
public var xVal:Number;
public var clip:Sprite;
public var rot:Number;
public var bx:Number;
public var by:Number;
public var yVal:Number;
public var
:Number;
public var :Number;
public function
(){
}
trace("ball created");
}
}//package terrypaton
Section 13
//brickClass (terrypaton.brickClass)
package terrypaton {
import flash.display.*;
public class brickClass {
public var high:int;
public var :int;
public var clip:Sprite;
public var wide:int;
public var removed:Boolean;
public var x:int;
public var y:int;
public var brickType:int;
public var health:int;
public function brickClass(_arg1:int, _arg2:int, _arg3:Sprite, _arg4:int, _arg5:int, _arg6:int, _arg7:int){
clip = _arg3;
x = _arg1;
y = _arg2;
health = _arg5;
brickType = _arg4;
removed = false;
wide = _arg6;
high = _arg7;
}
}
}//package terrypaton
Section 14
//fallingPoint (terrypaton.fallingPoint)
package terrypaton {
import flash.display.*;
public class fallingPoint {
public var clip:Sprite;
public var alive:Boolean;
public var pointsValue:int;
private var bx:Number;
private var by:Number;
public var x:Number;
public var y:Number;
public var life:int;
public function fallingPoint(_arg1:int, _arg2:int, _arg3:Sprite, _arg4:int){
x = _arg1;
y = _arg2;
clip = _arg3;
pointsValue = _arg4;
alive = true;
life = 1;
by = 0.25;
}
public function moveit(){
y = (y + by);
by = (by * 1.05);
if (y > 480){
alive = false;
};
}
}
}//package terrypaton
Section 15
//flameParticleClass (terrypaton.flameParticleClass)
package terrypaton {
import flash.display.*;
public class flameParticleClass {
public var alive:Boolean;
public var clip:Sprite;
private var x:Number;
private var y:Number;
public var alpha:Number;
public function flameParticleClass(_arg1:int, _arg2:int, _arg3:Sprite){
x = _arg1;
y = _arg2;
alive = true;
clip = _arg3;
alpha = 1;
}
public function moveit(){
alpha = (alpha * 0.9);
if (alpha < 0.1){
alive = false;
};
}
}
}//package terrypaton
Section 16
//laserClass (terrypaton.laserClass)
package terrypaton {
import flash.display.*;
public class laserClass {
public var clip:Sprite;
public var alive:Boolean;
private var bx:Number;
private var by:Number;
public var x:Number;
public var y:Number;
public var life:int;
public function laserClass(_arg1:int, _arg2:int, _arg3:Sprite){
x = _arg1;
y = _arg2;
alive = true;
life = 1;
by = 0.5;
}
public function moveit(){
y = (y - by);
by = (by * 1.05);
if (y < 10){
alive = false;
};
}
}
}//package terrypaton
Section 17
//pointsClass (terrypaton.pointsClass)
package terrypaton {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
public class pointsClass extends Sprite {
private var
:Timer;
public var clip:Sprite;
private var by:int;
private var bx:int;
private var speed:int;
public var pointsValue:int;
private var
:Number;
public var xVal:int;
public var
:DisplayObject;
public var rot:int;
public var yVal:int;
public static const clipRef:String = "spark is finished";
public function pointsClass(){
trace("points created");
by = 1;
speed = 0.5;
= new Timer(15);
.addEventListener(TimerEvent.TIMER,
);
.start();
clip.x = xVal;
}
private function
(_arg1:TimerEvent):void{
if (yVal > 450){
dispatchEvent(new Event(pointsClass.clipRef));
.removeEventListener(TimerEvent.TIMER,
);
} else {
by = (by * 1.04);
yVal = (yVal + by);
clip.y = yVal;
};
}
}
}//package terrypaton
Section 18
//powerupClass (terrypaton.powerupClass)
package terrypaton {
import flash.display.*;
public class powerupClass {
public var clip:Sprite;
public var powerUpType:int;
public var alive:Boolean;
private var bx:Number;
private var by:Number;
public var x:Number;
public var y:Number;
public var life:int;
public function powerupClass(_arg1:int, _arg2:int, _arg3:Sprite, _arg4:int){
x = _arg1;
y = _arg2;
clip = _arg3;
powerUpType = _arg4;
alive = true;
by = 0.5;
}
public function moveit(){
y = (y + by);
by = (by * 1.05);
if (y > 480){
alive = false;
};
}
}
}//package terrypaton
Section 19
//shakeClass (terrypaton.shakeClass)
package terrypaton {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
public class shakeClass extends Sprite {
private var
:Number;
private var
:Number;
private var
:Timer;
private var :Number;
private var :Number;
private var :Number;
public var :Number;
public var :Number;
private var :Sprite;
private var :Number;
private var :Number;
public function shakeClass(){
= 1;
}
private function (_arg1:TimerEvent):void{
if (_arg1.type == "timerComplete"){
.x = ;
.y = ;
.removeEventListener(TimerEvent.TIMER, );
};
if (_arg1.type == "timer"){
.x = ( + (Math.random() *
));
.y = ( + (Math.random() *
));
= (
- 0.5);
};
}
public function startShake(_arg1:Sprite){
= _arg1;
= .x;
= .y;
= new Timer(15, 10);
.addEventListener(TimerEvent.TIMER, );
.addEventListener(TimerEvent.TIMER_COMPLETE, );
.start();
}
}
}//package terrypaton
Section 20
//shatteredBrickParticle (terrypaton.shatteredBrickParticle)
package terrypaton {
import flash.display.*;
public class shatteredBrickParticle {
public var clip:Sprite;
public var alive:Boolean;
private var bx:Number;
private var by:Number;
public var x:Number;
public var y:Number;
public var life:int;
public function shatteredBrickParticle(_arg1:int, _arg2:int, _arg3:Sprite, _arg4:int){
var _local5:int;
var _local6:Number;
super();
_local5 = ((_arg4 + (Math.random() * 90)) - 45);
_local6 = ((_local5 * Math.PI) / 180);
bx = (((Math.random() * 1) + 1) * Math.cos(_local6));
by = (((Math.random() * 1) + 1) * Math.sin(_local6));
x = _arg1;
y = _arg2;
alive = true;
life = 40;
}
public function moveit(){
x = (x + bx);
y = (y + by);
life--;
if (life < 1){
alive = false;
};
}
}
}//package terrypaton
Section 21
//Tween (terrypaton.Tween)
package terrypaton {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
public class Tween extends EventDispatcher {
private var :Function;
private var
:Object;
private var target:Object;
private var :Array;
private var :Object;
private var :Number;// = 0
private var :Number;
private var :Object;
private var :Boolean;// = false
private var :Boolean;// = false
private var complete:Boolean;// = false
private var :Number;
private static var frame:Sprite = new Sprite();
public function Tween(_arg1:Object, _arg2:Object, _arg3:Function=null, _arg4:Array=null, _arg5:Boolean=false){
= function (_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
};
= [24];
= false;
= 0;
complete = false;
= false;
super();
this.target = _arg1;
this. = _arg2;
if (_arg3 != null){
this. = _arg3;
};
if (_arg4 != null){
this. = _arg4;
};
this. = _arg5;
= new Object();
= new Object();
}
public function get pause():Boolean{
return ();
}
private function (_arg1:Event):void{
var _local2:String;
var _local3:Array;
= () ? (((getTimer() / 1000) - ) - ) : ( + 1);
complete = true;
for (_local2 in ) {
_local3 = new Array(, [_local2], ([_local2] - [_local2])).concat();
[_local2] = .apply(this, _local3);
complete = ( >= [0]);
};
if (complete){
for (_local2 in ) {
target[_local2] = [_local2];
};
Tween.frame.removeEventListener(Event.ENTER_FRAME, );
dispatchEvent(new Event(Event.COMPLETE));
} else {
for (_local2 in ) {
target[_local2] =
[_local2];
};
};
}
public function set pause(_arg1:Boolean):void{
if (((!(complete)) && (!(( == _arg1))))){
= _arg1;
if (){
Tween.frame.removeEventListener(Event.ENTER_FRAME, );
} else {
if (){
= (((getTimer() / 1000) - ) - );
};
Tween.frame.addEventListener(Event.ENTER_FRAME, );
};
};
}
public function start():void{
var _local1:String;
for (_local1 in ) {
if (target[_local1] == null){
[_local1] = 0;
} else {
if (!isNaN(target[_local1])){
[_local1] = target[_local1];
};
};
};
= 0;
= (getTimer() / 1000);
Tween.frame.addEventListener(Event.ENTER_FRAME, );
}
}
}//package terrypaton
Section 22
//awesomewav (awesomewav)
package {
import flash.media.*;
public dynamic class awesomewav extends Sound {
}
}//package
Section 23
//ballHitsSolidBrickSndwav (ballHitsSolidBrickSndwav)
package {
import flash.media.*;
public dynamic class ballHitsSolidBrickSndwav extends Sound {
}
}//package
Section 24
//ballHitWallSnd1 (ballHitWallSnd1)
package {
import flash.media.*;
public dynamic class ballHitWallSnd1 extends Sound {
}
}//package
Section 25
//ballHitWallSnd2 (ballHitWallSnd2)
package {
import flash.media.*;
public dynamic class ballHitWallSnd2 extends Sound {
}
}//package
Section 26
//ballHitWallSnd3 (ballHitWallSnd3)
package {
import flash.media.*;
public dynamic class ballHitWallSnd3 extends Sound {
}
}//package
Section 27
//ballHitWallSnd4 (ballHitWallSnd4)
package {
import flash.media.*;
public dynamic class ballHitWallSnd4 extends Sound {
}
}//package
Section 28
//ballLostSnd (ballLostSnd)
package {
import flash.media.*;
public dynamic class ballLostSnd extends Sound {
}
}//package
Section 29
//border (border)
package {
import flash.display.*;
public dynamic class border extends BitmapData {
public function border(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 30
//breakit3 (breakit3)
package {
import flash.display.*;
import flash.events.*;
import terrypaton.*;
import fl.motion.easing.*;
import flash.text.*;
import flash.media.*;
import flash.utils.*;
import flash.filters.*;
import flash.geom.*;
import flash.net.*;
import flash.system.*;
import flash.external.*;
public class breakit3 extends MovieClip {
private var :powerUpCollectedSndwav;
private var :Object;
private var
:int;
private var :int;
private var :player;
private var :BlurFilter;
private var :Boolean;
private var :powerhitwav;
private var :introScreen;
private var
:BitmapData;
private var :int;
private var :Array;
private var
:Sprite;
private var :levelCompletewav;
private var :int;
private var :Bitmap;
private var
:Object;
public var
:Sprite;
private var
:int;
private var
:forceShield;
private var
:int;
private var
:int;
private var
:TextField;
private var
:Shape;
public var
;
private var
:Array;
private var :insanewav;
private var :TextFormat;
private var :wildwav;
private var :MovieClip;
private var
:flameParticle;
private var :excellentwav;
private var
:int;
private var :int;
private var :hitForceWallSndwav;
private var :mouseDownSndwav;
private var :int;
private var :int;
private var :BitmapData;
private var :TextFormat;
private var :Sprite;
private var :MovieClip;
private var :int;
private var :Array;
private var :Number;
private var
:laserHitSolidBrickSndwav;
private var :border;
private var :Bitmap;
private var :hitbrick1Snd;
private var :Object;
private var :multihitwav;
private var :int;
private var :breakitwav;
private var :int;
private var :unbelievablewav;
private var :Array;
private var :Bitmap;
private var
:SoundChannel;
private var :int;
private var
:levelSelector;
private var :String;
private var :Sprite;
private var :DropShadowFilter;
private var :Object;
private var :ballHitsSolidBrickSndwav;
private var :String;
private var :pointsCollectedSnd;
private var :Sprite;
private var
:Number;
private var :gameOverwav;
private var :incrediblewav;
private var ballLost:ballLostSnd;
private var :Array;
private var :Object;
private var :Boolean;
private var :String;
private var :SoundChannel;
private var :BitmapData;
private var :Rectangle;
private var
:pauseGameBtn;
private var :Object;
private var :TextFormat;
private var :levelAnnounce;
private var :brickSmashSnd;
public var :Sprite;
private var :MovieClip;
private var :chooseYourLevelwav;
private var :gameOverScreen;
private var
:extraLifewav;
private var
:gameCompleteScreen;
private var :BlurFilter;
private var :BitmapData;
private var :awesomewav;
private var :TextField;
private var :Point;
private var :Object;
private var health:int;
private var :Tween;
private var :Boolean;
private var :Sprite;
private var
:Object;
private var :Bitmap;
private var :int;
private var scoreTextBox:TextField;
private var :SharedObject;
private var :hitbatsnd1Snd;
private var :hitbatsnd3Snd;
private var :Array;
private var :Boolean;
private var :Array;
public var :int;
private var :hitbatsnd2Snd;
private var
:congratulationswav;
private var :BitmapData;
private var
:BitmapData;
private var :gameCompletewav;
private var :String;
private var :Boolean;
public var :Sprite;
private var :hitPowerUpwav;
private var :Object;
private var laser:laserSnd;
private var :SoundChannel;
private var :Array;
private var :gamePausedwav;
private var
:int;
private var :Array;
private var
:Boolean;
private var :ballHitWallSnd1;
private var :ballHitWallSnd2;
private var :ballHitWallSnd3;
private var :ballHitWallSnd4;
private var :Number;
private var :Sprite;
private var :int;
private var :Bitmap;
private var :TextField;
private var :int;
private var
:madnesswav;
private var :Object;
private var
:MovieClip;
private var :Array;
private var :Array;
private var :laserHitsBrickSndwav;
private var :Array;
private var :MovieClip;
private var :MovieClip;
private var :pausedClip;
private var :MovieClip;
private var :Number;
private var :SoundChannel;
private var
:Number;
private var :BitmapFilter;
private var :TextFormat;
private var :Boolean;
private var :Number;
private var :mouseOverSndwav;
public var :Sprite;
private var :mikeBarrySndwav;
private var :Array;
private var :int;
private var :MovieClip;
private var
:Array;
public var :String;
private var :Array;
private var
:brilliantwav;
private var :logoScreen;
private var :SoundChannel;
private var
:Object;
private var
:int;
private var
:spriteSheet;
private var
:Sprite;
private var
:Sprite;
private var
:Object;
private var
:TextFormat;
public static var root:DisplayObject;
public static var stage:Stage;
public function breakit3(){
var _local1:Timer;
var _local2:*;
= this;
= new SoundChannel();
= new SoundChannel();
= new SoundChannel();
= new SoundChannel();
= new SoundChannel();
super();
= 1;
= new Array();
= false;
= "breakit3";
trace("starting breakit 3");
= 30;
= "init";
_local1 = new Timer(15);
_local1.addEventListener(TimerEvent.TIMER,
);
_local1.start();
_local2 = new Pixelyn();
= new TextFormat();
.color = 0xFFFF00;
.font = "Pixelyn";
.align = "center";
.size = 10;
= new TextField();
addChild(
);
.text = "HEELO";
}
private function (){
var _local1:int;
var _local2:Number;
var _local3:int;
var _local4:int;
var _local5:Sprite;
= 1;
= new MovieClip();
= new levelSelector();
.addChild(
);
addChild(
);
.levelNumIndicator.levelTextBox.text = .toString();
.unlockedAmountTextBox.text = (("YOU HAVE UNLOCKED " + .data.upToLevel.toString()) + " LEVELS");
.levelChooserMarker.x = 80;
.levelChooserMarker.y = 115;
.levelNumIndicator.x = (
.levelChooserMarker.x + 24);
.levelNumIndicator.y =
.levelChooserMarker.y;
if (.data.upToLevel < 100){
= new Array();
= new BitmapData(48, 32, false, 0);
_local1 = .data.upToLevel;
_local2 = 0.7;
= _local1;
while (
< 100) {
_local3 = Math.floor((
/ 10));
_local4 = (
- (_local3 * 10));
= new Bitmap();
_local5 = new Sprite();
_local5.x = ((_local4 * 48) + 80);
_local5.y = ((_local3 * 32) + 115);
_local5.alpha = _local2;
_local2 = (_local2 + 0.005);
if (_local2 > 0.95){
_local2 = 0.95;
};
_local5.addChild();
.push(_local5);
.addChild(_local5);
++;
};
};
}
private function (){
var _local1:int;
var _local2:*;
_local1 = .length;
while (_local1--) {
_local2 = [_local1];
_local2.moveit();
if (!_local2.alive){
.removeChild(_local2.clip);
delete [_local1];
.splice(_local1, 1);
} else {
_local2.clip.x = _local2.x;
_local2.clip.y = _local2.y;
_local2.clip.alpha = (_local2.life / 40);
};
};
}
private function
(_arg1:int, _arg2:int, _arg3:int){
var _local4:Sprite;
var _local5:int;
var _local6:int;
var _local7:int;
var _local8:int;
var _local9:int;
var _local10:*;
if (_arg3 == 21){
if ((Math.random() * 10) < 4){
_arg3 = (Math.floor((Math.random() * 4)) + 17);
} else {
_arg3 = (Math.floor((Math.random() * 7)) + 22);
};
};
_local4 = new Sprite();
_local5 = (_arg3 + 33);
_local6 = [_local5][0];
_local7 = [_local5][1];
_local8 = [_local5][2];
_local9 = [_local5][3];
= new BitmapData(_local8, _local9, true, 4294967295);
= new Bitmap();
= new Rectangle(_local6, _local7, _local8, _local9);
= new Point(0, 0);
.copyPixels(
, , );
_local4.addChild();
.addChild(_local4);
_local4.x = _arg1;
_local4.y = _arg2;
_local10 = new powerupClass((_arg1 - 20), _arg2, _local4, _arg3);
.push(_local10);
}
private function
(_arg1:int, _arg2:int, _arg3:int){
if ((((((_arg1 == 0xFF)) && ((_arg2 == 10)))) && ((_arg3 == 10)))){
return ("red");
};
if ((((((_arg1 == 0xFF)) && ((_arg2 == 149)))) && ((_arg3 == 10)))){
return ("orange");
};
if ((((((_arg1 == 0xFF)) && ((_arg2 == 230)))) && ((_arg3 == 10)))){
return ("yellow");
};
if ((((((_arg1 == 157)) && ((_arg2 == 0xFF)))) && ((_arg3 == 10)))){
return ("green");
};
if ((((((_arg1 == 10)) && ((_arg2 == 0xFF)))) && ((_arg3 == 210)))){
return ("turq");
};
if ((((((_arg1 == 10)) && ((_arg2 == 210)))) && ((_arg3 == 0xFF)))){
return ("light blue");
};
if ((((((_arg1 == 10)) && ((_arg2 == 83)))) && ((_arg3 == 0xFF)))){
return ("blue");
};
if ((((((_arg1 == 186)) && ((_arg2 == 10)))) && ((_arg3 == 0xFF)))){
return ("purple");
};
if ((((((_arg1 == 40)) && ((_arg2 == 40)))) && ((_arg3 == 40)))){
return ("black");
};
if ((((((_arg1 == 240)) && ((_arg2 == 240)))) && ((_arg3 == 240)))){
return ("brick0");
};
if ((((((_arg1 == 235)) && ((_arg2 == 235)))) && ((_arg3 == 235)))){
return ("brick1");
};
if ((((((_arg1 == 230)) && ((_arg2 == 230)))) && ((_arg3 == 230)))){
return ("brick2");
};
if ((((((_arg1 == 225)) && ((_arg2 == 225)))) && ((_arg3 == 240)))){
return ("brick3");
};
if ((((((_arg1 == 220)) && ((_arg2 == 220)))) && ((_arg3 == 220)))){
return ("brick4");
};
if ((((((_arg1 == 215)) && ((_arg2 == 215)))) && ((_arg3 == 215)))){
return ("brick5");
};
if ((((((_arg1 == 210)) && ((_arg2 == 210)))) && ((_arg3 == 210)))){
return ("brick6");
};
if ((((((_arg1 == 205)) && ((_arg2 == 205)))) && ((_arg3 == 205)))){
return ("brick7");
};
if ((((((_arg1 == 200)) && ((_arg2 == 200)))) && ((_arg3 == 200)))){
return ("brick8");
};
if ((((((_arg1 == 0)) && ((_arg2 == 0)))) && ((_arg3 == 0)))){
return ("special");
};
if ((((((_arg1 == 79)) && ((_arg2 == 67)))) && ((_arg3 == 0)))){
return ("special1");
};
if ((((((_arg1 == 82)) && ((_arg2 == 69)))) && ((_arg3 == 0)))){
return ("special2");
};
if ((((((_arg1 == 86)) && ((_arg2 == 72)))) && ((_arg3 == 0)))){
return ("special3");
};
if ((((((_arg1 == 90)) && ((_arg2 == 76)))) && ((_arg3 == 0)))){
return ("special4");
};
if ((((((_arg1 == 95)) && ((_arg2 == 80)))) && ((_arg3 == 0)))){
return ("special5");
};
if ((((((_arg1 == 101)) && ((_arg2 == 85)))) && ((_arg3 == 0)))){
return ("special6");
};
if ((((((_arg1 == 107)) && ((_arg2 == 90)))) && ((_arg3 == 0)))){
return ("special7");
};
if ((((((_arg1 == 113)) && ((_arg2 == 94)))) && ((_arg3 == 0)))){
return ("special8");
};
if ((((((_arg1 == 119)) && ((_arg2 == 100)))) && ((_arg3 == 0)))){
return ("special9");
};
if ((((((_arg1 == 125)) && ((_arg2 == 105)))) && ((_arg3 == 0)))){
return ("special10");
};
if ((((((_arg1 == 131)) && ((_arg2 == 110)))) && ((_arg3 == 0)))){
return ("special11");
};
if ((((((_arg1 == 137)) && ((_arg2 == 115)))) && ((_arg3 == 0)))){
return ("special12");
};
if ((((((_arg1 == 142)) && ((_arg2 == 119)))) && ((_arg3 == 0)))){
return ("special13");
};
if ((((((_arg1 == 147)) && ((_arg2 == 124)))) && ((_arg3 == 0)))){
return ("special14");
};
}
private function (_arg1:int, _arg2:int){
var _local3:Sprite;
var _local4:int;
var _local5:*;
var _local6:*;
_local3 = new Sprite();
_local4 = ((Math.floor((Math.random() * 3)) + 1) * 50);
_local3.x = (_arg1 - 20);
_local3.y = _arg2;
_local5 = new TextField();
_local5.text = _local4;
_local5.embedFonts = true;
_local5.setTextFormat();
_local5.antiAliasType = "advanced";
_local3.addChild(_local5);
.addChild(_local3);
_local6 = new fallingPoint((_arg1 - 20), _arg2, _local3, _local4);
.push(_local6);
}
private function (){
= new levelAnnounce();
= new Sprite();
.addChild();
.levelNumTextBox.text = .toString();
.levelNumTextBox.setTextFormat();
.x = 320;
.y = 240;
addChild();
}
private function (_arg1:int, _arg2:int, _arg3:int){
}
private function (){
var _local1:int;
var _local2:*;
var _local3:int;
var _local4:*;
var _local5:Sprite;
var _local6:int;
var _local7:int;
var _local8:int;
var _local9:int;
var _local10:int;
var _local11:int;
var _local12:Boolean;
var _local13:*;
var _local14:int;
var _local15:int;
var _local16:int;
var _local17:int;
_local1 = .length;
while (_local1--) {
_local2 = [_local1];
_local2.moveit();
if (!_local2.alive){
delete [_local1];
.splice(_local1, 1);
.removeChild(_local2.clip);
} else {
_local2.clip.y = _local2.y;
_local3 = .length;
while (_local3--) {
_local4 = [_local3];
_local5 = _local4.clip;
_local6 = _local4.x;
_local7 = (_local4.x + _local4.wide);
_local8 = _local4.y;
_local9 = (_local4.y + _local4.high);
_local10 = Math.abs((_local2.x - (_local6 + _local4.wide)));
if (_local10 < 100){
_local11 = Math.abs((_local2.y - (_local8 + _local4.high)));
if (_local11 < 100){
_local12 = _local5.hitTestObject(_local2.clip);
if (_local12){
("laser hits brick");
_local4.health--;
if (_local4.health < 1){
if ((((_local4.brickType > 16)) && ((_local4.brickType < 39)))){
(_local4.clip.x, _local4.clip.y, _local4.brickType);
} else {
if ((Math.random() * 10) < 5){
(_local4.clip.x, _local4.clip.y);
};
};
(100);
_local4.removed = true;
(_local4, 270);
("brick smashes");
.removeChild(_local4.clip);
delete [_local3];
.splice(_local3, 1);
} else {
("laser hits solid brick");
(10);
_local13 = (39 + _local4.health);
_local14 = [_local13][0];
_local15 = [_local13][1];
_local16 = [_local13][2];
_local17 = [_local13][3];
= new BitmapData(_local16, _local17, true, 4294967295);
= new Bitmap();
= new Rectangle(_local14, _local15, _local16, _local17);
= new Point(0, 0);
.copyPixels(
, , );
_local5.addChild();
(_local4);
(_local2.x, _local2.y, 90);
};
_local2.alive = false;
};
};
};
};
};
};
}
private function (_arg1:Object){
var _local2:*;
_local2 = new shakeClass();
_local2.startShake(_arg1.clip);
}
private function (){
var _local1:*;
var _local2:Boolean;
= .length;
while (
--) {
_local1 = [
];
if (!_local1.alive){
.removeChild(_local1.clip);
delete [
];
.splice(
, 1);
} else {
_local1.moveit();
_local1.clip.y = _local1.y;
if (_local1.y > 380){
_local2 = .clip.hitTestObject(_local1.clip);
if (_local2){
(_local1.pointsValue);
_local1.alive = false;
("points collected");
.collectGlow.gotoAndPlay(2);
};
};
};
};
}
private function (_arg1:Event){
if (_arg1.type == "hit wall"){
("ball hits wall");
};
if (_arg1.type == "ball lost"){
trace("player has lost a ball");
trace(_arg1.target);
};
}
public function
(_arg1:Object, _arg2:Sprite){
var _local3:Boolean;
_local3 = _arg1.clip.hitTestObject(_arg2);
return (_local3);
}
private function (){
var _local1:int;
var _local2:*;
var _local3:Boolean;
_local1 =
.length;
while (_local1--) {
_local2 =
[_local1];
_local2.moveit();
if (!_local2.alive){
.removeChild(_local2.clip);
delete
[_local1];
.splice(_local1, 1);
} else {
_local2.clip.y = _local2.y;
if (_local2.y > 380){
_local3 = .clip.hitTestObject(_local2.clip);
if (_local3){
(500);
("powerup collected");
.collectGlow.gotoAndPlay(2);
(_local2.powerUpType);
.removeChild(_local2.clip);
delete
[_local1];
.splice(_local1, 1);
};
};
};
};
}
private function (){
var _local1:int;
var _local2:*;
_local1 = .length;
while (_local1--) {
_local2 = [_local1];
_local2.moveit();
if (!_local2.alive){
.removeChild(_local2.clip);
delete [_local1];
.splice(_local1, 1);
} else {
_local2.clip.scaleY = (_local2.clip.scaleX = (_local2.clip.scaleX * 0.95));
_local2.clip.alpha = _local2.alpha;
};
};
}
private function (){
var _local1:uint;
var _local2:int;
var _local3:Rectangle;
var _local4:Shape;
var _local5:Sprite;
var _local6:Number;
var _local7:int;
var _local8:Number;
var _local9:int;
var _local10:int;
var _local11:int;
var _local12:int;
var _local13:TextFormat;
var _local14:Sprite;
var _local15:TextField;
trace();
= new Array("0x07452C", "0x333300", "0x330000", "0x660000", "0x000033", "0x000066", "0x333333", "0x541A01", "0x54012B", "0x003366", "0x2F422F", "0x533D0B", "0x2D2420", "0x4B0135", "0x4B2E3A", "0x2B2009", "0x002D1C", "0x540154", "0x320154", "0x000000");
= new Array(1771972, 84774, 9397249, 0xFF0000, 3355647, 11928291, 0x999999, 8421597, 6723891, 0xFFFF00, 0xFF00FF);
_local1 = [Math.floor(( / 5))];
_local2 = (Math.floor(( / 20)) + 1);
trace(("drawing up level background " + _local2));
_local3 = new Rectangle(0, 0, 640, 480);
.fillRect(_local3, _local1);
.graphics.beginFill(_local1);
.graphics.drawRect(0, 0, 640, 480);
.graphics.endFill();
_local4 = new Shape();
_local5 = new Sprite();
_local6 = (Math.random() * 300);
_local7 = 0;
while (_local7 < 30) {
_local8 = ((Math.random() * 0.03) + 0.02);
_local9 = (Math.random() * 640);
_local10 = (Math.random() * 480);
_local11 = (Math.random() * 480);
_local12 = (Math.random() * 100);
_local4 = new Shape();
_local4.graphics.lineStyle((Math.random() * 30), 0xFFFFFF, _local8);
if (_local2 == 1){
_local4.graphics.drawCircle((_local9 + _local6), ((100 + (Math.random() * 100)) - 50), (_local10 / 2));
};
if (_local2 == 2){
_local4.x = _local9;
_local4.y = ((100 + (Math.random() * 100)) - 50);
_local4.graphics.drawRect(((-(_local9) / 2) + _local6), (-(_local10) / 2), _local9, _local10);
_local4.rotation = (Math.random() * 45);
};
if (_local2 == 3){
_local4.graphics.drawEllipse(_local9, ((100 + (Math.random() * 100)) - 50), (_local9 / 2), (_local10 / 2));
};
if (_local2 == 4){
_local4.graphics.moveTo((_local9 + _local6), _local10);
_local4.graphics.curveTo((_local9 + _local6), _local11, (Math.random() * 640), (Math.random() * 480));
};
if (_local2 >= 5){
_local4.graphics.moveTo((_local9 + _local6), 480);
_local4.graphics.curveTo((_local9 + _local6), (-150 + _local11), (320 + (Math.random() * 320)), 480);
};
_local5.addChild(_local4);
_local7++;
};
.draw(_local5, null, null, "hardlight");
if ( == "setup level"){
_local13 = new TextFormat();
_local13.color = 0xFFFFFF;
_local13.font = "Pixelyn";
_local13.align = "right";
_local13.size = 200;
_local14 = new Sprite();
_local15 = new TextField();
_local15.text = .toString();
_local14.addChild(_local15);
_local15.x = 420;
_local15.alpha = 0.15;
_local15.y = 322;
_local15.height = 200;
_local15.width = 200;
_local15.embedFonts = true;
_local15.setTextFormat(_local13);
_local15.antiAliasType = "advanced";
.draw(_local14, null, null, "difference");
};
= new BlurFilter();
.blurX = 3;
.blurY = 3;
.quality = 3;
}
private function
(){
var _local1:int;
var _local2:int;
_local1 = numChildren;
_local2 = 0;
while (_local2 < _local1) {
removeChildAt(0);
_local2++;
};
}
private function (){
var _local1:Sprite;
var _local2:Number;
var _local3:int;
var _local4:int;
var _local5:*;
_local1 = new Sprite();
= new BitmapData(14, 14, true, 4294967295);
= new Bitmap();
.copyPixels(
, new Rectangle(0, 0, 14, 14), new Point(0, 0));
_local1.addChild();
.x = -(
);
.y = -(
);
addChild(_local1);
_local2 = ((Math.random() * 20) + 270);
_local3 = .clip.x;
_local4 = 380;
_local1.x = _local3;
_local1.y = _local4;
_local5 = new ballClass(_local3, _local4, _local2, _local1,
,
);
.push(_local5);
_local5.addEventListener(ballClass.wallSound, , false, 0, true);
}
private function (){
.x = mouseX;
.y = mouseY;
if (
.x < 10){
.x = 10;
};
if (
.x > 630){
.x = 630;
};
if (
.y < 10){
.y = 10;
};
if (
.y > 470){
.y = 470;
};
}
private function (_arg1:Object, _arg2:Number){
var _local3:Sprite;
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:int;
var _local8:int;
var _local9:int;
var _local10:int;
var _local11:BitmapData;
var _local12:Bitmap;
var _local13:Sprite;
var _local14:*;
_local3 = _arg1.clip;
_local4 = _arg1.clip.width;
_local5 = _arg1.clip.height;
_local6 = _arg1.clip.x;
_local7 = _arg1.clip.y;
= new BitmapData(_local4, _local5, true, 4294967295);
= new Bitmap();
.draw(_arg1.clip);
_local8 = (_local4 / 5);
_local9 = (_local5 / 4);
= 0;
while ( < (_local5 - 1)) {
_local10 = 0;
while (_local10 < _local4) {
_local11 = new BitmapData(_local8, _local9, true, 4294967295);
_local12 = new Bitmap(_local11);
_local13 = new Sprite();
_local11.copyPixels(, new Rectangle(_local10, , _local8, _local9), new Point(0, 0));
_local13.addChild(_local12);
_local14 = new shatteredBrickParticle((_local6 + _local10), (_local7 + ), _local13, _arg2);
.push(_local14);
_local14.clip = _local13;
_local13.x = ((_local6 + _local10) + Math.random());
_local13.y = (_local7 + );
.addChild(_local13);
_local10 = (_local10 + _local8);
};
= ( + _local9);
};
}
private function (_arg1:String){
trace(("**** tellPlayerString = " + _arg1));
.text = _arg1;
.x = 320;
.y = 300;
.embedFonts = true;
.setTextFormat();
.antiAliasType = "normal";
.scaleX = ( .scaleY = 1);
.x = -35;
.y = -12;
.scaleX = ( .scaleY = 5);
.alpha = 1;
= new Tween( , {scaleX:0.1, scaleY:0.1, alpha:0}, Quadratic.easeInOut, [1], true);
.addEventListener(Event.COMPLETE, , false, 0, true);
.start();
}
private function
(_arg1:int, _arg2:int){
var _local3:*;
var _local4:BitmapData;
var _local5:Sprite;
var _local6:Number;
var _local7:Number;
var _local8:*;
_local3 = new flameParticle(25, 25);
_local4 = _local3;
if ((Math.random() * 10) < 8){
_local5 = new Sprite();
_local6 = 1.6;
= new BitmapData(25, 25, true, 4294967295);
= new Bitmap();
_local7 = (Math.floor((Math.random() * 4)) * 25);
= new Rectangle(_local7, 0, 25, 25);
= new Point(0, 0);
.copyPixels(_local4, , );
_local5.addChild();
_local5.scaleX = (_local5.scaleY = _local6);
.addChild(_local5);
.x = -((.width / 2));
.y = -((.height / 2));
_local5.x = ((_arg1 + (Math.random() * 6)) - 3);
_local5.y = ((_arg2 + (Math.random() * 6)) - 3);
_local5.rotation = (Math.random() * 360);
_local8 = new flameParticleClass(_arg1, _arg2, _local5);
.push(_local8);
};
}
public function (_arg1:String){
trace(("the game is running from " + _arg1));
= _arg1;
}
private function (){
= new mouseDownSndwav();
= new mouseOverSndwav();
= new hitForceWallSndwav();
= new laserHitsBrickSndwav();
= new laserHitSolidBrickSndwav();
= new hitPowerUpwav();
= new powerUpCollectedSndwav();
= new ballHitsSolidBrickSndwav();
= new mikeBarrySndwav();
= new pointsCollectedSnd();
= new ballHitWallSnd1();
= new ballHitWallSnd2();
= new ballHitWallSnd3();
= new ballHitWallSnd4();
= new hitbatsnd2Snd();
= new hitbatsnd3Snd();
= new hitbatsnd1Snd();
= new brickSmashSnd();
laser = new laserSnd();
ballLost = new ballLostSnd();
= new hitbrick1Snd();
= new awesomewav();
= new gameOverwav();
= new levelCompletewav();
= new gamePausedwav();
= new chooseYourLevelwav();
= new extraLifewav();
= new wildwav();
= new insanewav();
= new unbelievablewav();
= new incrediblewav();
= new madnesswav();
= new brilliantwav();
= new excellentwav();
= new powerhitwav();
= new breakitwav();
= new multihitwav();
= new congratulationswav();
= new gameCompletewav();
}
private function (_arg1:int, _arg2:int){
var _local3:Sprite;
var _local4:Bitmap;
var _local5:*;
("fire laser");
_local3 = new Sprite();
_local4 = new Bitmap(
);
_local3.addChild(_local4);
.addChild(_local3);
_local3.x = (_arg1 - 20);
_local3.y = _arg2;
_local5 = new laserClass((_arg1 - 20), _arg2, _local3);
_local5.clip = _local3;
.push(_local5);
}
private function (_arg1:String){
switch (_arg1){
case "congratulations":
=
.play();
break;
case "mouse over":
= .play();
break;
case "mouse down":
= .play();
break;
case "mike barry":
= .play();
break;
case "force wall":
= .play();
break;
case "powerup deactivated":
break;
case "ball hits solid brick":
= .play();
break;
case "power up collected":
= .play();
break;
case "hit power up":
= .play();
break;
case "laser hits solid brick":
=
.play();
break;
case "laser hits brick":
= .play();
break;
case "ball hits force shield":
= .play();
break;
case "awesome":
= .play();
break;
case "extra life":
=
.play();
break;
case "choose level":
= .play();
break;
case "level complete":
= .play();
break;
case "break it":
= .play();
break;
case "game complete":
= .play();
break;
case "game over":
= .play();
break;
case "points collected":
= .play();
break;
case "ball hits bat":
switch (Math.floor((Math.random() * 3))){
case 0:
= .play();
break;
case 1:
= .play();
break;
case 2:
= .play();
break;
};
break;
case "brick smashes":
= .play();
break;
case "ball hits brick":
= .play();
break;
case "ball hits wall":
switch (Math.floor((Math.random() * 4))){
case 0:
= .play();
break;
case 1:
= .play();
break;
case 2:
= .play();
break;
case 3:
= .play();
break;
};
break;
case "ball lost":
= ballLost.play();
break;
case "flame":
= .play();
break;
case "crazy ball":
= .play();
break;
case "sticky bat":
= .play();
break;
case "speed":
= .play();
break;
case "slow":
= .play();
break;
case "shrink":
= .play();
break;
case "multiball":
= .play();
break;
case "laser":
= .play();
break;
case "expand":
= .play();
break;
case "split":
= .play();
break;
case "fire laser":
= laser.play();
break;
case "multihit":
= .play();
break;
case "powerhit":
= .play();
break;
case "excellent":
= .play();
break;
case "brilliant":
=
.play();
break;
case "wild":
= .play();
break;
case "madness":
=
.play();
break;
case "incredible":
= .play();
break;
case "unbelievable":
= .play();
break;
case "insane":
= .play();
break;
};
}
private function (_arg1:int){
= ( + _arg1);
scoreTextBox.text = .toString();
scoreTextBox.setTextFormat();
if ( > 100000){
if ([0] != 1){
[0] = 1;
();
};
};
if ( > 250000){
if ([1] != 1){
[1] = 1;
();
};
};
if ( > 500000){
if ([2] != 1){
[2] = 1;
();
};
};
if ( > 750000){
if ([3] != 1){
[3] = 1;
();
};
};
if ( > 1000000){
if ([4] != 1){
[4] = 1;
();
};
};
if ( > 1250000){
if ([5] != 1){
[5] = 1;
();
};
};
if ( > 1500000){
if ([6] != 1){
[6] = 1;
();
};
};
if ( > 1750000){
if ([6] != 1){
[6] = 1;
();
};
};
if ( > 2000000){
if ([7] != 1){
[7] = 1;
();
};
};
}
private function (_arg1:Event){
var _local2:*;
_local2 = _arg1.currentTarget;
.removeChild(_local2.clip);
_local2.removeEventListener(pointsClass.clipRef, , false, 0, true);
}
private function (){
var _local1:Sprite;
var _local2:Shape;
var _local3:Bitmap;
var _local4:TextField;
var _local5:TextField;
var _local6:*;
var _local7:Sprite;
= new Array();
= 8;
= false;
= new border(640, 480);
= new Bitmap();
_local1 = new Sprite();
addChild();
= new Sprite();
_local2 = new Shape();
_local2.graphics.lineStyle(3, 0xFFFFFF, 0.25);
_local2.graphics.drawCircle(0, 0, 10);
.addChild(_local2);
stage.addEventListener(KeyboardEvent.KEY_DOWN,
);
= 2;
= new Array();
= .concat([1, 0, 0, 0, 0]);
= .concat([0, 1, 0, 0, 0]);
= .concat([0, 0, 1, 0, 0]);
= .concat([0, 0, 0, 0.9, 0]);
= new ColorMatrixFilter( );
= new BitmapData(3, 3, true, 4294967040);
stage.quality = "medium";
= 0;
= new TextFormat();
.color = 0xFFFF00;
.font = "Pixelyn";
.align = "left";
.size = 10;
= new TextFormat();
.color = 0xFFFFFF;
.font = "Pixelyn";
.align = "left";
.size = 20;
= new TextFormat();
.color = 0xFFFF00;
.font = "Pixelyn";
.align = "center";
.size = 20;
= new TextFormat();
.color = 0xFFFFFF;
.font = "Pixelyn";
.align = "center";
.size = 20;
= new TextFormat();
.color = 0xFFFFFF;
.font = "Pixelyn";
.align = "center";
.size = 60;
= new spriteSheet(400, 400);
= new levelDataBitmap(240, 400);
_local3 = new Bitmap(
);
_local4 = new TextField();
_local4.text = "SCORE";
_local4.x = 38;
_local4.y = 458;
_local4.embedFonts = true;
_local4.setTextFormat();
_local4.antiAliasType = "advanced";
addChild(_local4);
_local5 = new TextField();
_local5.text = "LIVES";
_local5.x = 575;
_local5.y = 458;
_local5.embedFonts = true;
_local5.setTextFormat();
_local5.antiAliasType = "advanced";
addChild(_local5);
addChild();
= new batClass();
= new Sprite();
= new forceShield();
.addChild(
);
addChild();
.x = 320;
.y = 460;
.gotoAndStop("hidden");
= new player();
= new MovieClip();
.addChild();
addChild();
.clip = ;
.x = 320;
.y = 425;
= new DropShadowFilter();
.blurX = 15;
.blurY = 15;
.quality = 1;
.distance = 14;
.strength = 0.34;
.angle = 74;
.filters = [];
= new BlurFilter();
.blurX = 2;
.blurY = 2;
.quality = 1;
scoreTextBox = new TextField();
scoreTextBox.text = .toString();
scoreTextBox.x = 40;
scoreTextBox.y = 440;
scoreTextBox.embedFonts = true;
scoreTextBox.setTextFormat();
scoreTextBox.antiAliasType = "advanced";
addChild(scoreTextBox);
= new TextField();
.text = .toString();
.x = 580;
.y = 440;
.embedFonts = true;
.setTextFormat();
.antiAliasType = "advanced";
addChild();
_local6 = new flameParticle(25, 25);
= new border(640, 480);
= new Bitmap();
addChild();
= new Array();
= new Array();
data();
= new TextField();
= new Object();
= 0;
= 0;
= new Object();
= new Sprite();
= ;
addChild( );
= new Sprite();
addChild(
);
= new BitmapData(640, 310, true, 0xFFFFFF);
= new Bitmap();
= new Sprite();
.addChild( );
addChild();
= new BitmapData(25, 25, true, 4294967295);
= new Rectangle(50, 0, 25, 25);
= new Point(0, 0);
.copyPixels(
, , );
= 0;
= new Object();
.text = .toString();
.setTextFormat();
_local7 = new Sprite();
= new pauseGameBtn();
= new MovieClip();
.addChild(
);
_local7.x = 0;
_local7.y = 360;
_local7.addChild();
addChild(_local7);
.name = "pauseBtn";
= new Sprite();
.addChild();
addChild( );
addChild(
);
}
private function (_arg1:MouseEvent):void{
var n:int;
var event = _arg1;
if ( == "paused"){
if (event.target.name == "resumeGameBtn"){
("mouse down");
trace("RESUME THE GAME");
removeChild(
);
= "playing";
};
} else {
if ( == "choose level"){
if (event.target.name == "levelSelectorClip"){
("mouse down");
trace("level chosen");
removeChild(
);
();
= "setup level";
};
} else {
if ( == "intro screen wait"){
if (event.target.name == "playBtn"){
("mouse down");
removeChild();
= "new game setup";
};
} else {
if (((( == "wait on game over screen")) || (( == "wait on game complete screen")))){
if (event.target.name == "playBtn"){
("mouse down");
try {
removeChild();
removeChild( );
} catch(e:ArgumentError) {
};
= "new game setup";
};
} else {
if ( == "playing"){
if ((((event.target.name == "pauseBtn")) && (!(( == "paused"))))){
("mouse down");
trace("pause the game");
= ;
= "start pause";
} else {
if ((() || (( == "first shot")))){
n = .length;
= 0;
while ( < n) {
= [];
if (.isBallStuck){
.rot = (270 - ( * 2));
.speed =
;
.isBallStuck = false;
.yVal = (.yVal - 10);
};
++;
};
= "normal";
};
if (){
(.clip.x, (.clip.y - 25));
};
};
};
};
};
};
};
}
private function (_arg1:Event):void{
var _local2:Loader;
var _local3:*;
var _local4:String;
_local2 = Loader(_arg1.target.loader);
trace(("completeHandler: " + _arg1));
_local3 = _local2.content;
_local2.content.x = 50;
_local2.content.y = 332;
trace(("score = " + ));
_local4 = "breakit3";
_local3.setHighscoreDetails(_local4, );
}
private function (){
var _local1:String;
var _local2:Loader;
var _local3:URLRequest;
_local1 = "http://www.terrypaton.com/highscores/highscoreSubmit_as3.swf";
_local2 = new Loader();
_local2.contentLoaderInfo.addEventListener(Event.COMPLETE, );
_local3 = new URLRequest(_local1);
_local2.load(_local3);
addChild(_local2);
}
private function (){
var _local1:int;
if ( == "split"){
--;
if (
< 1){
= "normal";
.gotoAndPlay("normal");
("powerup deactivated");
};
};
if ( == "shrink"){
--;
if ( < 1){
= "normal";
.gotoAndPlay("normal");
("powerup deactivated");
};
};
_local1 = 0;
if (){
--;
if ( < 1){
= false;
= 0;
("powerup deactivated");
.gotoAndPlay("normal");
= "normal";
};
};
if (){
--;
if ( < 1){
= false;
("powerup deactivated");
.gotoAndPlay("normal");
= "normal";
_local1 = .length;
= 0;
while ( < _local1) {
= [];
if (.stickyBat){
.stickyBat = false;
.isBallStuck = false;
.speed = .defaultSpeed;
};
++;
};
};
};
if (){
if ( > 0){
--;
if ( < 1){
= false;
_local1 = .length;
= 0;
while ( < _local1) {
= [];
.speed = .defaultSpeed;
++;
};
};
} else {
("powerup deactivated");
};
};
if (
){
if ( > 0){
--;
if ( < 1){
= false;
_local1 = .length;
= 0;
while ( < _local1) {
= [];
.crazyball = false;
++;
};
};
} else {
.rot = (.rot + 25);
("powerup deactivated");
};
};
if (){
if (
> 0){
--;
if (
< 1){
= false;
_local1 = .length;
= 0;
while ( < _local1) {
= [];
.flame = false;
++;
};
};
} else {
("powerup deactivated");
};
};
}
function (){
}
private function (){
var _local1:Number;
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:int;
var _local6:BitmapData;
var _local7:Rectangle;
var _local8:ByteArray;
var _local9:Array;
var _local10:int;
var _local11:int;
var _local12:int;
var _local13:*;
var _local14:int;
var _local15:int;
var _local16:int;
var _local17:String;
var _local18:String;
var _local19:Number;
var _local20:Number;
var _local21:Sprite;
var _local22:int;
var _local23:int;
var _local24:int;
var _local25:int;
var _local26:int;
var _local27:int;
var _local28:brickClass;
if (.data.upToLevel < ){
trace("new personal best level!");
.data.upToLevel = ;
.flush();
};
();
= new Array();
= new Array();
= new Array();
= new Array();
= new Array();
= new Array();
trace(("BUILDING LEVEL " + ));
_local1 = Math.floor((( - 1) / 10));
_local2 = ((( - 1) - (_local1 * 10)) * 24);
_local3 = (_local1 * 16);
_local4 = 24;
_local5 = 16;
_local6 = new BitmapData(_local4, _local5, true, 4294967295);
= new Bitmap(_local6);
= new Rectangle(_local2, _local3, _local4, _local5);
= new Point(0, 0);
_local6.copyPixels(, , );
_local7 = new Rectangle(0, 0, _local6.width, _local6.height);
_local8 = _local6.getPixels(_local7);
_local9 = new Array();
_local10 = 0;
_local10 = _local8.length;
= 0;
= 0;
while (
< _local10) {
_local14 = Math.floor(((
/ 4) / 24));
_local15 = ((_local14 * 25) + 25);
_local16 = ((((
- ((_local14 * 24) * 4)) / 4) * 25) + 25);
_local17 =
(_local8[(
+ 1)], _local8[(
+ 2)], _local8[(
+ 3)]);
_local18 =
(_local8[((
+ 1) + 4)], _local8[((
+ 2) + 4)], _local8[((
+ 3) + 4)]);
if ((((_local17 == "red")) && ((_local18 == "red")))){
_local9.push([_local16, _local15, 1]);
= (
+ 4);
};
if ((((_local17 == "red")) && (!((_local18 == "red"))))){
_local9.push([_local16, _local15, 9]);
};
if ((((_local17 == "orange")) && ((_local18 == "orange")))){
_local9.push([_local16, _local15, 2]);
= (
+ 4);
};
if ((((_local17 == "orange")) && (!((_local18 == "orange"))))){
_local9.push([_local16, _local15, 10]);
};
if ((((_local17 == "yellow")) && ((_local18 == "yellow")))){
_local9.push([_local16, _local15, 3]);
= (
+ 4);
};
if ((((_local17 == "yellow")) && (!((_local18 == "yellow"))))){
_local9.push([_local16, _local15, 11]);
};
if ((((_local17 == "green")) && ((_local18 == "green")))){
_local9.push([_local16, _local15, 4]);
= (
+ 4);
};
if ((((_local17 == "green")) && (!((_local18 == "green"))))){
_local9.push([_local16, _local15, 12]);
};
if ((((_local17 == "turq")) && ((_local18 == "turq")))){
_local9.push([_local16, _local15, 5]);
= (
+ 4);
};
if ((((_local17 == "turq")) && (!((_local18 == "turq"))))){
_local9.push([_local16, _local15, 13]);
};
if ((((_local17 == "light blue")) && ((_local18 == "light blue")))){
_local9.push([_local16, _local15, 6]);
= (
+ 4);
};
if ((((_local17 == "light blue")) && (!((_local18 == "light blue"))))){
_local9.push([_local16, _local15, 14]);
};
if ((((_local17 == "blue")) && ((_local18 == "blue")))){
_local9.push([_local16, _local15, 7]);
= (
+ 4);
};
if ((((_local17 == "blue")) && (!((_local18 == "blue"))))){
_local9.push([_local16, _local15, 15]);
};
if ((((_local17 == "purple")) && ((_local18 == "purple")))){
_local9.push([_local16, _local15, 8]);
= (
+ 4);
};
if ((((_local17 == "purple")) && (!((_local18 == "purple"))))){
_local9.push([_local16, _local15, 16]);
};
if ((((_local17 == "brick0")) && ((_local18 == "brick0")))){
_local9.push([_local16, _local15, 40]);
= (
+ 4);
};
if ((((_local17 == "brick0")) && (!((_local18 == "brick0"))))){
_local9.push([_local16, _local15, 40]);
};
if ((((_local17 == "brick1")) && ((_local18 == "brick1")))){
_local9.push([_local16, _local15, 41]);
= (
+ 4);
};
if ((((_local17 == "brick1")) && (!((_local18 == "brick1"))))){
_local9.push([_local16, _local15, 41]);
};
if ((((_local17 == "brick2")) && ((_local18 == "brick2")))){
_local9.push([_local16, _local15, 42]);
= (
+ 4);
};
if ((((_local17 == "brick2")) && (!((_local18 == "brick2"))))){
_local9.push([_local16, _local15, 42]);
};
if ((((_local17 == "brick3")) && ((_local18 == "brick3")))){
_local9.push([_local16, _local15, 43]);
= (
+ 4);
};
if ((((_local17 == "brick3")) && (!((_local18 == "brick3"))))){
_local9.push([_local16, _local15, 43]);
};
if ((((_local17 == "brick4")) && ((_local18 == "brick4")))){
_local9.push([_local16, _local15, 44]);
= (
+ 4);
};
if ((((_local17 == "brick4")) && (!((_local18 == "brick4"))))){
_local9.push([_local16, _local15, 44]);
};
if ((((_local17 == "brick5")) && ((_local18 == "brick5")))){
_local9.push([_local16, _local15, 45]);
= (
+ 4);
};
if ((((_local17 == "brick5")) && (!((_local18 == "brick5"))))){
_local9.push([_local16, _local15, 45]);
};
if ((((_local17 == "brick6")) && ((_local18 == "brick6")))){
_local9.push([_local16, _local15, 46]);
= (
+ 4);
};
if ((((_local17 == "brick6")) && (!((_local18 == "brick6"))))){
_local9.push([_local16, _local15, 46]);
};
if ((((_local17 == "brick7")) && ((_local18 == "brick7")))){
_local9.push([_local16, _local15, 47]);
= (
+ 4);
};
if ((((_local17 == "brick7")) && (!((_local18 == "brick7"))))){
_local9.push([_local16, _local15, 47]);
};
if ((((_local17 == "brick8")) && ((_local18 == "brick8")))){
_local9.push([_local16, _local15, 48]);
= (
+ 4);
};
if ((((_local17 == "brick8")) && (!((_local18 == "brick8"))))){
_local9.push([_local16, _local15, 48]);
};
if ((((_local17 == "special")) && ((_local18 == "special1")))){
_local9.push([_local16, _local15, 17]);
= (
+ 4);
};
if ((((_local17 == "special")) && ((_local18 == "special2")))){
_local9.push([_local16, _local15, 18]);
= (
+ 4);
};
if ((((_local17 == "special")) && ((_local18 == "special3")))){
_local9.push([_local16, _local15, 19]);
= (
+ 4);
};
if ((((_local17 == "special")) && ((_local18 == "special4")))){
_local9.push([_local16, _local15, 20]);
= (
+ 4);
};
if ((((_local17 == "special")) && ((_local18 == "special5")))){
_local9.push([_local16, _local15, 21]);
= (
+ 4);
};
if ((((_local17 == "special")) && ((_local18 == "special6")))){
_local9.push([_local16, _local15, 22]);
= (
+ 4);
};
if ((((_local17 == "special")) && ((_local18 == "special7")))){
_local9.push([_local16, _local15, 23]);
= (
+ 4);
};
if ((((_local17 == "special")) && ((_local18 == "special8")))){
_local9.push([_local16, _local15, 24]);
= (
+ 4);
};
if ((((_local17 == "special")) && ((_local18 == "special9")))){
_local9.push([_local16, _local15, 25]);
= (
+ 4);
};
if ((((_local17 == "special")) && ((_local18 == "special10")))){
_local9.push([_local16, _local15, 26]);
= (
+ 4);
};
if ((((_local17 == "special")) && ((_local18 == "special11")))){
_local9.push([_local16, _local15, 27]);
= (
+ 4);
};
if ((((_local17 == "special")) && ((_local18 == "special12")))){
_local9.push([_local16, _local15, 28]);
= (
+ 4);
};
if ((((_local17 == "special")) && ((_local18 == "special13")))){
_local9.push([_local16, _local15, 29]);
= (
+ 4);
};
= (
+ 4);
};
();
_local11 = 50;
_local12 = 25;
= new Array();
_local10 = _local9.length;
= 0;
while (
< _local10) {
_local19 = _local9[
][0];
_local1 = _local9[
][1];
_local20 = _local9[
][2];
_local21 = new Sprite();
_local22 = [_local20][0];
_local23 = [_local20][1];
_local24 = [_local20][2];
_local25 = [_local20][3];
= new BitmapData(_local24, _local25, true, 4294967295);
= new Bitmap();
= new Rectangle(_local22, _local23, _local24, _local25);
= new Point(0, 0);
.copyPixels(
, , );
_local21.addChild();
if (_local20 < 41){
health = 1;
} else {
health = (_local20 - 39);
};
_local26 = Math.floor((
/ 11));
_local27 = (
- (_local26 * 11));
_local21.x = _local19;
_local21.y = _local1;
_local28 = new brickClass(_local19, _local1, _local21, _local20, health, _local24, _local25);
.push(_local28);
.addChild(_local21);
++;
};
= new Array();
= 8;
= 0;
while (
< 1) {
();
++;
};
_local13 = [0];
_local13.isBallStuck = true;
_local13.clip.x = (_local13.xVal = .clip.x);
_local13.clip.y = (_local13.yVal = (.clip.y - 25));
= "first shot";
}
private function (_arg1:Event):void{
trace("complete!");
}
private function (){
var _local1:int;
var _local2:int;
var _local3:int;
var _local4:*;
var _local5:*;
var _local6:*;
var _local7:*;
var _local8:*;
trace("clean up level");
trace(("powerUpArray = " +
));
=
.length;
trace(("fallingpowerUpCount = " + ));
if ( > 0){
while (
--) {
trace(("powerUpArray = " +
));
_local4 =
[];
trace(("fallingPow = " + _local4));
.removeChild(_local4.clip);
delete
[];
.splice(, 1);
};
};
trace(("pointsHolderArray = " + ));
= .length;
trace(("fallingPointsCount = " +
));
if (
> 0){
while (
--) {
_local5 = [
];
.removeChild(_local5.clip);
delete [
];
.splice(
, 1);
};
};
_local1 = .length;
if (_local1 > 0){
while (_local1--) {
_local6 = [_local1];
.removeChild(_local6.clip);
delete [_local1];
.splice(_local1, 1);
};
};
_local2 = .length;
if (_local2 > 0){
while (_local2--) {
_local7 = [_local2];
delete [_local2];
.splice(_local2, 1);
};
};
_local3 = .length;
if (_local3 > 0){
while (_local3--) {
_local8 = [_local3];
.removeChild(_local8.clip);
delete [_local3];
.splice(_local3, 1);
};
};
}
private function
(_arg1:int){
var _local2:int;
_local2 = 0;
switch (_arg1){
case 17:
("sticky bat");
= false;
= 0;
.gotoAndPlay("stickyBat");
= true;
= 500;
_local2 = .length;
= 0;
while ( < _local2) {
= [];
.stickyBat = true;
++;
};
= "sticky";
break;
case 18:
("speed");
_local2 = .length;
= 0;
while ( < _local2) {
= [];
.speed = (.speed + 1.5);
++;
};
break;
case 19:
("slow");
= 400;
= true;
_local2 = .length;
= 0;
while ( < _local2) {
= [];
if (.speed > 2){
.speed = (.speed - 1.5);
};
if (.speed < 2){
.speed = 2;
};
++;
};
break;
case 20:
("shrink");
.gotoAndPlay("shrinkBat");
= "shrink";
= 450;
= false;
= 0;
= false;
= 0;
_local2 = .length;
= 0;
while ( < _local2) {
= [];
if (.stickyBat){
.stickyBat = false;
if (.isBallStuck){
.isBallStuck = false;
.rot = (270 - ( * 2));
.speed = 5;
.yVal = (.yVal - 10);
};
};
++;
};
break;
case 21:
break;
case 22:
("multiball");
= 0;
while (
< 2) {
();
++;
};
break;
case 23:
("laser");
.gotoAndPlay("laserBat");
= "laser";
= true;
= 400;
= false;
= 0;
_local2 = .length;
= 0;
while ( < _local2) {
= [];
.stickyBat = false;
if (.isBallStuck){
.isBallStuck = false;
.rot = (270 - ( * 2));
.speed = 5;
.yVal = (.yVal - 10);
};
++;
};
break;
case 24:
("expand");
.gotoAndPlay("expandBat");
= "expand";
= false;
= 0;
= false;
= 0;
_local2 = .length;
= 0;
while ( < _local2) {
= [];
.stickyBat = false;
if (.isBallStuck){
.isBallStuck = false;
.rot = (270 - ( * 2));
.speed = 5;
.yVal = (.yVal - 10);
};
++;
};
break;
case 25:
("split");
.gotoAndPlay("splitBat");
= 450;
= "split";
= false;
= 0;
= false;
= 0;
_local2 = .length;
= 0;
while ( < _local2) {
= [];
.stickyBat = false;
if (.isBallStuck){
.isBallStuck = false;
.rot = (270 - ( * 2));
.speed = 5;
.yVal = (.yVal - 10);
};
++;
};
break;
case 26:
("force wall");
if (!){
= true;
.gotoAndPlay(1);
};
break;
case 27:
("crazy ball");
= 400;
= true;
_local2 = .length;
= 0;
while ( < _local2) {
= [];
.crazyball = true;
++;
};
break;
case 28:
("flame");
= 400;
= true;
_local2 = .length;
= 0;
while ( < _local2) {
= [];
.flame = true;
++;
};
break;
};
}
private function (){
var _local1:int;
var _local2:int;
var _local3:*;
var _local4:int;
var _local5:int;
var _local6:Sprite;
var _local7:int;
var _local8:int;
var _local9:int;
var _local10:int;
var _local11:int;
var _local12:int;
var _local13:Boolean;
var _local14:Boolean;
var _local15:Boolean;
var _local16:Boolean;
var _local17:*;
var _local18:Sprite;
var _local19:int;
var _local20:int;
var _local21:int;
var _local22:int;
var _local23:int;
var _local24:int;
var _local25:Boolean;
var _local26:Boolean;
var _local27:Boolean;
var _local28:Boolean;
var _local29:*;
var _local30:int;
var _local31:int;
var _local32:int;
var _local33:int;
var _local34:BitmapData;
var _local35:Bitmap;
var _local36:Rectangle;
var _local37:Point;
_local1 =
;
_local2 = .length;
if (_local2 < 1){
= "life lost";
};
while (_local2--) {
_local3 = [_local2];
_local3.updateBallPosition();
_local3.clip.x = _local3.xVal;
_local3.clip.y = _local3.yVal;
if (_local3.isBallStuck){
_local3.clip.x = (_local3.xVal = ((.clip.x + _local3.stickOffset) - ( / 2)));
if (_local3.xVal > 605){
_local3.xVal = (_local3.clip.x = 605);
};
if (_local3.xVal < 35){
_local3.xVal = (_local3.clip.x = 35);
};
_local3.speed = 0;
if (_local3.stickOffset >= 0){
_local3.clip.y = (_local3.yVal = ((.clip.y - 25) - ( / 3)));
} else {
_local3.clip.y = (_local3.yVal = ((.clip.y - 25) + ( / 3)));
};
} else {
if (_local3.flame){
(_local3.xVal, _local3.yVal);
};
if (_local3.yVal > 460){
if (){
_local3.yVal = 460;
_local3.deflectBall("bottom", false);
(_local3.xVal, _local3.yVal, _local3.rot);
("ball hits force shield");
= false;
.gotoAndPlay("exit");
};
if (_local3.yVal > 480){
("ball lost");
removeChild(_local3.clip);
delete [_local2];
.splice(_local2, 1);
};
} else {
if (_local3.yVal > 350){
_local13 = false;
_local3.lastBrickHit = null;
_local14 = .clip.hitTestPoint(_local3.xVal, (_local3.yVal + _local1), true);
if (_local14){
_local13 = true;
("ball hits bat");
} else {
_local15 = .clip.hitTestPoint((_local3.xVal + (_local1 * 0.75)), _local1, true);
if (_local15){
_local13 = true;
("ball hits bat");
} else {
_local16 = .clip.hitTestPoint((_local3.xVal - (_local1 * 0.75)), (_local3.yVal + _local1), true);
if (_local16){
_local13 = true;
("ball hits bat");
};
};
};
if (_local13){
_local3.hitBricksInRow = 0;
if (_local3.stickyBat){
if (!_local3.isBallStuck){
_local3.isBallStuck = true;
};
_local3.stickOffset = (_local3.xVal - .clip.x);
if (_local3.stickOffset > ((.clip.width / 2) * 0.5)){
_local3.stickOffset = ((.clip.width / 2) * 0.5);
};
if (_local3.stickOffset < ((-(.clip.width) / 2) * 0.5)){
_local3.stickOffset = ((-(.clip.width) / 2) * 0.5);
};
} else {
_local3.hitBat();
};
};
};
};
};
_local4 = _local3.rot;
_local5 = 0;
_local5 = .length;
_local6 = _local3.clip;
_local7 = _local3.xVal;
_local8 = _local3.yVal;
_local9 = _local3.xVal;
_local10 = _local3.yVal;
_local11 = _local3.bx;
_local12 = _local3.by;
while (_local5--) {
_local17 = [_local5];
_local18 = _local17.clip;
if ((((_local3.lastBrickHit == null)) || (!((_local3.lastBrickHit == _local18))))){
_local19 = _local17.x;
_local20 = Math.abs(((_local9 - _local19) + (_local17.wide / 2)));
if (_local20 < 100){
_local21 = _local17.y;
_local22 = Math.abs(((_local10 - _local21) + (_local17.high / 2)));
if (_local22 < 100){
_local23 = (_local17.x + _local17.wide);
_local24 = (_local17.y + _local17.high);
_local25 = false;
_local26 = false;
_local27 = false;
_local28 = false;
if ((((((_local10 >= _local24)) && (((_local10 + _local12) <= _local24)))) || ((((_local10 >= _local24)) && (((_local10 + _local12) <= _local21)))))){
if ((((_local9 >= _local19)) && ((_local9 <= _local23)))){
_local3.deflectBall("top", true);
= _local7;
= (_local8 - _local1);
_local25 = true;
};
} else {
if ((((((_local10 <= _local21)) && (((_local10 + _local12) >= _local21)))) || ((((_local10 <= _local21)) && (((_local10 + _local12) >= _local24)))))){
if ((((_local9 >= _local19)) && ((_local9 <= _local23)))){
_local3.deflectBall("bottom", true);
= _local7;
= (_local8 + _local1);
_local26 = true;
};
} else {
if ((((_local9 <= _local19)) && (((_local9 + _local11) >= _local19)))){
if ((((_local10 >= _local21)) && ((_local10 <= _local24)))){
_local3.deflectBall("right", true);
= (_local7 + _local1);
= _local8;
_local27 = true;
};
} else {
if ((((_local9 >= _local23)) && (((_local9 + _local11) <= _local23)))){
if ((((_local10 >= _local21)) && ((_local10 <= _local24)))){
_local3.deflectBall("left", true);
= (_local7 - _local1);
= _local8;
_local28 = true;
};
};
};
};
};
if (((((((_local25) || (_local26))) || (_local27))) || (_local28))){
_local3.hitBricksInRow++;
switch (_local3.hitBricksInRow){
case 10:
(1000);
("multihit");
("multihit");
break;
case 20:
(1500);
("powerhit");
("powerhit");
break;
case 30:
(3000);
("excellent");
("excellent");
break;
case 40:
(6000);
("brilliant");
("brilliant");
break;
case 50:
(10000);
("awesome");
("awesome");
break;
case 60:
(15000);
("wild");
("wild");
break;
case 80:
(25000);
("madness");
("madness");
break;
case 100:
(30000);
("incredible");
("incredible");
break;
case 120:
(50000);
("unbelievable");
("unbelievable");
break;
case 150:
(100000);
("insane");
("insane");
break;
};
_local3.x = (_local3.x - _local3.bx);
_local3.y = (_local3.y - _local3.by);
_local17.health--;
if (_local17.health < 1){
if ((((_local17.brickType > 16)) && ((_local17.brickType < 39)))){
(_local17.clip.x, _local17.clip.y, _local17.brickType);
("hit power up");
} else {
if ((Math.random() * 10) < 5){
(_local17.clip.x, _local17.clip.y);
};
("brick smashes");
};
(100);
(_local17, _local4);
.removeChild(_local17.clip);
delete [_local5];
.splice(_local5, 1);
} else {
("ball hits solid brick");
(10);
_local29 = (39 + _local17.health);
_local30 = [_local29][0];
_local31 = [_local29][1];
_local32 = [_local29][2];
_local33 = [_local29][3];
_local34 = new BitmapData(_local32, _local33, true, 4294967295);
_local35 = new Bitmap(_local34);
_local36 = new Rectangle(_local30, _local31, _local32, _local33);
_local37 = new Point(0, 0);
_local34.copyPixels(
, _local36, _local37);
_local18.addChild(_local35);
(_local17);
(, , _local3.rot);
};
};
};
};
};
};
_local5 = .length;
if (_local5 > 0){
} else {
= "level complete";
};
};
}
private function (){
++;
("extra life");
("extra life");
.text = .toString();
.setTextFormat();
}
private function data(){
= new Array();
.push([0, 0, 0, 0]);
.push([0, 25, 50, 25]);
.push([50, 25, 50, 25]);
.push([100, 25, 50, 25]);
.push([150, 25, 50, 25]);
.push([200, 25, 50, 25]);
.push([250, 25, 50, 25]);
.push([300, 25, 50, 25]);
.push([350, 25, 50, 25]);
.push([100, 75, 25, 25]);
.push([125, 75, 25, 25]);
.push([150, 75, 25, 25]);
.push([175, 75, 25, 25]);
.push([200, 75, 25, 25]);
.push([225, 75, 25, 25]);
.push([250, 75, 25, 25]);
.push([275, 75, 25, 25]);
.push([0, 100, 50, 25]);
.push([50, 100, 50, 25]);
.push([100, 100, 50, 25]);
.push([150, 100, 50, 25]);
.push([200, 100, 50, 25]);
.push([250, 100, 50, 25]);
.push([300, 100, 50, 25]);
.push([350, 100, 50, 25]);
.push([0, 125, 50, 25]);
.push([50, 125, 50, 25]);
.push([100, 125, 50, 25]);
.push([150, 125, 50, 25]);
.push([0, 0, 50, 25]);
.push([0, 0, 50, 25]);
.push([0, 0, 50, 25]);
.push([0, 0, 50, 25]);
.push([0, 0, 50, 25]);
.push([0, 0, 50, 25]);
.push([0, 0, 50, 25]);
.push([0, 0, 50, 25]);
.push([0, 0, 50, 25]);
.push([0, 0, 50, 25]);
.push([0, 50, 50, 25]);
.push([50, 50, 50, 25]);
.push([100, 50, 50, 25]);
.push([150, 50, 50, 25]);
.push([200, 50, 50, 25]);
.push([250, 50, 50, 25]);
.push([300, 50, 50, 25]);
.push([350, 50, 50, 25]);
.push([0, 75, 50, 25]);
.push([50, 75, 50, 25]);
.push([0, 0, 50, 25]);
.push([0, 150, 50, 25]);
.push([50, 150, 50, 25]);
.push([100, 150, 50, 25]);
.push([150, 150, 50, 25]);
.push([200, 150, 50, 25]);
.push([250, 150, 50, 25]);
.push([300, 150, 50, 25]);
.push([350, 150, 50, 25]);
.push([0, 175, 50, 25]);
.push([50, 175, 50, 25]);
.push([100, 175, 50, 25]);
.push([150, 175, 50, 25]);
}
private function
(_arg1:KeyboardEvent):void{
trace((((("Key Pressed: " + String.fromCharCode(_arg1.charCode)) + " (character code: ") + _arg1.charCode) + ")"));
if ((((_arg1.charCode == 32)) && (( == "playing")))){
trace("pause the game");
= "start pause";
};
if ((((_arg1.charCode == 32)) && (( == "paused")))){
trace("un-pause the game");
removeChild(
);
= "playing";
};
if ((((_arg1.charCode == 77)) && (( == "paused")))){
trace("mike barry mode");
.mikeBarryClip.gotoAndPlay(2);
ExternalInterface.call("pageTracker._trackPageview", "/easteregg/Breakit3_mikeBarry");
("mike barry");
};
}
private function
(){
.x = 320;
.clip.rotation = 0;
= false;
= "normal";
.gotoAndPlay("normal");
= 0;
= false;
if (){
= false;
.gotoAndPlay("exit");
};
= 0;
= false;
= 0;
= false;
= 0;
= false;
= 0;
= 0;
= false;
= 0;
= 0;
}
private function
(_arg1:TimerEvent){
var _local2:Number;
var _local3:int;
var _local4:*;
var _local5:int;
var _local6:int;
var _local7:int;
var _local8:int;
var _local9:*;
var _local10:*;
var _local11:Object;
var _local12:String;
var _local13:int;
var _local14:String;
if (){
();
};
switch ( ){
case "playing":
();
();
();
();
();
();
();
_local2 = (mouseX - .clip.x);
.clip.x = (.clip.x + (_local2 / 5));
if (.clip.x < (25 + (.clip.width / 2))){
.clip.x = (25 + (.clip.width / 2));
};
if (.clip.x > (615 - (.clip.width / 2))){
.clip.x = (615 - (.clip.width / 2));
};
= -(_local2);
if ( > 30){
= 30;
};
if ( < -30){
= -30;
};
.clip.rotation = (-() / 1.7);
();
break;
case "wait for everything to load":
--;
if ( < 1){
= "init";
};
break;
case "init":
trace("I N I T");
();
.text = ;
.appendText("v");
= SharedObject.getLocal("breakit3_storage");
if (.size == 0){
.data.highScore = 0;
.data.upToLevel = 1;
= 1;
} else {
= .data.upToLevel;
};
= new Sprite();
= new BitmapData(640, 480, true, 4294967295);
= new Bitmap(
);
.addChild();
.appendText("x");
= new MovieClip();
= new levelSelector();
.addChild(
);
= new MovieClip();
= new gameOverScreen();
.addChild();
= new MovieClip();
= new gameCompleteScreen();
.addChild(
);
.appendText("y");
= new MovieClip();
= new logoScreen();
.addChild( );
addChild();
= 120;
.appendText( );
= "logo delay";
.appendText("z");
break;
case "start pause":
= new Sprite();
= new pausedClip();
= new MovieClip();
.addChild();
.mikeBarryClip.gotoAndStop(1);
.x = 0;
.y = 0;
.addChild( );
addChild(
);
= "paused";
break;
case "paused":
break;
case "life lost":
_local3 = .length;
while (_local3--) {
_local9 = [_local3];
.removeChild(_local9.clip);
delete [_local3];
.splice(_local3, 1);
};
= .length;
while (
--) {
_local10 = [
];
.removeChild(_local10.clip);
delete [
];
.splice(
, 1);
};
--;
if ( < 0){
.text = "0";
} else {
.text = .toString();
};
.setTextFormat();
= 90;
= "lose life wait";
switch (){
case "split":
.gotoAndPlay("splitlifelost");
break;
case "sticky":
.gotoAndPlay("stickyLifeLost");
break;
case "shrink":
.gotoAndPlay("shrinklifelost");
break;
case "laser":
.gotoAndPlay("laserlifelost");
break;
case "expand":
.gotoAndPlay("expandlifelost");
break;
default:
.gotoAndPlay("lifelost");
break;
};
break;
case "lose life wait":
();
();
();
();
();
--;
if ( < 1){
if ( < 0){
= 0;
= "game over";
} else {
();
= "next life";
};
};
break;
case "next life":
();
= 100;
();
_local4 = [0];
_local4.clip.x = (_local4.xVal = .clip.x);
_local4.clip.y = (_local4.yVal = (.clip.y - 25));
_local4.isBallStuck = true;
= "first shot";
= "setup level wait";
break;
case "game over":
trace( );
trace(("score = " + ));
= 50;
if (.data.upToLevel < ){
trace("new personal best level!");
.data.upToLevel = ;
};
if (.data.highScore < ){
trace("new personal best score!");
.data.highScore = ;
};
.flush();
= "game over wait";
break;
case "game over wait":
();
--;
if ( < 1){
();
addChild();
.yourHighestTextBox.text = ((("YOUR HIGHEST SCORE: " + .data.highScore.toString()) + " YOUR HIGHEST LEVEL: ") + .data.upToLevel.toString());
.levelTextBox.text = ("LEVEL: " + .toString());
.scoreTextBox.text = .toString();
trace(("score = " + ));
("game over");
trace("here");
if ( > 10000){
();
};
= "wait on game over screen";
};
break;
case "wait on game over screen":
break;
case "wait on game complete screen":
trace("create game complete special effect here");
trace( );
break;
case "setup level":
();
= 100;
= "setup level wait";
();
break;
case "setup level wait":
();
= ( * 0.98);
--;
if ( < 1){
removeChild();
= "playing";
};
break;
case "level complete":
("level complete");
_local5 = .length;
= 0;
while (
< _local5) {
_local11 = [
];
removeChild(_local11.clip);
++;
};
= 120;
= "level complete wait";
break;
case "level complete wait":
();
();
();
();
();
();
--;
if ( < 0){
();
++;
if ( > 100){
= 100;
_local12 = "breakit3";
ExternalInterface.call("urchinTracker", ("/gameCompleted/" + _local12));
= "game complete";
} else {
= "setup level";
};
};
break;
case "game complete":
trace( );
= 120;
if (.data.upToLevel < ){
trace("new personal best level!");
.data.upToLevel = ;
};
if (.data.highScore < ){
trace("new personal best score!");
.data.highScore = ;
};
.flush();
("congratulations");
= "game complete wait";
break;
case "game complete wait":
();
--;
if ( < 1){
();
addChild( );
.yourHighestTextBox.text = ((("YOUR HIGHEST SCORE: " + .data.highScore.toString()) + " YOUR HIGHEST LEVEL: ") + .data.upToLevel.toString());
.scoreTextBox.text = .toString();
("game complete");
if ( > 10000){
();
};
= "wait on game complete screen";
};
break;
case "new game setup":
addChild( );
if (.data.upToLevel > 1){
();
("choose level");
= "choose level";
} else {
= "setup level";
();
};
break;
case "choose level":
_local6 = Math.floor(((mouseY - 115) / 32));
_local7 = Math.floor(((mouseX - 80) / 48));
_local8 = ((_local6 * 10) + _local7);
if ((((((((_local8 > -1)) && ((_local8 < .data.upToLevel)))) && ((mouseX < 560)))) && ((mouseX > 80)))){
_local13 = ;
.levelChooserMarker.x = ((_local7 * 48) + 80);
.levelChooserMarker.y = ((_local6 * 32) + 115);
.levelNumIndicator.x = (
.levelChooserMarker.x + 24);
.levelNumIndicator.y =
.levelChooserMarker.y;
= (_local8 + 1);
if ( != _local13){
();
};
.levelNumIndicator.levelTextBox.text = .toString();
};
break;
case "logo delay":
--;
if ( < 1){
removeChildAt(0);
addChild( );
();
= new MovieClip();
= new introScreen();
.addChild();
= "http://www.terrypaton.com";
_local14 = .slice(0, 25);
if (_local14 == "http://www.terrypaton.com"){
= "intro screen";
} else {
trace("game is running illegally");
= "intro screen";
};
= "intro screen";
};
break;
case "intro screen":
("break it");
addChild( );
.vNumtext.text = "3.096";
if (.data.highScore > 0){
.yourHighestTextBox.text = ((("YOUR HIGHEST SCORE: " + .data.highScore.toString()) + " YOUR HIGHEST LEVEL: ") + .data.upToLevel.toString());
} else {
.yourHighestTextBox.text = " ";
};
= new Sprite();
addChild();
= true;
addChild();
trace("assigning mouse down event listener");
.addEventListener(MouseEvent.MOUSE_DOWN, );
= "intro screen wait";
break;
case "intro screen wait":
(mouseX, mouseY);
break;
};
}
Security.allowInsecureDomain("*");
Security.allowDomain("*");
}
}//package
Section 31
//breakitwav (breakitwav)
package {
import flash.media.*;
public dynamic class breakitwav extends Sound {
}
}//package
Section 32
//brickSmashSnd (brickSmashSnd)
package {
import flash.media.*;
public dynamic class brickSmashSnd extends Sound {
}
}//package
Section 33
//brilliantwav (brilliantwav)
package {
import flash.media.*;
public dynamic class brilliantwav extends Sound {
}
}//package
Section 34
//chooseYourLevelwav (chooseYourLevelwav)
package {
import flash.media.*;
public dynamic class chooseYourLevelwav extends Sound {
}
}//package
Section 35
//congratulationswav (congratulationswav)
package {
import flash.media.*;
public dynamic class congratulationswav extends Sound {
}
}//package
Section 36
//excellentwav (excellentwav)
package {
import flash.media.*;
public dynamic class excellentwav extends Sound {
}
}//package
Section 37
//extraLifewav (extraLifewav)
package {
import flash.media.*;
public dynamic class extraLifewav extends Sound {
}
}//package
Section 38
//flameParticle (flameParticle)
package {
import flash.display.*;
public dynamic class flameParticle extends BitmapData {
public function flameParticle(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 39
//forceShield (forceShield)
package {
import flash.display.*;
public dynamic class forceShield extends MovieClip {
public function forceShield(){
addFrameScript(9, , 20, frame21);
}
function (){
stop();
}
function frame21(){
stop();
}
}
}//package
Section 40
//gameCompleteScreen (gameCompleteScreen)
package {
import flash.display.*;
import flash.text.*;
public dynamic class gameCompleteScreen extends MovieClip {
public var yourHighestTextBox:TextField;
public var scoreTextBox:TextField;
public var playBtn:SimpleButton;
}
}//package
Section 41
//gameCompletewav (gameCompletewav)
package {
import flash.media.*;
public dynamic class gameCompletewav extends Sound {
}
}//package
Section 42
//gameOverScreen (gameOverScreen)
package {
import flash.display.*;
import flash.text.*;
public dynamic class gameOverScreen extends MovieClip {
public var yourHighestTextBox:TextField;
public var scoreTextBox:TextField;
public var playBtn:SimpleButton;
public var levelTextBox:TextField;
}
}//package
Section 43
//gameOverwav (gameOverwav)
package {
import flash.media.*;
public dynamic class gameOverwav extends Sound {
}
}//package
Section 44
//gamePausedwav (gamePausedwav)
package {
import flash.media.*;
public dynamic class gamePausedwav extends Sound {
}
}//package
Section 45
//hitbatsnd1Snd (hitbatsnd1Snd)
package {
import flash.media.*;
public dynamic class hitbatsnd1Snd extends Sound {
}
}//package
Section 46
//hitbatsnd2Snd (hitbatsnd2Snd)
package {
import flash.media.*;
public dynamic class hitbatsnd2Snd extends Sound {
}
}//package
Section 47
//hitbatsnd3Snd (hitbatsnd3Snd)
package {
import flash.media.*;
public dynamic class hitbatsnd3Snd extends Sound {
}
}//package
Section 48
//hitbrick1Snd (hitbrick1Snd)
package {
import flash.media.*;
public dynamic class hitbrick1Snd extends Sound {
}
}//package
Section 49
//hitForceWallSndwav (hitForceWallSndwav)
package {
import flash.media.*;
public dynamic class hitForceWallSndwav extends Sound {
}
}//package
Section 50
//hitPowerUpwav (hitPowerUpwav)
package {
import flash.media.*;
public dynamic class hitPowerUpwav extends Sound {
}
}//package
Section 51
//incrediblewav (incrediblewav)
package {
import flash.media.*;
public dynamic class incrediblewav extends Sound {
}
}//package
Section 52
//insanewav (insanewav)
package {
import flash.media.*;
public dynamic class insanewav extends Sound {
}
}//package
Section 53
//introScreen (introScreen)
package {
import flash.display.*;
import flash.text.*;
public dynamic class introScreen extends MovieClip {
public var yourHighestTextBox:TextField;
public var vNumtext:TextField;
public var playBtn:SimpleButton;
}
}//package
Section 54
//laserHitsBrickSndwav (laserHitsBrickSndwav)
package {
import flash.media.*;
public dynamic class laserHitsBrickSndwav extends Sound {
}
}//package
Section 55
//laserHitSolidBrickSndwav (laserHitSolidBrickSndwav)
package {
import flash.media.*;
public dynamic class laserHitSolidBrickSndwav extends Sound {
}
}//package
Section 56
//laserSnd (laserSnd)
package {
import flash.media.*;
public dynamic class laserSnd extends Sound {
}
}//package
Section 57
//levelAnnounce (levelAnnounce)
package {
import flash.display.*;
import flash.text.*;
public dynamic class levelAnnounce extends MovieClip {
public var levelNumTextBox:TextField;
}
}//package
Section 58
//levelCompletewav (levelCompletewav)
package {
import flash.media.*;
public dynamic class levelCompletewav extends Sound {
}
}//package
Section 59
//levelDataBitmap (levelDataBitmap)
package {
import flash.display.*;
public dynamic class levelDataBitmap extends BitmapData {
public function levelDataBitmap(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 60
//levelSelector (levelSelector)
package {
import flash.display.*;
import flash.text.*;
public dynamic class levelSelector extends MovieClip {
public var levelChooserMarker:MovieClip;
public var levelSelectorClip:MovieClip;
public var unlockedAmountTextBox:TextField;
public var levelNumIndicator:MovieClip;
}
}//package
Section 61
//logoScreen (logoScreen)
package {
import flash.display.*;
public dynamic class logoScreen extends MovieClip {
public function logoScreen(){
addFrameScript(90, );
}
function (){
stop();
}
}
}//package
Section 62
//madnesswav (madnesswav)
package {
import flash.media.*;
public dynamic class madnesswav extends Sound {
}
}//package
Section 63
//mikeBarrySndwav (mikeBarrySndwav)
package {
import flash.media.*;
public dynamic class mikeBarrySndwav extends Sound {
}
}//package
Section 64
//MochiAd (MochiAd)
package {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.system.*;
public class MochiAd {
public static function getVersion():String{
return ("2.3");
}
public static function showTimedAd(_arg1:Object):void{
trace("[MochiAd] DEPRECATED: showTimedAd was renamed to showInterLevelAd in 2.0");
MochiAd.showInterLevelAd(_arg1);
}
public static function _allowDomains(_arg1:String):String{
var _local2:String;
_local2 = _arg1.split("/")[2].split(":")[0];
Security.allowDomain("*");
Security.allowDomain(_local2);
Security.allowInsecureDomain("*");
Security.allowInsecureDomain(_local2);
return (_local2);
}
public static function load(_arg1:Object):MovieClip{
var DEFAULTS:Object;
var clip:Object;
var depth:Number;
var mc:MovieClip;
var wh:Array;
var lv:URLVariables;
var k:String;
var server:String;
var hostname:String;
var lc:LocalConnection;
var name:String;
var loader:Loader;
var f:Function;
var g:Function;
var req:URLRequest;
var v:Object;
var options = _arg1;
DEFAULTS = {server:"http://x.mochiads.com/srv/1/", method:"load", depth:10333, id:"_UNKNOWN_"};
options = MochiAd._parseOptions(options, DEFAULTS);
options.swfv = 9;
options.mav = MochiAd.getVersion();
clip = options.clip;
if (!MochiAd._isNetworkAvailable()){
return (null);
};
try {
if (clip._mochiad_loaded){
return (null);
};
} catch(e:Error) {
throw (new Error("MochiAd requires a clip that is an instance of a dynamic class. If your class extends Sprite or MovieClip, you must make it dynamic."));
};
depth = options.depth;
delete options.depth;
mc = createEmptyMovieClip(clip, "_mochiad", depth);
wh = MochiAd._getRes(options, clip);
options.res = ((wh[0] + "x") + wh[1]);
options.server = (options.server + options.id);
delete options.id;
clip._mochiad_loaded = true;
if (clip.loaderInfo.loaderURL.indexOf("http") == 0){
options.as3_swf = clip.loaderInfo.loaderURL;
};
lv = new URLVariables();
for (k in options) {
v = options[k];
if (!(v is Function)){
lv[k] = v;
};
};
server = lv.server;
delete lv.server;
hostname = _allowDomains(server);
lc = new LocalConnection();
lc.client = mc;
name = ["", Math.floor(new Date().getTime()), Math.floor((Math.random() * 999999))].join("_");
lc.allowDomain("*", "localhost");
lc.allowInsecureDomain("*", "localhost");
lc.connect(name);
mc.lc = lc;
lv.lc = name;
lv.st = getTimer();
loader = new Loader();
f = function (_arg1:Object):void{
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
mc._mochiad_ctr_failed = true;
};
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, f);
g = function (_arg1:Object):void{
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
MochiAd.unload(clip);
};
loader.contentLoaderInfo.addEventListener(Event.UNLOAD, g);
req = new URLRequest((server + ".swf"));
req.contentType = "application/x-www-form-urlencoded";
req.method = URLRequestMethod.POST;
req.data = lv;
loader.load(req);
mc.addChild(loader);
mc._mochiad_ctr = loader;
return (mc);
}
public static function sendHighScore(_arg1:Object, _arg2:Object, _arg3:Object=null):Boolean{
var _local4:MovieClip;
_local4 = MochiAd._loadCommunicator({clip:_arg1.clip, id:_arg1.id});
if (!_local4){
return (false);
};
_local4.doSend(["sendHighScore", _arg1], _arg2, _arg3);
return (true);
}
public static function _parseOptions(_arg1:Object, _arg2:Object):Object{
var _local3:Object;
var _local4:String;
var _local5:Array;
var _local6:Number;
var _local7:Array;
_local3 = {};
for (_local4 in _arg2) {
_local3[_local4] = _arg2[_local4];
};
if (_arg1){
for (_local4 in _arg1) {
_local3[_local4] = _arg1[_local4];
};
};
if (_local3.clip == undefined){
throw (new Error("MochiAd is missing the 'clip' parameter. This should be a MovieClip, Sprite or an instance of a class that extends MovieClip or Sprite."));
};
_arg1 = _local3.clip.loaderInfo.parameters.mochiad_options;
if (_arg1){
_local5 = _arg1.split("&");
_local6 = 0;
while (_local6 < _local5.length) {
_local7 = _local5[_local6].split("=");
_local3[unescape(_local7[0])] = unescape(_local7[1]);
_local6++;
};
};
if (_local3.id == "test"){
trace("[MochiAd] WARNING: Using the MochiAds test identifier, make sure to use the code from your dashboard, not this example!");
};
return (_local3);
}
public static function _isNetworkAvailable():Boolean{
return (!((Security.sandboxType == "localWithFile")));
}
public static function _cleanup(_arg1:Object):void{
var idx:Number;
var k:String;
var lc:LocalConnection;
var f:Function;
var mc = _arg1;
if (("lc" in mc)){
lc = mc.lc;
f = function ():void{
try {
lc.client = null;
lc.close();
} catch(e:Error) {
};
};
setTimeout(f, 0);
};
idx = DisplayObjectContainer(mc).numChildren;
while (idx > 0) {
idx = (idx - 1);
DisplayObjectContainer(mc).removeChildAt(idx);
};
for (k in mc) {
delete mc[k];
};
}
public static function unload(_arg1:Object):Boolean{
if (((_arg1.clip) && (_arg1.clip._mochiad))){
_arg1 = _arg1.clip;
};
if (!_arg1._mochiad){
return (false);
};
if (_arg1._mochiad.onUnload){
_arg1._mochiad.onUnload();
};
delete _arg1._mochiad_loaded;
delete _arg1._mochiad;
return (true);
}
public static function showInterLevelAd(_arg1:Object):void{
var DEFAULTS:Object;
var clip:Object;
var ad_msec:Number;
var ad_timeout:Number;
var fadeout_time:Number;
var mc:MovieClip;
var wh:Array;
var w:Number;
var h:Number;
var chk:MovieClip;
var options = _arg1;
DEFAULTS = {ad_timeout:2000, fadeout_time:250, regpt:"o", method:"showTimedAd", ad_started:function ():void{
if ((this.clip is MovieClip)){
this.clip.stop();
} else {
throw (new Error("MochiAd.showInterLevelAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers."));
};
}, ad_finished:function ():void{
if ((this.clip is MovieClip)){
this.clip.play();
} else {
throw (new Error("MochiAd.showInterLevelAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers."));
};
}, ad_loaded:function (_arg1:Number, _arg2:Number):void{
}, ad_failed:function ():void{
trace("[MochiAd] Couldn't load an ad, make sure your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}};
options = MochiAd._parseOptions(options, DEFAULTS);
clip = options.clip;
ad_msec = 11000;
ad_timeout = options.ad_timeout;
delete options.ad_timeout;
fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!MochiAd.load(options)){
options.ad_failed();
options.ad_finished();
return;
};
options.ad_started();
mc = clip._mochiad;
mc["onUnload"] = function ():void{
MochiAd._cleanup(mc);
options.ad_finished();
};
wh = MochiAd._getRes(options, clip);
w = wh[0];
h = wh[1];
mc.x = (w * 0.5);
mc.y = (h * 0.5);
chk = createEmptyMovieClip(mc, "_mochiad_wait", 3);
chk.ad_msec = ad_msec;
chk.ad_timeout = ad_timeout;
chk.started = getTimer();
chk.showing = false;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function ():void{
var _local1:Number;
if (!this.parent){
delete this.onEnterFrame;
delete this.fadeFunction;
return;
};
_local1 = (100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time)));
if (_local1 > 0){
this.parent.alpha = (_local1 * 0.01);
} else {
MochiAd.unload(clip);
delete this["onEnterFrame"];
};
};
mc.unloadAd = function ():void{
MochiAd.unload(clip);
};
mc.adLoaded = options.ad_loaded;
mc.adjustProgress = function (_arg1:Number):void{
var _local2:Object;
_local2 = mc._mochiad_wait;
_local2.server_control = true;
_local2.showing = true;
_local2.started = getTimer();
_local2.ad_msec = (_arg1 - 250);
};
chk["onEnterFrame"] = function ():void{
var _local1:Object;
var _local2:Number;
var _local3:Boolean;
var _local4:Number;
if (!this.parent){
delete this.onEnterFrame;
delete this.fadeFunction;
return;
};
_local1 = this.parent._mochiad_ctr;
_local2 = (getTimer() - this.started);
_local3 = false;
if (!chk.showing){
_local4 = _local1.loaderInfo.bytesTotal;
if ((((_local4 > 0)) || (("number" == "undefined")))){
chk.showing = true;
chk.started = getTimer();
} else {
if (_local2 > chk.ad_timeout){
options.ad_failed();
_local3 = true;
};
};
};
if (this.parent._mochiad_ctr_failed){
options.ad_failed();
_local3 = true;
};
if (_local2 > chk.ad_msec){
_local3 = true;
};
if (_local3){
if (this.server_control){
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = this.fadeFunction;
};
};
};
doOnEnterFrame(chk);
}
public static function _getRes(_arg1:Object, _arg2:Object):Array{
var _local3:Object;
var _local4:Number;
var _local5:Number;
var _local6:Array;
_local3 = _arg2.getBounds(_arg2.root);
_local4 = 0;
_local5 = 0;
if (typeof(_arg1.res) != "undefined"){
_local6 = _arg1.res.split("x");
_local4 = parseFloat(_local6[0]);
_local5 = parseFloat(_local6[1]);
} else {
_local4 = (_local3.xMax - _local3.xMin);
_local5 = (_local3.yMax - _local3.yMin);
};
if ((((_local4 == 0)) || ((_local5 == 0)))){
_local4 = _arg2.stage.stageWidth;
_local5 = _arg2.stage.stageHeight;
};
return ([_local4, _local5]);
}
public static function createEmptyMovieClip(_arg1:Object, _arg2:String, _arg3:Number):MovieClip{
var _local4:MovieClip;
_local4 = new MovieClip();
if (((false) && (_arg3))){
_arg1.addChildAt(_local4, _arg3);
} else {
_arg1.addChild(_local4);
};
_arg1[_arg2] = _local4;
_local4["_name"] = _arg2;
return (_local4);
}
public static function _loadCommunicator(_arg1:Object):MovieClip{
var DEFAULTS:Object;
var clip:Object;
var clipname:String;
var server:String;
var depth:Number;
var mc:MovieClip;
var lv:URLVariables;
var k:String;
var lc:LocalConnection;
var name:String;
var req:URLRequest;
var loader:Loader;
var options = _arg1;
DEFAULTS = {com_server:"http://x.mochiads.com/com/1/", method:"loadCommunicator", depth:10337, id:"_UNKNOWN_"};
options = MochiAd._parseOptions(options, DEFAULTS);
options.swfv = 9;
options.mav = MochiAd.getVersion();
clip = options.clip;
clipname = ("_mochiad_com_" + options.id);
if (!MochiAd._isNetworkAvailable()){
return (null);
};
if (clip[clipname]){
return (clip[clipname]);
};
server = (options.com_server + options.id);
MochiAd._allowDomains(server);
delete options.id;
delete options.com_server;
depth = options.depth;
delete options.depth;
mc = createEmptyMovieClip(clip, clipname, depth);
lv = new URLVariables();
for (k in options) {
lv[k] = options[k];
};
lc = new LocalConnection();
lc.client = mc;
name = ["", Math.floor(new Date().getTime()), Math.floor((Math.random() * 999999))].join("_");
lc.allowDomain("*", "localhost");
lc.allowInsecureDomain("*", "localhost");
lc.connect(name);
mc.name = name;
mc.lc = lc;
lv.lc = name;
mc._id = 0;
mc._queue = [];
mc.rpcResult = function (_arg1:Object):void{
var _local3:Array;
var _local4:Array;
var _local5:Number;
var _local6:Object;
var _local7:Object;
_arg1 = parseInt(_arg1.toString());
_local3 = mc._callbacks[_arg1];
if (typeof(_local3) == "undefined"){
return;
};
delete mc._callbacks[_arg1];
_local4 = [];
_local5 = 2;
while (_local5 < _local3.length) {
_local4.push(_local3[_local5]);
_local5++;
};
_local5 = 1;
while (_local5 < arguments.length) {
_local4.push(arguments[_local5]);
_local5++;
};
_local6 = _local3[1];
_local7 = _local3[0];
if (((_local7) && ((typeof(_local6) == "string")))){
_local6 = _local7[_local6];
};
if (typeof(_local6) == "function"){
_local6.apply(_local7, _local4);
};
};
mc._didConnect = function (_arg1:String):void{
var _local2:Array;
var _local3:Function;
var _local4:Number;
var _local5:Array;
mc._endpoint = _arg1;
_local2 = mc._queue;
delete mc._queue;
_local3 = mc.doSend;
_local4 = 0;
while (_local4 < _local2.length) {
_local5 = _local2[_local4];
_local3.apply(this, _local5);
_local4++;
};
};
mc.doSend = function (_arg1:Array, _arg2:Object, _arg3:Object):void{
var _local5:Number;
var _local6:LocalConnection;
var _local7:Array;
var _local8:Number;
if (mc._endpoint == null){
_local7 = [];
_local8 = 0;
while (_local8 < arguments.length) {
_local7.push(arguments[_local8]);
_local8++;
};
mc._queue.push(_local7);
return;
};
mc._id = (mc._id + 1);
_local5 = mc._id;
mc._callbacks[_local5] = [_arg2, ((_arg3) || (_arg2))];
_local6 = new LocalConnection();
_local6.send(mc._endpoint, "rpc", _local5, _arg1);
};
mc._callbacks = {};
mc._callbacks[0] = [mc, "_didConnect"];
lv.st = getTimer();
req = new URLRequest((server + ".swf"));
req.contentType = "application/x-www-form-urlencoded";
req.method = URLRequestMethod.POST;
req.data = lv;
loader = new Loader();
loader.load(req);
mc.addChild(loader);
mc._mochiad_com = loader;
return (mc);
}
public static function showPreGameAd(_arg1:Object):void{
var DEFAULTS:Object;
var clip:Object;
var ad_msec:Number;
var ad_timeout:Number;
var fadeout_time:Number;
var mc:MovieClip;
var wh:Array;
var w:Number;
var h:Number;
var chk:MovieClip;
var bar:MovieClip;
var bar_color:Number;
var bar_background:Number;
var bar_outline:Number;
var backing_mc:MovieClip;
var backing:Object;
var inside_mc:MovieClip;
var inside:Object;
var outline_mc:MovieClip;
var outline:Object;
var complete:Boolean;
var unloaded:Boolean;
var f:Function;
var r:MovieClip;
var options = _arg1;
DEFAULTS = {ad_timeout:3000, fadeout_time:250, regpt:"o", method:"showPreloaderAd", color:0xFF8A00, background:16777161, outline:13994812, ad_started:function ():void{
if ((this.clip is MovieClip)){
this.clip.stop();
} else {
throw (new Error("MochiAd.showPreGameAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers."));
};
}, ad_finished:function ():void{
if ((this.clip is MovieClip)){
this.clip.play();
} else {
throw (new Error("MochiAd.showPreGameAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers."));
};
}, ad_loaded:function (_arg1:Number, _arg2:Number):void{
}, ad_failed:function ():void{
trace("[MochiAd] Couldn't load an ad, make sure your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}};
options = MochiAd._parseOptions(options, DEFAULTS);
if ("5cc6f7dfb67f2f08341c831480f7c2a7".length == 0){
options.ad_started();
options.ad_finished();
return;
};
clip = options.clip;
ad_msec = 11000;
ad_timeout = options.ad_timeout;
delete options.ad_timeout;
fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!MochiAd.load(options)){
options.ad_failed();
options.ad_finished();
return;
};
options.ad_started();
mc = clip._mochiad;
mc["onUnload"] = function ():void{
var fn:Function;
MochiAd._cleanup(mc);
fn = function ():void{
options.ad_finished();
};
setTimeout(fn, 100);
};
wh = MochiAd._getRes(options, clip);
w = wh[0];
h = wh[1];
mc.x = (w * 0.5);
mc.y = (h * 0.5);
chk = createEmptyMovieClip(mc, "_mochiad_wait", 3);
chk.x = (w * -0.5);
chk.y = (h * -0.5);
bar = createEmptyMovieClip(chk, "_mochiad_bar", 4);
bar.x = 10;
bar.y = (h - 20);
bar_color = options.color;
delete options.color;
bar_background = options.background;
delete options.background;
bar_outline = options.outline;
delete options.outline;
backing_mc = createEmptyMovieClip(bar, "_outline", 1);
backing = backing_mc.graphics;
backing.beginFill(bar_background);
backing.moveTo(0, 0);
backing.lineTo((w - 20), 0);
backing.lineTo((w - 20), 10);
backing.lineTo(0, 10);
backing.lineTo(0, 0);
backing.endFill();
inside_mc = createEmptyMovieClip(bar, "_inside", 2);
inside = inside_mc.graphics;
inside.beginFill(bar_color);
inside.moveTo(0, 0);
inside.lineTo((w - 20), 0);
inside.lineTo((w - 20), 10);
inside.lineTo(0, 10);
inside.lineTo(0, 0);
inside.endFill();
inside_mc.scaleX = 0;
outline_mc = createEmptyMovieClip(bar, "_outline", 3);
outline = outline_mc.graphics;
outline.lineStyle(0, bar_outline, 100);
outline.moveTo(0, 0);
outline.lineTo((w - 20), 0);
outline.lineTo((w - 20), 10);
outline.lineTo(0, 10);
outline.lineTo(0, 0);
chk.ad_msec = ad_msec;
chk.ad_timeout = ad_timeout;
chk.started = getTimer();
chk.showing = false;
chk.last_pcnt = 0;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function ():void{
var _local1:Number;
_local1 = (100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time)));
if (_local1 > 0){
this.parent.alpha = (_local1 * 0.01);
} else {
MochiAd.unload(clip);
delete this["onEnterFrame"];
};
};
complete = false;
unloaded = false;
f = function (_arg1:Event):void{
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
complete = true;
if (unloaded){
MochiAd.unload(clip);
};
};
clip.loaderInfo.addEventListener(Event.COMPLETE, f);
if ((clip.root is MovieClip)){
r = (clip.root as MovieClip);
if (r.framesLoaded >= r.totalFrames){
complete = true;
};
};
mc.unloadAd = function ():void{
unloaded = true;
if (complete){
MochiAd.unload(clip);
};
};
mc.adLoaded = options.ad_loaded;
mc.adjustProgress = function (_arg1:Number):void{
var _local2:Object;
_local2 = mc._mochiad_wait;
_local2.server_control = true;
_local2.showing = true;
_local2.started = getTimer();
_local2.ad_msec = _arg1;
};
chk["onEnterFrame"] = function ():void{
var _local1:Object;
var _local2:Object;
var _local3:Number;
var _local4:Boolean;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Object;
var _local10:Number;
var _local11:Number;
if (((!(this.parent)) || (!(this.parent.parent)))){
delete this["onEnterFrame"];
return;
};
_local1 = this.parent.parent.root;
_local2 = this.parent._mochiad_ctr;
_local3 = (getTimer() - this.started);
_local4 = false;
_local5 = _local1.loaderInfo.bytesTotal;
_local6 = _local1.loaderInfo.bytesLoaded;
if (complete){
_local6 = Math.max(1, _local6);
_local5 = _local6;
};
_local7 = ((100 * _local6) / _local5);
_local8 = ((100 * _local3) / chk.ad_msec);
_local9 = this._mochiad_bar._inside;
_local10 = Math.min(100, Math.min(((_local7) || (0)), _local8));
_local10 = Math.max(this.last_pcnt, _local10);
this.last_pcnt = _local10;
_local9.scaleX = (_local10 * 0.01);
if (!chk.showing){
_local11 = _local2.loaderInfo.bytesTotal;
if ((((_local11 > 0)) || (("number" == "undefined")))){
chk.showing = true;
chk.started = getTimer();
} else {
if (_local3 > chk.ad_timeout){
options.ad_failed();
_local4 = true;
};
};
};
if (this.parent._mochiad_ctr_failed){
options.ad_failed();
_local4 = true;
};
if (_local3 > chk.ad_msec){
_local4 = true;
};
if (((complete) && (_local4))){
if (this.server_control){
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = chk.fadeFunction;
};
};
};
doOnEnterFrame(chk);
}
public static function showPreloaderAd(_arg1:Object):void{
trace("[MochiAd] DEPRECATED: showPreloaderAd was renamed to showPreGameAd in 2.0");
MochiAd.showPreGameAd(_arg1);
}
public static function fetchHighScores(_arg1:Object, _arg2:Object, _arg3:Object=null):Boolean{
var _local4:MovieClip;
_local4 = MochiAd._loadCommunicator({clip:_arg1.clip, id:_arg1.id});
if (!_local4){
return (false);
};
_local4.doSend(["fetchHighScores", _arg1], _arg2, _arg3);
return (true);
}
public static function doOnEnterFrame(_arg1:MovieClip):void{
var f:Function;
var mc = _arg1;
f = function (_arg1:Object):void{
if (((("onEnterFrame" in mc)) && (mc.onEnterFrame))){
mc.onEnterFrame();
} else {
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
};
};
mc.addEventListener(Event.ENTER_FRAME, f);
}
}
}//package
Section 65
//mouseDownSndwav (mouseDownSndwav)
package {
import flash.media.*;
public dynamic class mouseDownSndwav extends Sound {
}
}//package
Section 66
//mouseOverSndwav (mouseOverSndwav)
package {
import flash.media.*;
public dynamic class mouseOverSndwav extends Sound {
}
}//package
Section 67
//multihitwav (multihitwav)
package {
import flash.media.*;
public dynamic class multihitwav extends Sound {
}
}//package
Section 68
//pausedClip (pausedClip)
package {
import flash.display.*;
public dynamic class pausedClip extends MovieClip {
public var resumeGameBtn:SimpleButton;
public var mikeBarryClip:MovieClip;
}
}//package
Section 69
//pauseGameBtn (pauseGameBtn)
package {
import flash.display.*;
public dynamic class pauseGameBtn extends SimpleButton {
}
}//package
Section 70
//Pixelyn (Pixelyn)
package {
import flash.text.*;
public dynamic class Pixelyn extends Font {
}
}//package
Section 71
//player (player)
package {
import flash.display.*;
public dynamic class player extends MovieClip {
public var laser:MovieClip;
public var collectGlow:MovieClip;
public function player(){
addFrameScript(8,
, 20, frame21, 32,
, 45,
, 54,
, 67,
, 76,
, 89,
, 98,
, 110,
, 122,
, 134,
);
}
function
(){
stop();
}
function
(){
stop();
}
function
(){
stop();
}
function frame21(){
stop();
}
function
(){
stop();
}
function
(){
stop();
}
function
(){
stop();
}
function
(){
stop();
}
function
(){
stop();
}
function
(){
stop();
}
function
(){
stop();
}
function
(){
stop();
}
}
}//package
Section 72
//pointsCollectedSnd (pointsCollectedSnd)
package {
import flash.media.*;
public dynamic class pointsCollectedSnd extends Sound {
}
}//package
Section 73
//powerhitwav (powerhitwav)
package {
import flash.media.*;
public dynamic class powerhitwav extends Sound {
}
}//package
Section 74
//powerUpCollectedSndwav (powerUpCollectedSndwav)
package {
import flash.media.*;
public dynamic class powerUpCollectedSndwav extends Sound {
}
}//package
Section 75
//preloader (preloader)
package {
import flash.display.*;
import flash.events.*;
import flash.text.*;
public dynamic class preloader extends MovieClip {
public var bar:MovieClip;
public var textBox:TextField;
public function preloader(){
trace("LOADING MOVIE");
this.stop();
this.addEventListener(Event.ENTER_FRAME,
);
loaderInfo.addEventListener(ProgressEvent.PROGRESS, );
loaderInfo.addEventListener(Event.COMPLETE,
);
}
private function
(_arg1:Event){
loaderInfo.removeEventListener(ProgressEvent.PROGRESS, );
loaderInfo.removeEventListener(Event.COMPLETE,
);
this.removeEventListener(Event.ENTER_FRAME,
);
this.gotoAndStop(3);
}
private function
(_arg1:Event){
}
private function (_arg1:ProgressEvent){
var _local2:*;
var _local3:*;
var _local4:*;
_local2 = _arg1.target.bytesLoaded;
_local3 = _arg1.target.bytesTotal;
_local4 = (_local2 / _local3);
this.textBox.text = Math.floor((_local4 * 100)).toString();
this.textBox.appendText("%");
this.bar.scaleX = _local4;
}
}
}//package
Section 76
//spriteSheet (spriteSheet)
package {
import flash.display.*;
public dynamic class spriteSheet extends BitmapData {
public function spriteSheet(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 77
//unbelievablewav (unbelievablewav)
package {
import flash.media.*;
public dynamic class unbelievablewav extends Sound {
}
}//package
Section 78
//wildwav (wildwav)
package {
import flash.media.*;
public dynamic class wildwav extends Sound {
}
}//package