Frame 1
Mouse.hide();
_global.music = new Sound();
music.attachSound("song");
music.setVolume(100);
music.start("", 100);
stop();
Frame 2
stop();
Instance of Symbol 28 MovieClip "p2" in Frame 2
onClipEvent (load) {
pColor.gotoAndPlay(2);
}
Frame 3
_global.initX1 = p1._x;
_global.initY1 = p1._y;
_global.initX2 = p2._x;
_global.initY2 = p2._y;
_global.p1Draw = false;
_global.p2Draw = false;
_global.draw1 = 0;
_global.draw2 = 0;
_global.reset = false;
_global.reset2 = false;
_global.create1 = false;
_global.create2 = false;
_global.lineAlpha = 0;
_global.lineAlpha2 = 0;
_global.dist1 = 0;
_global.dist2 = 0;
_global.control1 = true;
_global.control2 = true;
_global.p1Score = 0;
_global.p2Score = 0;
_global.done = false;
_global.deadSound = false;
_global.sqColor = 0;
_global.p1numSq = 1;
_global.sq1Speed = 0;
_global.sqArray = new Array();
_global.p1SpeedArray = new Array();
_global.pArray = new Array();
_global.sqParent = new Array();
_global.hit = new Sound();
_global.make1 = new Sound();
_global.make2 = new Sound();
_global.hitWall = new Sound();
_global.collide1 = new Sound();
_global.collide2 = new Sound();
_global.explode = new Sound();
hit.attachSound("hit1");
hit.setVolume(100);
make1.attachSound("create1");
make1.setVolume(100);
make2.attachSound("create2");
make2.setVolume(100);
hitWall.attachSound("hitWall1");
hitWall.setVolume(100);
collide1.attachSound("pop1");
collide1.setVolume(100);
collide2.attachSound("pop2");
collide2.setVolume(100);
explode.attachSound("pound");
explode.setVolume(100);
createEmptyMovieClip("Line1", 1);
Line1.lineStyle(3, 0, 100);
createEmptyMovieClip("Line2", 2);
Line2.lineStyle(3, 0, 100);
Instance of Symbol 50 MovieClip "p1Sq" in Frame 3
onClipEvent (load) {
num = p1NumSq;
speed = p1SpeedArray[num];
real = false;
this._alpha = 20;
if (sqColor == 1) {
rColor.gotoAndPlay(1);
} else if (sqColor == 2) {
rColor.gotoAndPlay(2);
}
thisColor = sqColor;
}
onClipEvent (enterFrame) {
if (pArray[num - 1] != -3) {
p1DistR = math.abs(_root.p1._x + (_root.p1._width / 2));
p1DistL = math.abs(_root.p1._x - (_root.p1._width / 2));
p1DistU = math.abs(_root.p1._y - (_root.p1._height / 2));
p1DistD = math.abs(_root.p1._y + (_root.p1._height / 2));
p2DistR = math.abs(_root.p2._x + (_root.p2._width / 2));
p2DistL = math.abs(_root.p2._x - (_root.p2._width / 2));
p2DistU = math.abs(_root.p2._y - (_root.p2._height / 2));
p2DistD = math.abs(_root.p2._y + (_root.p2._height / 2));
distXRight = math.abs(this._x + (this._width / 2));
distXLeft = math.abs(this._x - (this._width / 2));
distYUp = math.abs(this._y - (this._height / 2));
distYDown = math.abs(this._y + (this._height / 2));
if (thisColor == 2) {
if (((((math.abs(pArray[num - 1]) != 1) && (math.abs(pArray[num - 1]) != 0)) && ((p1DistL - distXRight) <= 2.5)) && ((distXLeft - p1DistR) <= 2.5)) && (((((p1DistU > distYUp) && (p1DistU < distYDown)) || ((_root.p1._y > distYUp) && (_root.p1._y < distYDown))) || ((p1DistYD > distYUp) && (p1DistD < distYDown))) || ((((distYUp > p1DistU) && (distYUp < p1DistD)) || ((this._y > p1DistU) && (this._y < p1DistYD))) || ((distYDown > p1DistU) && (distYDown < p1DistYD))))) {
if (deadSound == false) {
hit.start("", 1);
_global.deadSound = true;
_root.p1.gotoAndPlay("die");
}
_global.control1 = false;
}
} else if (((((math.abs(pArray[num - 1]) != 2) && (math.abs(pArray[num - 1]) != 0)) && ((distXLeft - p2DistR) <= 2.5)) && ((p2DistL - distXRight) <= 2.5)) && (((((p2DistU > distYUp) && (p2DistU < distYDown)) || ((_root.p2._y > distYUp) && (_root.p2._y < distYDown))) || ((p2DistD > distYUp) && (p2DistD < distYDown))) || ((((distYUp > p2DistU) && (distYUp < p2DistD)) || ((sqY > p2DistU) && (sqY < p2DistD))) || ((distYDown > p2DistU) && (distYDown < p2DistD))))) {
if (deadSound == false) {
hit.start("", 1);
_global.deadSound = true;
_root.p2.gotoAndPlay("die");
}
_global.control2 = false;
}
}
speed = p1SpeedArray[num];
this._x = this._x + speed;
}
Instance of Symbol 50 MovieClip "p2Sq" in Frame 3
onClipEvent (load) {
this._alpha = 20;
rColor.gotoAndPlay(2);
}
Instance of Symbol 28 MovieClip "p1" in Frame 3
onClipEvent (load) {
vel_x = 0;
vel_y = 0;
minX = 0;
maxX = 0;
minY = 0;
maxY = 0;
}
onClipEvent (enterFrame) {
if (control1 == true) {
distX = math.abs(this._x + (this._width / 2));
distY = math.abs(this._y + (this._height / 2));
if (Key.isDown(87)) {
if ((distY - this._height) <= (_root.up._height / 2)) {
vel_y = 0;
} else {
vel_y = -speed;
}
vel_x = 0;
} else if (Key.isDown(83)) {
if (distY >= (768 - (_root.down._height / 2))) {
vel_y = 0;
} else {
vel_y = speed;
}
vel_x = 0;
} else if (Key.isDown(68)) {
if (distX >= (_root.middle._x - (_root.middle._width / 2))) {
vel_x = 0;
} else {
vel_x = speed;
}
vel_y = 0;
} else if (Key.isDown(65)) {
if ((distX - this._width) <= (_root.left._width / 2)) {
vel_x = 0;
} else {
vel_x = -speed;
}
vel_y = 0;
} else {
vel_x = 0;
vel_y = 0;
}
if (Key.isDown(32)) {
speed = 6;
if (this._x > maxX) {
maxX = this._x;
}
if (this._x < minX) {
minX = this._x;
}
if (this._y > maxY) {
maxY = this._y;
}
if (this._y < minY) {
minY = this._y;
}
if ((reset == true) || (minX == 0)) {
minX = this._x;
maxX = this._x;
minY = this._y;
maxY = this._y;
_global.reset = false;
}
} else {
speed = 9;
}
this._x = this._x + vel_x;
this._y = this._y + vel_y;
}
}
Instance of Symbol 28 MovieClip "p2" in Frame 3
onClipEvent (load) {
vel_x = 0;
vel_y = 0;
minX2 = 0;
maxX2 = 0;
minY2 = 0;
maxY2 = 0;
pColor.gotoAndPlay(2);
}
onClipEvent (enterFrame) {
if (control2 == true) {
distX = math.abs(this._x + (this._width / 2));
distY = math.abs(this._y + (this._height / 2));
if (Key.isDown(104)) {
if ((distY - this._height) <= (_root.up._height / 2)) {
vel_y = 0;
} else {
vel_y = -speed;
}
vel_x = 0;
} else if (Key.isDown(101)) {
if (distY >= (768 - (_root.down._height / 2))) {
vel_y = 0;
} else {
vel_y = speed;
}
vel_x = 0;
} else if (Key.isDown(102)) {
if (distX >= (_root.right._x - (_root.right._width / 2))) {
vel_x = 0;
} else {
vel_x = speed;
}
vel_y = 0;
} else if (Key.isDown(100)) {
if ((distX - this._width) <= (_root.middle._x + (_root.middle._width / 2))) {
vel_x = 0;
} else {
vel_x = -speed;
}
vel_y = 0;
} else {
vel_x = 0;
vel_y = 0;
}
if (Key.isDown(96)) {
speed = 6;
if (this._x > maxX2) {
maxX2 = this._x;
}
if (this._x < minX2) {
minX2 = this._x;
}
if (this._y > maxY2) {
maxY2 = this._y;
}
if (this._y < minY2) {
minY2 = this._y;
}
if ((reset2 == true) || (minX2 == 0)) {
minX2 = this._x;
maxX2 = this._x;
minY2 = this._y;
maxY2 = this._y;
_global.reset2 = false;
}
} else {
speed = 9;
}
this._x = this._x + vel_x;
this._y = this._y + vel_y;
}
}
Frame 4
duplicateMovieClip ("Line1", "Line10", 100);
_global.lineAlpha = getProperty(Line10, _alpha);
duplicateMovieClip ("Line2", "Line20", 150);
_global.lineAlpha2 = getProperty(Line20, _alpha);
Frame 5
function createSquare(minX, maxX, minY, maxY, sq) {
X = (maxX - minX) / 2;
Y = (maxY - minY) / 2;
setProperty(sq, _x , X + minX);
setProperty(sq, _y , Y + minY);
setProperty(sq, _width , X * 2);
setProperty(sq, _height , Y * 2);
height = getProperty(sq, _height);
}
function speed(area, dir) {
if ((area > 0) && (area <= 250)) {
sqSpeed = 6;
} else if ((area > 250) && (area <= 40250)) {
spSpeed = (48250 - area) / 8000;
} else {
spSpeed = (440250 - area) / 400000;
}
_global.sq1Speed = spSpeed * dir;
}
function score(square, player) {
area = square._height * square._width;
if (player == 1) {
_global.p1Score = _global.p1Score + area;
} else {
_global.p2Score = _global.p2Score + area;
}
}
function checkBlocked(movingSq, stillSq, num) {
sqY = getProperty(movingSq, _y);
sqHeight = getProperty(movingSq, _height);
distYUp = math.abs(sqY - (sqHeight / 2));
distYDown = math.abs(sqY + (sqHeight / 2));
sq2Y = getProperty(stillSq, _y);
sq2Height = getProperty(stillSq, _height);
distYU2 = math.abs(sq2Y - (sq2Height / 2));
distYD2 = math.abs(sq2Y + (sq2Height / 2));
if ((distYUp < distYU2) && (distYDown > distYD2)) {
return(-3);
}
return(num);
}
function stuckOn(square, player, num) {
pNum = sqParent[num];
p1SpeedArray[num + 1] = p1SpeedArray[pNum + 1];
sqX = getProperty(square, _x);
sqWidth = getProperty(square, _width);
distXRight = math.abs(sqX + (sqWidth / 2));
distXLeft = math.abs(sqX - (sqWidth / 2));
if (p1SpeedArray[num + 1] == 0) {
if (player == -4) {
if (distXLeft < (middle._x + (middle._width / 2))) {
trace("num: " + num);
trace("square: " + square);
trace("distXLeft: " + distXLeft);
pArray[num] = -3;
explode.start("", 1);
setProperty(square, _x , 2500);
} else {
pArray[num] = -1;
}
} else if (player == -5) {
if (distXRight > (middle._x - (middle._width / 2))) {
pArray[num] = -3;
explode.start("", 1);
setProperty(square, _x , 2500);
} else {
pArray[num] = -2;
}
} else if (player == -6) {
pArray[num] = -3;
if ((distXRight > (middle._x - (middle._width / 2))) || (distXLeft < (middle._x + (middle._width / 2)))) {
explode.start("", 1);
setProperty(square, _x , 2500);
}
}
}
}
function squareHit(square, player, num) {
collision = false;
sqX = getProperty(square, _x);
sqY = getProperty(square, _y);
sqWidth = getProperty(square, _width);
sqHeight = getProperty(square, _height);
sqArea = sqWidth * sqHeight;
distXRight = math.abs(sqX + (sqWidth / 2));
distXLeft = math.abs(sqX - (sqWidth / 2));
distYUp = math.abs(sqY - (sqHeight / 2));
distYDown = math.abs(sqY + (sqHeight / 2));
distRight = 1024 - (right._width / 2);
distLeft = left._width / 2;
if ((player == 1) && (distXRight >= distRight)) {
hitWall.start("", 1);
p1SpeedArray[num + 1] = 0;
setProperty(square, _x , sqX + 1);
score(square, 1);
pArray[num] = -1;
} else if ((player == 2) && (distXLeft <= distLeft)) {
hitWall.start("", 1);
p1SpeedArray[num + 1] = 0;
setProperty(square, _x , sqX - 1);
score(square, 2);
pArray[num] = -2;
}
j = 1;
while (j < p1NumSq) {
if (pArray[j] != -3) {
sq2X = getProperty(sqArray[j], _x);
sq2Width = getProperty(sqArray[j], _width);
distXR2 = math.abs(sq2X + (sq2Width / 2));
distXL2 = math.abs(sq2X - (sq2Width / 2));
sq2Y = getProperty(sqArray[j], _y);
sq2Height = getProperty(sqArray[j], _height);
distYU2 = math.abs(sq2Y - (sq2Height / 2));
distYD2 = math.abs(sq2Y + (sq2Height / 2));
sq2Area = sq2Width * sq2Height;
name = sqArray[j];
curSpeed = p1SpeedArray[j + 1];
if (num != j) {
if ((pArray[j] > 0) && (player != pArray[j])) {
if (player == 1) {
if ((((distXRight - distXL2) <= 2.5) && ((distXR2 - distXLeft) <= 2.5)) && (((((distYUp > distYU2) && (distYUp < distYD2)) || ((sqY > distYU2) && (sqY < distYD2))) || ((distYDown > distYU2) && (distYDown < distYD2))) || ((((distYU2 > distYUp) && (distYU2 < distYDown)) || ((sqY2 > distYUp) && (sqY2 < distYDown))) || ((distYD2 > distYUp) && (distYD2 < distYDown))))) {
collide1.start("", 1);
if (sqArea > sq2Area) {
newArea = (sqWidth * sqHeight) - (sq2Width * sq2Height);
newHeight = sqHeight * (newArea / sqArea);
newWidth = sqWidth * (newArea / sqArea);
setProperty(square, _width , math.abs(newWidth));
pArray[j] = -3;
p1SpeedArray[j + 1] = 0;
setProperty(sqArray[j], _x , -2000);
} else if (sqArea < sq2Area) {
newArea = (sq2Width * sq2Height) - (sqWidth * sqHeight);
newHeight = sq2Height * (newArea / sq2Area);
newWidth = sq2Width * (newArea / sq2Area);
setProperty(sqArray[j], _width , math.abs(newWidth));
setProperty(sqArray[j], _height , math.abs(newHeight));
pArray[num] = -3;
p1SpeedArray[num + 1] = 0;
setProperty(square, _x , 2000);
} else if (sqArea == sq2Area) {
pArray[num] = -3;
pArray[j] = -3;
p1SpeedArray[j + 1] = 0;
p1SpeedArray[num + 1] = 0;
setProperty(square, _x , 2000);
setProperty(sqArray[j], _x , -2000);
}
}
} else if (player == 2) {
if ((((distXLeft - distXR2) <= 2.5) && ((distXL2 - distXRight) <= 2.5)) && (((((distYUp > distYU2) && (distYUp < distYD2)) || ((sqY > distYU2) && (sqY < distYD2))) || ((distYDown > distYU2) && (distYDown < distYD2))) || ((((distYU2 > distYUp) && (distYU2 < distYDown)) || ((sqY2 > distYUp) && (sqY2 < distYDown))) || ((distYD2 > distYUp) && (distYD2 < distYDown))))) {
collide1.start("", 1);
if (sqArea > sq2Area) {
newArea = (sqWidth * sqHeight) - (sq2Width * sq2Height);
newHeight = sqHeight * (newArea / sqArea);
newWidth = sqWidth * (newArea / sqArea);
setProperty(square, _width , math.abs(newWidth));
setProperty(square, _height , math.abs(newHeight));
pArray[j] = -3;
p1SpeedArray[j + 1] = 0;
setProperty(sqArray[j], _x , -2000);
} else if (sqArea < sq2Area) {
newArea = (sq2Width * sq2Height) - (sqWidth * sqHeight);
newHeight = sq2Height * (newArea / sq2Area);
newWidth = sq2Width * (newArea / sq2Area);
setProperty(sqArray[j], _width , math.abs(newWidth));
setProperty(sqArray[j], _height , math.abs(newHeight));
pArray[num] = -3;
p1SpeedArray[num + 1] = 0;
setProperty(square, _x , 2000);
} else if (sqArea == sq2Area) {
pArray[num] = -3;
pArray[j] = -3;
p1SpeedArray[j + 1] = 0;
p1SpeedArray[num + 1] = 0;
setProperty(square, _x , 2000);
setProperty(sqArray[j], _x , -2000);
}
}
}
} else if (((player == 1) && (sqX < sq2X)) && (((pArray[j] == -1) || (pArray[j] == 1)) || (pArray[j] == -4))) {
if (((math.abs(distXRight - distXL2) <= 2.5) && ((num > j) || ((num < j) && (pArray[j] == -1)))) && (((((distYUp > distYU2) && (distYUp < distYD2)) || ((sqY > distYU2) && (sqY < distYD2))) || ((distYDown > distYU2) && (distYDown < distYD2))) || ((((distYU2 > distYUp) && (distYU2 < distYDown)) || ((sqY2 > distYUp) && (sqY2 < distYDown))) || ((distYD2 > distYUp) && (distYD2 < distYDown))))) {
collide1.start("", 1);
setProperty(square, _x , ((sq2X - (sq2Width / 2)) - (sqWidth / 2)) + 2.5);
p1SpeedArray[num + 1] = curSpeed;
sqParent[num] = j;
if ((distXLeft < (middle._x + (middle._width / 2))) && ((pArray[j] == -1) || ((pArray[j] == -4) && (curSpeed == 0)))) {
explode.start("", 1);
setProperty(square, _x , 2500);
pArray[num] = -3;
} else if (curSpeed == 0) {
pArray[num] = -1;
a = 1;
while (a < p1NumSq) {
if (pArray[a] == -1) {
pArray[a] = checkBlocked(square, sqArray[a], pArray[a]);
}
a++;
}
} else {
pArray[num] = -4;
}
if (((distYUp < distYU2) && (distYDown > distYD2)) && (pArray[num] != -3)) {
if (curSpeed == 0) {
pArray[j] = -3;
} else {
pArray[j] = -6;
}
}
}
} else if (((player == 2) && (sqX > sq2X)) && (((pArray[j] == -2) || (pArray[j] == 2)) || (pArray[j] == -5))) {
if (((math.abs(distXLeft - distXR2) <= 2.5) && ((num > j) || ((num < j) && (pArray[j] == -2)))) && (((((distYUp > distYU2) && (distYUp < distYD2)) || ((sqY > distYU2) && (sqY < distYD2))) || ((distYDown > distYU2) && (distYDown < distYD2))) || ((((distYU2 > distYUp) && (distYU2 < distYDown)) || ((sqY2 > distYUp) && (sqY2 < distYDown))) || ((distYD2 > distYUp) && (distYD2 < distYDown))))) {
collide2.start("", 1);
setProperty(square, _x , ((sq2X + (sq2Width / 2)) + (sqWidth / 2)) - 2.5);
p1SpeedArray[num + 1] = curSpeed;
sqParent[num] = j;
if ((distXRight > (middle._x - (middle._width / 2))) && ((pArray[j] == -2) || ((pArray[j] == -5) && (curSpeed == 0)))) {
explode.start("", 1);
setProperty(square, _x , 2500);
pArray[num] = -3;
} else if (curSpeed == 0) {
pArray[num] = -2;
a = 1;
while (a < p1NumSq) {
if (pArray[a] == -1) {
pArray[a] = checkBlocked(square, sqArray[a], pArray[a]);
}
a++;
}
} else {
pArray[num] = -5;
}
if (((distYUp < distYU2) && (distYDown > distYD2)) && (pArray[num] != -3)) {
if (curSpeed == 0) {
pArray[j] = -3;
} else {
pArray[j] = -6;
}
}
}
}
}
}
j++;
}
}
minX = p1.minX;
maxX = p1.maxX;
minY = p1.minY;
maxY = p1.maxY;
minX2 = p2.minX2;
maxX2 = p2.maxX2;
minY2 = p2.minY2;
maxY2 = p2.maxY2;
if (Key.isDown(32)) {
createSquare(minX, maxX, minY, maxY, p1Sq);
}
if (Key.isDown(96)) {
createSquare(minX2, maxX2, minY2, maxY2, p2Sq);
if (dist2 < 50) {
p2Sq._alpha = 60;
} else {
p2Sq._alpha = 20;
}
}
i = 1;
while (i < p1numSq) {
player = pArray[i];
if ((((p1SpeedArray[i + 1] != 0) && (player != -4)) && (player != -5)) && (player != -6)) {
squareHit("p1Sq" + i, player, i);
}
if (((((player == -4) || (player == -5)) || (player == -6)) || (player == -3)) && (p1SpeedArray[i + 1] != 0)) {
stuckOn("p1Sq" + i, player, i);
}
i++;
}
if (((control1 == false) || (control2 == false)) && (done == true)) {
gotoAndPlay (7);
}
X = p1._x;
Y = p1._y;
maxSpeed = 5;
disX1 = X - initX1;
disY1 = Y - initY1;
_global.dist1 = math.sqrt((disX1 * disX1) + (disY1 * disY1));
if (Key.isDown(32)) {
_global.p1Draw = true;
if (dist1 < 50) {
p1Sq._alpha = 100;
} else {
p1Sq._alpha = 20;
}
if (draw1 == 0) {
Line10.moveTo(X, Y);
_global.initX1 = X;
_global.initY1 = Y;
}
Line10.lineTo(X, Y);
_global.draw1++;
} else {
if (p1Draw == true) {
if (Line10._alpha >= 100) {
minX = p1.minX;
maxX = p1.maxX;
minY = p1.minY;
maxY = p1.maxY;
}
if (lineAlpha > 0) {
setProperty("Line10", _alpha , lineAlpha);
_global.lineAlpha = _global.lineAlpha - 90;
if (((dist1 < 50) && (math.abs(maxX - minX) > 3)) && (math.abs(maxY - minY) > 3)) {
if (create1 == false) {
duplicateMovieClip ("p1Sq", "p1Sq" + p1numSq, 100 + p1numSq);
createSquare(minX, maxX, minY, maxY, "p1Sq" + p1numSq);
make1.start("", 1);
p1.gotoAndPlay("make");
pArray[p1numSq] = 1;
sqArray[p1numSq] = "p1Sq" + p1numSq;
_global.sqColor = 1;
_global.p1numSq++;
area = (maxX - minX) * (maxY - minY);
speed(area, 1);
p1SpeedArray[p1numSq] = sq1Speed;
_global.create1 = true;
}
setProperty("p1Sq" + (p1numSq - 1), _alpha , 100);
}
} else {
p1Sq._alpha = 0;
if (create1 == true) {
_global.create1 = false;
}
removeMovieClip("Line10");
duplicateMovieClip ("Line1", "Line10", 100);
_global.lineAlpha = getProperty("Line10", _alpha);
_global.reset = true;
_global.p1Draw = false;
}
}
_global.draw1 = 0;
}
X2 = p2._x;
Y2 = p2._y;
maxSpeed = 4;
disX2 = X2 - initX2;
disY2 = Y2 - initY2;
_global.dist2 = math.sqrt((disX2 * disX2) + (disY2 * disY2));
if (Key.isDown(96)) {
_global.p2Draw = true;
if (dist2 < 50) {
p2Sq._alpha = 100;
} else {
p2Sq._alpha = 20;
}
if (draw2 == 0) {
Line20.moveTo(X2, Y2);
_global.initX2 = X2;
_global.initY2 = Y2;
}
Line20.lineTo(X2, Y2);
_global.draw2++;
} else {
if (p2Draw == true) {
if (Line20._alpha >= 100) {
minX2 = p2.minX2;
maxX2 = p2.maxX2;
minY2 = p2.minY2;
maxY2 = p2.maxY2;
}
if (lineAlpha2 > 0) {
setProperty("Line20", _alpha , lineAlpha2);
_global.lineAlpha2 = _global.lineAlpha2 - 80;
if (((dist2 < 50) && (math.abs(maxX2 - minX2) > 3)) && (math.abs(maxY2 - minY2) > 3)) {
if (create2 == false) {
duplicateMovieClip ("p1Sq", "p1Sq" + p1numSq, 100 + p1numSq);
createSquare(minX2, maxX2, minY2, maxY2, "p1Sq" + p1numSq);
Y = (maxY2 - minY2) / 2;
setProperty("p1Sq" + p1numSq, _height , Y * 2);
make2.start("", 1);
p2.gotoAndPlay("make");
pArray[p1numSq] = 2;
sqArray[p1numSq] = "p1Sq" + p1numSq;
_global.sqColor = 2;
_global.p1numSq++;
area2 = (maxX2 - minX2) * (maxY2 - minY2);
speed(area2, -1);
p1SpeedArray[p1numSq] = sq1Speed;
_global.create2 = true;
}
setProperty("p1Sq" + (p1numSq - 1), _alpha , 100);
alpha = getProperty(sqArray[p1numSq - 1], _alpha);
Xpos = getProperty(sqArray[p1numSq - 1], _x);
Xsize = getProperty(sqArray[p1numSq - 1], _width);
Ysize = getProperty(sqArray[p1numSq - 1], _height);
}
} else {
p2Sq._alpha = 0;
if (create2 == true) {
_global.create2 = false;
}
removeMovieClip("Line20");
duplicateMovieClip ("Line2", "Line20", 150);
_global.lineAlpha2 = getProperty("Line20", _alpha);
_global.reset2 = true;
_global.p2Draw = false;
}
}
_global.draw2 = 0;
}
Frame 6
gotoAndPlay (5);
Frame 7
if (control1 == false) {
if (control2 == false) {
if (p1Score > p2Score) {
gotoAndPlay (8);
} else if (p2Score > p1Score) {
gotoAndPlay (9);
} else {
gotoAndPlay (10);
}
} else {
gotoAndPlay (9);
}
} else if (control1 == false) {
if (p1Score > p2Score) {
gotoAndPlay (8);
} else if (p2Score > p1Score) {
gotoAndPlay (9);
} else {
gotoAndPlay (10);
}
} else {
gotoAndPlay (8);
}
stop();
Frame 8
stop();
pScore1.text("P1 Score: " + p1Score);
pScore2.text("P2 Score: " + p2Score);
i = 1;
while (i < (p1numSq + 1)) {
removeMovieClip(sqArray[i]);
trace("i: " + i);
i++;
}
removeMovieClip("Line20");
removeMovieClip("Line10");
Instance of Symbol 28 MovieClip "p2" in Frame 8
onClipEvent (load) {
gotoAndPlay (14);
pColor.gotoAndPlay(2);
}
Frame 9
stop();
pScore1.text("P1 Score: " + p1Score);
pScore2.text("P2 Score: " + p2Score);
i = 1;
while (i < (p1numSq + 1)) {
removeMovieClip(sqArray[i]);
trace("i: " + i);
i++;
}
removeMovieClip("Line20");
removeMovieClip("Line10");
Instance of Symbol 28 MovieClip "p1" in Frame 9
onClipEvent (load) {
gotoAndPlay (14);
}
Instance of Symbol 28 MovieClip "p2" in Frame 9
onClipEvent (load) {
pColor.gotoAndPlay(2);
}
Frame 10
stop();
pScore1.text("P1 Score: " + p1Score);
pScore2.text("P2 Score: " + p2Score);
i = 1;
while (i < (p1numSq + 1)) {
removeMovieClip(sqArray[i]);
trace("i: " + i);
i++;
}
removeMovieClip("Line20");
removeMovieClip("Line10");
Instance of Symbol 28 MovieClip "p2" in Frame 10
onClipEvent (load) {
gotoAndPlay (14);
pColor.gotoAndPlay(2);
}
Symbol 14 Button
on (keyPress "<Enter>") {
gotoAndPlay (2);
}
Symbol 16 Button
on (keyPress "<Enter>") {
gotoAndPlay (3);
}
Symbol 19 MovieClip Frame 1
stop();
Symbol 19 MovieClip Frame 2
stop();
Symbol 28 MovieClip Frame 11
stop();
Symbol 28 MovieClip Frame 25
_global.done = true;
stop();
Symbol 49 MovieClip Frame 1
stop();
Symbol 49 MovieClip Frame 2
stop();
Symbol 55 Button
on (keyPress "<Space>") {
gotoAndPlay (3);
}