Frame 2
stot = this.getBytesTotal();
sloa = this.getBytesLoaded();
if (stot != 0) {
per = Math.floor((sloa / stot) * 100);
} else {
per = 0;
}
mc_bar.mc._x = mc_bar.mc._width * (-1 + (sloa / stot));
txtPer = String(per) + "%";
if (((sloa >= 1) && (stot >= 1)) && (sloa == stot)) {
gotoAndStop ("menu");
}
Instance of Symbol 140 MovieClip in Frame 2
on (press) {
getURL ("http://www.justfreegames.com?WT.mc_id=FlashBombPong", "_blank");
}
Instance of Symbol 143 MovieClip in Frame 2
on (press) {
getURL ("http://www.justfreegames.com?WT.mc_id=FlashBombPong", "_blank");
}
Frame 3
gotoAndPlay ("loading");
Frame 4
if (!initialized) {
initialized = true;
snd_menu = new Sound();
snd_menu.attachSound("sound_menu");
}
if (!isSoundPlaying) {
snd_menu.start(0, 99999999);
isSoundPlaying = true;
}
stop();
Frame 7
snd_menu.stop();
isSoundPlaying = false;
Frame 8
isSoundPlaying = true;
snd_menu.start(0, 99999999);
Symbol 14 MovieClip [Racket1] Frame 1
#initclip 10
Object.registerClass("Racket1", CRacketPlayer);
#endinitclip
Symbol 35 MovieClip [Ball] Frame 1
#initclip 7
Object.registerClass("Ball", CBall);
#endinitclip
Symbol 38 MovieClip [Racket2] Frame 1
#initclip 8
Object.registerClass("Racket2", CRacketAI);
#endinitclip
Symbol 49 MovieClip Frame 1
stop();
Symbol 56 MovieClip Frame 1
stop();
Symbol 59 MovieClip Frame 1
stop();
Symbol 81 MovieClip Frame 1
stop();
Symbol 108 Button
on (press) {
_root.gotoAndStop("menu");
}
Symbol 113 Button
on (press) {
gotoAndStop ("game");
this.StartNewGame();
}
Symbol 120 Button
on (press) {
this.gotoAndStop("game");
StartRound();
}
Symbol 135 MovieClip Frame 1
stop();
Symbol 136 MovieClip [Game] Frame 1
#initclip 9
Object.registerClass("Game", CGame);
#endinitclip
stop();
Symbol 201 MovieClip [__Packages.CBall] Frame 0
class CBall extends MovieClip
{
var enabled, ALL_COLLISIONS_ENABLED, CONST_D, CONST_L, CONST_K, posX, posY, posZ, prevTime, speedY, speedMultiplier, speedX, speedZ, _parent, onTableFallAmount, destinationY, _x, _y, _xscale, _yscale, speed, destinationX;
function CBall () {
super();
enabled = false;
ALL_COLLISIONS_ENABLED = false;
CONST_D = CONST_H * Math.tan(ALPHA);
CONST_L = Math.sqrt((CONST_D * CONST_D) + (CONST_H * CONST_H));
CONST_K = CONST_h / Math.tan(ALPHA / 2);
Init();
}
function Init() {
posX = 50;
posY = 200;
posZ = 300;
}
function setEnabled(value) {
enabled = value;
}
function onEnterFrame() {
if (!enabled) {
prevTime = getTimer();
return(undefined);
}
var _local2 = (getTimer() - prevTime) / 1000;
prevTime = getTimer();
speedY = speedY - (((THE_G * _local2) * speedMultiplier) * GLOBAL_SPEED);
posX = posX + (((speedX * _local2) * speedMultiplier) * GLOBAL_SPEED);
posY = posY + (((speedY * _local2) * speedMultiplier) * GLOBAL_SPEED);
posZ = posZ + (((speedZ * _local2) * speedMultiplier) * GLOBAL_SPEED);
updateXYPosition();
if ((posZ > (TABLE_CENTER_Z - 15)) && (speedZ > 0)) {
_parent.setGreedLowDepth();
}
if ((posZ < (TABLE_CENTER_Z - 15)) && (speedZ < 0)) {
_parent.setGreedHighDepth();
}
if (posY < MIN_Y) {
if ((posX > MAX_X) || (posX < MIN_X)) {
if (speedZ > 0) {
_parent.compOut();
} else {
_parent.playerOut();
}
return(undefined);
}
if ((posZ > MAX_TABLE_Z) || (posZ < MIN_TABLE_Z)) {
if (onTableFallAmount == 0) {
if (speedZ > 0) {
_parent.compOut();
} else {
_parent.playerOut();
}
return(undefined);
}
if (speedZ > 0) {
_parent.playerMiss();
return(undefined);
}
} else {
if (((posZ > TABLE_CENTER_Z) && (speedZ < 0)) && (onTableFallAmount == 0)) {
_parent.playerMiss();
return(undefined);
}
if (((posZ < TABLE_CENTER_Z) && (speedZ < 0)) && (onTableFallAmount == 0)) {
calculateDestinationY();
}
_parent.PlayBallSound();
onTableFallAmount++;
posY = MIN_Y;
speedY = -speedY;
}
}
if (posZ > MAX_Z) {
posZ = MAX_Z;
_parent.playerHit();
onTableFallAmount = 0;
return(undefined);
}
if (((ALL_COLLISIONS_ENABLED && (onTableFallAmount == 1)) && (speedZ > 0)) && (posY > (MIN_Y + 40))) {
if (_parent.racket_player.tryHitBall() > 0) {
trace("NEW HIT");
_parent.playerHit();
onTableFallAmount = 0;
return(undefined);
}
}
if (posZ < MIN_Z) {
posZ = MIN_Z;
destinationY = 0;
_parent.compHit();
onTableFallAmount = 0;
return(undefined);
}
}
function updateXYPosition() {
var _local5 = (CConst.BOARD_WIDTH_HALF + posX) + ((posX * (posZ - MIN_Z)) / 150);
var _local4 = CONST_h - (CONST_K * Math.tan(Math.atan((CONST_D - posZ) / (CONST_H - posY)) - (ALPHA / 2)));
_x = _local5;
_y = _local4;
var _local2 = 100 * (1 - ((MAX_Z - posZ) / ((MAX_Z - MIN_Z) + 120)));
_xscale = _local2;
_yscale = _local2;
_parent.shadow._x = _x;
_parent.shadow._y = CONST_h - (CONST_K * Math.tan(Math.atan((CONST_D - posZ) / (CONST_H - MIN_Y)) - (ALPHA / 2)));
var _local3 = (_local2 * (CONST_SHADOW_H - posY)) / (CONST_SHADOW_H - MIN_Y);
_parent.shadow._xscale = _local3;
_parent.shadow._yscale = _local3;
}
function setSpeed(speedValue, vectorX, vectorY, vectorZ) {
speed = speedValue;
var _local2 = Math.atan(Math.abs(vectorZ) / Math.abs(vectorX));
if (vectorX > 0) {
speedX = speed * Math.cos(_local2);
} else {
speedX = (-speed) * Math.cos(_local2);
}
speedY = vectorY;
if (vectorZ > 0) {
speedZ = speed * Math.sin(_local2);
} else {
speedZ = (-speed) * Math.sin(_local2);
}
}
function Start(theX, theY, theSpeed, theSpeedX, theSpeedY, theSpeedZ) {
posX = theX;
posY = theY;
posZ = MAX_Z - 10;
setSpeed(theSpeed, theSpeedX, theSpeedY, theSpeedZ);
setEnabled(true);
destinationX = 0;
onTableFallAmount = -1;
}
function calculateDestinationY() {
var _local2 = (posZ - MIN_Z) / (-speedZ);
destinationY = (posY - (speedY * _local2)) - (((THE_G * _local2) * _local2) / 2.2);
}
var THE_G = 1500;
var MIN_X = -92;
var MIN_Y = 80;
var MIN_Z = 270;
var MAX_X = 92;
var MAX_Y = 180;
var MAX_Z = 505;
var MIN_TABLE_Z = 285;
var MAX_TABLE_Z = 500;
var TABLE_CENTER_Z = (CBall.prototype.MAX_TABLE_Z + CBall.prototype.MIN_TABLE_Z) / 2;
var ALPHA = 1.0471975511966;
var CONST_h = 250;
var CONST_H = 350;
var CONST_SHADOW_H = 300;
var GLOBAL_SPEED = 1;
}
Symbol 202 MovieClip [__Packages.CConst] Frame 0
class CConst
{
function CConst () {
}
static var BOARD_CENTER_X = 275;
static var BOARD_WIDTH = 550;
static var BOARD_WIDTH_HALF = 275;
static var BOARD_WIDTH_HALF_SMALL = 140;
static var RACKET_BLINK_TIME = 300;
static var RACKET_AI_UPDATE_TIME = 50;
static var SETS_IN_ROUND = 11;
static var MAX_ROUND = 7;
static var BALL_DEPTH_MIN = 1100;
static var BALL_DEPTH_MAX = 1200;
static var GREED_DEPTH = 1150;
}
Symbol 203 MovieClip [__Packages.CRacket] Frame 0
class CRacket extends MovieClip
{
function CRacket () {
super();
}
var MAX_ROTATION = 45;
}
Symbol 204 MovieClip [__Packages.CRacketAI] Frame 0
class CRacketAI extends CRacket
{
var enabled, timerID, posX, _x, posY, _y, _parent, DELTA_X, DELTA_Y, _rotation, MAX_ROTATION;
function CRacketAI () {
super();
enabled = false;
timerID = setInterval(this, "onTimer", CConst.RACKET_AI_UPDATE_TIME);
}
function setEnabled(value) {
enabled = value;
}
function onTimer() {
if (!enabled) {
return(undefined);
}
posX = _x - CConst.BOARD_WIDTH_HALF;
posY = 160 - _y;
if (_parent.ball.speedZ < 0) {
DELTA_X = _parent.ball.destinationX - posX;
DELTA_Y = _parent.ball.destinationY - posY;
if (_parent.ball.destinationY > 0) {
_y = _y - (DELTA_Y / 8);
}
if (_parent.ball.posZ < 300) {
_x = _x + DELTA_X;
} else if (_parent.ball.posZ < 400) {
_x = _x + (DELTA_X / 3);
} else if (_parent.ball.posZ < 500) {
_x = _x + (DELTA_X / 5);
}
updateRotation();
}
}
function updateRotation() {
_rotation = ((_x - CConst.BOARD_CENTER_X) / CConst.BOARD_WIDTH_HALF_SMALL) * MAX_ROTATION;
if (_rotation > MAX_ROTATION) {
_rotation = MAX_ROTATION;
}
if (_rotation < (-MAX_ROTATION)) {
_rotation = -MAX_ROTATION;
}
}
}
Symbol 205 MovieClip [__Packages.CGame] Frame 0
class CGame extends MovieClip
{
var SET_TIME, isHighGreed, greed2, BOOM_TIME, snd_ball, snd_raketka, snd_player, snd_comp, GLOBAL_SPEED, GRAVITY, speedMultiplier, speedRoundMultiplier, ALL_COLLISIONS_ENABLED, CURVE_CENTER_K, CURVE_END_K, MISS_SIMPLE_K, MISS_SIMPLE_B, MISS_CENTER_K, MISS_CENTER_B, MISS_END_K, MISS_END_B, CHANGE_SIDE_K, CHANGE_SIDE_B, OUT_K, OUT_B, PROB_FROM_1_TO_1, PROB_FROM_1_TO_2, PROB_FROM_1_TO_3, FROM_2_TO_OUT_K, PROB_FROM_2_TO_1, PROB_FROM_2_TO_2, FROM_3_TO_OUT_K, PROB_FROM_3_TO_2, PROB_FROM_3_TO_3, START_X, START_Y, START_SPEED, START_SPEED_X, START_SPEED_Y, START_SPEED_Z, PLAYER_SPEED, PLAYER_SPEED_X, PLAYER_SPEED_Y, PLAYER_SPEED_Z, PLAYER_CURVE_END_SPEED, PLAYER_CURVE_END_SPEED_Y, PLAYER_CURVE_CENTER_SPEED, PLAYER_CURVE_CENTER_SPEED_Y, COMP_SPEED, COMP_SPEED_X, COMP_SPEED_Y, COMP_SPEED_Z, COMP_CURVE_END_SPEED, COMP_CURVE_END_SPEED_Y, COMP_CURVE_CENTER_SPEED, COMP_CURVE_CENTER_SPEED_Y, PROB_CURVE_CENTER, roundNumber, PROB_CURVE_END, PROB_MISS_SIMPLE, PROB_NO_CURVE, PROB_MISS_CENTER, PROB_MISS_END, PROB_CHANGE_SIDE, KOEF_OUT, PROB_FROM_1_TO_OUT, PROB_FROM_2_TO_OUT, PROB_FROM_2_TO_3, PROB_FROM_3_TO_OUT, PROB_FROM_3_TO_1, gotoAndStop, rank, onEnterFrame, btn_serve, txt_bomb_time, player_score, comp_score, greed, bombTime, compShouldMiss, ball, timerID, blinkTimerID, racket_player, racket_ai, lamp_blink, txt_player_score, txt_comp_score, shadow, boomTimerID, nextMessageName, boom_player, boom_comp;
function CGame () {
super();
switch (_global.gameType) {
case 1 :
SET_TIME = 25;
break;
case 2 :
SET_TIME = 15;
break;
case 3 :
SET_TIME = 10;
}
isHighGreed = false;
greed2._visible = false;
BOOM_TIME = 400;
snd_ball = new Sound();
snd_ball.attachSound("sound_ball");
snd_raketka = new Sound();
snd_raketka.attachSound("sound_raketka");
snd_player = new Sound();
snd_player.attachSound("sound_player");
snd_comp = new Sound();
snd_comp.attachSound("sound_comp");
GLOBAL_SPEED = 0.7;
GRAVITY = 1500;
speedMultiplier = 1.02;
speedRoundMultiplier = 0.05;
ALL_COLLISIONS_ENABLED = false;
CURVE_CENTER_K = 5;
CURVE_END_K = 3;
MISS_SIMPLE_K = 1.5;
MISS_SIMPLE_B = 11;
MISS_CENTER_K = 1.5;
MISS_CENTER_B = 11;
MISS_END_K = 2;
MISS_END_B = 11;
CHANGE_SIDE_K = 7;
CHANGE_SIDE_B = 10;
OUT_K = 2;
OUT_B = 0.5;
PROB_FROM_1_TO_1 = 40;
PROB_FROM_1_TO_2 = 40;
PROB_FROM_1_TO_3 = 20;
FROM_2_TO_OUT_K = 20;
PROB_FROM_2_TO_1 = 30;
PROB_FROM_2_TO_2 = 30;
FROM_3_TO_OUT_K = 30;
PROB_FROM_3_TO_2 = 30;
PROB_FROM_3_TO_3 = 30;
START_X = 0;
START_Y = 130;
START_SPEED = 250;
START_SPEED_X = 0;
START_SPEED_Y = 0;
START_SPEED_Z = -100;
PLAYER_SPEED = 370;
PLAYER_SPEED_X = 10;
PLAYER_SPEED_Y = 240;
PLAYER_SPEED_Z = -100;
PLAYER_CURVE_END_SPEED = 490;
PLAYER_CURVE_END_SPEED_Y = 210;
PLAYER_CURVE_CENTER_SPEED = 490;
PLAYER_CURVE_CENTER_SPEED_Y = 210;
COMP_SPEED = 370;
COMP_SPEED_X = 10;
COMP_SPEED_Y = 260;
COMP_SPEED_Z = 100;
COMP_CURVE_END_SPEED = 490;
COMP_CURVE_END_SPEED_Y = 210;
COMP_CURVE_CENTER_SPEED = 490;
COMP_CURVE_CENTER_SPEED_Y = 210;
StartNewGame();
}
function onDataLoaded() {
}
function calculateAIParams() {
PROB_CURVE_CENTER = roundNumber * CURVE_CENTER_K;
PROB_CURVE_END = roundNumber * CURVE_END_K;
PROB_MISS_SIMPLE = (MISS_SIMPLE_B - roundNumber) * MISS_SIMPLE_K;
PROB_NO_CURVE = ((100 - PROB_CURVE_CENTER) - PROB_CURVE_END) - PROB_MISS_SIMPLE;
PROB_MISS_CENTER = (MISS_CENTER_B - roundNumber) * MISS_CENTER_K;
PROB_MISS_END = (MISS_END_B - roundNumber) * MISS_END_K;
PROB_CHANGE_SIDE = (CHANGE_SIDE_K * roundNumber) + CHANGE_SIDE_B;
KOEF_OUT = (roundNumber / OUT_K) + OUT_B;
PROB_FROM_1_TO_OUT = 0;
PROB_FROM_2_TO_OUT = FROM_2_TO_OUT_K / KOEF_OUT;
PROB_FROM_2_TO_3 = ((100 - PROB_FROM_2_TO_OUT) - PROB_FROM_2_TO_1) - PROB_FROM_2_TO_2;
PROB_FROM_3_TO_OUT = FROM_3_TO_OUT_K / KOEF_OUT;
PROB_FROM_3_TO_1 = ((100 - PROB_FROM_3_TO_OUT) - PROB_FROM_3_TO_2) - PROB_FROM_3_TO_3;
}
function StartNewGame() {
roundNumber = 1;
StartRound();
}
function onBtnServeClick() {
(gotoAndStop("game"));// not popped
rank.gotoAndStop(roundNumber);
onEnterFrame = StartSet;
}
function StartRound() {
btn_serve.OBJ_GAME = this;
btn_serve.onRelease = function () {
this.OBJ_GAME.onBtnServeClick();
};
txt_bomb_time = SET_TIME;
player_score = 0;
comp_score = 0;
rank.gotoAndStop(roundNumber);
ShowScores();
calculateAIParams();
}
function StartSet() {
onEnterFrame = null;
InitRackets();
btn_serve._visible = false;
isHighGreed = false;
greed._visible = true;
greed2._visible = false;
bombTime = SET_TIME;
txt_bomb_time = bombTime;
compShouldMiss = false;
ball.GLOBAL_SPEED = GLOBAL_SPEED;
ball.ALL_COLLISIONS_ENABLED = ALL_COLLISIONS_ENABLED;
ball.THE_G = GRAVITY;
ball.speedMultiplier = 1 + (speedRoundMultiplier * roundNumber);
ball.Start(START_X, START_Y, START_SPEED, START_SPEED_X, START_SPEED_Y, START_SPEED_Z);
timerID = setInterval(this, "onTimer", 1000);
blinkTimerID = setInterval(this, "onBlinkTimer", 1000);
}
function InitRackets() {
racket_player.setEnabled(true);
racket_ai.setEnabled(true);
Mouse.hide();
}
function PlayBallSound() {
snd_ball.start();
}
function PlayRacketSound() {
snd_raketka.start();
}
function onTimer() {
txt_bomb_time = --bombTime;
if (bombTime == 0) {
clearInterval(timerID);
}
}
function onBlinkTimer() {
lamp_blink.gotoAndPlay(2);
clearInterval(blinkTimerID);
blinkTimerID = setInterval(this, "onBlinkTimer", ((bombTime / SET_TIME) * 900) + 100);
}
function ShowScores() {
txt_player_score = player_score;
txt_comp_score = comp_score;
}
function playerHit() {
var _local3 = (-ball.speedX) * 0.3;
var _local2 = PLAYER_SPEED_Y;
var _local4 = PLAYER_SPEED;
if (bombTime == 0) {
playerBlowUp();
return(undefined);
}
if (ball.onTableFallAmount == 0) {
compOut();
return(undefined);
}
if (ball.onTableFallAmount > 1) {
playerMiss();
return(undefined);
}
switch (racket_player.tryHitBall()) {
case 0 :
playerMiss();
return(undefined);
case 1 :
_local3 = _local3 - PLAYER_SPEED_X;
break;
case 2 :
_local3 = _local3 + PLAYER_SPEED_X;
}
switch (racket_player.curveType) {
case 0 :
break;
case 1 :
_local2 = PLAYER_CURVE_CENTER_SPEED_Y;
_local4 = PLAYER_CURVE_CENTER_SPEED;
break;
case 2 :
_local2 = PLAYER_CURVE_END_SPEED_Y;
_local4 = PLAYER_CURVE_END_SPEED;
}
ball.curve = racket_player.curveType;
ball.setSpeed(_local4, _local3, _local2, PLAYER_SPEED_Z);
ball.updateXYPosition();
compShouldMiss = false;
switch (ball.curve) {
case 0 :
if ((Math.random() * 100) < PROB_MISS_SIMPLE) {
compShouldMiss = true;
}
break;
case 1 :
if ((Math.random() * 100) < PROB_MISS_CENTER) {
compShouldMiss = true;
}
break;
case 2 :
if ((Math.random() * 100) >= PROB_MISS_END) {
break;
}
compShouldMiss = true;
}
ball.destinationX = ball.posX + ((ball.speedX * (ball.posZ - ball.MIN_Z)) / (-ball.speedZ));
if (compShouldMiss) {
if (ball.destinationX > 0) {
ball.destinationX = ball.destinationX + 20;
} else {
ball.destinationX = ball.destinationX - 20;
}
}
ball.speedMultiplier = ball.speedMultiplier * speedMultiplier;
PlayRacketSound();
}
function compHit() {
if (bombTime == 0) {
compBlowUp();
return(undefined);
}
if (ball.onTableFallAmount == 0) {
playerOut();
return(undefined);
}
if (ball.onTableFallAmount > 1) {
compMiss();
return(undefined);
}
var _local8 = Math.ceil(Math.abs(ball.posX) / 40);
if (compShouldMiss) {
compShouldMiss = false;
if (ball.curve > 0) {
playerGoodCurve();
} else if (Math.abs(_local8) >= 3) {
playerSmartShoot();
} else {
compMiss();
}
return(undefined);
}
var _local2 = 0;
var _local6 = COMP_SPEED_Y;
var _local7 = COMP_SPEED;
var _local4 = Math.random() * 100;
if (_local4 < PROB_CURVE_CENTER) {
ball.curve = 1;
_local6 = COMP_CURVE_CENTER_SPEED_Y;
_local7 = COMP_CURVE_CENTER_SPEED;
} else if (_local4 < (PROB_CURVE_CENTER + PROB_CURVE_END)) {
ball.curve = 2;
_local6 = COMP_CURVE_END_SPEED_Y;
_local7 = COMP_CURVE_END_SPEED;
} else {
ball.curve = 0;
}
var _local5 = false;
if ((Math.random() * 100) < PROB_CHANGE_SIDE) {
_local5 = true;
}
_local4 = Math.random() * 100;
var _local3 = COMP_SPEED_X;
switch (_local8) {
case 1 :
if (_local4 < PROB_FROM_1_TO_OUT) {
if (ball.posX > 0) {
_local2 = _local3 * 4;
}
} else if (_local4 < (PROB_FROM_1_TO_OUT + PROB_FROM_1_TO_1)) {
if (_local5) {
_local2 = -_local3;
} else {
_local2 = 0;
}
} else if (_local4 < ((PROB_FROM_1_TO_OUT + PROB_FROM_1_TO_1) + PROB_FROM_1_TO_2)) {
if (_local5) {
_local2 = (-_local3) * 2;
} else {
_local2 = _local3;
}
} else if (_local5) {
_local2 = (-_local3) * 3;
} else {
_local2 = _local3 * 2;
}
break;
case 2 :
if (_local4 < PROB_FROM_2_TO_OUT) {
if (ball.posX > 0) {
_local2 = _local3 * 3;
}
} else if (_local4 < (PROB_FROM_2_TO_OUT + PROB_FROM_2_TO_1)) {
if (_local5) {
_local2 = -2 * _local3;
} else {
_local2 = -_local3;
}
} else if (_local4 < ((PROB_FROM_2_TO_OUT + PROB_FROM_2_TO_1) + PROB_FROM_2_TO_2)) {
if (_local5) {
_local2 = (-_local3) * 2.5;
} else {
_local2 = 0;
}
} else if (_local5) {
_local2 = (-_local3) * 2;
} else {
_local2 = _local3 * 0.5;
}
break;
default :
if (_local4 < PROB_FROM_3_TO_OUT) {
if (ball.posX > 0) {
_local2 = _local3 * 2;
}
} else if (_local4 < (PROB_FROM_3_TO_OUT + PROB_FROM_3_TO_1)) {
if (_local5) {
_local2 = -3 * _local3;
} else {
_local2 = -2 * _local3;
}
} else if (_local4 < ((PROB_FROM_3_TO_OUT + PROB_FROM_3_TO_1) + PROB_FROM_3_TO_2)) {
if (_local5) {
_local2 = (-_local3) * 3;
} else {
_local2 = -_local3;
}
} else if (_local5) {
_local2 = (-_local3) * 4;
} else {
_local2 = 0;
}
_local2 = _local2 - ((_local8 - 3) * _local3);
}
if (ball.curve > 0) {
_local2 = _local2 * 0.7;
}
if (ball.posX < 0) {
_local2 = -_local2;
}
ball.setSpeed(_local7, _local2, _local6, COMP_SPEED_Z);
ball.speedMultiplier = ball.speedMultiplier * speedMultiplier;
PlayRacketSound();
}
function playerOut() {
if (!isCompWonRound()) {
ShowPlayerBoom("msg_player_out");
}
}
function compOut() {
if (!isPlayerWonRound()) {
ShowCompBoom("msg_comp_out");
}
}
function playerMiss() {
if (!isCompWonRound()) {
ShowPlayerBoom("msg_player_mis");
}
}
function playerGoodCurve() {
if (!isPlayerWonRound()) {
ShowCompBoom("msg_curve");
}
}
function playerSmartShoot() {
if (!isPlayerWonRound()) {
ShowCompBoom("msg_shoot");
}
}
function compMiss() {
if (!isPlayerWonRound()) {
ShowCompBoom("msg_comp_mis");
}
}
function playerBlowUp() {
if (!isCompWonRound()) {
ShowPlayerBoom("msg_player_blow");
}
}
function compBlowUp() {
if (!isPlayerWonRound()) {
ShowCompBoom("msg_comp_blown");
}
}
function disableAll() {
ball.setEnabled(false);
ball._visible = false;
shadow._visible = false;
racket_player.setEnabled(false);
racket_player.removeHighlight();
racket_player._visible = false;
racket_ai.setEnabled(false);
racket_ai._visible = false;
greed._visible = true;
greed2._visible = false;
clearInterval(timerID);
clearInterval(blinkTimerID);
}
function isPlayerWonRound() {
disableAll();
player_score++;
ShowScores();
snd_player.start();
if ((player_score >= CConst.SETS_IN_ROUND) && ((player_score - comp_score) >= 2)) {
if (roundNumber == CConst.MAX_ROUND) {
Mouse.show();
_root.gotoAndStop("congratulation");
} else {
ShowCompBoom("msg_won");
rank.gotoAndStop(++roundNumber);
}
return(true);
}
return(false);
}
function isCompWonRound() {
disableAll();
comp_score++;
ShowScores();
snd_comp.start();
if ((comp_score >= CConst.SETS_IN_ROUND) && ((comp_score - player_score) >= 2)) {
ShowPlayerBoom("msg_lose");
return(true);
}
return(false);
}
function ShowPlayerBoom(massageName) {
clearInterval(boomTimerID);
nextMessageName = massageName;
boom_player.gotoAndStop(2);
boomTimerID = setInterval(this, "onBoomTimer", BOOM_TIME);
}
function ShowCompBoom(massageName) {
clearInterval(boomTimerID);
nextMessageName = massageName;
boom_comp.gotoAndStop(2);
boomTimerID = setInterval(this, "onBoomTimer", BOOM_TIME);
}
function onBoomTimer() {
Mouse.show();
btn_serve._visible = true;
boom_player.gotoAndStop(1);
boom_comp.gotoAndStop(1);
clearInterval(boomTimerID);
(gotoAndStop(nextMessageName));// not popped
rank.gotoAndStop(roundNumber);
}
function setGreedHighDepth() {
if (!isHighGreed) {
greed._visible = false;
greed2._visible = true;
isHighGreed = true;
}
}
function setGreedLowDepth() {
if (isHighGreed) {
greed._visible = true;
greed2._visible = false;
isHighGreed = false;
}
}
}
Symbol 206 MovieClip [__Packages.CRacketPlayer] Frame 0
class CRacketPlayer extends CRacket
{
var enabled, _alpha, right_side, left_side, _x, _y, startDrag, stopDrag, _rotation, MAX_ROTATION, previousY, curveType, _parent, timerID;
function CRacketPlayer () {
super();
enabled = false;
_alpha = 70;
right_side._alpha = 10;
left_side._alpha = 10;
}
function setEnabled(value) {
enabled = value;
if (enabled) {
_x = _root._xmouse;
_y = _root._ymouse;
startDrag();
} else {
stopDrag();
}
}
function onMouseMove() {
if (!enabled) {
return(undefined);
}
_rotation = ((_x - CConst.BOARD_CENTER_X) / CConst.BOARD_WIDTH_HALF) * MAX_ROTATION;
if (_rotation > MAX_ROTATION) {
_rotation = MAX_ROTATION;
}
if (_rotation < (-MAX_ROTATION)) {
_rotation = -MAX_ROTATION;
}
var _local2 = _y - previousY;
if (_local2 > 3) {
curveType = 1;
} else if (_local2 < -3) {
curveType = 2;
} else {
curveType = 0;
}
previousY = _y;
}
function tryHitBall() {
if (right_side.hitTest(_parent.ball._x, _parent.ball._y, false)) {
clearInterval(timerID);
right_side._alpha = 100;
timerID = setInterval(this, "removeHighlight", CConst.RACKET_BLINK_TIME);
return(1);
}
if (left_side.hitTest(_parent.ball._x, _parent.ball._y, false)) {
clearInterval(timerID);
left_side._alpha = 100;
timerID = setInterval(this, "removeHighlight", CConst.RACKET_BLINK_TIME);
return(2);
}
return(0);
}
function removeHighlight() {
clearInterval(timerID);
right_side._alpha = 10;
left_side._alpha = 10;
}
}
Symbol 159 Button
on (press) {
gotoAndStop ("gameType");
}
Symbol 164 Button
on (press) {
gotoAndStop ("help");
}
Symbol 169 Button
on (press) {
getURL ("http://www.justfreegames.com?WT.mc_id=FlashBombPong", "_blank");
}
Symbol 176 Button
on (press) {
_global.gameType = 2;
gotoAndStop ("game");
}
Symbol 181 Button
on (press) {
_global.gameType = 3;
gotoAndStop ("game");
}
Symbol 186 Button
on (press) {
_global.gameType = 1;
gotoAndStop ("game");
}
Symbol 194 Button
on (press) {
gotoAndStop ("menu");
}
Symbol 200 Button
on (press) {
gotoAndStop ("menu");
}