Section 1
//Crack01_139 (WallGame_fla.Crack01_139)
package WallGame_fla {
import flash.display.*;
public dynamic class Crack01_139 extends MovieClip {
public function Crack01_139(){
addFrameScript(4, frame5);
}
function frame5(){
stop();
}
}
}//package WallGame_fla
Section 2
//Crack01_44 (WallGame_fla.Crack01_44)
package WallGame_fla {
import flash.display.*;
public dynamic class Crack01_44 extends MovieClip {
public function Crack01_44(){
addFrameScript(4, frame5);
}
function frame5(){
stop();
}
}
}//package WallGame_fla
Section 3
//Crack02_141 (WallGame_fla.Crack02_141)
package WallGame_fla {
import flash.display.*;
public dynamic class Crack02_141 extends MovieClip {
public function Crack02_141(){
addFrameScript(4, frame5);
}
function frame5(){
stop();
}
}
}//package WallGame_fla
Section 4
//Crack02_46 (WallGame_fla.Crack02_46)
package WallGame_fla {
import flash.display.*;
public dynamic class Crack02_46 extends MovieClip {
public function Crack02_46(){
addFrameScript(4, frame5);
}
function frame5(){
stop();
}
}
}//package WallGame_fla
Section 5
//Crack03_143 (WallGame_fla.Crack03_143)
package WallGame_fla {
import flash.display.*;
public dynamic class Crack03_143 extends MovieClip {
public function Crack03_143(){
addFrameScript(4, frame5);
}
function frame5(){
stop();
}
}
}//package WallGame_fla
Section 6
//Crack03_48 (WallGame_fla.Crack03_48)
package WallGame_fla {
import flash.display.*;
public dynamic class Crack03_48 extends MovieClip {
public function Crack03_48(){
addFrameScript(4, frame5);
}
function frame5(){
stop();
}
}
}//package WallGame_fla
Section 7
//Crack03_81 (WallGame_fla.Crack03_81)
package WallGame_fla {
import flash.display.*;
public dynamic class Crack03_81 extends MovieClip {
public function Crack03_81(){
addFrameScript(4, frame5);
}
function frame5(){
stop();
}
}
}//package WallGame_fla
Section 8
//Fan_113 (WallGame_fla.Fan_113)
package WallGame_fla {
import flash.display.*;
public dynamic class Fan_113 extends MovieClip {
public function Fan_113(){
addFrameScript(20, frame21);
}
function frame21(){
stop();
}
}
}//package WallGame_fla
Section 9
//Fan_202 (WallGame_fla.Fan_202)
package WallGame_fla {
import flash.display.*;
public dynamic class Fan_202 extends MovieClip {
public function Fan_202(){
addFrameScript(20, frame21);
}
function frame21(){
stop();
}
}
}//package WallGame_fla
Section 10
//FireBallBlast_34 (WallGame_fla.FireBallBlast_34)
package WallGame_fla {
import flash.display.*;
public dynamic class FireBallBlast_34 extends MovieClip {
public function FireBallBlast_34(){
addFrameScript(14, frame15);
}
function frame15(){
stop();
}
}
}//package WallGame_fla
Section 11
//FireBallVanish_32 (WallGame_fla.FireBallVanish_32)
package WallGame_fla {
import flash.display.*;
public dynamic class FireBallVanish_32 extends MovieClip {
public function FireBallVanish_32(){
addFrameScript(14, frame15);
}
function frame15(){
stop();
}
}
}//package WallGame_fla
Section 12
//flashanimation_4 (WallGame_fla.flashanimation_4)
package WallGame_fla {
import flash.display.*;
public dynamic class flashanimation_4 extends MovieClip {
public function flashanimation_4(){
addFrameScript(94, frame95);
}
function frame95(){
stop();
}
}
}//package WallGame_fla
Section 13
//HighScore_158 (WallGame_fla.HighScore_158)
package WallGame_fla {
import flash.display.*;
import flash.text.*;
public dynamic class HighScore_158 extends MovieClip {
public var score1:TextField;
public var score5:TextField;
public var score10:TextField;
public var backhs:SimpleButton;
public var score6:TextField;
public var date1:TextField;
public var date2:TextField;
public var date3:TextField;
public var date6:TextField;
public var date7:TextField;
public var playmorehs:SimpleButton;
public var date5:TextField;
public var date9:TextField;
public var player1:TextField;
public var player2:TextField;
public var player6:TextField;
public var player7:TextField;
public var player8:TextField;
public var player5:TextField;
public var date4:TextField;
public var date8:TextField;
public var player3:TextField;
public var player9:TextField;
public var player4:TextField;
public var date10:TextField;
public var player10:TextField;
public var score2:TextField;
public var score3:TextField;
public var score7:TextField;
public var score8:TextField;
public var score9:TextField;
public var score4:TextField;
}
}//package WallGame_fla
Section 14
//InstructionsScreen_174 (WallGame_fla.InstructionsScreen_174)
package WallGame_fla {
import flash.display.*;
public dynamic class InstructionsScreen_174 extends MovieClip {
public var playmore:SimpleButton;
public var backintro:SimpleButton;
}
}//package WallGame_fla
Section 15
//Level1Animation_70 (WallGame_fla.Level1Animation_70)
package WallGame_fla {
import flash.display.*;
public dynamic class Level1Animation_70 extends MovieClip {
public function Level1Animation_70(){
addFrameScript(87, frame88);
}
function frame88(){
stop();
}
}
}//package WallGame_fla
Section 16
//Level2Animation_80 (WallGame_fla.Level2Animation_80)
package WallGame_fla {
import flash.display.*;
public dynamic class Level2Animation_80 extends MovieClip {
public function Level2Animation_80(){
addFrameScript(87, frame88);
}
function frame88(){
stop();
}
}
}//package WallGame_fla
Section 17
//Level3Animation_84 (WallGame_fla.Level3Animation_84)
package WallGame_fla {
import flash.display.*;
public dynamic class Level3Animation_84 extends MovieClip {
public function Level3Animation_84(){
addFrameScript(87, frame88);
}
function frame88(){
stop();
}
}
}//package WallGame_fla
Section 18
//Level4Animation_87 (WallGame_fla.Level4Animation_87)
package WallGame_fla {
import flash.display.*;
public dynamic class Level4Animation_87 extends MovieClip {
public function Level4Animation_87(){
addFrameScript(87, frame88);
}
function frame88(){
stop();
}
}
}//package WallGame_fla
Section 19
//Level5Animation_90 (WallGame_fla.Level5Animation_90)
package WallGame_fla {
import flash.display.*;
public dynamic class Level5Animation_90 extends MovieClip {
public function Level5Animation_90(){
addFrameScript(87, frame88);
}
function frame88(){
stop();
}
}
}//package WallGame_fla
Section 20
//Level6Animation_93 (WallGame_fla.Level6Animation_93)
package WallGame_fla {
import flash.display.*;
public dynamic class Level6Animation_93 extends MovieClip {
public function Level6Animation_93(){
addFrameScript(87, frame88);
}
function frame88(){
stop();
}
}
}//package WallGame_fla
Section 21
//LogoAni_118 (WallGame_fla.LogoAni_118)
package WallGame_fla {
import flash.display.*;
public dynamic class LogoAni_118 extends MovieClip {
public function LogoAni_118(){
addFrameScript(19, frame20);
}
function frame20(){
stop();
}
}
}//package WallGame_fla
Section 22
//LogoAni_166 (WallGame_fla.LogoAni_166)
package WallGame_fla {
import flash.display.*;
public dynamic class LogoAni_166 extends MovieClip {
public function LogoAni_166(){
addFrameScript(19, frame20);
}
function frame20(){
stop();
}
}
}//package WallGame_fla
Section 23
//LogoAni_207 (WallGame_fla.LogoAni_207)
package WallGame_fla {
import flash.display.*;
public dynamic class LogoAni_207 extends MovieClip {
public function LogoAni_207(){
addFrameScript(19, frame20);
}
function frame20(){
stop();
}
}
}//package WallGame_fla
Section 24
//ParticleGlow_35 (WallGame_fla.ParticleGlow_35)
package WallGame_fla {
import flash.display.*;
public dynamic class ParticleGlow_35 extends MovieClip {
public function ParticleGlow_35(){
addFrameScript(14, frame15);
}
function frame15(){
stop();
}
}
}//package WallGame_fla
Section 25
//total_mc_1 (WallGame_fla.total_mc_1)
package WallGame_fla {
import flash.display.*;
public dynamic class total_mc_1 extends MovieClip {
public function total_mc_1(){
addFrameScript(179, frame180);
}
function frame180(){
stop();
}
}
}//package WallGame_fla
Section 26
//WelcomeScreen_176 (WallGame_fla.WelcomeScreen_176)
package WallGame_fla {
import flash.display.*;
public dynamic class WelcomeScreen_176 extends MovieClip {
public var hs:SimpleButton;
public var intro:SimpleButton;
public var playGame:SimpleButton;
public var playmore:SimpleButton;
public var addMore:SimpleButton;
}
}//package WallGame_fla
Section 27
//YouLoseTextAni_98 (WallGame_fla.YouLoseTextAni_98)
package WallGame_fla {
import flash.display.*;
public dynamic class YouLoseTextAni_98 extends MovieClip {
public function YouLoseTextAni_98(){
addFrameScript(67, frame68);
}
function frame68(){
stop();
}
}
}//package WallGame_fla
Section 28
//YouWin_191 (WallGame_fla.YouWin_191)
package WallGame_fla {
import flash.display.*;
public dynamic class YouWin_191 extends MovieClip {
public var playmore:SimpleButton;
public var playAgain:SimpleButton;
}
}//package WallGame_fla
Section 29
//YouWinTextAnimation_193 (WallGame_fla.YouWinTextAnimation_193)
package WallGame_fla {
import flash.display.*;
public dynamic class YouWinTextAnimation_193 extends MovieClip {
public function YouWinTextAnimation_193(){
addFrameScript(62, frame63);
}
function frame63(){
stop();
}
}
}//package WallGame_fla
Section 30
//Ball (Ball)
package {
import flash.events.*;
import flash.geom.*;
import flash.display.*;
public class Ball extends MovieClip {
private var sin:Number;
private var ballIndex:Number;// = 0
public var minSpeed:Number;// = 7
private var brickBounce;// = -1
private var stageBounce:Array;
private var randomBounce;// = -1
private var mass:Number;// = 1
public var speed:Number;// = 7
private var RTD;// = 57.2957795130823
private var cos:Number;
private var ballOnFireCountMax:Number;// = 0
private var radius:Number;// = 10
private var paddleBounce;// = -1
public var ballOnFire:Boolean;// = false
private var DTR;// = 0.0174532925199433
private var angle:Number;// = 0
private var ballOnFireCount:Number;// = 0
public var velocity:Point;
private var dampingEnabled;// = false
private var veldx:Number;
private var veldy:Number;// = 0
public static var radius:Number = 10;
public function Ball(){
velocity = new Point();
minSpeed = 7;
speed = 7;
angle = 0;
RTD = (180 / Math.PI);
DTR = (Math.PI / 180);
stageBounce = new Array(-1, -1.1, -1.2, -0.75, -0.8, -0.9, -0.95, -1.15, -0.98, -0.85);
radius = 10;
paddleBounce = -1;
brickBounce = -1;
randomBounce = -1;
dampingEnabled = false;
veldy = 0;
ballIndex = 0;
mass = 1;
ballOnFire = false;
ballOnFireCount = 0;
ballOnFireCountMax = 0;
super();
addFrameScript(0, frame1, 1, frame2);
init();
}
public function init(){
minSpeed = GParams.ballVelocity[(GParams.currentLevel - 1)];
minSpeed = minSpeed;
speed = minSpeed;
angle = ((Math.random() * ((ballIndex + 1) * 90)) * DTR);
velocity.x = (speed * Math.cos(angle));
velocity.y = (speed * Math.sin(angle));
veldx = (velocity.x / speed);
veldy = (velocity.y / speed);
ballOnFire = false;
ballOnFireCount = 0;
ballOnFireCountMax = (GParams.frameRate * 10);
gotoAndStop(1);
}
public function checkLine(_arg1:Line, _arg2:Point):Boolean{
var _local3:*;
var _local4:Point;
var _local5:Rectangle;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
_local3 = false;
_local4 = new Point();
_local4.x = (_arg1.x + _arg2.x);
_local4.y = (_arg1.y + _arg2.y);
_local5 = _arg1.getBounds(this.parent);
if ((((x >= _local5.left)) && ((x <= _local5.right)))){
angle = (_arg1.rotation * DTR);
cos = Math.cos(angle);
sin = Math.sin(angle);
_local6 = (x - _local4.x);
_local7 = (y - _local4.y);
_local8 = ((cos * _local7) - (sin * _local6));
_local9 = ((cos * velocity.y) - (sin * velocity.x));
if ((((_local8 > -(radius))) && ((_local8 < _local9)))){
_local3 = true;
_local10 = ((cos * _local6) + (sin * _local7));
_local11 = ((cos * velocity.x) + (sin * velocity.y));
_local8 = -(radius);
_local6 = ((cos * _local10) - (sin * _local8));
_local7 = ((cos * _local8) + (sin * _local10));
velocity.x = (((cos * _local11) - (sin * _local9)) * 1.1);
velocity.y = (((cos * _local9) + (sin * _local11)) * 1.1);
velocity.y = (velocity.y * randomBounce);
speed = (minSpeed * 1.1);
x = (_local4.x + _local6);
y = (_local4.y + _local7);
veldx = (velocity.x / speed);
veldy = (velocity.y / speed);
};
};
return (_local3);
}
private function checkBalltoBallCollision(_arg1:Ball, _arg2:Ball):void{
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Point;
var _local10:Point;
var _local11:Point;
var _local12:Point;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Object;
var _local17:Object;
var _local18:Object;
var _local19:Object;
_local3 = (_arg2.x - _arg1.x);
_local4 = (_arg2.y - _arg1.y);
_local5 = Math.sqrt(((_local3 * _local3) + (_local4 * _local4)));
if (_local5 < (_arg1.radius + _arg2.radius)){
_local6 = Math.atan2(_local4, _local3);
_local7 = Math.sin(_local6);
_local8 = Math.cos(_local6);
_local9 = new Point(0, 0);
_local10 = rotate(_local3, _local4, _local7, _local8, true);
_local11 = rotate(_arg1.velocity.x, _arg1.velocity.y, _local7, _local8, true);
_local12 = rotate(_arg2.velocity.x, _arg2.velocity.y, _local7, _local8, true);
_local13 = (_local11.x - _local12.x);
_local11.x = (((_arg1.mass - (_arg2.mass * _local11.x)) + (((2 * _arg2.mass) * _local12.x) / _arg1.mass)) + _arg2.mass);
_local12.x = (_local13 + _local11.x);
_local14 = (Math.abs(_local11.x) + Math.abs(_local12.x));
_local15 = ((_arg1.radius + _arg2.radius) - Math.abs((_local9.x - _local10.x)));
_local9.x = (_local9.x + ((_local11.x / _local14) * _local15));
_local10.x = (_local10.x + ((_local12.x / _local14) * _local15));
_local16 = rotate(_local9.x, _local9.y, _local7, _local8, false);
_local17 = rotate(_local10.x, _local10.y, _local7, _local8, false);
_arg2.x = (_arg1.x + (_local17.x * 1.3));
_arg2.y = (_arg1.y + (_local17.y * 1.3));
_arg1.x = (_arg1.x + (_local16.x * 1.3));
_arg1.y = (_arg1.y + (_local16.y * 1.3));
_local18 = rotate(_local11.x, _local11.y, _local7, _local8, false);
_local19 = rotate(_local12.x, _local12.y, _local7, _local8, false);
_arg1.velocity.x = (_local18.x * 0.85);
_arg1.velocity.y = (_local18.y * 0.85);
_arg2.velocity.x = (_local19.x * 0.85);
_arg2.velocity.y = (_local19.y * 0.85);
};
}
public function bounceBallY():void{
velocity.y = (velocity.y * brickBounce);
this.y = (this.y + velocity.y);
this.x = (this.x + velocity.x);
veldx = (velocity.x / speed);
veldy = (velocity.y / speed);
setEnemyVelocity();
}
public function resetBallOnFire(){
ballOnFire = false;
gotoAndStop(1);
ballOnFireCount = 0;
}
private function setEnemyVelocity(){
var _local1:*;
_local1 = 0;
while (_local1 < (WallGameMain.surface.territory.length - 1)) {
WallGameMain.surface.territory[_local1].setPaddleVelocity();
_local1++;
};
}
public function setVelocity(_arg1:Number){
velocity.x = (speed * Math.cos(_arg1));
velocity.y = (speed * Math.sin(_arg1));
veldx = (velocity.x / speed);
veldy = (velocity.y / speed);
setEnemyVelocity();
}
function frame1(){
stop();
}
public function checkBoundaryTW(){
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:Number;
_local1 = (this.x - radius);
_local2 = (this.x + radius);
_local3 = (this.y - radius);
_local4 = (this.y + radius);
if (_local1 < GParams.stageBorder){
this.x = (GParams.stageBorder + radius);
WallGameMain.bhs.play();
bounceBallX();
return;
};
if (_local2 > GParams.innerEndX){
this.x = (GParams.innerEndX - radius);
WallGameMain.bhs.play();
bounceBallX();
return;
};
}
public function checkRhombusCollision(){
var _local1:Number;
_local1 = 0;
while (_local1 < 4) {
if (checkLine(Rhombus.randomObjects[0].lines[_local1], Rhombus.randomObjects[0].center) == true){
Rhombus.randomObjects[0].changePosition();
WallGameMain.rhs.play();
return (true);
};
_local1++;
};
return (false);
}
public function removeBallListener(){
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
}
public function bounceBallX():void{
velocity.x = (velocity.x * brickBounce);
this.x = (this.x + velocity.x);
this.y = (this.y + velocity.y);
veldx = (velocity.x / speed);
veldy = (velocity.y / speed);
setEnemyVelocity();
}
public function setIndex(_arg1:Number){
this.ballIndex = _arg1;
}
public function setBallOnFire(){
ballOnFire = true;
gotoAndStop(2);
ballOnFireCount = 0;
}
public function correctOverlap(_arg1:Number){
this.x = (this.x + (veldx * _arg1));
this.y = (this.y + (veldy * _arg1));
}
private function rotate(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Boolean):Point{
var _local6:Point;
_local6 = new Point();
if (_arg5){
_local6.x = ((_arg1 * _arg4) + (_arg2 * _arg3));
_local6.y = ((_arg2 * _arg4) - (_arg1 * _arg3));
} else {
_local6.x = ((_arg1 * _arg4) - (_arg2 * _arg3));
_local6.y = ((_arg2 * _arg4) + (_arg1 * _arg3));
};
return (_local6);
}
function frame2(){
stop();
}
public function onEnterFrame(_arg1:Event){
this.x = (this.x + velocity.x);
this.y = (this.y + velocity.y);
switch (GParams.currentLevel){
case 1:
collisionCheckLevel1();
break;
case 2:
collisionCheckLevel2();
break;
case 3:
collisionCheckLevel3();
break;
case 4:
boundaryCheckSplitLevel();
break;
case 5:
collisionCheckLevel5();
break;
case 6:
boundaryCheckLevel2();
break;
};
if (ballOnFire == true){
ballOnFireCount = (ballOnFireCount + 1);
if (ballOnFireCount >= ballOnFireCountMax){
resetBallOnFire();
};
};
}
public function reinit(){
minSpeed = GParams.ballVelocity[(GParams.currentLevel - 1)];
minSpeed = minSpeed;
angle = ((Math.random() * 360) * DTR);
velocity.x = (speed * Math.cos(angle));
velocity.y = (speed * Math.sin(angle));
veldx = (velocity.x / speed);
veldy = (velocity.y / speed);
ballOnFire = false;
ballOnFireCount = 0;
gotoAndStop(1);
addEventListener(Event.ENTER_FRAME, onEnterFrame);
}
public function collisionCheckLevel3(){
boundaryCheckLevel1();
checkBallCollision();
if (WallGameMain.surface.checkRotatorCollision() == true){
setEnemyVelocity();
return;
};
}
public function collisionCheckLevel1(){
boundaryCheckLevel1();
}
public function boundaryCheckLevel2(){
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Boolean;
var _local7:Boolean;
_local1 = 0;
_local2 = (this.x - radius);
_local3 = (this.x + radius);
_local4 = (this.y - radius);
_local5 = (this.y + radius);
_local6 = false;
_local7 = false;
if (checkRhombusCollision() == true){
setEnemyVelocity();
return;
};
if (WallGameMain.surface.checkRotatorCollision() == true){
setEnemyVelocity();
return;
};
if (_local2 < GParams.stageBorder){
this.x = (GParams.stageBorder + radius);
WallGameMain.bhs.play();
bounceBallX();
return;
};
if (_local3 > GParams.innerWidth){
this.x = (GParams.innerWidth - radius);
WallGameMain.bhs.play();
bounceBallX();
return;
};
if (_local4 < GParams.stageBorder){
this.y = (GParams.stageBorder + radius);
WallGameMain.bhs.play();
bounceBallY();
return;
};
if (_local5 > GParams.innerHeight){
this.y = (GParams.innerHeight - radius);
WallGameMain.bhs.play();
bounceBallY();
return;
};
}
public function collisionCheckLevel5(){
checkBallCollision();
boundaryCheckLevel1();
if (WallGameMain.surface.checkRotatorCollision() == true){
setEnemyVelocity();
return;
};
}
public function boundaryCheckSplitLevel(){
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:Number;
_local1 = (this.x - radius);
_local2 = (this.x + radius);
_local3 = (this.y - radius);
_local4 = (this.y + radius);
if (ballIndex == 0){
if (_local1 < GParams.split1MinX){
this.x = (GParams.split1MinX + radius);
bounceBallX();
WallGameMain.bhs.play();
return;
};
if (_local2 > GParams.split1MaxX){
this.x = (GParams.split1MaxX - radius);
bounceBallX();
WallGameMain.bhs.play();
return;
};
if (_local3 < GParams.stageBorder){
this.y = (GParams.stageBorder + radius);
bounceBallY();
WallGameMain.bhs.play();
return;
};
if (_local4 > GParams.innerHeight){
this.y = (GParams.innerHeight - radius);
bounceBallY();
WallGameMain.bhs.play();
return;
};
} else {
if (_local1 < GParams.split2MinX){
this.x = (GParams.split2MinX + radius);
bounceBallX();
WallGameMain.bhs.play();
return;
};
if (_local2 > GParams.split2MaxX){
this.x = (GParams.split2MaxX - radius);
bounceBallX();
WallGameMain.bhs.play();
return;
};
if (_local3 < GParams.stageBorder){
this.y = (GParams.stageBorder + radius);
bounceBallY();
WallGameMain.bhs.play();
return;
};
if (_local4 > GParams.innerHeight){
this.y = (GParams.innerHeight - radius);
WallGameMain.bhs.play();
bounceBallY();
return;
};
};
}
public function checkBallCollision(){
var _local1:Number;
var _local2:Ball;
_local1 = ((ballIndex + 1) % 2);
_local2 = WallGameMain.ballArray[_local1];
checkBalltoBallCollision(this, _local2);
}
public function checkPaddleCollisionTW():Boolean{
var _local1:*;
_local1 = 0;
while (_local1 < WallGameMain.surface.territory.length) {
if (WallGameMain.surface.territory[_local1].checkPaddleCollision(this) == true){
setEnemyVelocity();
return (true);
};
_local1++;
};
return (false);
}
public function boundaryCheckLevel1(){
checkBoundaryTW();
}
public function collisionCheckLevel2(){
checkRhombusCollision();
boundaryCheckLevel1();
}
public function checkReflectorCollisionTW():Boolean{
var _local1:Boolean;
var _local2:*;
_local1 = false;
_local2 = 0;
while (_local2 < WallGameMain.surface.reflectors.length) {
if (WallGameMain.surface.reflectors[_local2].checkBallCollision(this) == true){
setEnemyVelocity();
return (true);
};
_local2++;
};
return (false);
}
}
}//package
Section 31
//BottomWallReflector (BottomWallReflector)
package {
import flash.events.*;
public class BottomWallReflector extends Reflector {
private var speed:Number;// = 6
private var bounce:Number;// = -1
private var xMin:Number;// = 0
private var xMax:Number;// = 0
public static var reflectorArray:Array = new Array(reflectorCount);
public function BottomWallReflector(){
xMin = 0;
xMax = 0;
speed = 6;
bounce = -1;
super();
width = 30;
height = 9;
halfWidth = (width / 2);
halfHeight = (height / 2);
minDistX = ((halfWidth + Ball.radius) + 3);
minDistY = ((halfHeight + Ball.radius) + 3);
}
public function setBoundary(_arg1:Number, _arg2:Number){
xMin = _arg1;
xMax = _arg2;
addEventListener(Event.ENTER_FRAME, onEnterFrame);
trace((((" xMin : " + xMin) + "xMax : ") + xMax));
}
public function onEnterFrame(_arg1:Event){
this.x = (this.x + speed);
if (this.x <= xMin){
speed = (speed * bounce);
this.x = xMin;
} else {
if (this.x >= xMax){
speed = (speed * bounce);
this.x = xMax;
};
};
checkBallCollision();
}
public function reinit(){
addEventListener(Event.ENTER_FRAME, onEnterFrame);
}
override public function resetReflector(){
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
}
override public function checkBallCollision():Boolean{
var _local1:Boolean;
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Ball;
var _local6:Number;
_local1 = false;
_local2 = 0;
_local3 = 0;
_local4 = 0;
_local5 = null;
_local6 = 0;
while (_local6 < WallGameMain.ballArray.length) {
_local5 = WallGameMain.ballArray[_local6];
_local2 = (this.x - _local5.x);
if (Math.abs(_local2) <= minDistX){
_local3 = (this.y - _local5.y);
if (Math.abs(_local3) <= minDistY){
_local4 = (Math.atan2(_local3, _local2) - Math.PI);
_local5.setVelocity(_local4);
_local1 = true;
return (_local1);
};
};
_local6++;
};
return (_local1);
}
public static function createReflectors():void{
var _local1:Number;
var _local2:Number;
var _local3:*;
_local1 = -1;
_local2 = -3;
_local3 = 0;
while (_local3 < reflectorArray.length) {
if (reflectorArray[_local3] == null){
reflectorArray[_local3] = new (BottomWallReflector);
reflectorArray[_local3].speed = _local2;
_local2 = (_local2 * _local1);
};
_local3++;
};
}
}
}//package
Section 32
//BoundaryHit (BoundaryHit)
package {
import flash.media.*;
public class BoundaryHit extends Sound {
}
}//package
Section 33
//BreakOne (BreakOne)
package {
import flash.media.*;
public class BreakOne extends Sound {
}
}//package
Section 34
//BreakThree (BreakThree)
package {
import flash.media.*;
public class BreakThree extends Sound {
}
}//package
Section 35
//BreakTwo (BreakTwo)
package {
import flash.media.*;
public class BreakTwo extends Sound {
}
}//package
Section 36
//Brick (Brick)
package {
import flash.events.*;
import flash.geom.*;
import flash.display.*;
public class Brick extends MovieClip {
private var territoryIndex:Number;// = -1
private var brickIndex:Number;// = -1
public var minHeight:Number;// = 0
public var pos:Point;
public var injuryLevel:Number;// = 0
public var minWidth:Number;// = 0
private var overlapMin:Number;// = 0
public var isActive:Boolean;// = true
private var shieldOn:Boolean;// = false
private var powerType:Number;// = -1
public static var brickSize:Number = 30;
public static var halfWidth:Number = (brickSize / 2);
public static var brickHeight:Number = 20;
public static var halfHeight:Number = (brickHeight / 2);
public function Brick(){
isActive = true;
injuryLevel = 0;
pos = new Point();
minWidth = 0;
minHeight = 0;
territoryIndex = -1;
overlapMin = 0;
powerType = -1;
shieldOn = false;
brickIndex = -1;
super();
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5, 5, frame6, 6, frame7, 7, frame8, 8, frame9, 9, frame10, 10, frame11, 11, frame12);
minWidth = (halfWidth + Ball.radius);
minHeight = (halfHeight + Ball.radius);
overlapMin = Math.sqrt(((minWidth * minWidth) + (minHeight * minHeight)));
brickIndex = -1;
}
public function damageBrick(_arg1:Boolean, _arg2:Number){
if (isActive == false){
return;
};
if (shieldOn == true){
WallGameMain.bhs.play();
return;
};
if (territoryIndex == 0){
incrementScore();
};
if (_arg1 == true){
if ((((powerType >= 0)) && ((injuryLevel <= 3)))){
WallGameMain.surface.initPower(powerType, territoryIndex, brickIndex);
};
injuryLevel = 3;
gotoAndStop((injuryLevel + 1));
isActive = false;
updateTerritoryLife();
WallGameMain.bths.play();
return;
};
if (injuryLevel <= 3){
if (injuryLevel == 0){
if (powerType >= 0){
WallGameMain.surface.initPower(powerType, territoryIndex, brickIndex);
};
WallGameMain.bos.play();
} else {
if (injuryLevel == 1){
WallGameMain.bts.play();
};
};
gotoAndStop((injuryLevel + 2));
injuryLevel = (injuryLevel + 1);
if (injuryLevel == 3){
isActive = false;
updateTerritoryLife();
WallGameMain.bths.play();
};
};
return (true);
}
function frame11(){
stop();
}
function frame10(){
stop();
}
function frame12(){
stop();
}
private function incrementScore(){
GParams.scoreValue = (GParams.scoreValue + GParams.paddleLooseScore);
GParams.currentLevelScore = (GParams.currentLevelScore + GParams.paddleLooseScore);
if (GParams.currentLevel != 4){
TwoBallSurface(WallGameMain.surface).score.text = GParams.scoreValue.toString();
} else {
SplitWallSurface(WallGameMain.surface).score.text = GParams.scoreValue.toString();
};
}
public function hasPowerup():Boolean{
if (powerType > 0){
return (true);
};
return (false);
}
function frame6(){
stop();
}
function frame7(){
stop();
}
function frame1(){
stop();
}
function frame3(){
stop();
}
public function disableShield(){
if (injuryLevel > 0){
gotoAndStop((injuryLevel + 9));
} else {
if (powerType >= 0){
gotoAndStop((powerType + 4));
} else {
gotoAndStop(1);
};
};
shieldOn = false;
}
function frame4(){
stop();
stop();
}
function frame5(){
stop();
}
function frame9(){
stop();
}
function frame8(){
stop();
}
function frame2(){
stop();
}
public function resetBricks(){
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
powerType = -1;
}
public function repair(){
if (injuryLevel > 0){
injuryLevel = 0;
isActive = true;
if (shieldOn != true){
gotoAndStop(1);
};
addEventListener(Event.ENTER_FRAME, onEnterFrame);
};
if (powerType == GParams.POWERUP_REPAIR){
powerType = -1;
};
}
public function assignPowerup(_arg1){
var _local2:Number;
this.powerType = _arg1;
_local2 = (_arg1 + 4);
gotoAndStop(_local2);
}
public function setPosition(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number){
pos.x = _arg1;
pos.y = _arg2;
this.territoryIndex = _arg3;
this.brickIndex = _arg4;
}
public function onEnterFrame(_arg1:Event){
var _local2:Ball;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
_local2 = null;
_local3 = 0;
_local4 = 0;
_local5 = 0;
while (_local5 < WallGameMain.ballArray.length) {
_local2 = WallGameMain.ballArray[_local5];
_local6 = (_local2.x - this.x);
_local7 = (_local2.y - this.y);
if ((((Math.abs(_local6) <= minWidth)) && ((Math.abs(_local7) <= minHeight)))){
_local4 = Math.atan2(_local7, _local6);
damageBrick(_local2.ballOnFire, brickIndex);
_local3 = (overlapMin - Math.sqrt(((_local6 * _local6) + (_local7 * _local7))));
_local2.setVelocity(_local4);
if (_local3 > 0){
_local2.correctOverlap(_local3);
};
};
_local5++;
};
}
public function reinit(){
injuryLevel = 0;
isActive = true;
gotoAndStop(1);
addEventListener(Event.ENTER_FRAME, onEnterFrame);
powerType = -1;
}
public function enableShield(){
gotoAndStop(9);
shieldOn = true;
}
private function updateTerritoryLife(){
WallGameMain.surface.territoryLife[territoryIndex] = (WallGameMain.surface.territoryLife[territoryIndex] - 1);
if (territoryIndex == 0){
if (WallGameMain.surface.territoryLife[territoryIndex] == 0){
WallGameMain.levelWin = true;
};
TerritoryTop(WallGameMain.surface.territory[territoryIndex]).life.text = WallGameMain.surface.territoryLife[territoryIndex].toString();
} else {
if (WallGameMain.surface.territoryLife[territoryIndex] == 0){
WallGameMain.levelLoose = true;
};
TerritoryBottom(WallGameMain.surface.territory[territoryIndex]).life.text = WallGameMain.surface.territoryLife[territoryIndex].toString();
};
}
}
}//package
Section 37
//EnemyPaddle (EnemyPaddle)
package {
import flash.geom.*;
public class EnemyPaddle extends Paddle {
private var constantY:Number;// = 0
protected var xAngle:Number;// = 0
protected var speed:Number;// = 6
public var velControl:Number;// = -1
protected var minY:Number;// = -1
protected var maxY:Number;// = -1
protected var minX:Number;// = 0
protected var maxX:Number;// = 0
protected var velocityAdjust:Number;// = 25
protected var yAngle:Number;// = 0
protected var destP:Point;
protected var speedX:Number;// = 6
protected var speedY:Number;// = 0
public function EnemyPaddle(){
constantY = 0;
destP = new Point();
speed = 6;
speedX = 6;
speedY = 0;
minX = 0;
maxX = 0;
minY = -1;
maxY = -1;
xAngle = 0;
yAngle = 0;
velocityAdjust = 25;
velControl = -1;
super();
}
public function setEnemyVelocity(){
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Ball;
var _local10:Number;
var _local11:Number;
_local1 = (Math.random() * 10);
if (_local1 >= velControl){
return;
};
_local7 = 0;
_local8 = 0;
_local9 = null;
_local10 = -1;
if (GParams.currentLevel < 4){
_local11 = 0;
while (_local11 < WallGameMain.ballArray.length) {
_local9 = WallGameMain.ballArray[_local11];
_local2 = _local9.x;
_local4 = _local9.y;
_local3 = (_local2 + _local9.velocity.x);
_local5 = (_local4 + _local9.velocity.y);
if ((_local5 - _local4) < 0){
_local6 = ((_local4 - _local5) / (_local2 - _local3));
_local7 = (_local4 - (_local6 * _local2));
destP.y = this.y;
destP.x = ((destP.y - _local7) / _local6);
if ((((destP.x >= minX)) && ((destP.x <= maxX)))){
_local8 = (destP.x - this.x);
if (Math.abs(_local10) > Math.abs(_local8)){
_local8 = _local10;
};
speed = (_local8 / velocityAdjust);
} else {
speed = 0.5;
};
};
_local11++;
};
} else {
_local9 = WallGameMain.ballArray[enemyIndex];
_local2 = _local9.x;
_local4 = _local9.y;
_local3 = (_local2 + _local9.velocity.x);
_local5 = (_local4 + _local9.velocity.y);
if ((_local5 - _local4) < 0){
_local6 = ((_local4 - _local5) / (_local2 - _local3));
_local7 = (_local4 - (_local6 * _local2));
destP.y = this.y;
destP.x = ((destP.y - _local7) / _local6);
if ((((destP.x >= minX)) && ((destP.x <= maxX)))){
_local8 = (destP.x - this.x);
if (Math.abs(_local10) > Math.abs(_local8)){
_local8 = _local10;
};
speed = (_local8 / velocityAdjust);
} else {
speed = 0.5;
};
};
};
}
override public function setBoundary(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number=-1, _arg7:Number=-1){
this.enemyIndex = _arg1;
this.xAngle = _arg2;
this.yAngle = _arg3;
minX = _arg4;
maxX = _arg5;
if (_arg6 != -1){
this.minY = _arg6;
this.maxY = _arg7;
};
velControl = GParams.intelligenceControl[(GParams.currentLevel - 1)];
}
public function checkBoundary(){
if ((((GParams.currentLevel == 1)) || ((GParams.currentLevel == 2)))){
if ((x - radius) < WallGameMain.surface.boundaryL1XMin){
x = (WallGameMain.surface.boundaryL1XMin + radius);
} else {
if ((x + radius) > WallGameMain.surface.boundaryL1XMax){
x = (WallGameMain.surface.boundaryL1XMax - radius);
};
};
};
if (GParams.currentLevel == 3){
if (enemyIndex == 0){
if (x < minX){
this.x = minX;
} else {
if (x >= maxX){
this.rotation = yAngle;
this.y = (this.y - radius);
this.x = maxX;
};
};
if (y < minY){
y = minY;
} else {
if (y > maxY){
y = maxY;
this.rotation = xAngle;
this.x = (this.x - radius);
x = (x - 2);
};
};
} else {
if (x < minX){
this.x = minX;
this.rotation = yAngle;
this.y = (this.y - radius);
} else {
if (x >= maxX){
this.x = maxX;
};
};
if (enemyIndex == 1){
if (y < minY){
y = minY;
} else {
if (y > maxY){
y = maxY;
this.rotation = xAngle;
this.x = (this.x - radius);
x = (x - 2);
};
};
} else {
if (y < minY){
y = minY;
this.rotation = xAngle;
this.x = (this.x - radius);
x = (x - 2);
} else {
if (y > maxY){
y = maxY;
};
};
};
};
};
}
override public function checkBoundaryFW(){
if (x < minX){
x = minX;
} else {
if (x >= maxX){
x = maxX;
};
};
if (y < minY){
y = minY;
x = (x - 1);
} else {
if (y > maxY){
y = maxY;
};
};
}
public function reinit(){
isDamaged = false;
}
public function setVelocityAdjust(_arg1:Number){
this.velocityAdjust = _arg1;
}
}
}//package
Section 38
//EnemyPaddleBottomRight (EnemyPaddleBottomRight)
package {
import flash.events.*;
import flash.geom.*;
public class EnemyPaddleBottomRight extends EnemyPaddle {
private var horizontal:Boolean;// = true
private var verticle:Boolean;// = false
public function EnemyPaddleBottomRight(){
verticle = false;
horizontal = true;
super();
}
override public function removePaddleEventListener(){
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
}
override public function setBoundary(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number=-1, _arg7:Number=-1){
enemyIndex = _arg1;
xAngle = _arg2;
yAngle = _arg3;
this.minX = _arg4;
this.maxX = _arg5;
if (_arg6 != -1){
this.minY = _arg6;
this.maxY = _arg7;
};
velocityAdjust = GParams.enemyPaddleSpeedAdjust[(GParams.currentLevel - 1)];
}
override public function reinit(){
addEventListener(Event.ENTER_FRAME, onEnterFrame);
isDamaged = false;
this.alpha = 1;
paddleBlockCount = 0;
paddleBlocked = false;
horizontal = true;
verticle = false;
}
public function onEnterFrame(_arg1:Event){
if (paddleBlocked == true){
paddleBlockCount = (paddleBlockCount + 1);
if (paddleBlockCount == paddleBlockMaxCount){
paddleBlocked = false;
};
checkBallCollision();
return;
};
if (horizontal == true){
if ((((((speedX < 0)) && ((this.x >= destP.x)))) || ((((speedX > 0)) && ((this.x <= destP.x)))))){
this.x = (this.x + speedX);
if (this.x < (minX + GParams.paddleRadius)){
this.x = minX;
this.y = (minY + GParams.paddleRadius);
rotation = 270;
horizontal = false;
verticle = true;
} else {
if (this.x > maxX){
this.x = maxX;
};
};
};
};
if (verticle == true){
this.x = minX;
if ((((((speedY < 0)) && ((this.y > destP.y)))) || ((((speedY > 0)) && ((this.y < destP.y)))))){
this.y = (this.y + speedY);
if (this.y <= (minY + GParams.paddleRadius)){
this.y = minY;
this.x = ((minX + GParams.paddleRadius) + 2);
rotation = 0;
verticle = false;
horizontal = true;
} else {
if (this.y > maxY){
this.y = maxY;
};
};
};
};
checkBoundaryFW();
checkBallCollisionFW();
}
override public function setEnemyVelocityL2():void{
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Point;
var _local13:Point;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Ball;
var _local18:Number;
if (this.isDamaged == true){
return;
};
_local6 = 0;
_local7 = 0;
_local8 = 0;
_local9 = 0;
_local10 = -1;
_local11 = -1;
_local12 = new Point();
_local13 = new Point();
_local15 = 0;
_local16 = -1;
_local17 = null;
_local18 = 0;
while (_local18 < WallGameMain.ballArray.length) {
_local17 = WallGameMain.ballArray[_local18];
_local1 = _local17.x;
_local3 = _local17.y;
_local2 = (_local1 + _local17.velocity.x);
_local4 = (_local3 + _local17.velocity.y);
_local8 = (_local2 - _local1);
_local9 = (_local4 - _local3);
_local5 = ((_local3 - _local4) / (_local1 - _local2));
_local6 = (_local3 - (_local5 * _local1));
_local12.y = minY;
_local12.x = ((_local12.y - _local6) / _local5);
if ((((_local12.x >= minX)) && ((_local12.x <= maxX)))){
_local14 = (_local17.x - _local12.x);
_local15 = (_local17.y - _local12.y);
_local10 = Math.sqrt(((_local14 * _local14) + (_local15 * _local15)));
};
_local13.x = minX;
_local13.y = ((_local5 * _local13.x) + _local6);
if ((((_local13.y >= minY)) && ((_local13.y <= maxY)))){
_local14 = (_local17.x - _local13.x);
_local15 = (_local17.y - _local13.y);
_local11 = Math.sqrt(((_local14 * _local14) + (_local15 * _local15)));
};
if (((!((_local11 == -1))) && (!((_local10 == -1))))){
_local16 = ((_local11)<_local10) ? 1 : 0;
} else {
if (_local11 != -1){
_local16 = 1;
} else {
if (_local10 != -1){
_local16 = 0;
} else {
_local16 = -1;
};
};
};
if (_local16 == 0){
_local7 = (_local12.x - this.x);
speedX = (_local7 / velocityAdjust);
_local7 = (_local12.y - this.y);
speedY = (_local7 / velocityAdjust);
destP.x = _local12.x;
destP.y = _local12.y;
} else {
if (_local16 == 1){
_local7 = (_local13.y - this.y);
speedY = (_local7 / velocityAdjust);
_local7 = (_local13.x - this.x);
speedX = (_local7 / velocityAdjust);
destP.x = _local13.x;
destP.y = _local13.y;
} else {
speedX = 0.4;
speedY = 0.4;
};
};
_local18++;
};
}
}
}//package
Section 39
//EnemyPaddleTop (EnemyPaddleTop)
package {
import flash.events.*;
public class EnemyPaddleTop extends EnemyPaddle {
private var horizontal:Boolean;// = true
public var setVelocity:Boolean;// = false
private var verticle:Boolean;// = false
public function EnemyPaddleTop(){
verticle = false;
setVelocity = false;
horizontal = true;
super();
paddleBlockCount = 0;
paddleBlockMaxCount = GParams.paddleBlockCountMax;
}
public function resetListener(){
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
}
override public function checkBoundary(){
if ((x - radius) < minX){
x = (minX + radius);
} else {
if ((x + radius) > maxX){
x = (maxX - radius);
};
};
}
public function addEnemyPaddleListener(){
paddleBlockCount = 0;
paddleBlocked = false;
addEventListener(Event.ENTER_FRAME, onEnterFrame);
}
override public function setBoundary(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number=-1, _arg7:Number=-1){
enemyIndex = _arg1;
xAngle = _arg2;
yAngle = _arg3;
this.minX = _arg4;
this.maxX = _arg5;
if (_arg6 != -1){
this.minY = _arg6;
this.maxY = _arg7;
};
velControl = GParams.intelligenceControl[(GParams.currentLevel - 1)];
}
public function onEnterFrame(_arg1:Event){
if (paddleBlocked == true){
paddleBlockCount = (paddleBlockCount + 1);
if (paddleBlockCount == paddleBlockMaxCount){
paddleBlocked = false;
};
checkBallCollision();
return;
};
if (speed < 0){
if (this.x >= destP.x){
this.x = (this.x + speed);
};
} else {
if (this.x <= destP.x){
this.x = (this.x + speed);
};
};
checkBoundary();
checkBallCollision();
}
}
}//package
Section 40
//EnemyPaddleTopLeft (EnemyPaddleTopLeft)
package {
import flash.events.*;
import flash.geom.*;
public class EnemyPaddleTopLeft extends EnemyPaddle {
private var horizontal:Boolean;// = true
private var maxPaddleY:Number;// = 0
private var maxPaddleX:Number;// = 0
private var minPaddleX:Number;// = 0
private var minPaddleY:Number;// = 0
private var verticle:Boolean;// = false
public function EnemyPaddleTopLeft(){
verticle = false;
horizontal = true;
maxPaddleY = 0;
minPaddleY = 0;
maxPaddleX = 0;
minPaddleX = 0;
super();
paddleBlockCount = 0;
paddleBlockMaxCount = GParams.paddleBlockCountMax;
}
override public function removePaddleEventListener(){
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
}
override public function setBoundary(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number=-1, _arg7:Number=-1){
enemyIndex = _arg1;
xAngle = _arg2;
yAngle = _arg3;
this.minX = _arg4;
this.maxX = _arg5;
if (_arg6 != -1){
this.minY = _arg6;
this.maxY = _arg7;
};
velocityAdjust = GParams.enemyPaddleSpeedAdjust[(GParams.currentLevel - 1)];
maxPaddleY = (_arg7 + paddleHeight);
minPaddleY = (_arg6 + radius);
minPaddleX = (minX - radius);
maxPaddleX = (maxX + radius);
velControl = GParams.intelligenceControl[(GParams.currentLevel - 1)];
}
override public function reinit(){
addEventListener(Event.ENTER_FRAME, onEnterFrame);
isDamaged = false;
this.alpha = 1;
paddleBlockCount = 0;
paddleBlocked = false;
horizontal = true;
verticle = false;
this.x = (minX + 50);
this.y = maxY;
rotation = 0;
destP.x = this.x;
destP.y = this.y;
}
public function onEnterFrame(_arg1:Event){
if (paddleBlocked == true){
paddleBlockCount = (paddleBlockCount + 1);
if (paddleBlockCount == paddleBlockMaxCount){
paddleBlocked = false;
};
checkBallCollision();
return;
};
if (horizontal == true){
if ((((((speedX < 0)) && ((this.x >= destP.x)))) || ((((speedX > 0)) && ((this.x <= destP.x)))))){
this.x = (this.x + speedX);
if (this.x >= (maxX - GParams.paddleRadius)){
this.x = maxX;
this.y = (maxY - GParams.paddleRadius);
rotation = 270;
horizontal = false;
verticle = true;
} else {
if (this.x < minX){
this.x = minX;
};
};
};
};
if (verticle == true){
this.x = maxX;
if ((((((speedY < 0)) && ((this.y > destP.y)))) || ((((speedY > 0)) && ((this.y < destP.y)))))){
this.y = (this.y + speedY);
if (this.y > (maxY - GParams.paddleRadius)){
this.y = maxY;
this.x = (maxX - GParams.paddleRadius);
rotation = 0;
verticle = false;
horizontal = true;
} else {
if (this.y < minPaddleY){
this.y = minPaddleY;
};
};
} else {
this.y = (this.y + (speedY * 0.01));
if (this.y < minPaddleY){
this.y = minPaddleY;
};
};
};
checkBallCollisionFW();
}
override public function setEnemyVelocityL2():void{
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Point;
var _local14:Point;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Ball;
var _local19:Number;
_local1 = (Math.random() * 10);
if (_local1 >= velControl){
return;
};
if (this.isDamaged == true){
return;
};
_local7 = 0;
_local8 = 0;
_local9 = 0;
_local10 = 0;
_local11 = -1;
_local12 = -1;
_local13 = new Point();
_local14 = new Point();
_local16 = 0;
_local17 = -1;
_local18 = null;
_local19 = 0;
while (_local19 < WallGameMain.ballArray.length) {
_local18 = WallGameMain.ballArray[_local19];
_local2 = _local18.x;
_local4 = _local18.y;
_local3 = (_local2 + _local18.velocity.x);
_local5 = (_local4 + _local18.velocity.y);
_local9 = (_local3 - _local2);
_local10 = (_local5 - _local4);
_local6 = ((_local4 - _local5) / (_local2 - _local3));
_local7 = (_local4 - (_local6 * _local2));
_local13.y = maxPaddleY;
_local13.x = ((_local13.y - _local7) / _local6);
if ((((_local13.x >= minPaddleX)) && ((_local13.x <= maxPaddleX)))){
_local15 = (_local18.x - _local13.x);
_local16 = (_local18.y - _local13.y);
_local11 = Math.sqrt(((_local15 * _local15) + (_local16 * _local16)));
};
_local14.x = maxPaddleX;
_local14.y = ((_local6 * _local14.x) + _local7);
if ((((_local14.y > minY)) && ((_local14.y < maxPaddleY)))){
_local15 = (_local18.x - _local14.x);
_local16 = (_local18.y - _local14.y);
_local12 = Math.sqrt(((_local15 * _local15) + (_local16 * _local16)));
};
if (((!((_local12 == -1))) && (!((_local11 == -1))))){
_local17 = ((_local12)<_local11) ? 1 : 0;
} else {
if (_local12 != -1){
_local17 = 1;
} else {
if (_local11 != -1){
_local17 = 0;
} else {
_local17 = -1;
};
};
};
if (_local17 == 0){
_local8 = (_local13.x - this.x);
speedX = _local8;
_local8 = (_local13.y - this.y);
speedY = _local8;
destP.x = _local13.x;
destP.y = _local13.y;
} else {
if (_local17 == 1){
_local8 = (_local14.y - this.y);
speedY = _local8;
_local8 = (_local14.x - this.x);
speedX = _local8;
destP.x = _local14.x;
destP.y = _local14.y;
} else {
speedX = 0.2;
speedY = 0.2;
};
};
_local19++;
};
}
}
}//package
Section 41
//EnemyPaddleTopRight (EnemyPaddleTopRight)
package {
import flash.events.*;
import flash.geom.*;
public class EnemyPaddleTopRight extends EnemyPaddle {
private var horizontal:Boolean;// = true
private var maxPaddleY:Number;// = 0
private var maxPaddleX:Number;// = 0
private var minPaddleX:Number;// = 0
private var minPaddleY:Number;// = 0
private var verticle:Boolean;// = false
public function EnemyPaddleTopRight(){
verticle = false;
horizontal = true;
maxPaddleY = 0;
minPaddleY = 0;
maxPaddleX = 0;
minPaddleX = 0;
super();
paddleBlockCount = 0;
paddleBlockMaxCount = GParams.paddleBlockCountMax;
}
override public function removePaddleEventListener(){
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
}
override public function setBoundary(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number=-1, _arg7:Number=-1){
enemyIndex = _arg1;
xAngle = _arg2;
yAngle = _arg3;
this.minX = _arg4;
this.maxX = _arg5;
if (_arg6 != -1){
this.minY = _arg6;
this.maxY = _arg7;
};
velocityAdjust = GParams.enemyPaddleSpeedAdjust[(GParams.currentLevel - 1)];
maxPaddleY = (_arg7 + paddleHeight);
minPaddleY = (_arg6 - radius);
minPaddleX = (minX - radius);
maxPaddleX = (maxX + radius);
velControl = GParams.intelligenceControl[(GParams.currentLevel - 1)];
}
override public function reinit(){
addEventListener(Event.ENTER_FRAME, onEnterFrame);
isDamaged = false;
this.alpha = 1;
paddleBlockCount = 0;
paddleBlocked = false;
speedX = 0;
speedY = 0;
horizontal = true;
verticle = false;
this.x = (minX + 50);
this.y = maxY;
destP.x = this.x;
destP.y = this.y;
rotation = 0;
}
public function onEnterFrame(_arg1:Event){
if (paddleBlocked == true){
paddleBlockCount = (paddleBlockCount + 1);
if (paddleBlockCount == paddleBlockMaxCount){
paddleBlocked = false;
};
checkBallCollision();
return;
};
if (horizontal == true){
if ((((((speedX < 0)) && ((this.x >= destP.x)))) || ((((speedX > 0)) && ((this.x <= destP.x)))))){
this.x = (this.x + speedX);
if (this.x < (minX + GParams.paddleRadius)){
this.x = minX;
this.y = (maxY - GParams.paddleRadius);
rotation = 90;
horizontal = false;
verticle = true;
} else {
if (this.x > maxX){
this.x = maxX;
};
};
};
};
if (verticle == true){
this.x = minX;
if ((((((speedY < 0)) && ((this.y > destP.y)))) || ((((speedY > 0)) && ((this.y < destP.y)))))){
this.y = (this.y + speedY);
if (this.y >= (maxY - GParams.paddleRadius)){
this.y = maxY;
this.x = ((minX + GParams.paddleRadius) + 2);
rotation = 0;
verticle = false;
horizontal = true;
};
} else {
if (this.y < minY){
this.y = minY;
};
};
};
checkBoundaryFW();
checkBallCollisionFW();
}
override public function setEnemyVelocityL2():void{
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Point;
var _local14:Point;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Ball;
var _local19:Number;
_local1 = (Math.random() * 10);
if (_local1 >= velControl){
return;
};
if (this.isDamaged == true){
return;
};
_local7 = 0;
_local8 = 0;
_local9 = 0;
_local10 = 0;
_local11 = -1;
_local12 = -1;
_local13 = new Point();
_local14 = new Point();
_local16 = 0;
_local17 = -1;
_local18 = null;
_local19 = 0;
while (_local19 < WallGameMain.ballArray.length) {
_local18 = WallGameMain.ballArray[_local19];
_local2 = _local18.x;
_local4 = _local18.y;
_local3 = (_local2 + _local18.velocity.x);
_local5 = (_local4 + _local18.velocity.y);
_local9 = (_local3 - _local2);
_local10 = (_local5 - _local4);
_local6 = ((_local4 - _local5) / (_local2 - _local3));
_local7 = (_local4 - (_local6 * _local2));
_local13.y = maxPaddleY;
_local13.x = ((_local13.y - _local7) / _local6);
if ((((_local13.x > minPaddleX)) && ((_local13.x < maxPaddleX)))){
_local15 = (_local18.x - _local13.x);
_local16 = (_local18.y - _local13.y);
_local11 = Math.sqrt(((_local15 * _local15) + (_local16 * _local16)));
};
_local14.x = minPaddleX;
_local14.y = ((_local6 * _local14.x) + _local7);
if ((((_local14.y > minPaddleY)) && ((_local14.y < maxPaddleY)))){
_local15 = (_local18.x - _local14.x);
_local16 = (_local18.y - _local14.y);
_local12 = Math.sqrt(((_local15 * _local15) + (_local16 * _local16)));
};
if (((!((_local12 == -1))) && (!((_local11 == -1))))){
_local17 = ((_local12)<_local11) ? 1 : 0;
} else {
if (_local12 != -1){
_local17 = 1;
} else {
if (_local11 != -1){
_local17 = 0;
} else {
_local17 = -1;
};
};
};
if (_local17 == 0){
_local8 = (_local13.x - this.x);
speedX = (_local8 / velocityAdjust);
_local8 = (_local13.y - this.y);
speedY = (_local8 / velocityAdjust);
destP.x = _local13.x;
destP.y = _local13.y;
} else {
if (_local17 == 1){
_local8 = (_local14.y - this.y);
speedY = (_local8 / velocityAdjust);
_local8 = (_local14.x - this.x);
speedX = (_local8 / velocityAdjust);
destP.x = _local14.x;
destP.y = _local14.y;
} else {
speedX = 0.2;
speedY = 0.2;
};
};
_local19++;
};
}
}
}//package
Section 42
//FireBall (FireBall)
package {
import flash.events.*;
import flash.display.*;
public class FireBall extends MovieClip {
private var minDist:Number;// = 0
private var vanishCount:Number;// = 0
private var speed:Number;
private var vanishCountMax:Number;// = 20
private var maxX:Number;
private var minX:Number;
private var bounce;// = -1
private var radius:Number;// = 0
private var dir:Number;// = 0
private var maxLoopCount:Number;
private var loopCount:Number;
public function FireBall(){
dir = 0;
bounce = -1;
minDist = 0;
radius = 0;
vanishCount = 0;
vanishCountMax = 20;
super();
addFrameScript(2, frame3);
radius = 15;
minX = (GParams.stageBorder + 50);
maxX = (GParams.stageWidth - 50);
speed = 2;
maxLoopCount = (GParams.frameRate * 30);
minDist = (radius + Ball.radius);
bounce = -1;
}
public function init(){
var _local1:Number;
this.x = GParams.stageCenter.x;
this.y = GParams.stageCenter.y;
_local1 = Math.random();
if (_local1 < 0.5){
dir = -1;
speed = -2;
} else {
dir = 1;
speed = 2;
};
vanishCount = 0;
loopCount = 0;
WallGameMain.surface.addChild(this);
addEventListener(Event.ENTER_FRAME, onEnterFrame);
}
function frame3(){
stop();
}
private function updateAffectedTerritoryIndex(){
if ((((GParams.currentLevel < 3)) || ((GParams.currentLevel == 5)))){
if (WallGameMain.lastHitPaddleIndex < 2){
WallGameMain.fireAffectedTerritoryIndex = 0;
} else {
WallGameMain.fireAffectedTerritoryIndex = 1;
};
} else {
WallGameMain.fireAffectedTerritoryIndex = WallGameMain.lastHitPaddleIndex;
};
}
public function onEnterFrame(_arg1:Event){
if (currentFrame == 2){
vanishCount = (vanishCount + 1);
if (vanishCount >= vanishCountMax){
resetFireBall();
};
return;
};
loopCount = (loopCount + 1);
if (dir == 1){
if (x < maxX){
x = (x + speed);
} else {
speed = (speed * bounce);
dir = (dir * bounce);
};
} else {
if (dir == -1){
if (x > minX){
x = (x + speed);
} else {
speed = (speed * bounce);
dir = (dir * bounce);
};
};
};
checkBallCollision();
if (loopCount >= maxLoopCount){
resetFireBall();
};
}
public function resetFireBall(){
if (WallGameMain.surface.contains(this)){
WallGameMain.surface.removeChild(this);
};
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
}
private function checkBallCollision(){
var _local1:Ball;
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
_local1 = null;
_local5 = 0;
while (_local5 < WallGameMain.ballArray.length) {
_local1 = WallGameMain.ballArray[_local5];
_local2 = Math.abs((this.x - _local1.x));
_local3 = Math.abs((this.y - _local1.y));
if ((((_local2 <= minDist)) && ((_local3 <= minDist)))){
updateAffectedTerritoryIndex();
vanishFireBall();
_local1.setBallOnFire();
WallGameMain.pns.play();
};
_local5++;
};
}
private function vanishFireBall(){
gotoAndStop(2);
}
}
}//package
Section 43
//FourWallBrick (FourWallBrick)
package {
import flash.events.*;
import flash.geom.*;
import flash.display.*;
public class FourWallBrick extends MovieClip {
private var territoryIndex:Number;// = -1
private var brickIndex:Number;// = -1
private var minDist:Number;// = 0
private var minDistY;
public var pos:Point;
private var minDistX;
private var shieldOn:Boolean;// = false
public var injuryLevel:Number;// = 0
private var overlapMin:Number;// = 0
public var isActive:Boolean;// = true
private var powerType:Number;// = -1
public static var brickSize:Number = 30;
public static var halfWidth:Number = (brickSize / 2);
public static var brickHeight:Number = 20;
public static var halfHeight:Number = (brickHeight / 2);
public function FourWallBrick(){
isActive = true;
injuryLevel = 0;
pos = new Point();
minDistX = (halfWidth + Ball.radius);
minDistY = (halfHeight + Ball.radius);
minDist = 0;
overlapMin = 0;
territoryIndex = -1;
powerType = -1;
shieldOn = false;
brickIndex = -1;
super();
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5, 5, frame6, 6, frame7, 7, frame8, 8, frame9, 9, frame10, 10, frame11, 11, frame12);
minDist = Math.sqrt(((minDistX * minDistX) + (minDistY * minDistY)));
}
public function damageBrick(_arg1:Boolean, _arg2:Number){
if (isActive == false){
return;
};
if (shieldOn == true){
WallGameMain.bhs.play();
return;
};
if (_arg1 == true){
if ((((powerType >= 0)) && ((injuryLevel <= 3)))){
WallGameMain.surface.initPower(powerType, territoryIndex, brickIndex);
};
injuryLevel = 3;
WallGameMain.bths.play();
gotoAndStop((injuryLevel + 1));
isActive = false;
updateTerritoryLife();
WallGameMain.bths.play();
return;
};
if (injuryLevel <= 3){
if (injuryLevel == 0){
if (powerType >= 0){
WallGameMain.surface.initPower(powerType, territoryIndex, brickIndex);
};
WallGameMain.bos.play();
} else {
if (injuryLevel == 1){
WallGameMain.bts.play();
};
};
gotoAndStop((injuryLevel + 2));
injuryLevel = (injuryLevel + 1);
if (injuryLevel == 3){
isActive = false;
updateTerritoryLife();
WallGameMain.bths.play();
return;
};
};
}
function frame10(){
stop();
}
function frame12(){
stop();
}
function frame3(){
stop();
}
function frame6(){
stop();
}
function frame7(){
stop();
}
function frame1(){
stop();
}
public function disableShield(){
if (injuryLevel > 0){
gotoAndStop((injuryLevel + 9));
} else {
if (powerType >= 0){
gotoAndStop((powerType + 4));
} else {
gotoAndStop(1);
};
};
shieldOn = false;
}
function frame4(){
stop();
stop();
}
function frame5(){
stop();
}
function frame9(){
stop();
}
function frame8(){
stop();
}
public function resetBricks(){
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
powerType = -1;
}
public function repair(){
if (injuryLevel > 0){
injuryLevel = 0;
isActive = true;
if (shieldOn != true){
gotoAndStop(1);
};
addEventListener(Event.ENTER_FRAME, onEnterFrame);
};
if (powerType == GParams.POWERUP_REPAIR){
powerType = -1;
};
}
public function assignPowerup(_arg1){
var _local2:Number;
this.powerType = _arg1;
_local2 = (_arg1 + 4);
gotoAndStop(_local2);
}
function frame2(){
stop();
}
public function setPosition(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number){
var _local5:Number;
pos.x = (this.x + _arg1);
pos.y = (this.y + _arg2);
overlapMin = Math.sqrt(((minDistX * minDistX) + (minDistY * minDistY)));
brickIndex = _arg4;
if ((((rotation == 90)) || ((rotation == 270)))){
_local5 = minDistX;
minDistX = minDistY;
minDistY = _local5;
};
this.territoryIndex = _arg3;
}
public function onEnterFrame(_arg1:Event){
var _local2:Ball;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
_local2 = null;
_local3 = 0;
_local4 = 0;
_local5 = 0;
_local6 = 0;
_local8 = 0;
while (_local8 < WallGameMain.ballArray.length) {
_local2 = WallGameMain.ballArray[_local8];
_local4 = Math.abs((_local2.x - this.x));
_local5 = Math.abs((_local2.y - this.y));
if ((((rotation == 0)) || ((rotation == 180)))){
_local4 = (_local2.x - this.x);
if (Math.abs(_local4) <= minDistX){
_local5 = (_local2.y - this.y);
if (Math.abs(_local5) < minDistY){
_local7 = Math.sqrt(((_local4 * _local4) + (_local5 * _local5)));
_local3 = (minDist - _local7);
_local6 = Math.atan2(_local5, _local4);
_local2.setVelocity(_local6);
_local2.correctOverlap(_local3);
damageBrick(_local2.ballOnFire, _local8);
return (true);
};
};
} else {
_local4 = (_local2.x - this.x);
if (Math.abs(_local4) <= minDistY){
_local5 = (_local2.y - this.y);
if (Math.abs(_local5) < minDistX){
_local7 = Math.sqrt(((_local4 * _local4) + (_local5 * _local5)));
_local3 = (minDist - _local7);
_local6 = Math.atan2(_local5, _local4);
_local2.setVelocity(_local6);
_local2.correctOverlap(_local3);
damageBrick(_local2.ballOnFire, _local8);
return (true);
};
};
};
_local8++;
};
return (false);
}
public function reinit(){
injuryLevel = 0;
isActive = true;
gotoAndStop(1);
addEventListener(Event.ENTER_FRAME, onEnterFrame);
powerType = -1;
this.alpha = 1;
}
public function enableShield(){
gotoAndStop(9);
shieldOn = true;
}
function frame11(){
stop();
}
private function updateTerritoryLife(){
WallGameMain.surface.territoryLife[territoryIndex] = (WallGameMain.surface.territoryLife[territoryIndex] - 1);
if ((((territoryIndex == 0)) || ((territoryIndex == 1)))){
if ((((WallGameMain.surface.territoryLife[0] == 0)) && ((WallGameMain.surface.territoryLife[1] == 0)))){
WallGameMain.levelWin = true;
};
if (territoryIndex == 0){
TerritoryTopLeft(WallGameMain.surface.territory[territoryIndex]).life.text = WallGameMain.surface.territoryLife[territoryIndex].toString();
if (WallGameMain.surface.territoryLife[territoryIndex] == 0){
TerritoryTopLeft(WallGameMain.surface.territory[territoryIndex]).damageTerritory();
};
} else {
TerritoryTopRight(WallGameMain.surface.territory[territoryIndex]).life.text = WallGameMain.surface.territoryLife[territoryIndex].toString();
if (WallGameMain.surface.territoryLife[territoryIndex] == 0){
TerritoryTopRight(WallGameMain.surface.territory[territoryIndex]).damageTerritory();
};
};
} else {
if ((((territoryIndex == 2)) || ((territoryIndex == 3)))){
if ((((WallGameMain.surface.territoryLife[2] == 0)) && ((WallGameMain.surface.territoryLife[3] == 0)))){
WallGameMain.levelLoose = true;
};
if (territoryIndex == 2){
TerritoryBottomRight(WallGameMain.surface.territory[territoryIndex]).life.text = WallGameMain.surface.territoryLife[territoryIndex].toString();
if (WallGameMain.surface.territoryLife[territoryIndex] == 0){
TerritoryBottomRight(WallGameMain.surface.territory[territoryIndex]).damageTerritory();
};
} else {
TerritoryBottomLeft(WallGameMain.surface.territory[territoryIndex]).life.text = WallGameMain.surface.territoryLife[territoryIndex].toString();
if (WallGameMain.surface.territoryLife[territoryIndex] == 0){
TerritoryBottomLeft(WallGameMain.surface.territory[territoryIndex]).damageTerritory();
};
};
};
};
}
}
}//package
Section 44
//FourWallSurface (FourWallSurface)
package {
import flash.geom.*;
import flash.text.*;
public class FourWallSurface extends Surface {
public var hbCount;
public var score:TextField;
public var tHeight;
private var brickCountYAxis:Number;
private var xGap:Number;// = 315
public var brickCount;
private var baseHeight:Number;// = 120
public var levelNum:TextField;
private var baseWidth:Number;// = 180
private var brickCountXAxis:Number;
private var yGap:Number;// = 140
private var totalBrickCount:Number;
public var tWidth;
public var vbCount;
public var timetick:TextField;
public function FourWallSurface(){
baseWidth = 180;
baseHeight = 120;
xGap = 315;
yGap = 140;
brickCountXAxis = Math.ceil((baseWidth / FourWallBrick.brickSize));
brickCountYAxis = Math.ceil((baseHeight / FourWallBrick.brickSize));
totalBrickCount = (brickCountXAxis + brickCountYAxis);
tHeight = GParams.territoryHeight;
tWidth = GParams.territoryWidth;
hbCount = GParams.horizontalBrickCount;
vbCount = GParams.verticleBrickCount;
brickCount = (hbCount + vbCount);
super();
territoryLife = new Array(4);
}
public function createSurface(){
paddleCount = 3;
enemy = new Array(enemyCount);
territory = new Array(4);
randomObjectCount = 4;
createTerritories();
createReflectors();
createRotator();
createRandomObject();
}
public function createObstacles(){
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:Number;
ObstacleFactory.createObstacles();
_local1 = (GParams.stageBorder + 50);
_local2 = (GParams.stageCenter.y + 50);
_local3 = 150;
_local4 = 0;
while (_local4 < ObstacleFactory.obstaclesXAxis.length) {
ObstacleFactory.obstaclesXAxis[_local4].x = _local1;
ObstacleFactory.obstaclesXAxis[_local4].y = _local2;
addChild(ObstacleFactory.obstaclesXAxis[_local4]);
ObstacleFactory.obstaclesXAxis[_local4].setBoundary(_local1, 180);
_local1 = (_local1 + _local3);
_local2 = (_local2 - 15);
_local4++;
};
}
override protected function blockPaddle(_arg1:Number, _arg2:Number){
territory[_arg1].paddlen.blockPaddle();
}
override public function resetSurface(){
var _local1:Number;
resetStats();
_local1 = 0;
while (_local1 < territoryLife.length) {
territoryLife[_local1] = GParams.territoryLife;
_local1++;
};
_local1 = 0;
while (_local1 < reflectors.length) {
reflectors[_local1].resetReflector();
_local1++;
};
_local1 = 0;
while (_local1 < territory.length) {
territory[_local1].reset();
_local1++;
};
_local1 = 0;
while (_local1 < Rotator.rotatorArray.length) {
Rotator.rotatorArray[_local1].removeRotatorListener();
_local1++;
};
}
override public function resetStats(){
this.score.text = "";
this.levelNum.text = "";
this.timetick.text = "";
}
public function arrangeBricksBottomLeft(){
var _local1:Point;
var _local2:Number;
_local1 = new Point();
_local2 = 0;
_local1.x = (territory[3].minXInner + FourWallBrick.halfWidth);
_local1.y = (territory[3].minYInner - FourWallBrick.halfHeight);
_local2 = 0;
while (_local2 < hbCount) {
addChild(territory[3].bricks[_local2]);
territory[3].bricks[_local2].x = _local1.x;
territory[3].bricks[_local2].y = _local1.y;
_local1.x = (_local1.x + FourWallBrick.brickSize);
territory[3].bricks[_local2].setPosition(0, 0, 3, _local2);
_local2++;
};
_local1.x = (territory[3].maxXInner + FourWallBrick.halfHeight);
_local1.y = (territory[3].minYInner + FourWallBrick.halfWidth);
_local2 = hbCount;
while (_local2 < brickCount) {
addChild(territory[3].bricks[_local2]);
territory[3].bricks[_local2].x = _local1.x;
territory[3].bricks[_local2].y = _local1.y;
_local1.y = (_local1.y + FourWallBrick.brickSize);
territory[3].bricks[_local2].setPosition(0, 0, 3, _local2);
_local2++;
};
}
override protected function shieldTerritory(_arg1:Number, _arg2:Number){
switch (_arg1){
case 0:
_arg1 = 3;
break;
case 1:
_arg1 = 2;
break;
case 2:
_arg1 = 1;
break;
case 3:
_arg1 = 0;
break;
};
addShield(_arg1, _arg2);
}
public function arrangeBricksBottomRight(){
var _local1:Point;
var _local2:Number;
_local1 = new Point();
_local2 = 0;
_local1.x = ((territory[2].minXInner + FourWallBrick.halfHeight) - FourWallBrick.halfWidth);
_local1.y = (territory[2].minYInner - FourWallBrick.halfHeight);
_local2 = 0;
while (_local2 < hbCount) {
addChild(territory[2].bricks[_local2]);
territory[2].bricks[_local2].x = _local1.x;
territory[2].bricks[_local2].y = _local1.y;
_local1.x = (_local1.x + FourWallBrick.brickSize);
territory[2].bricks[_local2].setPosition(0, 0, 2, _local2);
_local2++;
};
_local1.x = (territory[2].minXInner - FourWallBrick.halfHeight);
_local1.y = (territory[2].minYInner + FourWallBrick.halfWidth);
_local2 = hbCount;
while (_local2 < brickCount) {
addChild(territory[2].bricks[_local2]);
territory[2].bricks[_local2].x = _local1.x;
territory[2].bricks[_local2].y = _local1.y;
_local1.y = (_local1.y + FourWallBrick.brickSize);
territory[2].bricks[_local2].setPosition(0, 0, 2, _local2);
_local2++;
};
}
override public function assignPowerupsToBricks(){
var _local1:*;
var _local2:Number;
var _local3:Number;
var _local4:Number;
_local1 = -1;
_local2 = Math.floor((Math.random() * brickCount));
_local3 = 0;
while (_local3 < GParams.powerups[(GParams.currentLevel - 1)].length) {
_local1 = GParams.powerups[(GParams.currentLevel - 1)][_local3];
if (_local1 == 1){
_local4 = 0;
while (_local4 < territory.length) {
territory[_local4].bricks[_local2].assignPowerup(_local1);
_local4++;
};
};
if (_local1 == 2){
territory[0].bricks[_local2].assignPowerup(_local1);
territory[3].bricks[_local2].assignPowerup(_local1);
};
if (_local1 == 3){
territory[1].bricks[_local2].assignPowerup(_local1);
territory[2].bricks[_local2].assignPowerup(_local1);
};
_local2 = ((_local2 + 7) % brickCount);
_local3++;
};
}
public function clearMessage(_arg1:Number){
territory[_arg1].mesg.text = "";
}
private function createRandomObject(){
Rhombus.createInstance();
addChild(Rhombus.randomObjects[0]);
Rhombus.randomObjects[0].x = GParams.stageCenter.x;
Rhombus.randomObjects[0].y = GParams.stageCenter.y;
Rhombus.randomObjects[0].init();
}
public function arrangeBricksTopRight(){
var _local1:Point;
var _local2:Number;
_local1 = new Point();
_local2 = 0;
_local1.x = ((territory[1].minXInner - FourWallBrick.halfWidth) + FourWallBrick.halfHeight);
_local1.y = (territory[1].maxYInner + FourWallBrick.halfHeight);
_local2 = 0;
while (_local2 < hbCount) {
addChild(territory[1].bricks[_local2]);
territory[1].bricks[_local2].x = _local1.x;
territory[1].bricks[_local2].y = _local1.y;
_local1.x = (_local1.x + FourWallBrick.brickSize);
territory[1].bricks[_local2].setPosition(0, 0, 1, _local2);
_local2++;
};
_local1.x = (territory[1].minXInner - FourWallBrick.halfHeight);
_local1.y = (territory[1].minYInner + FourWallBrick.halfWidth);
_local2 = hbCount;
while (_local2 < brickCount) {
addChild(territory[1].bricks[_local2]);
territory[1].bricks[_local2].x = _local1.x;
territory[1].bricks[_local2].y = _local1.y;
_local1.y = (_local1.y + FourWallBrick.brickSize);
territory[1].bricks[_local2].setPosition(0, 0, 1, _local2);
_local2++;
};
}
public function createRotator(){
var _local1:Number;
var _local2:Number;
var _local3:*;
_local1 = ((Math.random() * Math.PI) * 2);
Rotator.createInstance();
_local2 = ((Math.PI * 2) / Rotator.rotatorArray.length);
_local3 = 0;
while (_local3 < Rotator.rotatorArray.length) {
addChild(Rotator.rotatorArray[_local3]);
Rotator.rotatorArray[_local3].setPosition(_local1, GParams.orbitRadius);
_local1 = (_local1 + (Math.PI / 2));
_local3++;
};
}
override public function checkRotatorCollision():Boolean{
var _local1:*;
_local1 = 0;
while (_local1 < Rotator.rotatorArray.length) {
if (Rotator.rotatorArray[_local1].checkBallCollision() == true){
return (true);
};
_local1++;
};
return (false);
}
public function createReflectors(){
var _local1:Point;
var _local2:Number;
var _local3:*;
var _local4:*;
var _local5:Number;
var _local6:Number;
TopWallReflector.createReflectors();
BottomWallReflector.createReflectors();
reflectors[0] = TopWallReflector.reflectorArray[0];
reflectors[1] = TopWallReflector.reflectorArray[1];
reflectors[2] = BottomWallReflector.reflectorArray[0];
reflectors[3] = BottomWallReflector.reflectorArray[1];
_local1 = new Point(territory[3].maxXOuter, territory[2].minXInner);
_local2 = 0;
_local3 = (territory[3].maxXOuter + (reflectors[0].width * 2));
_local4 = (territory[2].minXOuter - (reflectors[0].width * 2));
_local2 = ((_local4 - _local3) / 2);
_local4 = (_local2 + _local3);
_local5 = GParams.stageBorder;
_local6 = GParams.innerHeight;
addChild(reflectors[0]);
reflectors[0].x = (territory[3].maxXOuter + 50);
reflectors[0].y = _local5;
reflectors[0].setBoundary(_local3, _local4);
addChild(reflectors[2]);
reflectors[2].x = (territory[3].maxXOuter + 50);
reflectors[2].y = _local6;
reflectors[2].setBoundary(_local3, _local4);
_local3 = (_local4 + GParams.paddleRadius);
_local4 = (_local4 + _local2);
addChild(reflectors[1]);
reflectors[1].x = (_local4 - 50);
reflectors[1].y = _local5;
reflectors[1].setBoundary(_local3, _local4);
addChild(reflectors[3]);
reflectors[3].x = (_local4 - 50);
reflectors[3].y = _local6;
reflectors[3].setBoundary(_local3, _local4);
}
override public function updateStats(_arg1:Number){
this.timetick.text = _arg1.toString();
}
public function addShield(_arg1:Number, _arg2:Number){
var _local3:Number;
if (territory[_arg1].isDamaged == false){
_local3 = 0;
while (_local3 < brickCount) {
territory[_arg1].bricks[_local3].enableShield();
_local3++;
};
territory[_arg1].enableShield();
};
}
override public function createTerritories(){
territory[0] = new TerritoryTopLeft();
territory[0].x = GParams.stageBorder;
territory[0].y = GParams.stageBorder;
territory[0].init(territory[0].x, territory[0].y);
addChild(territory[0]);
addChild(territory[0].paddlen);
arrangeBricksTopLeft();
territory[1] = new TerritoryTopRight();
territory[1].x = (GParams.stageWidth - (GParams.stageBorder + GParams.territoryWidth));
territory[1].y = GParams.stageBorder;
territory[1].init(territory[1].x, territory[1].y);
addChild(territory[1]);
addChild(territory[1].paddlen);
arrangeBricksTopRight();
territory[2] = new TerritoryBottomRight();
territory[2].x = (GParams.stageWidth - (GParams.stageBorder + GParams.territoryWidth));
territory[2].y = (GParams.stageHeight - (GParams.stageBorder + GParams.territoryHeight));
territory[2].init(territory[2].x, territory[2].y);
addChild(territory[2]);
addChild(territory[2].paddlen);
arrangeBricksBottomRight();
territory[3] = new TerritoryBottomLeft();
territory[3].x = GParams.stageBorder;
territory[3].y = (GParams.stageHeight - (GParams.stageBorder + GParams.territoryHeight));
territory[3].init(territory[3].x, territory[3].y);
addChild(territory[3]);
addChild(territory[3].paddlen);
arrangeBricksBottomLeft();
territoryLife[0] = GParams.territoryLife;
territoryLife[1] = GParams.territoryLife;
territoryLife[2] = GParams.territoryLife;
territoryLife[3] = GParams.territoryLife;
}
override public function checkAllEnemiesDamaged(){
if ((((((territory[0].isDamaged == true)) && ((territory[1].isDamaged == true)))) && ((territory[2].isDamaged == true)))){
WallGameMain.levelWin = true;
};
if (territory[0].isDamaged == true){
if (territory[0].alpha != 0){
territory[0].alpha = (territory[0].alpha - 0.1);
};
};
if (territory[1].isDamaged == true){
territory[1].alpha = 0.6;
};
if (territory[2].isDamaged == true){
territory[2].alpha = 0.6;
};
if (territory[3].isDamaged == true){
territory[3].alpha = 0.6;
};
}
override public function reinit(){
var _local1:Number;
var _local2:Number;
damagedEnemies = 0;
if (GParams.currentLevel == 6){
createRotator();
} else {
if (Rotator.rotatorArray != null){
_local1 = 0;
while (_local1 < Rotator.rotatorArray.length) {
if (contains(Rotator.rotatorArray[_local1])){
removeChild(Rotator.rotatorArray[_local1]);
};
_local1++;
};
};
};
if (Rotator.rotatorArray != null){
_local1 = 0;
while (_local1 < Rotator.rotatorArray.length) {
Rotator.rotatorArray[_local1].reinit();
_local1++;
};
};
_local1 = 0;
while (_local1 < territory.length) {
territory[_local1].reinit();
territory[_local1].paddlen.reinit();
_local2 = 0;
while (_local2 < brickCount) {
territory[_local1].bricks[_local2].reinit();
_local2++;
};
_local1++;
};
_local1 = 0;
while (_local1 < reflectors.length) {
reflectors[_local1].reinit();
_local1++;
};
levelNum.text = GParams.currentLevel.toString();
this.score.text = GParams.scoreValue.toString();
this.timetick.text = "0";
assignPowerupsToBricks();
}
override protected function repairTerritoryBricks(_arg1:Number, _arg2:Number){
switch (_arg1){
case 0:
_arg1 = 3;
break;
case 1:
_arg1 = 2;
break;
case 2:
_arg1 = 1;
break;
case 3:
_arg1 = 0;
break;
};
if (territory[_arg1].isDamaged == false){
territory[_arg1].repairBricks(_arg2);
};
}
override public function initPower(_arg1:Number, _arg2:Number, _arg3:Number){
switch (_arg1){
case 1:
blockPaddle(_arg2, _arg3);
break;
case 2:
shieldTerritory(_arg2, _arg3);
break;
case 3:
repairTerritoryBricks(_arg2, _arg3);
break;
};
}
public function arrangeBricksTopLeft(){
var _local1:Point;
var _local2:Number;
_local1 = new Point();
_local2 = 0;
_local1.x = (territory[0].minXInner + FourWallBrick.halfWidth);
_local1.y = (territory[0].maxYInner + (FourWallBrick.brickHeight / 2));
_local2 = 0;
while (_local2 < hbCount) {
addChild(territory[0].bricks[_local2]);
territory[0].bricks[_local2].x = _local1.x;
territory[0].bricks[_local2].y = _local1.y;
_local1.x = (_local1.x + FourWallBrick.brickSize);
territory[0].bricks[_local2].setPosition(0, 0, 0, _local2);
_local2++;
};
_local1.x = (territory[0].maxXInner + FourWallBrick.halfHeight);
_local1.y = (territory[0].minYInner + FourWallBrick.halfWidth);
_local2 = hbCount;
while (_local2 < brickCount) {
addChild(territory[0].bricks[_local2]);
territory[0].bricks[_local2].x = _local1.x;
territory[0].bricks[_local2].y = _local1.y;
_local1.y = (_local1.y + FourWallBrick.brickSize);
territory[0].bricks[_local2].setPosition(0, 0, 0, _local2);
_local2++;
};
}
}
}//package
Section 45
//GameOver (GameOver)
package {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import flash.net.*;
public class GameOver extends MovieClip {
public var errormesg:TextField;
public var bonus:TextField;
var urlPlayMore:String;// = "http://www.flasharcade.com"
var requestPlayMore:URLRequest;// = null
public var submitScore:SimpleButton;
public var playmore:SimpleButton;
public var totalScore:TextField;
public var playAgain:SimpleButton;
public var player:TextField;
private static var gameOver:GameOver = null;
public function GameOver(){
urlPlayMore = "http://www.flasharcade.com";
requestPlayMore = null;
super();
requestPlayMore = new URLRequest(urlPlayMore);
playmore.addEventListener(MouseEvent.CLICK, handleClick);
}
public function getPlayerName():String{
var _local1:String;
_local1 = this.player.text;
if (_local1 == null){
return (null);
};
this.errormesg.text = "";
return (_local1);
}
public function handleClick(_arg1:MouseEvent){
var event = _arg1;
try {
navigateToURL(requestPlayMore, "_blank");
} catch(e:Error) {
};
}
public function updateScores(){
trace(" updating score ");
this.bonus.text = GParams.bonusPoints.toString();
this.totalScore.text = GParams.scoreValue.toString();
}
public function resetData(){
trace(" reseting game over data");
this.bonus.text = "";
this.totalScore.text = " ";
this.player.text = "";
this.errormesg.text = " ";
}
public function setErrorMesg(_arg1:String){
this.errormesg.text = _arg1;
}
public static function getInstance():GameOver{
if (gameOver == null){
gameOver = new (GameOver);
};
return (gameOver);
}
}
}//package
Section 46
//GameStatistics (GameStatistics)
package {
public class GameStatistics {
}
}//package
Section 47
//GParams (GParams)
package {
import flash.geom.*;
public class GParams {
public static var boundaryFWLeftXMin:Number = borderFW;
public static var ball:Ball = null;
public static var innerEndXCW:Number = (stageWidth - stageBorderCW);
public static var randomObjectMaxTime:Number = 30;
public static var innerWidth:Number = (stageWidth - stageBorder);
public static var ACBRightCenter:Point = new Point(628, 270);
public static var powerups:Array = new Array([1, 5], [1, 5], [2, 4, 5], [1, 2, 3], [2, 4, 3], [1, 2, 3, 5]);
public static var ballMaxY:Number = (stageHeight - (stageBorderTW + territoryHeightTW));
public static var boundaryFWLeftXMax:Number = ((boundaryFWLeftXMin + territoryWidth) + Brick.brickHeight);
public static var circlePaddleOrbit:Number = (circleTerritoryRadius - 10);
public static var shieldOnCountMax:Number = (frameRate * 10);
public static var orbitRadiusLarge:Number = 120;
public static var innerHeight:Number = (stageHeight - stageBorder);
public static var territoryHeightTW:Number = 50;
public static var verticleBrickCount = 4;
public static var boundaryFWTopYMin:Number = boardStartY;
public static var territoryLife:Number = 3;
public static var paddleBlockCountMax:Number = (frameRate * 10);
public static var boundaryFWTopYMax:Number = ((boundaryFWTopYMin + territoryHeight) + Brick.brickHeight);
public static var enemyPaddleSpeedAdjust:Array = new Array(30, 20, 5, 10, 5, 10, 1);
public static var POWERUP_SHIELD:Number = 2;
public static var paddleHitScore:Number = 100;
public static var split1MinX:Number = stageBorder;
public static var territoryWidthTW:Number = 570;
public static var startLevel:Number = 0;
public static var innerEndX:Number = (stageWidth - stageBorderTW);
public static var innerEndY:Number = (stageHeight - stageBorderTW);
public static var ACBRightMinAngle:Number = 37.7;
public static var ACBLeftMinAngle:Number = 142.3;
public static var circleTerritoryRadius:Number = 160;
public static var stageWidth:Number = 620;
public static var split1MaxX:Number = 300;
public static var POWERUP_REPAIR:Number = 3;
public static var ACBLeftMaxAngle:Number = 217.7;
public static var ACBYAxisRadius = 355;
public static var orbitRadius:Number = 75;
public static var paddleSizeCountMax:Number = (frameRate * 30);
public static var currentLevel:Number = 0;
public static var ACBTopCenter:Point = new Point(365, 365);
public static var ACBTopMinAngle:Number = 243.4;
public static var ACBBottomMinAngle:Number = 63.4;
public static var leftKeyDown = false;
public static var paddleRadius:Number = 25;
public static var paddleLooseScore:Number = 50;
public static var wallStartY:Number = 0;
public static var ACBRightMaxAngle:Number = 322.3;
public static var intelligenceControl:Array = new Array(8, 7, 8, 8, 7.5, 8, 9);
public static var ACBXAxisRadius = 110;
public static var enemyPaddleAdjuster:Array = new Array(40, 40, 40, 40);
public static var rotatorVelocity:Number = 4;
public static var ACBBottomMaxAngle:Number = 116.6;
public static var horizontalBrickCount = 6;
public static var boundaryFWRightXMin:Number = (stageWidth - ((boardStartX + territoryWidth) + Brick.brickHeight));
public static var fireBallShown:Array = new Array(false, false, false, true, true, false);
public static var boardStartY:Number = 0;
public static var stageBorderCW:Number = 10;
public static var boundaryFWBottomYMin:Number = (stageHeight - ((boardStartY + territoryHeight) + Brick.brickHeight));
public static var ACBLeftCenter:Point = new Point(120, 270);
public static var stageHeight:Number = 470;
public static var currentLevelScore:Number = 0;
public static var innerEndYCW:Number = (stageHeight - stageBorderCW);
public static var POWERUP_PADDLEBLOCK:Number = 1;
public static var stageBorderTW:Number = 25;
public static var stageBorder:Number = 25;
public static var ACBTopMaxAngle:Number = 296.6;
public static var boardStartX:Number = 0;
public static var fireBallMinScore:Number = 1200;
public static var territoryWidth:Number = 160;
public static var boundaryFWRightXMax:Number = (stageWidth - boardStartX);
public static var ACBBottomCenter:Point = new Point(365, 185);
public static var territoryHeight:Number = 120;
public static var bonusPoints:Number = 0;
public static var rightKeyDown = false;
public static var boundaryFWBottomYMax:Number = ((boundaryFWBottomYMin + territoryHeight) + Brick.brickHeight);
public static var split2MinX:Number = 300;
public static var frameRate:Number = 40;
public static var stageCenter:Point = new Point((stageWidth / 2), (stageHeight / 2));
public static var ballMinY:Number = (stageBorderTW + territoryHeightTW);
public static var split2MaxX:Number = (stageWidth - stageBorder);
public static var ballVelocity:Array = new Array(7, 7, 5, 6, 6, 6, 4.5);
public static var borderFW:Number = 15;
public static var scoreValue:Number = 0;
}
}//package
Section 48
//KickOffText (KickOffText)
package {
import flash.display.*;
import flash.text.*;
public class KickOffText extends Sprite {
private var mesg:String;// = "Press Space bar to Continue"
private var optionalMesg:String;// = ""
private var resultMesg:TextField;
private var guidenceMesg:TextField;
private static var kickOffText:KickOffText = null;
public function KickOffText(){
mesg = "Press Space bar to Continue";
optionalMesg = "";
super();
draw();
}
private function draw(){
var _local1:TextFormat;
_local1 = new TextFormat();
_local1.font = "Albertus Extra Bold";
_local1.color = 16711100;
_local1.size = 17;
_local1.underline = false;
_local1.bold = false;
_local1.align = "center";
resultMesg = new TextField();
resultMesg.defaultTextFormat = _local1;
resultMesg.text = mesg;
resultMesg.autoSize = TextFieldAutoSize.CENTER;
resultMesg.y = 10;
addChild(resultMesg);
guidenceMesg = new TextField();
_local1.size = 12;
_local1.color = 0xFCFC00;
_local1.font = "Albertus Extra Bold";
guidenceMesg.defaultTextFormat = _local1;
guidenceMesg.text = mesg;
guidenceMesg.autoSize = TextFieldAutoSize.CENTER;
reinit();
guidenceMesg.y = 30;
addChild(guidenceMesg);
}
public function updateText(_arg1:String){
resultMesg.text = _arg1.toString();
}
public function reinit(){
switch (GParams.currentLevel){
case 1:
optionalMesg = " Move the paddle using arrow keys.(<- -> )";
break;
case 2:
optionalMesg = " Move the paddle using arrow keys.(<- -> )";
break;
case 3:
optionalMesg = " Move the paddle using arrow keys.(<- -> )";
break;
case 4:
optionalMesg = " Move the left paddle using 'A' and 'D'. Move the right paddle using arrow keys(<- -> )";
break;
case 5:
optionalMesg = " Move the paddle using arrow keys.(<- -> )";
break;
case 6:
optionalMesg = " Move the left paddle using 'A' and 'D'. Move the right paddle using arrow keys(<- -> )";
break;
};
guidenceMesg.text = optionalMesg;
}
public static function getInstance():KickOffText{
if (kickOffText == null){
kickOffText = new (KickOffText);
};
return (kickOffText);
}
}
}//package
Section 49
//LeftWallReflector (LeftWallReflector)
package {
import flash.events.*;
public class LeftWallReflector extends Reflector {
private var yMin:Number;// = 0
private var yMax:Number;// = 0
private var isMoving:Boolean;// = false
private var speed:Number;// = 4
private var bounce:Number;// = -1
public static var reflectorArray:Array = new Array(reflectorCount);
public function LeftWallReflector(){
yMin = 0;
yMax = 0;
speed = 4;
bounce = -1;
isMoving = false;
super();
width = 15;
height = 50;
}
public function setBoundary(_arg1:Number, _arg2:Number, _arg3:Boolean=false){
yMin = _arg1;
yMax = _arg2;
this.isMoving = _arg3;
if (isMoving == true){
addEventListener(Event.ENTER_FRAME, onEnterFrame);
};
}
public function onEnterFrame(_arg1:Event){
this.y = (this.y + speed);
if (this.y <= yMin){
speed = (speed * bounce);
this.y = yMin;
} else {
if (this.y >= yMax){
speed = (speed * bounce);
this.y = yMax;
};
};
checkBallCollision();
}
public function reinit(){
addEventListener(Event.ENTER_FRAME, onEnterFrame);
}
override public function resetReflector(){
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
}
public static function createReflectors():void{
var _local1:Number;
var _local2:Number;
var _local3:*;
_local1 = -1;
_local2 = -3;
_local3 = 0;
while (_local3 < reflectorArray.length) {
reflectorArray[_local3] = new (LeftWallReflector);
reflectorArray[_local3].speed = _local2;
_local2 = (_local2 * _local1);
_local3++;
};
}
}
}//package
Section 50
//Levels (Levels)
package {
import flash.display.*;
public class Levels extends MovieClip {
var levelNum:Number;// = 1
private static var level:Levels = null;
public function Levels(){
levelNum = 1;
super();
addFrameScript(0, frame1, 2, frame3, 5, frame6, 8, frame9, 11, frame12, 14, frame15, 17, frame18);
}
function frame18(){
stop();
}
function frame12(){
stop();
}
function frame3(){
stop();
}
function frame1(){
}
function frame6(){
stop();
}
function frame9(){
stop();
}
function frame15(){
stop();
}
public static function getInstance():Levels{
if (level == null){
level = new (Levels);
};
return (level);
}
}
}//package
Section 51
//LevelupSound (LevelupSound)
package {
import flash.media.*;
public class LevelupSound extends Sound {
}
}//package
Section 52
//Line (Line)
package {
import flash.display.*;
public class Line extends Sprite {
public var len:Number;// = 0
private var isCenter:Boolean;// = false
private var color:Number;// = 0xFF0000
private var thickness;// = 1
public function Line(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Boolean=false){
len = 0;
color = 0xFF0000;
thickness = 1;
isCenter = false;
super();
this.len = _arg1;
this.x = _arg2;
this.y = _arg3;
this.rotation = _arg4;
this.isCenter = _arg5;
draw();
}
public function draw(){
if (isCenter == false){
graphics.lineStyle(3, color, 5);
graphics.moveTo((-(len) / 2), 0);
graphics.lineTo((len / 2), 0);
visible = false;
} else {
graphics.lineStyle(3, color, 5);
graphics.moveTo(0, 0);
graphics.lineTo(len, 0);
};
}
public function setPosition(_arg1:Number, _arg2:Number, _arg3:Number){
x = _arg1;
y = _arg2;
this.rotation = _arg3;
}
}
}//package
Section 53
//MyPaddle (MyPaddle)
package {
public class MyPaddle extends Paddle {
protected var minY:Number;// = 0
protected var paddleSizeCount:Number;// = 0
protected var maxY:Number;// = 0
protected var minX:Number;// = 0
protected var maxX:Number;// = 0
protected var paddleIndex:Number;// = -1
protected var paddleSizeChanged:Boolean;// = false
protected var paddleSizeMaxCount:Number;// = 0
protected var actualRadius:Number;// = 0
public static var leftSpeed = -35;
public static var rightKeyDown = false;
public static var speed:Number = 10;
public static var rightSpeed = 35;
public static var twoKeyDown = false;
public static var myPaddle:MyPaddle = null;
public static var leftKeyDown = false;
public static var oneKeyDown = false;
public function MyPaddle(){
minX = 0;
maxX = 0;
minY = 0;
maxY = 0;
actualRadius = 0;
paddleIndex = -1;
paddleSizeCount = 0;
paddleSizeMaxCount = 0;
paddleSizeChanged = false;
super();
}
override public function setBoundary(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number=-1, _arg7:Number=-1){
this.minX = _arg4;
this.maxX = _arg5;
if (_arg6 != -1){
this.minY = _arg6;
this.maxY = _arg7;
};
this.paddleIndex = _arg1;
}
public function checkBoundary(){
}
}
}//package
Section 54
//MyPaddleFW (MyPaddleFW)
package {
import flash.events.*;
public class MyPaddleFW extends MyPaddle {
public function MyPaddleFW(){
minDistX = (halfWidth + Ball.radius);
minDistY = (halfHeight + Ball.radius);
minDist = Math.sqrt(((minDistX * minDistX) + (minDistY * minDistY)));
paddleBlockCount = 0;
paddleBlockMaxCount = GParams.paddleBlockCountMax;
actualRadius = radius;
paddleSizeCount = 0;
paddleSizeMaxCount = GParams.paddleSizeCountMax;
paddleSizeChanged = false;
}
override public function removePaddleEventListener(){
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
}
private function incrementScore(){
GParams.scoreValue = (GParams.scoreValue + GParams.paddleHitScore);
SplitWallSurface(WallGameMain.surface).score.text = GParams.scoreValue.toString();
}
override public function checkBoundary(){
if (x < minX){
x = minX;
} else {
if (x >= maxX){
this.rotation = 90;
x = maxX;
};
};
if (y < minY){
y = minY;
this.rotation = 0;
x = (x - 1);
} else {
if (y > maxY){
y = maxY;
};
};
}
public function onEnterFrame(_arg1:Event){
if (paddleBlocked == true){
paddleBlockCount = (paddleBlockCount + 1);
if (paddleBlockCount >= paddleBlockMaxCount){
paddleBlocked = false;
};
checkBallCollision();
return;
};
if (oneKeyDown == true){
if (x < maxX){
this.x = (this.x - speed);
} else {
this.y = (this.y - speed);
};
} else {
if (twoKeyDown == true){
if (x < maxX){
this.x = (this.x + speed);
} else {
this.y = (this.y + speed);
};
};
};
checkBoundary();
checkBallCollisionFW();
}
public function createInstance():void{
if (myPaddle == null){
myPaddle = new MyPaddleFW();
};
}
public function reinit(){
isDamaged = false;
addEventListener(Event.ENTER_FRAME, onEnterFrame);
this.alpha = 1;
paddleBlockCount = 0;
paddleBlocked = false;
this.x = (minX + 50);
this.y = minY;
this.rotation = 0;
}
public function addMyPaddleListener(){
paddleBlockCount = 0;
paddleBlocked = false;
addEventListener(Event.ENTER_FRAME, onEnterFrame);
paddleSizeCount = 0;
paddleSizeChanged = false;
}
}
}//package
Section 55
//MyPaddleFWRight (MyPaddleFWRight)
package {
import flash.events.*;
public class MyPaddleFWRight extends MyPaddle {
public function MyPaddleFWRight(){
minDistX = (halfWidth + Ball.radius);
minDistY = (halfHeight + Ball.radius);
paddleBlockCount = 0;
paddleBlockMaxCount = GParams.paddleBlockCountMax;
actualRadius = radius;
paddleSizeCount = 0;
paddleSizeMaxCount = GParams.paddleSizeCountMax;
paddleSizeChanged = false;
}
override public function removePaddleEventListener(){
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
}
override public function checkBoundary(){
if ((((x < minX)) && ((y >= minY)))){
x = minX;
this.rotation = 270;
y = (y + 1);
} else {
if (x >= maxX){
x = maxX;
};
};
if ((((y < minY)) && ((x <= minX)))){
y = minY;
this.rotation = 0;
x = (x + 1);
} else {
if (y > maxY){
y = maxY;
};
};
}
public function onEnterFrame(_arg1:Event){
if (paddleBlocked == true){
paddleBlockCount = (paddleBlockCount + 1);
if (paddleBlockCount >= paddleBlockMaxCount){
paddleBlocked = false;
};
checkBallCollision();
return;
};
if (leftKeyDown == true){
if (x > minX){
this.x = (this.x - speed);
} else {
x = (minX - 1);
this.y = (this.y + speed);
};
} else {
if (rightKeyDown == true){
if (x > minX){
this.x = (this.x + speed);
} else {
this.y = (this.y - speed);
};
};
};
checkBoundary();
checkBallCollisionFW();
}
public function createInstance():void{
if (myPaddle == null){
myPaddle = new MyPaddleFW();
};
}
public function reinit(){
isDamaged = false;
addEventListener(Event.ENTER_FRAME, onEnterFrame);
this.alpha = 1;
paddleBlockCount = 0;
paddleBlocked = false;
this.x = (minX + 50);
this.y = minY;
this.rotation = 0;
}
public function addMyPaddleListener(){
paddleBlockCount = 0;
paddleBlocked = false;
addEventListener(Event.ENTER_FRAME, onEnterFrame);
paddleSizeCount = 0;
paddleSizeChanged = false;
}
}
}//package
Section 56
//MyPaddleTW (MyPaddleTW)
package {
import flash.events.*;
public class MyPaddleTW extends MyPaddle {
public function MyPaddleTW(){
if (GParams.currentLevel == 1){
speed = 8;
} else {
if (GParams.currentLevel == 2){
speed = 10;
} else {
if (GParams.currentLevel == 3){
speed = 11;
} else {
if (GParams.currentLevel == 5){
speed = 12;
};
};
};
};
addEventListener(Event.ENTER_FRAME, onEnterFrame);
paddleBlockCount = 0;
paddleBlockMaxCount = GParams.paddleBlockCountMax;
radius = GParams.paddleRadius;
actualRadius = GParams.paddleRadius;
paddleSizeCount = 0;
paddleSizeMaxCount = GParams.paddleSizeCountMax;
paddleSizeChanged = false;
}
public function resetListener(){
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
}
private function incrementScore(){
GParams.scoreValue = (GParams.scoreValue + GParams.paddleHitScore);
GParams.currentLevelScore = (GParams.currentLevelScore + GParams.paddleHitScore);
TwoBallSurface(WallGameMain.surface).score.text = GParams.scoreValue.toString();
}
public function maximisePaddle(){
this.scaleX = 2.5;
radius = (actualRadius * 2.5);
paddleSizeChanged = true;
minDistX = (radius + Ball.radius);
minDist = Math.sqrt(((minDistX * minDistX) + (minDistY * minDistY)));
}
override public function checkBoundary(){
if ((x - radius) < WallGameMain.surface.boundaryL1XMin){
x = (WallGameMain.surface.boundaryL1XMin + radius);
} else {
if ((x + radius) > WallGameMain.surface.boundaryL1XMax){
x = (WallGameMain.surface.boundaryL1XMax - radius);
};
};
}
public function reinit(){
radius = GParams.paddleRadius;
actualRadius = GParams.paddleRadius;
addMyPaddleListener();
minDistX = (halfWidth + Ball.radius);
minDistY = (halfHeight + Ball.radius);
minDist = Math.sqrt(((minDistX * minDistX) + (minDistY * minDistY)));
paddleSizeChanged = false;
minimisePaddle();
}
public function minimisePaddle(){
this.scaleX = 1;
radius = actualRadius;
minDistX = (radius + Ball.radius);
paddleSizeChanged = false;
minDist = Math.sqrt(((minDistX * minDistX) + (minDistY * minDistY)));
}
public function onEnterFrame(_arg1:Event){
if (paddleSizeChanged == true){
paddleSizeCount = (paddleSizeCount + 1);
if (paddleSizeCount >= paddleSizeMaxCount){
minimisePaddle();
};
};
if (paddleBlocked == true){
paddleBlockCount = (paddleBlockCount + 1);
if (paddleBlockCount >= paddleBlockMaxCount){
paddleBlocked = false;
};
checkBallCollision();
return;
};
if (leftKeyDown == true){
this.x = (this.x - speed);
};
if (rightKeyDown == true){
this.x = (this.x + speed);
};
checkBoundary();
checkBallCollision();
}
override public function checkBallCollision():Boolean{
var _local1:Boolean;
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Ball;
var _local8:Number;
_local1 = false;
_local2 = 0;
_local3 = 0;
_local4 = 0;
_local5 = 0;
_local6 = 0;
_local7 = null;
_local8 = 0;
while (_local8 < WallGameMain.ballArray.length) {
_local7 = WallGameMain.ballArray[_local8];
_local2 = (this.x - _local7.x);
if (Math.abs(_local2) <= minDistX){
_local3 = (this.y - _local7.y);
if (Math.abs(_local3) <= minDistY){
_local4 = Math.sqrt(((_local2 * _local2) + (_local3 * _local3)));
_local6 = (minDist - _local4);
_local5 = (Math.atan2(_local3, _local2) + Math.PI);
_local7.setVelocity(_local5);
_local7.x = (_local7.x + (Math.cos(_local5) * _local6));
_local7.y = (_local7.y + (Math.sin(_local5) * _local6));
WallGameMain.lastHitPaddleIndex = paddleIndex;
incrementScore();
WallGameMain.pcs.play();
_local1 = true;
};
};
_local8++;
};
return (_local1);
}
public function addMyPaddleListener(){
paddleBlockCount = 0;
paddleBlocked = false;
addEventListener(Event.ENTER_FRAME, onEnterFrame);
paddleSizeCount = 0;
paddleSizeChanged = false;
}
}
}//package
Section 57
//MyPaddleTWS (MyPaddleTWS)
package {
import flash.events.*;
public class MyPaddleTWS extends MyPaddle {
private var ballIndex:Number;// = 0
public function MyPaddleTWS(){
ballIndex = 0;
super();
if (GParams.currentLevel == 1){
speed = 8;
} else {
speed = 9;
};
paddleBlockCount = 0;
paddleBlockMaxCount = (GParams.frameRate * 10);
paddleBlockCount = 0;
paddleBlockMaxCount = GParams.paddleBlockCountMax;
radius = GParams.paddleRadius;
actualRadius = GParams.paddleRadius;
paddleSizeCount = 0;
paddleSizeMaxCount = GParams.paddleSizeCountMax;
paddleSizeChanged = false;
}
public function resetListener(){
if (ballIndex == 0){
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
} else {
removeEventListener(Event.ENTER_FRAME, onEnterFrameLeft);
};
}
private function incrementScore(){
GParams.scoreValue = (GParams.scoreValue + GParams.paddleHitScore);
SplitWallSurface(WallGameMain.surface).score.text = GParams.scoreValue.toString();
}
override public function checkBoundary(){
if ((x - radius) < minX){
x = (minX + radius);
} else {
if ((x + radius) > maxX){
x = (maxX - radius);
};
};
}
public function reinit(){
radius = GParams.paddleRadius;
actualRadius = GParams.paddleRadius;
addMyPaddleListener();
minDistX = (halfWidth + Ball.radius);
minDistY = (halfHeight + Ball.radius);
minDist = Math.sqrt(((minDistX * minDistX) + (minDistY * minDistY)));
}
public function onEnterFrame(_arg1:Event){
if (paddleBlocked == true){
paddleBlockCount = (paddleBlockCount + 1);
if (paddleBlockCount == paddleBlockMaxCount){
paddleBlocked = false;
};
checkBallCollision();
return;
};
if (leftKeyDown == true){
this.x = (this.x - speed);
};
if (rightKeyDown == true){
this.x = (this.x + speed);
};
checkBoundary();
checkBallCollision();
}
public function setBallIndex(_arg1:Number){
ballIndex = _arg1;
}
override public function checkBallCollision():Boolean{
var _local1:Boolean;
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Ball;
var _local8:Number;
_local1 = false;
_local2 = 0;
_local3 = 0;
_local4 = 0;
_local5 = 0;
_local6 = 0;
_local7 = null;
_local8 = 0;
while (_local8 < WallGameMain.ballArray.length) {
_local7 = WallGameMain.ballArray[_local8];
_local2 = (this.x - _local7.x);
if (Math.abs(_local2) <= minDistX){
_local3 = (this.y - _local7.y);
if (Math.abs(_local3) <= minDistY){
_local4 = Math.sqrt(((_local2 * _local2) + (_local3 * _local3)));
_local6 = (minDist - _local4);
_local5 = (Math.atan2(_local3, _local2) + Math.PI);
_local7.setVelocity(_local5);
_local7.x = (_local7.x + (Math.cos(_local5) * _local6));
_local7.y = (_local7.y + (Math.sin(_local5) * _local6));
incrementScore();
WallGameMain.pcs.play();
_local1 = true;
};
};
_local8++;
};
return (_local1);
}
public function addMyPaddleListener(){
paddleBlockCount = 0;
paddleBlocked = false;
if (ballIndex == 0){
addEventListener(Event.ENTER_FRAME, onEnterFrame);
} else {
addEventListener(Event.ENTER_FRAME, onEnterFrameLeft);
};
}
public function onEnterFrameLeft(_arg1:Event){
if (paddleBlocked == true){
paddleBlockCount = (paddleBlockCount + 1);
if (paddleBlockCount == paddleBlockMaxCount){
paddleBlocked = false;
};
checkBallCollision();
return;
};
if (oneKeyDown == true){
this.x = (this.x - speed);
};
if (twoKeyDown == true){
this.x = (this.x + speed);
};
checkBoundary();
checkBallCollision();
}
}
}//package
Section 58
//Obstacle (Obstacle)
package {
import flash.display.*;
public class Obstacle extends Sprite {
protected var min:Number;
protected var speed:Number;// = 3
protected var max:Number;
protected var bounce;// = -1
protected var radius:Number;// = 25
public static var minDist:Number;
public function Obstacle(){
speed = 3;
bounce = -1;
radius = 25;
super();
}
}
}//package
Section 59
//ObstacleFactory (ObstacleFactory)
package {
public class ObstacleFactory {
public static var obstaclesXAxis:Array = null;
public static var obstaclesYAxis:Array = null;
public static function createObstacles(){
var _local1:Number;
obstaclesXAxis = new Array(4);
obstaclesYAxis = new Array(3);
_local1 = 0;
while (_local1 < obstaclesXAxis.length) {
obstaclesXAxis[_local1] = new ObstacleXAxis();
_local1++;
};
_local1 = 0;
while (_local1 < obstaclesYAxis.length) {
obstaclesYAxis[_local1] = new ObstacleYAxis();
_local1++;
};
}
}
}//package
Section 60
//ObstacleXAxis (ObstacleXAxis)
package {
import flash.events.*;
public class ObstacleXAxis extends Obstacle {
public function ObstacleXAxis(){
minDist = (radius + Ball.radius);
addEventListener(Event.ENTER_FRAME, onEnterFrame);
}
public function setBoundary(_arg1:Number, _arg2:Number){
this.min = _arg1;
this.max = (min + _arg2);
}
public function onEnterFrame(_arg1:Event){
rotation = ((rotation + speed) % 360);
this.x = (this.x + speed);
if (x < min){
speed = (speed * bounce);
x = min;
} else {
if (x > max){
speed = (speed * bounce);
x = max;
};
};
}
}
}//package
Section 61
//ObstacleYAxis (ObstacleYAxis)
package {
public class ObstacleYAxis extends Obstacle {
}
}//package
Section 62
//Paddle (Paddle)
package {
import flash.display.*;
public class Paddle extends Sprite {
protected var radmin10:Number;// = 0
protected var paddleBlocked:Boolean;// = false
protected var rad10:Number;// = 0
protected var controlBallIndex:Number;// = 0
protected var halfHeight:Number;
public var minDist:Number;// = 0
public var minDistY:Number;// = 0
protected var enemyIndex:Number;// = -1
public var isDamaged:Boolean;// = false
protected var halfWidth:Number;
protected var paddleBlockMaxCount:Number;// = 0
protected var rad170:Number;// = 0
public var radius:Number;// = 25
protected var paddleBlockCount:Number;// = 0
protected var radmin170:Number;// = 0
public var minDistX:Number;// = 0
public static var paddleHeight:Number = 15;
public function Paddle(){
radius = 25;
halfWidth = radius;
halfHeight = paddleHeight;
rad10 = 0;
rad170 = 0;
radmin10 = 0;
radmin170 = 0;
enemyIndex = -1;
isDamaged = false;
minDistX = 0;
minDistY = 0;
minDist = 0;
paddleBlockCount = 0;
paddleBlockMaxCount = 0;
paddleBlocked = false;
controlBallIndex = 0;
super();
rad10 = ((Math.PI * 10) / 180);
rad170 = ((Math.PI * 170) / 180);
radmin10 = ((Math.PI * 350) / 180);
radmin170 = ((Math.PI * 190) / 180);
minDistX = (halfWidth + Ball.radius);
minDistY = (halfHeight + Ball.radius);
minDist = Math.sqrt(((minDistX * minDistX) + (minDistY * minDistY)));
}
public function removePaddleEventListener(){
}
public function checkBallCollisionFW(){
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Ball;
var _local7:Boolean;
var _local8:Number;
_local1 = 0;
_local2 = 0;
_local3 = 0;
_local4 = 0;
_local5 = 0;
_local6 = null;
_local7 = false;
_local8 = 0;
while (_local8 < WallGameMain.ballArray.length) {
_local7 = false;
_local6 = WallGameMain.ballArray[_local8];
if ((((rotation == 0)) || ((rotation == 180)))){
_local1 = (this.x - _local6.x);
if (Math.abs(_local1) <= minDistX){
_local2 = (this.y - _local6.y);
if (Math.abs(_local2) <= minDistY){
_local3 = Math.sqrt(((_local1 * _local1) + (_local2 * _local2)));
_local5 = (minDist - _local3);
_local4 = (Math.atan2(_local2, _local1) + Math.PI);
_local6.setVelocity(_local4);
_local6.correctOverlap(_local5);
WallGameMain.lastHitPaddleIndex = enemyIndex;
incrementScoreFW();
WallGameMain.pcs.play();
_local7 = true;
};
};
} else {
_local1 = (this.x - _local6.x);
if (Math.abs(_local1) <= minDistY){
_local2 = (this.y - _local6.y);
if (Math.abs(_local2) <= minDistX){
_local3 = Math.sqrt(((_local1 * _local1) + (_local2 * _local2)));
_local5 = (minDist - _local3);
_local4 = (Math.atan2(_local2, _local1) + Math.PI);
_local6.setVelocity(_local4);
_local6.correctOverlap(_local5);
WallGameMain.lastHitPaddleIndex = enemyIndex;
WallGameMain.pcs.play();
incrementScoreFW();
_local7 = true;
};
};
};
_local8++;
};
return (_local7);
}
public function blockPaddle(){
paddleBlocked = true;
}
public function assignControlBallIndex(_arg1:Number){
controlBallIndex = _arg1;
}
private function incrementScore(){
GParams.scoreValue = (GParams.scoreValue + GParams.paddleHitScore);
SplitWallSurface(WallGameMain.surface).score.text = GParams.scoreValue.toString();
}
private function incrementScoreFW(){
GParams.scoreValue = (GParams.scoreValue + GParams.paddleHitScore);
FourWallSurface(WallGameMain.surface).score.text = GParams.scoreValue.toString();
}
public function checkBallCollisionTW(_arg1:Ball):Boolean{
return (false);
}
public function setBoundary(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number=-1, _arg7:Number=-1){
}
public function checkBoundaryFW(){
}
public function checkBallCollision():Boolean{
var _local1:Boolean;
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Ball;
var _local8:Number;
_local1 = false;
_local2 = 0;
_local3 = 0;
_local4 = 0;
_local5 = 0;
_local6 = 0;
_local7 = null;
_local8 = 0;
while (_local8 < WallGameMain.ballArray.length) {
_local7 = WallGameMain.ballArray[_local8];
_local2 = (this.x - _local7.x);
if (Math.abs(_local2) <= minDistX){
_local3 = (this.y - _local7.y);
if (Math.abs(_local3) <= minDistY){
_local4 = Math.sqrt(((_local2 * _local2) + (_local3 * _local3)));
_local6 = (minDist - _local4);
_local5 = (Math.atan2(_local3, _local2) + Math.PI);
_local7.setVelocity(_local5);
_local7.x = (_local7.x + (Math.cos(_local5) * _local6));
_local7.y = (_local7.y + (Math.sin(_local5) * _local6));
WallGameMain.lastHitPaddleIndex = enemyIndex;
WallGameMain.pcs.play();
_local1 = true;
};
};
_local8++;
};
return (_local1);
}
public function setEnemyVelocityL2():void{
}
}
}//package
Section 63
//PaddleCollisionSound (PaddleCollisionSound)
package {
import flash.media.*;
public class PaddleCollisionSound extends Sound {
}
}//package
Section 64
//PNegetiveSound (PNegetiveSound)
package {
import flash.media.*;
public class PNegetiveSound extends Sound {
}
}//package
Section 65
//PowerupSound (PowerupSound)
package {
import flash.media.*;
public class PowerupSound extends Sound {
}
}//package
Section 66
//PPositiveSound (PPositiveSound)
package {
import flash.media.*;
public class PPositiveSound extends Sound {
}
}//package
Section 67
//Preloader (Preloader)
package {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import flash.utils.*;
import flash.net.*;
public class Preloader extends MovieClip {
private var percentText:TextField;
var urlPlayMore:String;// = "http://www.flasharcade.com"
public var percent:TextField;
var requestPlayMore:URLRequest;// = null
var timer:Timer;
private var progressBar:Sprite;
public var percentbar:MovieClip;
public var logo:MovieClip;
public static const startFrame:Number = 3;
public static const mainClass:String = "WallGameMain";
public function Preloader(){
requestPlayMore = null;
urlPlayMore = "http://www.flasharcade.com";
addFrameScript(2, frame3);
stop();
super();
requestPlayMore = new URLRequest(urlPlayMore);
progressBar = (getChildByName("percentbar") as Sprite);
progressBar.scaleX = 0;
percentText = (getChildByName("percent") as TextField);
trace((" percentText : " + percentText));
percentText.text = "0";
timer = new Timer(100, 0);
timer.addEventListener(TimerEvent.TIMER, afterSecond);
timer.start();
logo.buttonMode = true;
logo.useHandCursor = true;
logo.addEventListener(MouseEvent.CLICK, handleClick);
}
private function enterFrameHandler(_arg1:Event):void{
trace(" loading complete");
if (currentFrame >= _slot1.startFrame){
removeEventListener(Event.ENTER_FRAME, enterFrameHandler);
stop();
initApp();
};
}
private function onComplete(_arg1:Event):void{
play();
addEventListener(Event.ENTER_FRAME, enterFrameHandler);
}
function frame3(){
stop();
}
public function handleClick(_arg1:MouseEvent){
var event = _arg1;
try {
navigateToURL(requestPlayMore, "_blank");
} catch(e:Error) {
};
}
public function afterSecond(_arg1:TimerEvent){
var _local2:uint;
var _local3:uint;
var _local4:Number;
trace(" inside after second");
_local2 = loaderInfo.bytesLoaded;
_local3 = loaderInfo.bytesTotal;
_local4 = (_local2 / _local3);
progressBar.scaleX = ((_local2 / _local3) * 4);
percentText.text = (Math.round((_local4 * 100)).toString() + "%");
trace((" percentText.text : " + percentText.text));
if (_local2 >= _local3){
timer.stop();
play();
addEventListener(Event.ENTER_FRAME, enterFrameHandler);
};
}
private function showProgress(_arg1:ProgressEvent):void{
var _local2:uint;
var _local3:uint;
var _local4:Number;
_local2 = _arg1.bytesLoaded;
_local3 = _arg1.bytesTotal;
_local4 = (_local2 / _local3);
progressBar.scaleX = ((_local2 / _local3) * 4);
percentText.text = (Math.round((_local4 * 100)).toString() + "%");
}
private function initApp():void{
var _local1:Boolean;
var _local2:Class;
var _local3:Sprite;
_local1 = loaderInfo.applicationDomain.hasDefinition(_slot1.mainClass);
trace((" definition : " + _local1));
_local2 = (loaderInfo.applicationDomain.getDefinition(_slot1.mainClass) as Class);
_local3 = (new (_local2) as Sprite);
addChild(_local3);
}
}
}//package
Section 68
//Reflector (Reflector)
package {
import flash.display.*;
public class Reflector extends Sprite {
public var minDistY;
public var minDistX;
private var radius;// = 25
protected static var reflectorCount = 2;
private static var maxReflectorsOnBoard:Number = 8;
public static var halfWidth:Number = 7.5;
public static var refLength:Number = 50;
public static var halfHeight:Number = 25;
public static var reflectorGroup:Reflector = null;
public function Reflector(){
radius = 25;
minDistX = ((halfWidth + Ball.radius) + 3);
minDistY = ((halfHeight + Ball.radius) + 3);
super();
}
public function resetReflector(){
}
public function checkBallCollision():Boolean{
var _local1:Boolean;
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Ball;
var _local6:Number;
_local1 = false;
_local2 = 0;
_local3 = 0;
_local4 = 0;
_local5 = null;
_local6 = 0;
while (_local6 < WallGameMain.ballArray.length) {
_local5 = WallGameMain.ballArray[_local6];
_local2 = (this.x - _local5.x);
if (Math.abs(_local2) <= minDistX){
_local3 = (this.y - _local5.y);
if (Math.abs(_local3) <= minDistY){
_local4 = (Math.atan2(_local3, _local2) - Math.PI);
_local5.setVelocity(_local4);
_local1 = true;
WallGameMain.bhs.play();
return (_local1);
};
};
_local6++;
};
return (_local1);
}
public static function createInstance(){
if (reflectorGroup == null){
reflectorGroup = new (Reflector);
};
}
}
}//package
Section 69
//Rhombus (Rhombus)
package {
import flash.geom.*;
import flash.display.*;
public class Rhombus extends MovieClip {
private var angles:Array;// = null
private var angularPos:Number;// = 1.5707963267949
private var sideLength:Number;// = 25
private var radian:Number;// = 0.0174532925199433
public var minDist:Number;
private var halfWidth:Number;// = 15
public var center:Point;
private var orbitRadius;// = 100
private var halfHeight:Number;// = 20
public var lines:Array;// = null
public static var randomObjects:Array = null;
public function Rhombus(){
center = new Point(GParams.stageCenter.x, GParams.stageCenter.y);
halfWidth = 15;
halfHeight = 20;
radian = (Math.PI / 180);
sideLength = 25;
angles = null;
lines = null;
orbitRadius = 100;
angularPos = (Math.PI / 2);
minDist = (Ball.radius + halfHeight);
super();
angles = new Array(53, 127, 233, 307);
lines = new Array(4);
}
public function init():void{
var _local1:Point;
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
changePosition();
this.center.x = x;
this.center.y = y;
_local1 = new Point();
_local1.x = 0;
_local1.y = -(halfHeight);
_local2 = 0;
_local3 = 0;
_local4 = 0;
_local5 = 0;
while (_local5 < angles.length) {
_local2 = (angles[_local5] * radian);
_local3 = ((Math.cos(_local2) * sideLength) / 2);
_local4 = ((Math.sin(_local2) * sideLength) / 2);
lines[_local5] = new Line(sideLength, (_local1.x + _local3), (_local1.y + _local4), angles[_local5]);
addChild(lines[_local5]);
_local1.x = (_local1.x + (_local3 * 2));
_local1.y = (_local1.y + (_local4 * 2));
_local5++;
};
}
public function changePosition(){
angularPos = ((Math.random() * Math.PI) * 2);
this.x = (GParams.stageCenter.x + (Math.cos(angularPos) * orbitRadius));
this.y = (GParams.stageCenter.y + (Math.sin(angularPos) * orbitRadius));
this.center.x = x;
this.center.y = y;
}
public static function createInstance(){
var _local1:Number;
if (randomObjects == null){
randomObjects = new Array(2);
_local1 = 0;
while (_local1 < randomObjects.length) {
randomObjects[_local1] = new (Rhombus);
_local1++;
};
};
}
}
}//package
Section 70
//RhombusHitSound (RhombusHitSound)
package {
import flash.media.*;
public class RhombusHitSound extends Sound {
}
}//package
Section 71
//RightWallReflector (RightWallReflector)
package {
import flash.events.*;
public class RightWallReflector extends Reflector {
private var yMin:Number;// = 0
private var yMax:Number;// = 0
private var isMoving:Boolean;// = false
private var speed:Number;// = 3
private var bounce:Number;// = -1
public static var reflectorArray:Array = new Array(reflectorCount);
public function RightWallReflector(){
yMin = 0;
yMax = 0;
speed = 3;
bounce = -1;
isMoving = false;
super();
width = 15;
height = 50;
}
public function setBoundary(_arg1:Number, _arg2:Number, _arg3:Boolean=false){
yMin = _arg1;
yMax = _arg2;
this.isMoving = _arg3;
if (isMoving == true){
addEventListener(Event.ENTER_FRAME, onEnterFrame);
};
}
public function onEnterFrame(_arg1:Event){
this.y = (this.y + speed);
if (this.y <= yMin){
speed = (speed * bounce);
this.y = yMin;
} else {
if (this.y >= yMax){
speed = (speed * bounce);
this.y = yMax;
};
};
checkBallCollision();
}
public function reinit(){
addEventListener(Event.ENTER_FRAME, onEnterFrame);
}
override public function resetReflector(){
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
}
public static function createReflectors():void{
var _local1:Number;
var _local2:Number;
var _local3:*;
_local1 = -1;
_local2 = -1;
_local3 = 0;
while (_local3 < reflectorArray.length) {
if (reflectorArray[_local3] == null){
reflectorArray[_local3] = new (RightWallReflector);
reflectorArray[_local3].speed = _local2;
_local2 = (_local2 * _local1);
};
_local3++;
};
}
}
}//package
Section 72
//RingHitSound (RingHitSound)
package {
import flash.media.*;
public class RingHitSound extends Sound {
}
}//package
Section 73
//Rotator (Rotator)
package {
import flash.events.*;
import flash.geom.*;
import flash.display.*;
public class Rotator extends Sprite {
private var maxRadius:Number;// = 130
private var minDist:Number;
private var twoPI:Number;
private var pos:Point;
private var deltaRadius:Number;// = 0.5
public var orbitRadius:Number;
private var minRadius:Number;// = 30
private var radius:Number;// = 15
private var angle:Number;// = 0
public var angularVelocity:Number;
private static var rotatorCount:Number = 2;
public static var rotatorArray:Array = null;
public static var rotator:Rotator = null;
public function Rotator(){
radius = 15;
angularVelocity = ((GParams.rotatorVelocity * Math.PI) / 180);
angle = 0;
minDist = (radius + Ball.radius);
orbitRadius = GParams.orbitRadius;
pos = new Point();
deltaRadius = 0.5;
minRadius = 30;
maxRadius = 130;
super();
twoPI = (Math.PI * 2);
}
public function removeRotatorListener(){
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
}
public function setPosition(_arg1:Number, _arg2:Number){
this.angle = _arg1;
this.orbitRadius = _arg2;
this.x = ((Math.cos(_arg1) * _arg2) + GParams.stageCenter.x);
this.y = ((Math.sin(_arg1) * _arg2) + GParams.stageCenter.y);
}
public function onEnterFrame(_arg1:Event){
angle = (angle + angularVelocity);
if (angle >= twoPI){
orbitRadius = (orbitRadius + deltaRadius);
angle = 0;
angle = (angle + angularVelocity);
};
orbitRadius = (orbitRadius + deltaRadius);
if (orbitRadius >= maxRadius){
deltaRadius = (deltaRadius * -1);
orbitRadius = (orbitRadius + deltaRadius);
} else {
if (orbitRadius <= minRadius){
deltaRadius = (deltaRadius * -1);
orbitRadius = (orbitRadius + deltaRadius);
};
};
rotation = (rotation + angularVelocity);
this.x = ((Math.cos(angle) * orbitRadius) + GParams.stageCenter.x);
this.y = ((Math.sin(angle) * orbitRadius) + GParams.stageCenter.y);
}
public function reinit(){
addEventListener(Event.ENTER_FRAME, onEnterFrame);
}
public function checkBallCollision():Boolean{
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Ball;
var _local6:Boolean;
var _local7:Number;
_local1 = 0;
_local2 = 0;
_local3 = 0;
_local4 = 0;
_local5 = null;
_local6 = false;
_local7 = 0;
while (_local7 < WallGameMain.ballArray.length) {
_local6 = false;
_local5 = WallGameMain.ballArray[_local7];
_local1 = (this.x - _local5.x);
_local2 = (this.y - _local5.y);
_local3 = Math.sqrt(((_local1 * _local1) + (_local2 * _local2)));
if (_local3 < minDist){
_local4 = (Math.atan2(_local2, _local1) - Math.PI);
_local5.setVelocity(_local4);
_local6 = true;
};
_local7++;
};
return (_local6);
}
public static function createInstance(){
var _local1:*;
if (rotatorArray == null){
rotatorArray = new Array(rotatorCount);
_local1 = 0;
while (_local1 < rotatorArray.length) {
rotatorArray[_local1] = new (Rotator);
if ((_local1 % 2) == 0){
rotatorArray[_local1].angularVelocity = (rotatorArray[_local1].angularVelocity * -1);
};
_local1++;
};
};
}
}
}//package
Section 74
//SplitWallSurface (SplitWallSurface)
package {
import flash.geom.*;
import flash.text.*;
public class SplitWallSurface extends Surface {
public var topBricks:Array;
private var myBrickStartPoint:Point;
public var bottomBricks:Array;
public var rightReflectorL1X:Number;
public var score:TextField;
public var enemyPaddleYL1:Number;// = 0
public var brickCount:Number;
public var levelNum:TextField;
private var brickStartPoint:Point;
private var baseWidth:Number;
public var myPaddleYL1:Number;// = 0
public var tWidth;
public var leftReflectorL1X:Number;
public var timetick:TextField;
private static var splitWallSurfaceL4:SplitWallSurface = null;
public function SplitWallSurface(){
brickStartPoint = new Point(0, 80);
myBrickStartPoint = new Point(0, 465);
tWidth = GParams.territoryWidthTW;
brickCount = Math.ceil((tWidth / Brick.brickSize));
topBricks = new Array(brickCount);
bottomBricks = new Array(brickCount);
leftReflectorL1X = (boundaryL1XMin + 15);
rightReflectorL1X = (boundaryL1XMax - 15);
myPaddleYL1 = 0;
enemyPaddleYL1 = 0;
super();
}
public function createSurface(){
territoryLife = new Array(2);
createTerritories();
createReflectors();
}
public function arrangeBottomBricks(_arg1:Number, _arg2:Number){
var _local3:Point;
var _local4:Number;
_local3 = new Point();
_local4 = 0;
_local3.x = (_arg1 + Brick.halfWidth);
_local3.y = (_arg2 - Brick.halfHeight);
_local4 = 0;
while (_local4 < brickCount) {
bottomBricks[_local4] = new Brick();
addChild(bottomBricks[_local4]);
bottomBricks[_local4].x = _local3.x;
bottomBricks[_local4].y = _local3.y;
bottomBricks[_local4].rotation = 0;
bottomBricks[_local4].setPosition(_local3.x, _local3.y, 1, _local4);
_local3.x = (_local3.x + Brick.brickSize);
_local4++;
};
}
override protected function blockPaddle(_arg1:Number, _arg2:Number){
if (_arg1 == 0){
if (_arg2 <= (brickCount / 2)){
territory[0].enemyPaddles[0].blockPaddle();
} else {
territory[0].enemyPaddles[1].blockPaddle();
};
} else {
if (_arg2 <= Math.floor((brickCount / 2))){
territory[1].paddleArray[0].blockPaddle();
} else {
territory[1].paddleArray[1].blockPaddle();
};
};
}
override public function resetSurface(){
var _local1:Number;
_local1 = 0;
while (_local1 < territoryLife.length) {
territoryLife[_local1] = GParams.territoryLife;
_local1++;
};
_local1 = 0;
while (_local1 < reflectors.length) {
reflectors[_local1].resetReflector();
_local1++;
};
_local1 = 0;
while (_local1 < brickCount) {
bottomBricks[_local1].resetBricks();
topBricks[_local1].resetBricks();
_local1++;
};
_local1 = 0;
while (_local1 < territory.length) {
territory[_local1].resetTerritory();
_local1++;
};
resetStats();
}
override public function resetStats(){
this.score.text = "";
this.levelNum.text = "";
this.timetick.text = "";
}
override protected function shieldTerritory(_arg1:Number, _arg2:Number){
_arg1 = ((_arg1 + 1) % 2);
addShield(_arg1, _arg2);
}
override public function assignPowerupsToBricks(){
var _local1:*;
var _local2:Number;
var _local3:Number;
var _local4:Number;
_local1 = -1;
_local2 = Math.floor((Math.random() * brickCount));
_local3 = 0;
while (_local3 < GParams.powerups[(GParams.currentLevel - 1)].length) {
_local1 = GParams.powerups[(GParams.currentLevel - 1)][_local3];
if (_local1 == GParams.POWERUP_SHIELD){
_local4 = Math.floor(((_local2 + 7) % Math.floor((brickCount / 2))));
topBricks[_local4].assignPowerup(_local1);
_local4 = Math.floor(((_local4 + 7) % Math.floor((brickCount / 2))));
bottomBricks[_local4].assignPowerup(_local1);
} else {
if (_local1 == GParams.POWERUP_REPAIR){
_local4 = (10 + Math.floor(((_local2 + 7) % 9)));
topBricks[_local4].assignPowerup(_local1);
_local4 = (10 + Math.floor(((_local4 + 7) % 9)));
bottomBricks[_local4].assignPowerup(_local1);
} else {
_local4 = Math.floor(((_local2 + 8) % Math.floor((brickCount / 2))));
if (topBricks[_local4].hasPowerup() == true){
_local4 = ((_local4 + 2) % Math.floor((brickCount / 2)));
};
topBricks[_local4].assignPowerup(_local1);
_local4 = Math.floor((((_local4 + 8) % brickCount) / 2));
if (bottomBricks[_local4].hasPowerup() == true){
_local4 = ((_local4 + 2) % Math.floor((brickCount / 2)));
};
bottomBricks[_local4].assignPowerup(_local1);
_local4 = (10 + Math.floor(((_local2 + 8) % 9)));
if (topBricks[_local4].hasPowerup() == true){
_local4 = (10 + Math.floor(((_local4 + 2) % 9)));
};
topBricks[_local4].assignPowerup(_local1);
_local4 = (10 + Math.floor(((_local4 + 8) % 9)));
if (bottomBricks[_local4].hasPowerup() == true){
_local4 = (10 + Math.floor(((_local4 + 2) % 9)));
};
bottomBricks[_local4].assignPowerup(_local1);
};
};
_local3++;
};
}
public function createReflectors(){
var _local1:Point;
var _local2:*;
var _local3:*;
var _local4:Number;
var _local5:Number;
LeftWallReflector.createReflectors();
RightWallReflector.createReflectors();
reflectors[0] = new LeftWallReflector();
reflectors[1] = new LeftWallReflector();
reflectors[2] = new RightWallReflector();
reflectors[3] = new RightWallReflector();
_local1 = new Point(boundaryL1XMin, boundaryL1YMin);
_local2 = (boundaryL1YMin + ((Reflector.refLength / 2) + 50));
_local3 = ((boundaryL1YMin + ((boundaryL1YMax - boundaryL1YMin) / 2)) - (Reflector.refLength / 2));
_local4 = boundaryL1XMin;
_local5 = boundaryL1XMax;
addChild(reflectors[0]);
reflectors[0].x = _local4;
reflectors[0].y = _local2;
reflectors[0].setBoundary(_local2, _local3, true);
addChild(reflectors[2]);
reflectors[2].x = _local5;
reflectors[2].y = _local2;
reflectors[2].setBoundary(_local2, _local3, true);
_local2 = (_local3 + Reflector.refLength);
_local3 = (boundaryL1YMax - ((Reflector.refLength / 2) + 50));
addChild(reflectors[1]);
reflectors[1].x = _local4;
reflectors[1].y = _local3;
reflectors[1].setBoundary(_local2, _local3, true);
addChild(reflectors[3]);
reflectors[3].x = _local5;
reflectors[3].y = _local3;
reflectors[3].setBoundary(_local2, _local3, true);
}
override public function updateStats(_arg1:Number){
this.timetick.text = _arg1.toString();
}
public function addShield(_arg1:Number, _arg2:Number){
var _local3:Number;
if (_arg1 == 0){
_local3 = 0;
while (_local3 < Math.floor((brickCount / 2))) {
topBricks[_local3].enableShield();
_local3++;
};
} else {
_local3 = 0;
while (_local3 < Math.floor((brickCount / 2))) {
bottomBricks[_local3].enableShield();
_local3++;
};
};
territory[_arg1].enableShield();
}
override public function createTerritories(){
var _local1:Number;
var _local2:Number;
var _local3:Number;
territory = new Array(2);
territory[0] = new TerritoryTop();
territory[0].init(GParams.stageBorderTW, GParams.stageBorderTW);
addChild(territory[0]);
_local1 = GParams.stageBorderTW;
_local2 = (GParams.stageBorderTW + GParams.territoryHeightTW);
arrangeTopBricks(_local1, _local2);
_local3 = 0;
while (_local3 < territory[0].enemyPaddles.length) {
addChild(territory[0].enemyPaddles[_local3]);
_local3++;
};
territory[1] = new TerritoryBottom();
territory[1].init(GParams.stageBorderTW, (GParams.stageHeight - (GParams.stageBorderTW + GParams.territoryHeightTW)));
addChild(territory[1]);
_local1 = GParams.stageBorderTW;
_local2 = (GParams.stageHeight - (GParams.stageBorderTW + GParams.territoryHeightTW));
arrangeBottomBricks(_local1, _local2);
_local3 = 0;
while (_local3 < territory[1].paddleArray.length) {
territory[1].paddleArray[_local3].setBallIndex(((_local3 + 1) % 2));
addChild(territory[1].paddleArray[_local3]);
_local3++;
};
territoryLife[0] = GParams.territoryLife;
territoryLife[1] = GParams.territoryLife;
}
public function triggerEnemyVelocity(){
setEnemyVelocity = true;
}
public function arrangeTopBricks(_arg1:Number, _arg2:Number){
var _local3:Point;
var _local4:Number;
_local3 = new Point();
_local4 = 0;
_local3.x = (_arg1 + Brick.halfWidth);
_local3.y = (_arg2 + Brick.halfHeight);
_local4 = 0;
while (_local4 < brickCount) {
topBricks[_local4] = new Brick();
addChild(topBricks[_local4]);
topBricks[_local4].x = _local3.x;
topBricks[_local4].y = _local3.y;
topBricks[_local4].rotation = 180;
topBricks[_local4].setPosition(_local3.x, _local3.y, 0, _local4);
_local3.x = (_local3.x + Brick.brickSize);
_local4++;
};
}
override public function reinit(){
var _local1:Number;
_local1 = 0;
while (_local1 < territory.length) {
territory[_local1].reinit();
_local1++;
};
_local1 = 0;
while (_local1 < brickCount) {
topBricks[_local1].reinit();
_local1++;
};
_local1 = 0;
while (_local1 < brickCount) {
bottomBricks[_local1].reinit();
_local1++;
};
_local1 = 0;
while (_local1 < reflectors.length) {
reflectors[_local1].reinit();
_local1++;
};
assignPowerupsToBricks();
levelNum.text = GParams.currentLevel.toString();
this.score.text = GParams.scoreValue.toString();
this.timetick.text = "0";
}
override protected function repairTerritoryBricks(_arg1:Number, _arg2:Number){
_arg1 = ((_arg1 + 1) % 2);
territory[_arg1].repairBricks(_arg2);
}
override public function initPower(_arg1:Number, _arg2:Number, _arg3:Number){
switch (_arg1){
case 1:
blockPaddle(_arg2, _arg3);
break;
case 2:
shieldTerritory(_arg2, _arg3);
break;
case 3:
repairTerritoryBricks(_arg2, _arg3);
break;
case 4:
break;
};
}
}
}//package
Section 75
//Surface (Surface)
package {
import flash.geom.*;
import flash.display.*;
public class Surface extends MovieClip {
public var territory:Array;// = null
public var myBricks:Array;
public var reflectors:Array;
protected var startX;// = 0
protected var startY;// = 0
public var setEnemyVelocity:Boolean;// = false
public var myPaddle:MyPaddle;// = null
protected var sideBorder:Number;// = 20
protected var ceilTileHeight:Number;// = 60
public var boundaryL1XMin:Number;
public var enemyCount:Number;// = 0
public var territoryLife:Array;// = null
public var damagedEnemies:Number;// = 0
public var enemy:Array;
public var boundaryL1XMax:Number;
protected var floorTileHeight:Number;// = 70
public var enemyPaddles:Array;// = null
protected var rotatorArray:Array;// = null
protected var randomObjectCount:Number;// = 0
public var paddleCount:Number;
public var boundaryL1YMin:Number;
public var reflectorArray:Array;// = null
public var boundaryL1YMax:Number;
public var randomObject:Rhombus;// = null
public static var enemy3EndPoint:Point = new Point();
public static var enemy2EndPoint:Point = new Point();
public static var myEndPoint:Point = new Point();
public static var stageHeight:Number = GParams.stageHeight;
public static var stageWidth:Number = GParams.stageWidth;
public static var stageCenter:Point = new Point((stageWidth / 2), (stageHeight / 2));
public static var enemy1StartPoint:Point = new Point();
public static var enemy2StartPoint:Point = new Point();
public static var enemy3StartPoint:Point = new Point();
public static var myStartPoint:Point = new Point();
public static var enemy1EndPoint:Point = new Point();
public function Surface(){
startX = 0;
startY = 0;
sideBorder = 20;
floorTileHeight = 70;
ceilTileHeight = 60;
enemyCount = 0;
enemyPaddles = null;
myPaddle = null;
boundaryL1XMin = sideBorder;
boundaryL1XMax = (stageWidth - sideBorder);
boundaryL1YMin = ((ceilTileHeight + Brick.brickHeight) + 5);
boundaryL1YMax = (stageHeight - ((floorTileHeight + Brick.brickHeight) + 5));
reflectorArray = null;
damagedEnemies = 0;
territory = null;
randomObject = null;
randomObjectCount = 0;
reflectors = new Array(2);
territoryLife = null;
setEnemyVelocity = false;
rotatorArray = null;
super();
}
public function checkBrickCollision(_arg1:Number, _arg2:Ball):Boolean{
return (false);
}
protected function maximisePaddle(_arg1:Number){
}
protected function blockPaddle(_arg1:Number, _arg2:Number){
}
public function checkObstacleCollision():Boolean{
return (false);
}
public function checkRotatorCollision():Boolean{
var _local1:*;
_local1 = 0;
while (_local1 < rotatorArray.length) {
if (rotatorArray[_local1].checkBallCollision() == true){
return (true);
};
_local1++;
};
return (false);
}
public function resetSurface(){
}
public function updateStats(_arg1:Number){
}
public function checkLineCollision(){
}
public function resetStats(){
}
public function checkAllEnemiesDamaged(){
}
protected function shieldTerritory(_arg1:Number, _arg2:Number){
}
public function createTerritories(){
}
public function reinit(){
}
public function initPower(_arg1:Number, _arg2:Number, _arg3:Number){
}
protected function repairTerritoryBricks(_arg1:Number, _arg2:Number){
}
public function checkBallCollision():Boolean{
return (false);
}
public function assignPowerupsToBricks(){
}
}
}//package
Section 76
//SurfaceFactory (SurfaceFactory)
package {
public class SurfaceFactory {
private static var twoWallSurfaceL5:TwoBallSurface = null;
private static var twoWallSurfaceL1:TwoBallSurface = null;
private static var fourWallSurfaceL6:FourWallSurface = null;
private static var splitWallSurfaceL4:SplitWallSurface = null;
private static var twoWallSurfaceL2:TwoBallSurface = null;
private static var twoWallSurfaceL3:TwoBallSurface = null;
public static function createInstance():Surface{
switch (GParams.currentLevel){
case 1:
if (twoWallSurfaceL1 == null){
twoWallSurfaceL1 = new TwoBallSurface();
twoWallSurfaceL1.createSurface();
};
return (twoWallSurfaceL1);
case 2:
if (twoWallSurfaceL2 == null){
twoWallSurfaceL2 = new TwoBallSurface();
twoWallSurfaceL2.createSurface();
};
return (twoWallSurfaceL2);
case 3:
if (twoWallSurfaceL3 == null){
twoWallSurfaceL3 = new TwoBallSurface();
twoWallSurfaceL3.createSurface();
};
return (twoWallSurfaceL3);
case 4:
if (splitWallSurfaceL4 == null){
splitWallSurfaceL4 = new SplitWallSurface();
splitWallSurfaceL4.createSurface();
};
return (splitWallSurfaceL4);
case 5:
if (twoWallSurfaceL5 == null){
twoWallSurfaceL5 = new TwoBallSurface();
twoWallSurfaceL5.createSurface();
};
return (twoWallSurfaceL5);
case 6:
if (fourWallSurfaceL6 == null){
fourWallSurfaceL6 = new FourWallSurface();
fourWallSurfaceL6.createSurface();
};
return (fourWallSurfaceL6);
default:
return (null);
};
}
}
}//package
Section 77
//Territory (Territory)
package {
import flash.geom.*;
import flash.display.*;
public class Territory extends MovieClip {
public var maxYOuter:Number;
protected var tHalfHeightTotal:Number;
public var hbCount;
public var paddlen:Paddle;// = null
protected var tHalfWidthTotal:Number;
protected var tHeightTotal:Number;
public var brickCount:Number;
public var isDamaged:Boolean;// = false
public var center:Point;
public var minYInner:Number;
public var maxXOuter:Number;
public var maxXInner:Number;
public var bricks:Array;
public var minYOuter:Number;
protected var shielfOnCountMax:Number;// = 0
protected var shieldOn:Boolean;// = false
public var minXInner:Number;
public var tWidth;
public var tHeight;
protected var tWidthTotal:Number;
public var vbCount;
public var minXOuter:Number;
protected var shieldOnCount:Number;// = 0
public var maxYInner:Number;
public function Territory(){
tHeight = GParams.territoryHeight;
tWidth = GParams.territoryWidth;
hbCount = GParams.horizontalBrickCount;
vbCount = GParams.verticleBrickCount;
brickCount = (hbCount + vbCount);
bricks = new Array(brickCount);
isDamaged = false;
tWidthTotal = (tWidth + Brick.brickHeight);
tHeightTotal = (tHeight + Brick.brickHeight);
center = new Point();
paddlen = null;
shieldOn = false;
shieldOnCount = 0;
shielfOnCountMax = 0;
super();
shielfOnCountMax = (GParams.frameRate * 10);
}
public function init(_arg1:Number, _arg2:Number):void{
}
public function checkBrickCollision():Boolean{
trace(" inside brick col");
return (false);
}
public function createPaddle(){
}
public function reinit(){
var _local1:Number;
isDamaged = false;
_local1 = 0;
while (_local1 < bricks.length) {
bricks[_local1].reinit();
_local1++;
};
}
public function damageTerritory(){
var _local1:Number;
this.isDamaged = true;
_local1 = 0;
while (_local1 < bricks.length) {
bricks[_local1].alpha = 0.4;
bricks[_local1].resetBricks();
_local1++;
};
WallGameMain.ballArray[0].speed = (WallGameMain.ballArray[0].speed + 1);
paddlen.isDamaged = true;
paddlen.removePaddleEventListener();
paddlen.alpha = 0.4;
this.alpha = 0.3;
WallGameMain.tds.play();
}
}
}//package
Section 78
//TerritoryBottom (TerritoryBottom)
package {
import flash.events.*;
import flash.display.*;
import flash.text.*;
public class TerritoryBottom extends Sprite {
public var life:TextField;
public var paddleArray:Array;// = null
protected var shieldOnCountMax:Number;// = 0
protected var shieldOn:Boolean;// = false
public var bricks:Array;
public var brickCount:Number;
public var totalLife:Number;// = 3
public var maxX:Number;
public var maxY;
public var minX:Number;
public var tWidth;
public var tHeight;
public var yMinInner:Number;// = 0
protected var shieldOnCount:Number;// = 0
public var yMinOuter:Number;// = 0
public function TerritoryBottom(){
yMinInner = 0;
yMinOuter = 0;
tHeight = GParams.territoryHeightTW;
tWidth = GParams.territoryWidthTW;
brickCount = Math.ceil((tWidth / Brick.brickSize));
bricks = new Array(brickCount);
paddleArray = null;
totalLife = 3;
shieldOn = false;
shieldOnCount = 0;
shieldOnCountMax = 0;
super();
shieldOnCountMax = GParams.shieldOnCountMax;
}
private function removeShield(){
var _local1:int;
if (GParams.currentLevel != 4){
_local1 = 0;
while (_local1 < brickCount) {
TwoBallSurface(WallGameMain.surface).bottomBricks[_local1].disableShield();
_local1++;
};
} else {
_local1 = 0;
while (_local1 < brickCount) {
SplitWallSurface(WallGameMain.surface).bottomBricks[_local1].disableShield();
_local1++;
};
};
}
public function init(_arg1:Number, _arg2:Number):void{
this.x = _arg1;
this.y = _arg2;
minX = _arg1;
maxX = (minX + (brickCount * Brick.brickSize));
yMinInner = _arg2;
yMinOuter = (_arg2 - Brick.brickHeight);
maxY = (yMinInner + tHeight);
createPaddle();
}
public function repairBricks(_arg1:Number){
var _local2:Number;
if (GParams.currentLevel != 4){
_local2 = 0;
while (_local2 < brickCount) {
TwoBallSurface(WallGameMain.surface).bottomBricks[_local2].repair();
_local2++;
};
} else {
if (_arg1 <= (brickCount / 2)){
_local2 = 0;
while (_local2 < Math.floor((brickCount / 2))) {
SplitWallSurface(WallGameMain.surface).bottomBricks[_local2].repair();
_local2++;
};
} else {
_local2 = Math.floor((brickCount / 2));
while (_local2 < brickCount) {
SplitWallSurface(WallGameMain.surface).bottomBricks[_local2].repair();
_local2++;
};
};
};
}
public function resetTerritory(){
var _local1:Number;
_local1 = 0;
while (_local1 < paddleArray.length) {
paddleArray[_local1].resetListener();
_local1++;
};
if (shieldOn == true){
shieldOnCount = 0;
shieldOn = false;
removeShield();
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
};
}
public function createPaddle(){
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
if (GParams.currentLevel != 4){
paddleArray = new Array(1);
paddleArray[0] = new MyPaddleTW();
minX = (minX + GParams.paddleRadius);
maxX = (maxX - GParams.paddleRadius);
paddleArray[0].setBoundary(2, 0, 0, minX, maxX, -1, -1);
paddleArray[0].x = (((maxX - minX) / 2) + minX);
paddleArray[0].y = yMinOuter;
} else {
paddleArray = new Array(2);
_local1 = ((maxX - minX) / 2);
_local2 = minX;
_local3 = (minX + _local1);
_local4 = 2;
_local5 = 0;
while (_local5 < paddleArray.length) {
paddleArray[_local5] = new MyPaddleTWS();
paddleArray[_local5].setBoundary(_local4, 0, 0, _local2, _local3, -1, -1);
paddleArray[_local5].x = (((_local3 - _local2) / 2) + _local2);
paddleArray[_local5].y = yMinOuter;
_local4 = (_local4 + 1);
_local2 = _local3;
_local3 = (_local3 + _local1);
if (_local5 == 1){
};
_local5++;
};
};
}
public function reinit(){
var _local1:Number;
this.life.text = GParams.territoryLife.toString();
_local1 = 0;
while (_local1 < paddleArray.length) {
paddleArray[_local1].reinit();
_local1++;
};
shieldOnCount = 0;
shieldOn = false;
removeShield();
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
}
public function enableShield(){
shieldOn = true;
addEventListener(Event.ENTER_FRAME, onEnterFrame);
}
public function onEnterFrame(_arg1:Event){
if (shieldOn == true){
shieldOnCount = (shieldOnCount + 1);
if (shieldOnCount >= GParams.shieldOnCountMax){
shieldOn = false;
removeShield();
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
};
} else {
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
removeShield();
};
}
}
}//package
Section 79
//TerritoryBottomLeft (TerritoryBottomLeft)
package {
import flash.events.*;
import flash.text.*;
public class TerritoryBottomLeft extends Territory {
public var mesg:TextField;
public var life:TextField;
private function removeShield(){
var _local1:int;
_local1 = 0;
while (_local1 < brickCount) {
bricks[_local1].disableShield();
_local1++;
};
}
override public function init(_arg1:Number, _arg2:Number):void{
minXInner = _arg1;
minYInner = _arg2;
maxXInner = (minXInner + tWidth);
maxYInner = (minYInner + tHeight);
minXOuter = minXInner;
maxXOuter = (minXOuter + (hbCount * FourWallBrick.brickSize));
minYOuter = (minYInner - FourWallBrick.brickHeight);
maxYOuter = ((minYOuter + (vbCount * FourWallBrick.brickSize)) + FourWallBrick.brickHeight);
center.x = (_arg1 + (tWidthTotal / 2));
center.y = (_arg2 + (tHeightTotal / 2));
tHalfWidthTotal = (tWidthTotal / 2);
tHalfHeightTotal = (tHeightTotal / 2);
arrangeBricks();
createPaddle();
}
public function arrangeBricks(){
var _local1:Number;
_local1 = 0;
_local1 = 0;
while (_local1 < hbCount) {
bricks[_local1] = new FourWallBrick();
_local1++;
};
_local1 = hbCount;
while (_local1 < brickCount) {
bricks[_local1] = new FourWallBrick();
bricks[_local1].rotation = 90;
_local1++;
};
}
public function repairBricks(_arg1:Number){
var _local2:Number;
_local2 = 0;
while (_local2 < brickCount) {
bricks[_local2].repair();
_local2++;
};
}
override public function createPaddle(){
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:Number;
paddlen = new MyPaddleFW();
_local1 = (minXOuter + GParams.paddleRadius);
_local2 = maxXOuter;
_local4 = (maxYOuter - GParams.paddleRadius);
_local3 = minYOuter;
paddlen.setBoundary(2, 0, 270, _local1, _local2, _local3, _local4);
paddlen.x = (_local1 + 50);
paddlen.y = _local3;
}
public function enableShield(){
shieldOn = true;
addEventListener(Event.ENTER_FRAME, onEnterFrame);
}
override public function reinit(){
this.life.text = GParams.territoryLife.toString();
this.alpha = 1;
isDamaged = false;
}
public function reset(){
var _local1:Number;
_local1 = 0;
while (_local1 < brickCount) {
bricks[_local1].resetBricks();
_local1++;
};
if (shieldOn == true){
shieldOnCount = 0;
shieldOn = false;
removeShield();
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
};
paddlen.removePaddleEventListener();
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
}
public function onEnterFrame(_arg1:Event){
if (shieldOn == true){
shieldOnCount = (shieldOnCount + 1);
if (shieldOnCount >= GParams.shieldOnCountMax){
shieldOn = false;
removeShield();
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
};
} else {
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
removeShield();
};
}
}
}//package
Section 80
//TerritoryBottomRight (TerritoryBottomRight)
package {
import flash.events.*;
import flash.text.*;
public class TerritoryBottomRight extends Territory {
public var mesg:TextField;
public var life:TextField;
private function removeShield(){
var _local1:int;
_local1 = 0;
while (_local1 < brickCount) {
bricks[_local1].disableShield();
_local1++;
};
}
override public function init(_arg1:Number, _arg2:Number):void{
minXInner = _arg1;
minYInner = _arg2;
maxXInner = (minXInner + tWidth);
maxYInner = (minYInner + tHeight);
minXOuter = (minXInner - FourWallBrick.brickHeight);
maxXOuter = (minXOuter + (hbCount * FourWallBrick.brickSize));
minYOuter = (minYInner - FourWallBrick.brickHeight);
maxYOuter = ((minYOuter + (vbCount * FourWallBrick.brickSize)) + FourWallBrick.brickHeight);
center.x = (_arg1 + (tWidthTotal / 2));
center.y = (_arg2 + (tHeightTotal / 2));
tHalfWidthTotal = (tWidthTotal / 2);
tHalfHeightTotal = (tHeightTotal / 2);
arrangeBricks();
createPaddle();
}
public function arrangeBricks(){
var _local1:Number;
_local1 = 0;
_local1 = 0;
while (_local1 < hbCount) {
bricks[_local1] = new FourWallBrick();
_local1++;
};
_local1 = hbCount;
while (_local1 < brickCount) {
bricks[_local1] = new FourWallBrick();
bricks[_local1].rotation = 270;
_local1++;
};
}
public function repairBricks(_arg1:Number){
var _local2:Number;
_local2 = 0;
while (_local2 < brickCount) {
bricks[_local2].repair();
_local2++;
};
}
public function setPaddleVelocity(){
}
override public function createPaddle(){
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:Number;
paddlen = new MyPaddleFWRight();
_local1 = minXOuter;
_local2 = (maxXOuter - GParams.paddleRadius);
_local4 = (maxYOuter - GParams.paddleRadius);
_local3 = minYOuter;
paddlen.setBoundary(3, 0, 270, _local1, _local2, _local3, _local4);
paddlen.x = (_local1 + 50);
paddlen.y = _local3;
}
public function enableShield(){
shieldOn = true;
addEventListener(Event.ENTER_FRAME, onEnterFrame);
}
override public function reinit(){
this.life.text = GParams.territoryLife.toString();
this.alpha = 1;
isDamaged = false;
}
public function reset(){
var _local1:Number;
_local1 = 0;
while (_local1 < brickCount) {
bricks[_local1].resetBricks();
_local1++;
};
if (shieldOn == true){
shieldOnCount = 0;
shieldOn = false;
removeShield();
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
};
paddlen.removePaddleEventListener();
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
}
public function onEnterFrame(_arg1:Event){
if (shieldOn == true){
shieldOnCount = (shieldOnCount + 1);
if (shieldOnCount >= GParams.shieldOnCountMax){
shieldOn = false;
removeShield();
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
};
} else {
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
removeShield();
};
}
}
}//package
Section 81
//TerritoryDamageSound (TerritoryDamageSound)
package {
import flash.media.*;
public class TerritoryDamageSound extends Sound {
}
}//package
Section 82
//TerritoryTop (TerritoryTop)
package {
import flash.events.*;
import flash.geom.*;
import flash.display.*;
import flash.text.*;
public class TerritoryTop extends Sprite {
public var life:TextField;
public var yMaxOuter:Number;// = 0
protected var shieldOnCountMax:Number;// = 0
protected var shieldOn:Boolean;// = false
public var brickCount:Number;
public var minY;
public var totalLife:Number;// = 3
public var maxX:Number;
public var minX:Number;
public var enemyPaddles:Array;// = null
public var tWidth;
public var tHeight;
private var paddleCount:Number;// = 0
protected var shieldOnCount:Number;// = 0
public var yMaxInner:Number;// = 0
public function TerritoryTop(){
yMaxInner = 0;
yMaxOuter = 0;
tHeight = GParams.territoryHeightTW;
tWidth = GParams.territoryWidthTW;
brickCount = Math.ceil((tWidth / Brick.brickSize));
enemyPaddles = null;
paddleCount = 0;
totalLife = 3;
shieldOn = false;
shieldOnCount = 0;
shieldOnCountMax = 0;
super();
if ((((GParams.currentLevel == 1)) || ((GParams.currentLevel == 3)))){
paddleCount = 1;
} else {
if ((((((GParams.currentLevel == 2)) || ((GParams.currentLevel == 4)))) || ((GParams.currentLevel == 5)))){
paddleCount = 2;
};
};
shieldOnCountMax = GParams.shieldOnCountMax;
}
private function removeShield(){
var _local1:int;
if (GParams.currentLevel != 4){
_local1 = 0;
while (_local1 < brickCount) {
TwoBallSurface(WallGameMain.surface).topBricks[_local1].disableShield();
_local1++;
};
} else {
_local1 = 0;
while (_local1 < brickCount) {
SplitWallSurface(WallGameMain.surface).topBricks[_local1].disableShield();
_local1++;
};
};
}
public function init(_arg1:Number, _arg2:Number):void{
this.x = _arg1;
this.y = _arg2;
minX = _arg1;
maxX = (minX + (brickCount * Brick.brickSize));
minY = _arg2;
yMaxInner = (minY + tHeight);
yMaxOuter = (yMaxInner + Brick.brickHeight);
createPaddle();
shieldOn = false;
}
public function repairBricks(_arg1:Number){
var _local2:*;
if (GParams.currentLevel != 4){
_local2 = 0;
while (_local2 < brickCount) {
TwoBallSurface(WallGameMain.surface).topBricks[_local2].repair();
_local2++;
};
} else {
if (_arg1 <= (brickCount / 2)){
_local2 = 0;
while (_local2 < Math.floor((brickCount / 2))) {
SplitWallSurface(WallGameMain.surface).topBricks[_local2].repair();
_local2++;
};
} else {
_local2 = Math.floor((brickCount / 2));
while (_local2 < brickCount) {
SplitWallSurface(WallGameMain.surface).topBricks[_local2].repair();
_local2++;
};
};
};
}
public function setPaddleVelocity():void{
var _local1:Number;
_local1 = 0;
while (_local1 < enemyPaddles.length) {
enemyPaddles[_local1].setEnemyVelocity();
_local1++;
};
}
public function resetTerritory(){
var _local1:Number;
shieldOn = false;
_local1 = 0;
while (_local1 < enemyPaddles.length) {
enemyPaddles[_local1].resetListener();
_local1++;
};
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
}
public function createPaddle(){
var _local1:Point;
var _local2:*;
var _local3:Number;
var _local4:Number;
var _local5:Number;
enemyPaddles = new Array(paddleCount);
_local1 = new Point();
_local2 = ((maxX - minX) / (paddleCount * 2));
_local4 = 0;
_local3 = minX;
_local4 = (_local2 * 2);
_local1.x = (_local3 + _local2);
_local1.y = yMaxOuter;
_local5 = 0;
while (_local5 < enemyPaddles.length) {
enemyPaddles[_local5] = new EnemyPaddleTop();
addChild(enemyPaddles[_local5]);
enemyPaddles[_local5].x = _local1.x;
enemyPaddles[_local5].y = _local1.y;
enemyPaddles[_local5].setBoundary(_local5, 0, 0, _local3, _local4, -1, -1);
enemyPaddles[_local5].setVelocityAdjust(GParams.enemyPaddleSpeedAdjust[(GParams.currentLevel - 1)]);
_local1.x = (_local1.x + (_local2 * 2));
_local3 = (_local4 + 10);
_local4 = ((_local4 + (_local2 * 2)) - 10);
_local5++;
};
}
public function reinit(){
var _local1:Number;
this.life.text = GParams.territoryLife.toString();
shieldOnCount = 0;
shieldOn = false;
removeShield();
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
_local1 = 0;
while (_local1 < enemyPaddles.length) {
enemyPaddles[_local1].addEnemyPaddleListener();
_local1++;
};
}
public function enableShield(){
shieldOn = true;
addEventListener(Event.ENTER_FRAME, onEnterFrame);
}
public function checkPaddleCollision(_arg1:Ball):Boolean{
var _local2:Number;
_local2 = 0;
while (_local2 < enemyPaddles.length) {
if (enemyPaddles[_local2].checkBallCollisionTW(_arg1) == true){
return (true);
};
_local2++;
};
return (false);
}
public function onEnterFrame(_arg1:Event){
if (shieldOn == true){
shieldOnCount = (shieldOnCount + 1);
if (shieldOnCount >= GParams.shieldOnCountMax){
shieldOn = false;
removeShield();
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
};
} else {
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
removeShield();
};
}
}
}//package
Section 83
//TerritoryTopLeft (TerritoryTopLeft)
package {
import flash.events.*;
import flash.geom.*;
import flash.text.*;
public class TerritoryTopLeft extends Territory {
public var mesg:TextField;
public var life:TextField;
private function removeShield(){
var _local1:int;
_local1 = 0;
while (_local1 < brickCount) {
bricks[_local1].disableShield();
_local1++;
};
}
override public function init(_arg1:Number, _arg2:Number):void{
minXInner = _arg1;
minYInner = _arg2;
maxXInner = (minXInner + tWidth);
maxYInner = (minYInner + tHeight);
minXOuter = minXInner;
maxXOuter = (minXOuter + (hbCount * FourWallBrick.brickSize));
minYOuter = minYInner;
maxYOuter = ((minYOuter + (vbCount * FourWallBrick.brickSize)) + FourWallBrick.brickHeight);
center.x = (_arg1 + (tWidthTotal / 2));
center.y = (_arg2 + (tHeightTotal / 2));
tHalfWidthTotal = (tWidthTotal / 2);
tHalfHeightTotal = (tHeightTotal / 2);
arrangeBricks();
createPaddle();
}
public function arrangeBricks(){
var _local1:Point;
var _local2:Number;
_local1 = new Point();
_local2 = 0;
_local2 = 0;
while (_local2 < hbCount) {
bricks[_local2] = new FourWallBrick();
bricks[_local2].rotation = 180;
_local2++;
};
_local2 = hbCount;
while (_local2 < brickCount) {
bricks[_local2] = new FourWallBrick();
bricks[_local2].rotation = 90;
_local2++;
};
}
public function repairBricks(_arg1:Number){
var _local2:Number;
_local2 = 0;
while (_local2 < brickCount) {
trace(" repairing bricks");
bricks[_local2].repair();
_local2++;
};
}
public function setPaddleVelocity(){
paddlen.setEnemyVelocityL2();
}
override public function createPaddle(){
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:Number;
paddlen = new EnemyPaddleTopLeft();
_local1 = (minXOuter + GParams.paddleRadius);
_local2 = maxXOuter;
_local4 = maxYOuter;
_local3 = (minYOuter + GParams.paddleRadius);
paddlen.setBoundary(0, 0, 270, _local1, _local2, _local3, _local4);
paddlen.x = (_local1 + 50);
paddlen.y = _local4;
}
public function enableShield(){
shieldOn = true;
addEventListener(Event.ENTER_FRAME, onEnterFrame);
}
override public function reinit(){
this.life.text = GParams.territoryLife.toString();
this.alpha = 1;
isDamaged = false;
}
public function reset(){
var _local1:Number;
_local1 = 0;
while (_local1 < brickCount) {
bricks[_local1].resetBricks();
_local1++;
};
if (shieldOn == true){
shieldOnCount = 0;
shieldOn = false;
removeShield();
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
};
paddlen.removePaddleEventListener();
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
}
public function onEnterFrame(_arg1:Event){
if (shieldOn == true){
shieldOnCount = (shieldOnCount + 1);
if (shieldOnCount >= GParams.shieldOnCountMax){
shieldOn = false;
removeShield();
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
};
} else {
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
removeShield();
};
}
}
}//package
Section 84
//TerritoryTopRight (TerritoryTopRight)
package {
import flash.events.*;
import flash.text.*;
public class TerritoryTopRight extends Territory {
public var mesg:TextField;
public var life:TextField;
private function removeShield(){
var _local1:int;
if (GParams.currentLevel != 4){
_local1 = 0;
while (_local1 < brickCount) {
bricks[_local1].disableShield();
_local1++;
};
};
}
override public function init(_arg1:Number, _arg2:Number):void{
minXOuter = (_arg1 - FourWallBrick.brickHeight);
maxXOuter = (minXOuter + (hbCount * FourWallBrick.brickSize));
minYOuter = _arg2;
maxYOuter = ((minYOuter + (vbCount * FourWallBrick.brickSize)) + FourWallBrick.brickHeight);
minXInner = _arg1;
maxXInner = (minXInner + tWidth);
minYInner = _arg2;
maxYInner = (minYInner + tHeight);
center.x = (_arg1 + (tWidthTotal / 2));
center.y = (_arg2 + (tHeightTotal / 2));
tHalfWidthTotal = (tWidthTotal / 2);
tHalfHeightTotal = (tHeightTotal / 2);
arrangeBricks();
createPaddle();
}
public function arrangeBricks(){
var _local1:Number;
_local1 = 0;
_local1 = 0;
while (_local1 < hbCount) {
bricks[_local1] = new FourWallBrick();
bricks[_local1].rotation = 180;
_local1++;
};
_local1 = hbCount;
while (_local1 < brickCount) {
bricks[_local1] = new FourWallBrick();
bricks[_local1].rotation = 270;
_local1++;
};
}
public function repairBricks(_arg1:Number){
var _local2:Number;
_local2 = 0;
while (_local2 < brickCount) {
bricks[_local2].repair();
_local2++;
};
}
public function setPaddleVelocity(){
paddlen.setEnemyVelocityL2();
}
override public function createPaddle(){
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:Number;
paddlen = new EnemyPaddleTopRight();
_local1 = minXOuter;
_local2 = (maxXOuter - GParams.paddleRadius);
_local4 = maxYOuter;
_local3 = (minYOuter + GParams.paddleRadius);
paddlen.setBoundary(1, 0, 270, _local1, _local2, _local3, _local4);
paddlen.x = (_local1 + 50);
paddlen.y = _local4;
}
public function enableShield(){
shieldOn = true;
addEventListener(Event.ENTER_FRAME, onEnterFrame);
}
override public function reinit(){
this.life.text = GParams.territoryLife.toString();
this.alpha = 1;
isDamaged = false;
}
public function reset(){
var _local1:Number;
_local1 = 0;
while (_local1 < brickCount) {
bricks[_local1].resetBricks();
_local1++;
};
if (shieldOn == true){
shieldOnCount = 0;
shieldOn = false;
removeShield();
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
};
paddlen.removePaddleEventListener();
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
}
public function onEnterFrame(_arg1:Event){
if (shieldOn == true){
shieldOnCount = (shieldOnCount + 1);
if (shieldOnCount >= GParams.shieldOnCountMax){
shieldOn = false;
removeShield();
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
};
} else {
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
removeShield();
};
}
}
}//package
Section 85
//TopWallReflector (TopWallReflector)
package {
import flash.events.*;
public class TopWallReflector extends Reflector {
private var speed:Number;// = 6
private var bounce:Number;// = -1
private var xMin:Number;// = 0
private var xMax:Number;// = 0
public static var reflectorArray:Array = new Array(reflectorCount);
public function TopWallReflector(){
xMin = 0;
xMax = 0;
speed = 6;
bounce = -1;
super();
width = 30;
height = 9;
halfWidth = (width / 2);
halfHeight = (height / 2);
minDistX = ((halfWidth + Ball.radius) + 3);
minDistY = ((halfHeight + Ball.radius) + 3);
}
public function setBoundary(_arg1:Number, _arg2:Number){
xMin = _arg1;
xMax = _arg2;
trace((((" xMin : " + xMin) + "xMax : ") + xMax));
addEventListener(Event.ENTER_FRAME, onEnterFrame);
}
public function onEnterFrame(_arg1:Event){
this.x = (this.x + speed);
if (this.x <= xMin){
speed = (speed * bounce);
this.x = xMin;
} else {
if (this.x >= xMax){
speed = (speed * bounce);
this.x = xMax;
};
};
checkBallCollision();
}
public function reinit(){
addEventListener(Event.ENTER_FRAME, onEnterFrame);
}
override public function resetReflector(){
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
}
override public function checkBallCollision():Boolean{
var _local1:Boolean;
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Ball;
var _local6:Number;
_local1 = false;
_local2 = 0;
_local3 = 0;
_local4 = 0;
_local5 = null;
_local6 = 0;
while (_local6 < WallGameMain.ballArray.length) {
_local5 = WallGameMain.ballArray[_local6];
_local2 = (this.x - _local5.x);
if (Math.abs(_local2) <= minDistX){
_local3 = (this.y - _local5.y);
if (Math.abs(_local3) <= minDistY){
_local4 = (Math.atan2(_local3, _local2) - Math.PI);
_local5.setVelocity(_local4);
_local1 = true;
return (_local1);
};
};
_local6++;
};
return (_local1);
}
public static function createReflectors():void{
var _local1:Number;
var _local2:Number;
var _local3:*;
_local1 = -1;
_local2 = -3;
_local3 = 0;
while (_local3 < reflectorArray.length) {
if (reflectorArray[_local3] == null){
reflectorArray[_local3] = new (TopWallReflector);
reflectorArray[_local3].speed = _local2;
_local2 = (_local2 * _local1);
};
_local3++;
};
}
}
}//package
Section 86
//TwoBallSurface (TwoBallSurface)
package {
import flash.geom.*;
import flash.text.*;
public class TwoBallSurface extends Surface {
public var topBricks:Array;
private var myBrickStartPoint:Point;
public var bottomBricks:Array;
public var rightReflectorL1X:Number;
public var score:TextField;
public var enemyPaddleYL1:Number;// = 0
public var brickCount:Number;
public var levelNum:TextField;
private var brickStartPoint:Point;
private var baseWidth:Number;
public var myPaddleYL1:Number;// = 0
public var tWidth;
private var rightWallStartP:Point;
public var leftReflectorL1X:Number;
public var timetick:TextField;
private var leftWallStartP:Point;
public function TwoBallSurface(){
brickStartPoint = new Point(0, 80);
myBrickStartPoint = new Point(0, 465);
leftWallStartP = brickStartPoint;
rightWallStartP = new Point(730, brickStartPoint.y);
tWidth = GParams.territoryWidthTW;
brickCount = Math.ceil((tWidth / Brick.brickSize));
topBricks = new Array(brickCount);
bottomBricks = new Array(brickCount);
leftReflectorL1X = (boundaryL1XMin + 15);
rightReflectorL1X = (boundaryL1XMax - 15);
myPaddleYL1 = 0;
enemyPaddleYL1 = 0;
super();
}
public function createSurface(){
territoryLife = new Array(2);
createTerritories();
baseWidth = stageWidth;
enemy = new Array(enemyCount);
createReflectors();
if ((((GParams.currentLevel == 3)) || ((GParams.currentLevel == 5)))){
createRotator();
};
}
public function arrangeBottomBricks(_arg1:Number, _arg2:Number){
var _local3:Point;
var _local4:Number;
_local3 = new Point();
_local4 = 0;
_local3.x = (_arg1 + Brick.halfWidth);
_local3.y = (_arg2 - Brick.halfHeight);
_local4 = 0;
while (_local4 < brickCount) {
bottomBricks[_local4] = new Brick();
addChild(bottomBricks[_local4]);
bottomBricks[_local4].x = _local3.x;
bottomBricks[_local4].y = _local3.y;
bottomBricks[_local4].rotation = 0;
bottomBricks[_local4].setPosition(_local3.x, _local3.y, 1, _local4);
_local3.x = (_local3.x + Brick.brickSize);
_local4++;
};
}
override protected function blockPaddle(_arg1:Number, _arg2:Number){
if (_arg1 == 0){
if (territory[0].enemyPaddles.length > 1){
if (_arg2 <= (brickCount / 2)){
territory[0].enemyPaddles[0].blockPaddle();
} else {
territory[0].enemyPaddles[1].blockPaddle();
};
} else {
territory[0].enemyPaddles[0].blockPaddle();
};
} else {
if (territory[1].paddleArray.length > 1){
if (_arg2 <= (brickCount / 2)){
territory[1].paddleArray[0].blockPaddle();
} else {
territory[1].paddleArray[1].blockPaddle();
};
} else {
territory[1].paddleArray[0].blockPaddle();
};
};
}
override public function resetSurface(){
var _local1:Number;
resetStats();
_local1 = 0;
while (_local1 < territoryLife.length) {
territoryLife[_local1] = GParams.territoryLife;
_local1++;
};
_local1 = 0;
while (_local1 < reflectors.length) {
reflectors[_local1].resetReflector();
_local1++;
};
_local1 = 0;
while (_local1 < brickCount) {
bottomBricks[_local1].resetBricks();
topBricks[_local1].resetBricks();
_local1++;
};
_local1 = 0;
while (_local1 < territory.length) {
territory[_local1].resetTerritory();
_local1++;
};
if ((((GParams.currentLevel == 3)) || ((GParams.currentLevel == 5)))){
_local1 = 0;
while (_local1 < rotatorArray.length) {
rotatorArray[_local1].removeRotatorListener();
_local1++;
};
};
}
override public function resetStats(){
this.score.text = "";
this.levelNum.text = "";
this.timetick.text = "";
}
override protected function shieldTerritory(_arg1:Number, _arg2:Number){
_arg1 = ((_arg1 + 1) % 2);
addShield(_arg1, _arg2);
}
override public function assignPowerupsToBricks(){
var _local1:*;
var _local2:Number;
var _local3:Number;
var _local4:Number;
_local1 = -1;
_local2 = Math.floor((Math.random() * brickCount));
_local3 = 0;
while (_local3 < GParams.powerups[(GParams.currentLevel - 1)].length) {
_local1 = GParams.powerups[(GParams.currentLevel - 1)][_local3];
if (_local1 < 5){
if ((((_local1 == 2)) && ((GParams.currentLevel == 4)))){
_local4 = Math.floor(((_local2 + 9) % (brickCount / 2)));
topBricks[_local4].assignPowerup(_local1);
_local4 = ((_local4 + 9) % brickCount);
topBricks[_local4].assignPowerup(_local1);
} else {
topBricks[_local2].assignPowerup(_local1);
_local2 = ((_local2 + 9) % brickCount);
};
};
_local3++;
};
_local3 = 0;
while (_local3 < GParams.powerups[(GParams.currentLevel - 1)].length) {
_local1 = GParams.powerups[(GParams.currentLevel - 1)][_local3];
if (_local1 < 4){
bottomBricks[_local2].assignPowerup(_local1);
_local2 = ((_local2 + 9) % brickCount);
};
_local3++;
};
}
public function createRotator(){
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:*;
_local1 = ((Math.random() * Math.PI) * 2);
_local2 = 2;
if (rotatorArray == null){
rotatorArray = new Array(_local2);
_local4 = 0;
while (_local4 < rotatorArray.length) {
rotatorArray[_local4] = new Rotator();
if ((_local4 % 2) == 0){
rotatorArray[_local4].angularVelocity = (rotatorArray[_local4].angularVelocity * -1);
};
_local4++;
};
};
_local3 = ((Math.PI * 2) / rotatorArray.length);
_local4 = 0;
while (_local4 < rotatorArray.length) {
addChild(rotatorArray[_local4]);
rotatorArray[_local4].setPosition(_local1, GParams.orbitRadius);
_local1 = (_local1 + (Math.PI / 2));
_local4++;
};
}
public function createReflectors(){
var _local1:Point;
var _local2:*;
var _local3:*;
var _local4:Number;
var _local5:Number;
LeftWallReflector.createReflectors();
RightWallReflector.createReflectors();
reflectors[0] = new LeftWallReflector();
reflectors[1] = new RightWallReflector();
_local1 = new Point(boundaryL1XMin, boundaryL1YMin);
_local2 = (boundaryL1YMin + ((Reflector.refLength / 2) + 90));
_local3 = ((boundaryL1YMin + (boundaryL1YMax - boundaryL1YMin)) - Reflector.refLength);
_local4 = boundaryL1XMin;
_local5 = boundaryL1XMax;
_local3 = (_local3 - 15);
addChild(reflectors[0]);
reflectors[0].x = _local4;
reflectors[0].y = _local2;
reflectors[0].setBoundary(_local2, _local3, true);
addChild(reflectors[1]);
reflectors[1].x = _local5;
reflectors[1].y = _local2;
reflectors[1].setBoundary(_local2, _local3, true);
}
override protected function maximisePaddle(_arg1:Number){
if (_arg1 == 0){
territory[1].paddleArray[0].maximisePaddle();
};
}
override public function updateStats(_arg1:Number){
this.timetick.text = _arg1.toString();
}
public function addShield(_arg1:Number, _arg2:Number){
var _local3:Number;
if (_arg1 == 0){
if (GParams.currentLevel != 4){
_local3 = 0;
while (_local3 < brickCount) {
topBricks[_local3].enableShield();
_local3++;
};
} else {
if (_arg2 <= (brickCount / 2)){
_local3 = 0;
while (_local3 < Math.floor((brickCount / 2))) {
topBricks[_local3].enableShield();
_local3++;
};
} else {
_local3 = Math.floor((brickCount / 2));
while (_local3 < brickCount) {
topBricks[_local3].enableShield();
_local3++;
};
};
};
} else {
if (GParams.currentLevel != 4){
_local3 = 0;
while (_local3 < brickCount) {
bottomBricks[_local3].enableShield();
_local3++;
};
} else {
if (_arg2 <= (brickCount / 2)){
_local3 = 0;
while (_local3 < Math.floor((brickCount / 2))) {
bottomBricks[_local3].enableShield();
_local3++;
};
} else {
_local3 = Math.floor((brickCount / 2));
while (_local3 < brickCount) {
bottomBricks[_local3].enableShield();
_local3++;
};
};
};
};
territory[_arg1].enableShield();
}
override public function createTerritories(){
var _local1:Number;
var _local2:Number;
var _local3:Number;
territory = new Array(2);
territory[0] = new TerritoryTop();
territory[0].init(GParams.stageBorderTW, GParams.stageBorderTW);
addChild(territory[0]);
_local1 = GParams.stageBorderTW;
_local2 = (GParams.stageBorderTW + GParams.territoryHeightTW);
arrangeTopBricks(_local1, _local2);
_local3 = 0;
while (_local3 < territory[0].enemyPaddles.length) {
addChild(territory[0].enemyPaddles[_local3]);
_local3++;
};
territory[1] = new TerritoryBottom();
territory[1].init(GParams.stageBorderTW, (GParams.stageHeight - (GParams.stageBorderTW + GParams.territoryHeightTW)));
addChild(territory[1]);
_local1 = GParams.stageBorderTW;
_local2 = (GParams.stageHeight - (GParams.stageBorderTW + GParams.territoryHeightTW));
arrangeBottomBricks(_local1, _local2);
_local3 = 0;
while (_local3 < territory[1].paddleArray.length) {
addChild(territory[1].paddleArray[_local3]);
_local3++;
};
territoryLife[0] = GParams.territoryLife;
territoryLife[1] = GParams.territoryLife;
}
public function triggerEnemyVelocity(){
setEnemyVelocity = true;
}
public function arrangeTopBricks(_arg1:Number, _arg2:Number){
var _local3:Point;
var _local4:Number;
_local3 = new Point();
_local4 = 0;
_local3.x = (_arg1 + Brick.halfWidth);
_local3.y = (_arg2 + Brick.halfHeight);
_local4 = 0;
while (_local4 < brickCount) {
topBricks[_local4] = new Brick();
addChild(topBricks[_local4]);
topBricks[_local4].x = _local3.x;
topBricks[_local4].y = _local3.y;
topBricks[_local4].rotation = 180;
topBricks[_local4].setPosition(_local3.x, _local3.y, 0, _local4);
_local3.x = (_local3.x + Brick.brickSize);
_local4++;
};
}
override public function reinit(){
var _local1:Number;
_local1 = 0;
while (_local1 < territory.length) {
territory[_local1].reinit();
_local1++;
};
_local1 = 0;
while (_local1 < brickCount) {
topBricks[_local1].reinit();
_local1++;
};
_local1 = 0;
while (_local1 < brickCount) {
bottomBricks[_local1].reinit();
_local1++;
};
_local1 = 0;
while (_local1 < reflectors.length) {
reflectors[_local1].reinit();
_local1++;
};
if ((((GParams.currentLevel == 3)) || ((GParams.currentLevel == 5)))){
if (rotatorArray != null){
_local1 = 0;
while (_local1 < rotatorArray.length) {
rotatorArray[_local1].reinit();
_local1++;
};
};
};
levelNum.text = GParams.currentLevel.toString();
this.score.text = GParams.scoreValue.toString();
this.timetick.text = "0";
assignPowerupsToBricks();
}
override protected function repairTerritoryBricks(_arg1:Number, _arg2:Number){
_arg1 = ((_arg1 + 1) % 2);
territory[_arg1].repairBricks(_arg2);
}
override public function initPower(_arg1:Number, _arg2:Number, _arg3:Number){
switch (_arg1){
case 1:
blockPaddle(_arg2, _arg3);
break;
case 2:
shieldTerritory(_arg2, _arg3);
break;
case 3:
repairTerritoryBricks(_arg2, _arg3);
break;
case 4:
maximisePaddle(_arg2);
break;
};
}
public static function getInstance():TwoBallSurface{
return (new (TwoBallSurface));
}
}
}//package
Section 87
//WallGameMain (WallGameMain)
package {
import flash.events.*;
import flash.media.*;
import flash.display.*;
import flash.utils.*;
import flash.net.*;
public class WallGameMain extends Sprite {
private var welcomePage:Welcome;// = null
private var kickOffText:KickOffText;// = null
var levelPage:Levels;// = null
var urlPlayMore:String;// = "http://www.flasharcade.com"
private var youWin:YouWin;// = null
var timer:Timer;
private var fireBallScore:Number;// = 0
var requestPlayMore:URLRequest;// = null
private var randomTimeLimit:Number;
private var gameStat:GameStatistics;// = null
private var gameTimer:Timer;
private var fireBallPowerupShown:Boolean;// = false
private var levelEndCount:Number;// = 0
var levelStartTimer:Timer;
var _channel:SoundChannel;
private var gameOver:GameOver;// = null
public static var yls:YouLooseSound = null;
public static var fireAffectedTerritoryIndex:Number = -1;
public static var bos:BreakOne = null;
public static var lus:LevelupSound = null;
public static var ringhs:RingHitSound = null;
public static var fireBall:FireBall = null;
public static var tds:TerritoryDamageSound = null;
public static var yws:YouWinSound = null;
public static var bths:BreakThree = null;
public static var pcs:PaddleCollisionSound = null;
public static var ws:WelcomeSound = null;
public static var ps:PowerupSound = null;
public static var bts:BreakTwo = null;
public static var ballArray:Array = new Array(1);
public static var lastHitPaddleIndex:Number = -1;
public static var bhs:BoundaryHit = null;
public static var pps:PPositiveSound = null;
public static var surface:Surface = null;
public static var pns:PNegetiveSound = null;
public static var levelWin:Boolean = false;
public static var levelLoose:Boolean = false;
public static var rhs:RhombusHitSound = null;
public function WallGameMain(){
urlPlayMore = "http://www.flasharcade.com";
requestPlayMore = null;
gameOver = null;
youWin = null;
welcomePage = null;
levelPage = null;
randomTimeLimit = Math.round((Math.random() * GParams.randomObjectMaxTime));
kickOffText = null;
fireBallScore = 0;
fireBallPowerupShown = false;
levelEndCount = 0;
gameStat = null;
super();
inititaliseSounds();
requestPlayMore = new URLRequest(urlPlayMore);
timer = new Timer(1000, randomTimeLimit);
timer.addEventListener(TimerEvent.TIMER_COMPLETE, randomObjectTimeout);
timer.stop();
createWelcome();
createFireBall();
kickOffText = new KickOffText();
gameTimer = new Timer(1000, 0);
gameTimer.addEventListener(TimerEvent.TIMER, gameTimerUpdates);
gameTimer.stop();
gameStat = new GameStatistics();
}
private function createRandomObject(){
Rhombus.createInstance();
addChild(Rhombus.randomObjects[0]);
Rhombus.randomObjects[0].x = GParams.stageCenter.x;
Rhombus.randomObjects[0].y = GParams.stageCenter.y;
Rhombus.randomObjects[0].init();
}
private function stopSounds(){
_channel.stop();
_channel.removeEventListener(Event.SOUND_COMPLETE, completeGOSoundHandler);
_channel.removeEventListener(Event.SOUND_COMPLETE, completeWelcomeSoundHandler);
SoundMixer.stopAll();
}
public function createGameOver(){
clearGraphics();
gameOver = GameOver.getInstance();
gameOver.resetData();
addChild(gameOver);
gameOver.x = GParams.stageCenter.x;
gameOver.y = GParams.stageCenter.y;
gameOver.updateScores();
gameOver.setErrorMesg("");
gameOver.playmore.addEventListener(MouseEvent.CLICK, handleClick);
gameOver.playAgain.addEventListener(MouseEvent.CLICK, clickPlayAgain);
gameOver.submitScore.addEventListener(MouseEvent.CLICK, submitScoreOnGameOver);
gameOver.play();
_channel = yls.play();
_channel.addEventListener(Event.SOUND_COMPLETE, completeGOSoundHandler);
}
private function checkMouseClick(_arg1:MouseEvent){
stage.focus = this;
stage.stageFocusRect = false;
}
public function calculateBonusScore(_arg1:Number){
_arg1 = (_arg1 - 15);
if (_arg1 > 0){
GParams.bonusPoints = (_arg1 * 10);
GParams.scoreValue = (GParams.scoreValue + GParams.bonusPoints);
};
}
public function init(){
clearGraphics();
levelEndCount = 0;
createSurface();
generateFireBallScore();
surface.reinit();
createBall();
if ((((GParams.currentLevel == 2)) || ((GParams.currentLevel == 6)))){
createRandomObject();
timer.start();
};
fireBallPowerupShown = GParams.fireBallShown[(GParams.currentLevel - 1)];
trace(fireBallPowerupShown);
if (kickOffText != null){
kickOffText.reinit();
};
addChild(kickOffText);
kickOffText.y = GParams.stageCenter.y;
kickOffText.x = (GParams.stageCenter.x - 50);
stage.addEventListener(KeyboardEvent.KEY_DOWN, kickOffLevel);
stage.focus = this;
stage.stageFocusRect = false;
addEventListener(MouseEvent.CLICK, checkMouseClick);
}
private function createBall(){
var _local1:Number;
var _local2:Number;
ballArray[0] = new Ball();
ballArray[0].setIndex(0);
surface.addChild(ballArray[0]);
ballArray[0].x = Surface.stageCenter.x;
ballArray[0].y = Surface.stageCenter.y;
if ((((((GParams.currentLevel == 3)) || ((GParams.currentLevel == 4)))) || ((GParams.currentLevel == 5)))){
ballArray[1] = new Ball();
ballArray[1].setIndex(1);
surface.addChild(ballArray[1]);
ballArray[1].x = Surface.stageCenter.x;
ballArray[1].y = Surface.stageCenter.y;
};
_local1 = (GParams.stageWidth / (ballArray.length + 1));
_local2 = 0;
while (_local2 < ballArray.length) {
ballArray[_local2].x = _local1;
ballArray[_local2].y = GParams.stageCenter.y;
_local1 = (_local1 * 2);
ballArray[_local2].gotoAndStop(1);
_local2++;
};
}
public function randomObjectTimeout(_arg1:TimerEvent){
randomTimeLimit = Math.round((Math.random() * GParams.randomObjectMaxTime));
Rhombus.randomObjects[0].changePosition();
timer.repeatCount = randomTimeLimit;
timer.reset();
timer.start();
}
private function createSurface(){
surface = SurfaceFactory.createInstance();
addChild(surface);
}
private function displayFireBall(){
fireBall.gotoAndStop(1);
fireBall.init();
}
public function startLevel(_arg1:TimerEvent){
init();
}
public function sendData(_arg1:String, _arg2:Number):Boolean{
var request:URLRequest;
var variables:URLVariables;
var playerName = _arg1;
var score = _arg2;
try {
request = new URLRequest("http://www.flasharcade.com/setscores.php");
request.method = URLRequestMethod.POST;
variables = new URLVariables();
variables.scoreName = playerName;
variables.scoreText = score;
variables.gameId = "ace017";
variables.gameName = "Bricks Breakout";
request.data = variables;
sendToURL(request);
} catch(e:Error) {
youWin.setErrorMesg("Could not submit the score");
return (false);
} catch(e:SecurityError) {
youWin.setErrorMesg("Security Error ");
return (false);
};
return (true);
}
public function handleClick(_arg1:MouseEvent){
var event = _arg1;
try {
navigateToURL(requestPlayMore, "_blank");
} catch(e:Error) {
};
}
public function sendDataGameOver(_arg1:String, _arg2:Number):Boolean{
var url:String;
var request:URLRequest;
var variables:URLVariables;
var playerName = _arg1;
var score = _arg2;
try {
url = "http://www.flasharcade.com/setscores.php";
request = new URLRequest(url);
request.method = URLRequestMethod.POST;
variables = new URLVariables();
variables.scoreName = playerName;
variables.scoreText = score;
variables.gameId = "ace017";
variables.gameName = "Bricks Breakout";
request.data = variables;
sendToURL(request);
} catch(e:Error) {
trace(" caught error");
gameOver.setErrorMesg("Could not submit the score");
return (false);
} catch(e:SecurityError) {
trace(" caught error");
gameOver.setErrorMesg("Security Error ");
return (false);
};
return (true);
}
public function submitScore(_arg1:MouseEvent){
var _local2:String;
var _local3:Number;
youWin.setErrorMesg("");
_local2 = null;
_local2 = youWin.getPlayerName();
_local3 = GParams.scoreValue;
if ((((_local2 == null)) || ((_local2 == "")))){
youWin.setErrorMesg("Please enter your name");
} else {
if (sendData(_local2, _local3) == false){
return;
};
displayHighScoreScreen();
};
}
public function keyUpEvent(_arg1:KeyboardEvent){
var _local2:Number;
_local2 = _arg1.keyCode;
switch (_local2){
case 37:
MyPaddle.leftKeyDown = false;
GParams.leftKeyDown = false;
break;
case 39:
MyPaddle.rightKeyDown = false;
GParams.rightKeyDown = false;
break;
case 65:
MyPaddle.oneKeyDown = false;
GParams.rightKeyDown = false;
break;
case 68:
MyPaddle.twoKeyDown = false;
GParams.rightKeyDown = false;
break;
};
}
private function createFireBall(){
fireBall = new FireBall();
}
public function fetchHighScore(_arg1:MouseEvent){
var _local2:URLRequest;
var _local3:URLLoader;
var _local4:URLVariables;
welcomePage.setChildIndex(welcomePage.hs, 2);
welcomePage.emptyScores();
_local2 = new URLRequest("http://www.flasharcade.com/getscoresas3.php");
_local2.method = URLRequestMethod.POST;
_local3 = new URLLoader();
_local3.dataFormat = URLLoaderDataFormat.VARIABLES;
_local4 = new URLVariables();
_local4.gameId = "ace017";
_local2.data = _local4;
_local3.load(_local2);
_local3.addEventListener(Event.COMPLETE, completeHandler);
}
public function gotoLEVEL1(_arg1:MouseEvent){
removeChild(welcomePage);
createLevelsPage();
}
public function createYouWin(){
clearGraphics();
youWin = YouWin.getInstance();
youWin.resetData();
addChild(youWin);
youWin.x = GParams.stageCenter.x;
youWin.y = GParams.stageCenter.y;
youWin.win.playAgain.addEventListener(MouseEvent.CLICK, clickPlayAgain);
youWin.submitScore.addEventListener(MouseEvent.CLICK, submitScore);
youWin.win.playmore.addEventListener(MouseEvent.CLICK, handleClick);
youWin.setErrorMesg("");
youWin.updateScores();
_channel = yws.play();
_channel.addEventListener(Event.SOUND_COMPLETE, completeYWSHandler);
}
public function keyDownEvent(_arg1:KeyboardEvent){
var _local2:Number;
_local2 = _arg1.keyCode;
trace(("keyCode : " + _local2));
switch (_local2){
case 37:
MyPaddle.leftKeyDown = true;
GParams.leftKeyDown = true;
break;
case 39:
MyPaddle.rightKeyDown = true;
GParams.rightKeyDown = true;
break;
case 65:
MyPaddle.oneKeyDown = true;
GParams.rightKeyDown = true;
break;
case 68:
MyPaddle.twoKeyDown = true;
GParams.rightKeyDown = true;
break;
};
}
private function removeBallListener(){
var _local1:Number;
_local1 = 0;
while (_local1 < ballArray.length) {
if (ballArray[_local1] != null){
ballArray[_local1].removeBallListener();
};
_local1++;
};
}
public function completeYWSHandler(_arg1:Event){
_channel.removeEventListener(Event.SOUND_COMPLETE, completeYWSHandler);
_channel = yws.play();
_channel.addEventListener(Event.SOUND_COMPLETE, completeYWSHandler);
}
private function inititaliseSounds(){
ws = new WelcomeSound();
yls = new YouLooseSound();
yws = new YouWinSound();
bhs = new BoundaryHit();
bos = new BreakOne();
bts = new BreakTwo();
bths = new BreakThree();
lus = new LevelupSound();
pns = new PNegetiveSound();
pps = new PPositiveSound();
rhs = new RhombusHitSound();
ringhs = new RingHitSound();
tds = new TerritoryDamageSound();
pcs = new PaddleCollisionSound();
}
public function createLevelsPage(){
clearGraphics();
GParams.currentLevel = (GParams.currentLevel + 1);
levelPage = Levels.getInstance();
levelPage.gotoAndPlay(("Level" + GParams.currentLevel.toString()));
levelPage.x = GParams.stageCenter.x;
levelPage.y = GParams.stageCenter.y;
levelStartTimer = new Timer(1000, 4);
levelStartTimer.addEventListener(TimerEvent.TIMER_COMPLETE, startLevel);
levelStartTimer.start();
addChild(levelPage);
lus.play();
}
private function kickOffLevel(_arg1:KeyboardEvent){
var _local2:Number;
var _local3:Number;
_local2 = _arg1.keyCode;
switch (_local2){
case 32:
stage.removeEventListener(KeyboardEvent.KEY_DOWN, kickOffLevel);
if (contains(kickOffText)){
removeChild(kickOffText);
};
addEventListener(KeyboardEvent.KEY_DOWN, keyDownEvent);
addEventListener(KeyboardEvent.KEY_UP, keyUpEvent);
addEventListener(Event.ENTER_FRAME, onEnterFrame);
_local3 = 0;
while (_local3 < ballArray.length) {
ballArray[_local3].reinit();
_local3++;
};
gameTimer.start();
stage.focus = this;
stage.stageFocusRect = false;
};
}
public function completeGOSoundHandler(_arg1:Event){
_channel.removeEventListener(Event.SOUND_COMPLETE, completeGOSoundHandler);
_channel = yls.play();
_channel.addEventListener(Event.SOUND_COMPLETE, completeGOSoundHandler);
}
private function generateFireBallScore(){
fireBallScore = (GParams.fireBallMinScore + (Math.random() * 100));
}
public function createWelcome(){
welcomePage = Welcome.getInstance();
addChild(welcomePage);
welcomePage.x = GParams.stageCenter.x;
welcomePage.y = GParams.stageCenter.y;
GParams.currentLevel = GParams.startLevel;
welcomePage.ipwelcome.playGame.addEventListener(MouseEvent.CLICK, gotoLEVEL1);
welcomePage.ipwelcome.hs.addEventListener(MouseEvent.CLICK, fetchHighScore);
_channel = ws.play();
_channel.addEventListener(Event.SOUND_COMPLETE, completeWelcomeSoundHandler);
}
public function displayHighScoreScreen(){
clearGraphics();
createWelcome();
fetchHighScore(null);
welcomePage.setChildIndex(welcomePage.hs, 2);
}
private function completeHandler(_arg1:Event):void{
var _local2:Number;
var _local3:Number;
var _local4:URLLoader;
var _local5:String;
var _local6:Array;
_local3 = 0;
_local4 = URLLoader(_arg1.target);
_local5 = "";
_local6 = null;
if (_local4.data.data0 != undefined){
_local6 = _local4.data.data0.split("|", 3);
welcomePage.hs.player1.text = _local6[0];
welcomePage.hs.score1.text = _local6[1];
welcomePage.hs.date1.text = _local6[2];
};
if (_local4.data.data1 != undefined){
_local6 = _local4.data.data1.split("|", 3);
welcomePage.hs.player2.text = _local6[0];
welcomePage.hs.score2.text = _local6[1];
welcomePage.hs.date2.text = _local6[2];
};
if (_local4.data.data2 != undefined){
_local6 = _local4.data.data2.split("|", 3);
welcomePage.hs.player3.text = _local6[0];
welcomePage.hs.score3.text = _local6[1];
welcomePage.hs.date3.text = _local6[2];
};
if (_local4.data.data3 != undefined){
_local6 = _local4.data.data3.split("|", 3);
welcomePage.hs.player4.text = _local6[0];
welcomePage.hs.score4.text = _local6[1];
welcomePage.hs.date4.text = _local6[2];
};
if (_local4.data.data4 != undefined){
_local6 = _local4.data.data4.split("|", 3);
welcomePage.hs.player5.text = _local6[0];
welcomePage.hs.score5.text = _local6[1];
welcomePage.hs.date5.text = _local6[2];
};
if (_local4.data.data5 != undefined){
_local6 = _local4.data.data5.split("|", 3);
welcomePage.hs.player6.text = _local6[0];
welcomePage.hs.score6.text = _local6[1];
welcomePage.hs.date6.text = _local6[2];
};
if (_local4.data.data6 != undefined){
_local6 = _local4.data.data6.split("|", 3);
welcomePage.hs.player7.text = _local6[0];
welcomePage.hs.score7.text = _local6[1];
welcomePage.hs.date7.text = _local6[2];
};
if (_local4.data.data7 != undefined){
_local6 = _local4.data.data7.split("|", 3);
welcomePage.hs.player8.text = _local6[0];
welcomePage.hs.score8.text = _local6[1];
welcomePage.hs.date8.text = _local6[2];
};
if (_local4.data.data8 != undefined){
_local6 = _local4.data.data8.split("|", 3);
welcomePage.hs.player9.text = _local6[0];
welcomePage.hs.score9.text = _local6[1];
welcomePage.hs.date9.text = _local6[2];
};
if (_local4.data.data9 != undefined){
_local6 = _local4.data.data9.split("|", 3);
welcomePage.hs.player10.text = _local6[0];
welcomePage.hs.score10.text = _local6[1];
welcomePage.hs.date10.text = _local6[2];
};
}
private function clearScores(){
GParams.bonusPoints = 0;
GParams.scoreValue = 0;
}
private function gameTimerUpdates(_arg1:TimerEvent){
surface.updateStats(gameTimer.currentCount);
}
public function onEnterFrame(_arg1:Event){
if (levelWin == true){
levelEndCount = (levelEndCount + 1);
if (levelEndCount == 1){
removeBallListener();
surface.resetSurface();
calculateBonusScore(gameTimer.currentCount);
gameTimer.stop();
};
if (levelEndCount == 50){
if (GParams.currentLevel == 6){
createYouWin();
} else {
createLevelsPage();
};
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
};
return;
};
if (levelLoose == true){
levelEndCount = (levelEndCount + 1);
if (levelEndCount == 1){
removeBallListener();
surface.resetSurface();
calculateBonusScore(gameTimer.currentCount);
gameTimer.stop();
};
if (levelEndCount == 50){
createGameOver();
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
};
return;
};
if ((((GParams.currentLevelScore >= fireBallScore)) && ((fireBallPowerupShown == false)))){
fireBallPowerupShown = true;
displayFireBall();
};
}
public function clickPlayAgain(_arg1:MouseEvent){
clearGraphics();
createWelcome();
clearScores();
}
public function submitScoreOnGameOver(_arg1:MouseEvent){
var _local2:String;
var _local3:Number;
gameOver.setErrorMesg("");
_local2 = null;
_local2 = gameOver.getPlayerName();
_local3 = GParams.scoreValue;
if (_local3 <= 0){
gameOver.setErrorMesg("You cannot submit an invalid score");
} else {
if ((((_local2 == null)) || ((_local2 == "")))){
gameOver.setErrorMesg("Please enter your name");
} else {
if (sendDataGameOver(_local2, _local3) == false){
return;
};
displayHighScoreScreen();
};
};
}
public function completeWelcomeSoundHandler(_arg1:Event){
_channel.removeEventListener(Event.SOUND_COMPLETE, completeWelcomeSoundHandler);
_channel = ws.play();
_channel.addEventListener(Event.SOUND_COMPLETE, completeWelcomeSoundHandler);
}
public function clearGraphics(){
var _local1:Number;
var _local2:Number;
_channel.stop();
SoundMixer.stopAll();
removeEventListener(MouseEvent.CLICK, checkMouseClick);
stage.focus = null;
levelLoose = false;
levelWin = false;
fireBallPowerupShown = false;
lastHitPaddleIndex = -1;
fireAffectedTerritoryIndex = -1;
GParams.currentLevelScore = 0;
gameTimer.stop();
gameTimer.reset();
timer.stop();
if (levelPage != null){
if (contains(levelPage)){
removeChild(levelPage);
};
};
_local1 = 0;
while (_local1 < ballArray.length) {
if (ballArray[_local1] != null){
ballArray[_local1].removeBallListener();
if (surface.contains(ballArray[_local1])){
surface.removeChild(ballArray[_local1]);
};
};
_local1++;
};
_local2 = ballArray.length;
_local1 = 0;
while (_local1 < _local2) {
ballArray.shift();
_local1++;
};
if (((!((Rhombus.randomObjects == null))) && (contains(Rhombus.randomObjects[0])))){
timer.stop();
removeChild(Rhombus.randomObjects[0]);
};
if (((!((surface == null))) && (contains(surface)))){
removeChild(surface);
};
if (youWin != null){
if (contains(youWin)){
removeChild(youWin);
};
};
if (gameOver != null){
if (contains(gameOver)){
removeChild(gameOver);
};
};
if (welcomePage != null){
if (contains(welcomePage)){
removeChild(welcomePage);
};
};
}
}
}//package
Section 88
//Welcome (Welcome)
package {
import flash.events.*;
import flash.display.*;
import flash.net.*;
public class Welcome extends MovieClip {
public var hs:MovieClip;
var requestAddMore:URLRequest;// = null
var urlPlayMore:String;// = "http://www.flasharcade.com"
public var ipwelcome:MovieClip;
var requestPlayMore:URLRequest;// = null
public var introframe:MovieClip;
var urlAddMoreGames:String;// = "http://www.flasharcade.com/flash-games/"
private static var welcome:Welcome = null;
public function Welcome(){
urlPlayMore = "http://www.flasharcade.com";
requestPlayMore = null;
urlAddMoreGames = "http://www.flasharcade.com/flash-games/";
requestAddMore = null;
super();
requestPlayMore = new URLRequest(urlPlayMore);
requestAddMore = new URLRequest(urlAddMoreGames);
ipwelcome.playmore.addEventListener(MouseEvent.CLICK, handleClick);
ipwelcome.addMore.addEventListener(MouseEvent.CLICK, handleClickAddMore);
ipwelcome.intro.addEventListener(MouseEvent.CLICK, gotoIntro);
introframe.backintro.addEventListener(MouseEvent.CLICK, gotoWelCome);
introframe.playmore.addEventListener(MouseEvent.CLICK, handleClick);
hs.playmorehs.addEventListener(MouseEvent.CLICK, handleClick);
hs.backhs.addEventListener(MouseEvent.CLICK, gotoWelCome);
}
public function handleClickAddMore(_arg1:MouseEvent){
var event = _arg1;
try {
navigateToURL(requestAddMore, "_blank");
} catch(e:Error) {
};
}
public function handleClick(_arg1:MouseEvent){
var event = _arg1;
try {
navigateToURL(requestPlayMore, "_blank");
} catch(e:Error) {
};
}
public function gotoWelCome(_arg1:MouseEvent){
setChildIndex(ipwelcome, 2);
}
public function gotoIntro(_arg1:MouseEvent){
setChildIndex(introframe, 2);
}
public function emptyScores(){
var _local1:String;
_local1 = "";
hs.player1.text = _local1;
hs.score1.text = _local1;
hs.date1.text = _local1;
hs.player2.text = _local1;
hs.score2.text = _local1;
hs.date2.text = _local1;
hs.player3.text = _local1;
hs.score3.text = _local1;
hs.date3.text = _local1;
hs.player4.text = _local1;
hs.score4.text = _local1;
hs.date4.text = _local1;
hs.player5.text = _local1;
hs.score5.text = _local1;
hs.date5.text = _local1;
hs.player6.text = _local1;
hs.score6.text = _local1;
hs.date6.text = _local1;
hs.player7.text = _local1;
hs.score7.text = _local1;
hs.date7.text = _local1;
hs.player8.text = _local1;
hs.score8.text = _local1;
hs.date8.text = _local1;
hs.player9.text = _local1;
hs.score9.text = _local1;
hs.date9.text = _local1;
hs.player10.text = _local1;
hs.score10.text = _local1;
hs.date10.text = _local1;
}
public static function getInstance():Welcome{
if (welcome == null){
welcome = new (Welcome);
};
return (welcome);
}
}
}//package
Section 89
//WelcomeSound (WelcomeSound)
package {
import flash.media.*;
public class WelcomeSound extends Sound {
}
}//package
Section 90
//YouLooseSound (YouLooseSound)
package {
import flash.media.*;
public class YouLooseSound extends Sound {
}
}//package
Section 91
//YouWin (YouWin)
package {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import flash.net.*;
public class YouWin extends MovieClip {
public var win:MovieClip;
public var errormesg:TextField;
public var bonus:TextField;
var urlPlayMore:String;// = "http://www.flasharcade.com"
var requestPlayMore:URLRequest;// = null
public var submitScore:SimpleButton;
public var totalScore:TextField;
public var player:TextField;
private static var youWin:YouWin = null;
public function YouWin(){
urlPlayMore = "http://www.flasharcade.com";
requestPlayMore = null;
super();
requestPlayMore = new URLRequest(urlPlayMore);
}
public function getPlayerName():String{
var _local1:String;
_local1 = this.player.text;
if (_local1 == null){
return (null);
};
this.errormesg.text = "";
return (_local1);
}
public function handleClick(_arg1:MouseEvent){
var event = _arg1;
try {
navigateToURL(requestPlayMore, "_blank");
} catch(e:Error) {
};
}
public function updateScores(){
this.bonus.text = GParams.bonusPoints.toString();
this.totalScore.text = GParams.scoreValue.toString();
}
public function resetData(){
this.bonus.text = "";
this.totalScore.text = " ";
this.player.text = "";
this.errormesg.text = " ";
}
public function setErrorMesg(_arg1:String){
this.errormesg.text = _arg1;
}
public static function getInstance():YouWin{
if (youWin == null){
youWin = new (YouWin);
};
return (youWin);
}
}
}//package
Section 92
//YouWinSound (YouWinSound)
package {
import flash.media.*;
public class YouWinSound extends Sound {
}
}//package