Frame 1
stop();
pole.text = "100 %";
this.onEnterFrame = function () {
trace(this.getBytesLoaded());
if (pole.text == "") {
this.stop();
}
var _local2 = Math.floor((this.getBytesLoaded() / this.getBytesTotal()) * 100);
pole.text = Math.floor(_local2) + " %";
mc_bar.mc._x = mc_bar.mc._width * (-1 + (_local2 / 100));
if (this.getBytesLoaded() == this.getBytesTotal()) {
pole.text = "100 %";
this.gotoAndStop("menu");
delete this.onEnterFrame;
}
};
Instance of Symbol 225 MovieClip in Frame 1
on (press) {
getURL ("http://www.justfreegames.com?WT.mc_id=FlashBombPong", "_blank");
}
Instance of Symbol 228 MovieClip in Frame 1
on (press) {
getURL ("http://www.justfreegames.com?WT.mc_id=FlashBombPong", "_blank");
}
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");
}
Frame 3
gotoAndPlay ("loading");
Frame 4
function func() {
myGame.ReadProperties(gProperties);
myGame.BornGame();
}
stop();
var xml_doc = "<settings><fild cellWidth='16' cellHeigth='16' rows='23' columns='34' /><paxon speed='6' mHeight='15' mWidth='15' /><enemy><ordinary speed='5' mass='5' mHeight='16' mWidth='16' point='100'/><rear speed='3' mass='5' mHeight='16' mWidth='16' point='150'/><great speed='2' mass='50' mHeight='22' mWidth='22' point='50'/><contour speed='2' mass='5000' mHeight='16' mWidth='16' point='80'/></enemy><linespeed speed='14' /><levels><l1 e1='2' e2='0' e3='0' e4='0' progresNeeded='80' point='6' /><l2 e1='2' e2='1' e3='0' e4='0' progresNeeded='80' point='6' /><l3 e1='2' e2='0' e3='1' e4='0' progresNeeded='80' point='10' /><l4 e1='2' e2='0' e3='0' e4='1' progresNeeded='80' point='10' /><l5 e1='2' e2='1' e3='0' e4='1' progresNeeded='80' point='12' /><l6 e1='3' e2='0' e3='1' e4='1' progresNeeded='80' point='14' /><l7 e1='1' e2='1' e3='1' e4='3' progresNeeded='80' point='16' /><l8 e1='3' e2='1' e3='3' e4='0' progresNeeded='80' point='18' /><l9 e1='3' e2='3' e3='0' e4='1' progresNeeded='80' point='20' /><l10 e1='1' e2='2' e3='0' e4='3' progresNeeded='80' point='24' /><l11 e1='3' e2='0' e3='2' e4='2' progresNeeded='80' point='26' /><l12 e1='3' e2='2' e3='1' e4='2' progresNeeded='80' point='28' /><l13 e1='3' e2='2' e3='1' e4='3' progresNeeded='80' point='30' /><l14 e1='3' e2='2' e3='2' e4='3' progresNeeded='80' point='32' /><l15 e1='2' e2='0' e3='2' e4='3' progresNeeded='80' point='34' /><l16 e1='1' e2='3' e3='2' e4='4' progresNeeded='80' point='36' /><l17 e1='7' e2='3' e3='1' e4='1' progresNeeded='80' point='38' /><l18 e1='2' e2='1' e3='2' e4='4' progresNeeded='80' point='40' /><l19 e1='4' e2='3' e3='1' e4='3' progresNeeded='80' point='42' /><l20 e1='0' e2='2' e3='0' e4='5' progresNeeded='80' point='44' /></levels><beginLevel number='1' /><addSpeed k='0.1'></addSpeed><bonuses step='500' steplive='3000' bonusTime='8000'><freez namemc='freez' probability='20' point='50'></freez><ghostEater namemc='ghostEater' probability='10' point='100'></ghostEater><live namemc='live' point='50'></live><slow namemc='slow' probability='35' point='25'></slow><fast namemc='fast' probability='35' point='25'></fast></bonuses><interval v='34'></interval></settings>";
var gProperties = new XML(xml_doc);
gProperties.ignoreWhite = true;
func();
var g_sound = new Sound();
Symbol 33 MovieClip [Pacman_end] Frame 16
stop();
_parent._parent.PaxonDieComplete();
Symbol 34 MovieClip [Fild] Frame 1
#initclip 22
Object.registerClass("Fild", Fild);
#endinitclip
Symbol 35 MovieClip [Live] Frame 1
#initclip 14
Object.registerClass("Live", Live);
#endinitclip
Symbol 36 MovieClip [World] Frame 1
#initclip 15
Object.registerClass("World", World);
#endinitclip
Symbol 38 MovieClip [Bonus] Frame 1
#initclip 16
Object.registerClass("Bonus", Bonus);
#endinitclip
Symbol 56 MovieClip [ghost1] Frame 8
if (!_parent._parent.isGhostEater) {
gotoAndPlay (1);
}
Symbol 56 MovieClip [ghost1] Frame 10
if (!_parent._parent.isGhostEater) {
gotoAndPlay (1);
} else {
gotoAndPlay (9);
}
Symbol 73 MovieClip [ghost2] Frame 8
if (!_parent._parent.isGhostEater) {
gotoAndPlay (1);
}
Symbol 73 MovieClip [ghost2] Frame 10
if (!_parent._parent.isGhostEater) {
gotoAndPlay (1);
} else {
gotoAndPlay (9);
}
Symbol 90 MovieClip [ghost3] Frame 8
if (!_parent._parent.isGhostEater) {
gotoAndPlay (1);
}
Symbol 90 MovieClip [ghost3] Frame 10
if (!_parent._parent.isGhostEater) {
gotoAndPlay (1);
} else {
gotoAndPlay (9);
}
Symbol 107 MovieClip [ghost4] Frame 8
if (!_parent._parent.isGhostEater) {
gotoAndPlay (1);
}
Symbol 107 MovieClip [ghost4] Frame 10
if (!_parent._parent.isGhostEater) {
gotoAndPlay (1);
} else {
gotoAndPlay (9);
}
Symbol 118 MovieClip Frame 1
stop();
Symbol 120 MovieClip [Enemy] Frame 1
#initclip 17
Object.registerClass("Enemy", Enemy);
#endinitclip
stop();
Symbol 120 MovieClip [Enemy] Frame 2
stop();
Symbol 120 MovieClip [Enemy] Frame 3
stop();
Symbol 120 MovieClip [Enemy] Frame 4
stop();
Symbol 146 MovieClip [Cell] Frame 1
#initclip 18
Object.registerClass("Cell", Cell);
#endinitclip
stop();
Symbol 146 MovieClip [Cell] Frame 2
stop();
Symbol 146 MovieClip [Cell] Frame 3
stop();
Symbol 146 MovieClip [Cell] Frame 4
stop();
Symbol 146 MovieClip [Cell] Frame 5
stop();
Symbol 151 MovieClip [Timer] Frame 1
#initclip 19
Object.registerClass("Timer", Timer);
#endinitclip
Symbol 162 MovieClip [Statistic] Frame 1
#initclip 20
Object.registerClass("Statistic", Statistic);
#endinitclip
Symbol 179 MovieClip [GameOver] Frame 1
#initclip 21
Object.registerClass("GameOver", GameOver);
#endinitclip
Symbol 267 MovieClip [__Packages.Live] Frame 0
class Live extends MovieClip
{
var enemysNumber, oldIsMive, moveSound, paxSpeed, isFast, isSlow, isFreez, isGhostEater, _parent, myPaxon, bonusTime, prevVector, attachMovie, getNextHighestDepth, paxW, paxH, paxCondition, eOrdinarS, eOrdinarM, eOrdinarP, eRearS, eRearM, eRearP, eGreatS, eGreatM, eGreatP, eContourS, eContourM, eContourP, eOrdinarW, eOrdinarH, eRearW, eRearH, eGreatW, eGreatH, eContourW, eContourH;
function Live () {
super();
enemysNumber = 0;
oldIsMive = false;
moveSound = new Sound();
moveSound.attachSound("pakapaka");
}
function FastTime(iID) {
var _local3 = new Sound();
_local3.attachSound("zamedl_w_konce_uskoreniya");
if (_root.myGame.soundOn) {
_local3.start();
}
paxSpeed = int(paxSpeed / 2);
isFast = false;
clearInterval(intervalID[iID]);
}
function SlowTime(iID) {
var _local3 = new Sound();
_local3.attachSound("bonus_zamedl_konez");
if (_root.myGame.soundOn) {
_local3.start();
}
isSlow = false;
clearInterval(intervalID[iID]);
}
function FreezTime(iID) {
var _local3 = new Sound();
_local3.attachSound("razmorozka_wragov");
if (_root.myGame.soundOn) {
_local3.start();
}
isFreez = false;
clearInterval(intervalID[iID]);
}
function GhostEaterTime(iID) {
var _local3 = new Sound();
_local3.attachSound("privedeniya_smelie");
if (_root.myGame.soundOn) {
_local3.start();
}
isGhostEater = false;
clearInterval(intervalID[iID]);
}
function Heart(b) {
var _local3;
switch (_parent.myFild.PaxonBonuses(myPaxon)) {
case "fast" :
if (!isFast) {
var _local5 = new Sound();
_local5.attachSound("uskor_w_nachale_uskor");
if (_root.myGame.soundOn) {
_local5.start();
}
paxSpeed = paxSpeed * 2;
isFast = true;
intervalID[intervalID.length] = setInterval(this, "FastTime", bonusTime, intervalID.length);
}
_parent.myStatistic.BonusScore("fast");
break;
case "slow" :
if (!isSlow) {
var _local7 = new Sound();
_local7.attachSound("bonus_zamedl_nasalo");
if (_root.myGame.soundOn) {
_local7.start();
}
isSlow = true;
intervalID[intervalID.length] = setInterval(this, "SlowTime", bonusTime, intervalID.length);
}
_parent.myStatistic.BonusScore("slow");
break;
case "freez" :
if (!isFreez) {
var _local6 = new Sound();
_local6.attachSound("zamorka_wragov");
if (_root.myGame.soundOn) {
_local6.start();
}
isFreez = true;
intervalID[intervalID.length] = setInterval(this, "FreezTime", bonusTime, intervalID.length);
}
_parent.myStatistic.BonusScore("freez");
break;
case "ghostEater" :
if (!isGhostEater) {
var _local4 = new Sound();
_local4.attachSound("privedeniya_ispug_variant");
if (_root.myGame.soundOn) {
_local4.start();
}
isGhostEater = true;
intervalID[intervalID.length] = setInterval(this, "GhostEaterTime", bonusTime, intervalID.length);
}
_parent.myStatistic.BonusScore("ghostEater");
}
if (isFast) {
myPaxon.pacman.gotoAndPlay(myPaxon.pacman._currentframe + 1);
}
MovePax(b);
_local3 = 0;
while (_local3 < enemysNumber) {
if (enemys[_local3]._x > 0) {
enemys[_local3].Heart();
}
_local3++;
}
_local3 = 0;
while (_local3 < enemysNumber) {
if (enemys[_local3]._x > 0) {
_parent.BoomTest(enemys[_local3]);
}
_local3++;
}
EnemyBoomTest();
_local3 = 0;
while (_local3 < enemysNumber) {
if (enemys[_local3]._x > 0) {
enemys[_local3].Go();
}
_local3++;
}
}
function MovePax(d) {
var _local4;
var _local6;
var _local2;
var _local5;
_local2 = _parent.GetCellCondition(myPaxon._x, myPaxon._y) == "free";
_local4 = -100;
if (_local2) {
switch (d) {
case "left" :
if (prevVector == "right") {
d = prevVector;
}
break;
case "right" :
if (prevVector == "left") {
d = prevVector;
}
break;
case "up" :
if (prevVector == "down") {
d = prevVector;
}
break;
case "down" :
if (prevVector == "up") {
d = prevVector;
}
break;
case "nothing" :
d = prevVector;
}
}
_local5 = false;
switch (d) {
case "left" :
if ((!_local2) or (_local2 and (prevVector != "right"))) {
_local4 = myPaxon._x;
_local6 = true;
myPaxon._rotation = 180;
myPaxon._x = _parent.limitPos(myPaxon._x - Number(paxSpeed), true);
_local5 = true;
}
break;
case "right" :
if ((!_local2) or (_local2 and (prevVector != "left"))) {
_local4 = myPaxon._x;
_local6 = true;
myPaxon._rotation = 0;
myPaxon._x = _parent.limitPos(myPaxon._x + Number(paxSpeed), true);
_local5 = true;
}
break;
case "up" :
if ((!_local2) or (_local2 and (prevVector != "down"))) {
_local4 = myPaxon._y;
_local6 = false;
myPaxon._rotation = -90;
myPaxon._y = _parent.limitPos(myPaxon._y - Number(paxSpeed), false);
_local5 = true;
}
break;
case "down" :
if (!((!_local2) or (_local2 and (prevVector != "up")))) {
break;
}
_local4 = myPaxon._y;
_local6 = false;
myPaxon._rotation = 90;
myPaxon._y = _parent.limitPos(myPaxon._y + Number(paxSpeed), false);
_local5 = true;
}
if (prevVector != d) {
myPaxon._y = _parent.NormalizePos(myPaxon._y, false, myPaxon._rotation);
myPaxon._x = _parent.NormalizePos(myPaxon._x, true, myPaxon._rotation);
}
if (_local4 > -100) {
_parent.DrawLine(_local4, myPaxon._x, myPaxon._y, _local6);
prevVector = d;
}
}
function EnemyBoomTest() {
var _local2;
var _local3;
var _local6;
var _local8;
var _local7;
var _local4;
var _local5;
_local2 = 0;
while (_local2 < (enemysNumber - 1)) {
if ((!enemys[_local2].isTested) and (enemys[_local2]._x > 0)) {
_local3 = _local2 + 1;
while (_local3 < enemysNumber) {
if (enemys[_local3]._x > 0) {
if (Math.sqrt(Math.pow(enemys[_local3].nX - enemys[_local2].nX, 2) + Math.pow(enemys[_local3].nY - enemys[_local2].nY, 2)) <= (enemys[_local3].rad + enemys[_local2].rad)) {
if (enemys[_local3].speed <= enemys[_local2].speed) {
_local6 = enemys[_local2].m + enemys[_local3].m;
_local8 = (((2 * enemys[_local3].m) * enemys[_local3].yS) + ((enemys[_local2].m - enemys[_local3].m) * enemys[_local2].yS)) / _local6;
_local7 = (((2 * enemys[_local3].m) * enemys[_local3].xS) + ((enemys[_local2].m - enemys[_local3].m) * enemys[_local2].xS)) / _local6;
if (enemys[_local3].Kind != "contour") {
enemys[_local3].yS = (((2 * enemys[_local2].m) * enemys[_local2].yS) + ((enemys[_local3].m - enemys[_local2].m) * enemys[_local3].yS)) / _local6;
enemys[_local3].xS = (((2 * enemys[_local2].m) * enemys[_local2].xS) + ((enemys[_local3].m - enemys[_local2].m) * enemys[_local3].xS)) / _local6;
_local5 = (_parent.myStatistic.level * _parent.speedK) + enemys[_local3].speed;
_local4 = Math.sqrt(Math.pow(enemys[_local3].yS, 2) + Math.pow(enemys[_local3].xS, 2));
enemys[_local3].yS = _local5 * (enemys[_local3].yS / _local4);
enemys[_local3].xS = _local5 * (enemys[_local3].xS / _local4);
}
if (enemys[_local2].Kind != "contour") {
enemys[_local2].yS = _local8;
enemys[_local2].xS = _local7;
_local5 = (_parent.myStatistic.level * _parent.speedK) + enemys[_local2].speed;
_local4 = Math.sqrt(Math.pow(enemys[_local2].yS, 2) + Math.pow(enemys[_local2].xS, 2));
enemys[_local2].yS = _local5 * (enemys[_local2].yS / _local4);
enemys[_local2].xS = _local5 * (enemys[_local2].xS / _local4);
}
enemys[_local3].isTested = true;
}
}
}
_local3++;
}
} else {
enemys[_local2].isTested = false;
}
if (enemys[_local2].hitTest(myPaxon)) {
if (isGhostEater) {
_parent.myStatistic.AddScore(enemys[_local2].point);
_parent.PutRandom(enemys[_local2], enemys[_local2].Kind);
} else {
PaxonDie();
}
}
_local2++;
}
if (enemys[enemysNumber - 1].isTested) {
enemys[enemysNumber - 1].isTested = false;
}
if (enemys[enemysNumber - 1].hitTest(myPaxon)) {
if (isGhostEater) {
_parent.myStatistic.AddScore(enemys[enemysNumber - 1].point);
_parent.PutRandom(enemys[enemysNumber - 1], enemys[enemysNumber - 1].Kind);
} else {
PaxonDie();
}
}
}
function sortEnemyX(a, b) {
if (a.nX < b.nX) {
return(-1);
}
if (a.nX > b.nX) {
return(1);
}
return(0);
}
function Clear() {
var _local2;
myPaxon._y = _parent.NormalizePos(0, false, 0);
myPaxon._x = _parent.NormalizePos(0, true, 0);
myPaxon._rotation = 0;
_local2 = 0;
while (_local2 < enemysNumber) {
enemys[_local2].removeMovieClip();
_local2++;
}
enemysNumber = 0;
oldIsMive = false;
while (intervalID.length > 0) {
clearInterval(intervalID.shift());
}
if (isFast) {
paxSpeed = int(paxSpeed / 2);
isFast = false;
}
if (isSlow) {
isSlow = false;
}
if (isFreez) {
isFreez = false;
}
if (isGhostEater) {
isGhostEater = false;
}
}
function normalizeEnemyPozition() {
var _local2;
var _local3;
do {
_local3 = false;
_local2 = 0;
while (_local2 < enemysNumber) {
if (enemys[_local2].hitTest(myPaxon)) {
_parent.PutRandom(enemys[_local2], enemys[_local2].Kind);
_local3 = true;
}
_local2++;
}
} while (_local3);
}
function SetPax() {
attachMovie("Paxon", "myPaxon", getNextHighestDepth());
myPaxon._width = paxW;
myPaxon._height = paxH;
myPaxon._x = 0;
myPaxon._y = 0;
}
function PaxonDie() {
var _local4;
myPaxon.attachMovie("Pacman_end", "myPaxonEnd", getNextHighestDepth());
_local4 = myPaxon._rotation;
myPaxon.myPacman._alpha = 0;
myPaxon._rotation = 0;
myPaxon.myPaxonEnd._rotation = _local4 + 90;
myPaxon.myPaxonEnd.gotoAndPlay(1);
moveSound.stop();
var _local3 = new Sound();
_local3.attachSound("deathwav");
if (_root.myGame.soundOn) {
_local3.start();
}
_parent.SetPause();
}
function PaxonDieComplete() {
_root.myGame.myWorld.myLive.myPaxon.myPaxonEnd.removeMovieClip();
_root.myGame.myWorld.myLive.myPaxon.myPacman._alpha = 100;
_root.myGame.myWorld.DelLive();
_root.myGame.myWorld.myLive.ReSetPaxon();
}
function ReSetPaxon() {
myPaxon._y = _parent.NormalizePos(0, false, 0);
myPaxon._x = _parent.NormalizePos(0, true, 0);
myPaxon._rotation = 0;
_parent.myFild.EraseLine();
normalizeEnemyPozition();
_parent.SetPlay();
}
function SetPaxSpeed(s) {
paxSpeed = s;
}
function SetPaxDimension(w, h) {
paxH = h;
paxW = w;
myPaxon._width = paxW;
myPaxon._height = paxH;
}
function SetPaxCondition(c) {
paxCondition = c;
}
function SetEnemy(k) {
var _local4;
var _local3;
enemys[enemysNumber] = attachMovie("Enemy", "myEnemy" + enemysNumber, getNextHighestDepth());
enemys[enemysNumber].SetKind(k);
_parent.PutRandom(enemys[enemysNumber], k);
enemysNumber++;
}
function SetEnemySpeed(s, m, p, k) {
switch (k) {
case "ordinary" :
eOrdinarS = s;
eOrdinarM = m;
eOrdinarP = p;
break;
case "rear" :
eRearS = s;
eRearM = m;
eRearP = p;
break;
case "great" :
eGreatS = s;
eGreatM = m;
eGreatP = p;
break;
case "contour" :
eContourS = s;
eContourM = m;
eContourP = p;
}
ReSetEnemy(k, false);
}
function SetEnemyDimension(w, h, k) {
switch (k) {
case "ordinary" :
eOrdinarW = w;
eOrdinarH = h;
break;
case "rear" :
eRearW = w;
eRearH = h;
break;
case "great" :
eGreatW = w;
eGreatH = h;
break;
case "contour" :
eContourW = w;
eContourH = h;
}
ReSetEnemy(k, false);
}
function ReSetEnemy(k, all) {
var _local2;
var _local4;
_local2 = 0;
while (_local2 < enemysNumber) {
if (all) {
enemys[_local2].SetKind(k);
} else {
_local4 = enemys[_local2].GetKind();
if (_local4 == k) {
enemys[_local2].SetKind(k);
}
}
_local2++;
}
}
function GetEnemys() {
return(enemys);
}
var intervalID = new Array();
var enemys = new Array();
}
Symbol 268 MovieClip [__Packages.Paxon] Frame 0
class Paxon extends MovieClip
{
function Paxon () {
super();
}
}
Symbol 269 MovieClip [__Packages.World] Frame 0
class World extends MovieClip
{
var attachMovie, getNextHighestDepth, myListener, myFild, myLive, myStatistic, interval, bLevel, myCompliteLevel, EndLevel, BeginLevel, _parent, myBeginLevel, StopScreen, prevPres, isPaused, myGameOver;
function World () {
super();
attachMovie("Fild", "myFild", getNextHighestDepth());
attachMovie("Live", "myLive", getNextHighestDepth());
attachMovie("Statistic", "myStatistic", getNextHighestDepth());
myListener = new Object();
myListener.onKeyDown = PressKey;
Key.addListener(myListener);
}
function BornWorld() {
myFild.BuildFild();
myLive.slowFast = 2;
myLive.SetPax();
AddLive();
AddLive();
AddLive();
myStatistic._x = 0;
myStatistic._y = -25;
setInterval(this, "Heart", interval);
}
function BeginGame() {
LoadLevel(bLevel - 1);
}
function PressKey() {
_root.myGame.myWorld.StartLevel();
_root.myGame.myWorld.CompleteLevel();
}
function StepLevel(p) {
attachMovie("CompliteLevel", "myCompliteLevel", getNextHighestDepth());
var _local3 = new Sound();
_local3.attachSound("vinvaw");
if (_root.myGame.soundOn) {
_local3.start();
}
myCompliteLevel.useHandCursor = false;
myCompliteLevel.progres = p;
myCompliteLevel._x = 275;
myCompliteLevel._y = 170;
myCompliteLevel.onPress = function () {
this._parent.CompleteLevel();
};
myCompliteLevel.onKeyDown = function () {
this._parent.CompleteLevel();
};
_local3 = new Sound();
_local3.attachSound("proigr_nachalowav");
_local3.start();
intervalID[intervalID.length] = setInterval(this, "AllowEndLevel", 1000, intervalID.length);
SetPause();
}
function AllowEndLevel(iID) {
EndLevel = true;
clearInterval(intervalID[iID]);
}
function AddLevel(n, dat) {
levels[n] = new Level(dat);
}
function LoadLevel(n) {
var _local3;
ClearGame();
myStatistic.SetNewLevel(n, levels[n].progresNeeded, levels[n].point);
_local3 = 0;
while (_local3 < levels[n].e1) {
myLive.SetEnemy("ordinary");
_local3++;
}
_local3 = 0;
while (_local3 < levels[n].e2) {
myLive.SetEnemy("contour");
_local3++;
}
_local3 = 0;
while (_local3 < levels[n].e3) {
myLive.SetEnemy("rear");
_local3++;
}
_local3 = 0;
while (_local3 < levels[n].e4) {
myLive.SetEnemy("great");
_local3++;
}
myLive.normalizeEnemyPozition();
myLive.myPaxon.myPacman._alpha = 100;
BeginLevel = true;
_parent.gameSound.stop();
attachMovie("BeginLevel", "myBeginLevel", getNextHighestDepth());
var _local5 = new Sound();
_local5.attachSound("proigr_nachalowav");
if (_root.myGame.soundOn) {
if (n < 1) {
_local5.start();
}
}
myBeginLevel.useHandCursor = false;
myBeginLevel.onPress = function () {
this._parent.StartLevel();
};
n++;
myBeginLevel.level = ((n < 10) ? ("0" + n) : (n));
myBeginLevel._x = 275;
myBeginLevel._y = 170;
SetPause();
}
function StartLevel() {
if (BeginLevel) {
_parent.gameSound.play(0, 999999);
myBeginLevel.removeMovieClip();
BeginLevel = false;
SetPlay();
}
}
function CompleteLevel() {
if (EndLevel) {
myCompliteLevel.removeMovieClip();
EndLevel = false;
AddLive();
if (myStatistic.level < 21) {
LoadLevel(myStatistic.level + 1);
} else {
LoadLevel(1);
}
SetPlay();
}
}
function ClearGame() {
while (intervalID.length > 0) {
clearInterval(intervalID.shift());
}
myFild.Clear();
myLive.Clear();
}
function Heart() {
var _local2;
_local2 = _parent.GetPressed();
if (((!StopScreen) and (!BeginLevel)) and (!EndLevel)) {
if ((_local2 == "pause") and (prevPres != "pause")) {
isPaused = !isPaused;
} else if ((!isPaused) and (_local2 != "pause")) {
myLive.Heart(((_local2 == "mouseLeft") ? "nothing" : (_local2)));
myFild.Heart();
}
}
prevPres = _local2;
}
function NormalizePos(pos, hor, rot) {
return(myFild.NormalizePos(pos, hor, rot));
}
function limitPos(pos, hor) {
return(myFild.limitPos(pos, hor));
}
function DrawLine(bPos, ePos, nPos, hor) {
myFild.DrawLine(bPos, ePos, nPos, hor);
}
function PutRandom(m, w) {
myFild.PutRandom(m, w);
}
function BoomTest(e) {
myFild.BoomTest(e);
}
function GameOver() {
StopScreen = true;
_parent.gameSound.stop();
attachMovie("GameOver", "myGameOver", getNextHighestDepth());
myGameOver._x = 0;
myGameOver._y = -25;
}
function NewContinue() {
StopScreen = false;
myGameOver.removeMovieClip();
AddLive();
AddLive();
AddLive();
AddLive();
myStatistic.score = 0;
LoadLevel(myStatistic.level);
}
function AddBonus(c) {
myFild.AddBonus(c);
}
function AddProgres(n) {
myStatistic.AddProgres(n);
}
function DelProgres() {
myStatistic.DelProgres();
}
function AddLive() {
myStatistic.AddLive();
}
function DelLive() {
myStatistic.DelLive();
}
function SetPlay() {
if (!StopScreen) {
isPaused = false;
}
}
function SetPause() {
if (!StopScreen) {
isPaused = true;
}
}
function SetCellDimension(w, h) {
myFild.SetCellDimension(w, h);
}
function SetFildDimension(w, h) {
myFild.SetFildDimension(w, h);
}
function SetPaxSpeed(s) {
myLive.SetPaxSpeed(s);
}
function SetPaxDimension(w, h) {
myLive.SetPaxDimension(w, h);
}
function SetPaxCondition(c) {
myLive.SetPaxCondition(c);
}
function SetEnemySpeed(s, m, p, k) {
myLive.SetEnemySpeed(int(s), int(m), int(p), k);
}
function SetEnemyDimension(w, h, k) {
myLive.SetEnemyDimension(w, h, k);
}
function SetFullFild(s) {
myStatistic.SetFullFild(s);
}
function GetCellCondition(c, r) {
return(myFild.GetCellCondition(c, r));
}
function GetEnemys() {
return(myLive.GetEnemys());
}
var levels = new Array();
var intervalID = new Array();
}
Symbol 270 MovieClip [__Packages.Fild] Frame 0
class Fild extends MovieClip
{
var fildWidth, cellWidth2, columns, cellWidth, fildHeigth, cellHeigth2, rows, cellHeigth, cellNumber, myCell, getNextHighestDepth, burned, cB, _parent, cPaxX, cPaxY, cellFilled, lineSpeed, attachMovie;
function Fild () {
super();
}
function BuildFild() {
var _local3;
var _local2;
var _local4;
fildWidth = (cellWidth * columns) - cellWidth2;
fildHeigth = (cellHeigth * rows) - cellHeigth2;
SetCell();
_local3 = 0;
_local2 = 0;
_local4 = 0;
while (_local3 < cellNumber) {
if (_local2 == columns) {
_local2 = 0;
_local4++;
}
cellArray[_local3] = myCell.duplicateMovieClip((("c_" + _local2) + "_") + _local4, getNextHighestDepth());
cellArray[_local3].SetDimension(cellWidth, cellHeigth, _local2, _local4);
cellArray[_local3].SetIon(0);
if ((((_local2 == 0) or (_local2 == (columns - 1))) or (_local4 == 0)) or (_local4 == (rows - 1))) {
cellArray[_local3].SetCondition("border");
} else {
cellArray[_local3].SetCondition("free");
}
_local3++;
_local2++;
}
myCell._visible = false;
burned = false;
cB = 0;
}
function Clear() {
var _local2;
var _local3;
_local2 = 0;
while (_local2 < cellNumber) {
if (cellArray[_local2].GetCondition() != "border") {
cellArray[_local2].SetCondition("free");
cellArray[_local2].SetIon(0);
cellArray[_local2].lineDir = "";
}
_local2++;
}
while (intervalID.length > 0) {
clearInterval(intervalID.shift());
}
_local3 = bonuses.length;
_local2 = 0;
while (_local2 < _local3) {
bonuses[_local2].removeMovieClip();
_local2++;
}
}
function NormalizePos(pos, hor, rot) {
var _local2;
if (hor) {
_local2 = pos % cellWidth;
pos = pos - (_local2 - cellWidth2);
} else {
_local2 = pos % cellHeigth;
pos = pos - (_local2 - cellHeigth2);
}
return(pos);
}
function limitPos(pos, hor) {
if (hor) {
pos = ((pos < cellWidth2) ? (cellWidth2) : (((pos > fildWidth) ? (fildWidth) : (pos))));
} else {
pos = ((pos < cellHeigth2) ? (cellHeigth2) : (((pos > fildHeigth) ? (fildHeigth) : (pos))));
}
return(pos);
}
function DrawLine(bPos, ePos, nPos, hor) {
var _local3;
var _local5;
var _local6;
var _local4;
var _local10;
var _local8;
var _local7;
var _local14;
var _local16;
var _local9;
_local9 = false;
if (hor) {
_local5 = int(ePos / cellWidth);
_local6 = int(bPos / cellWidth);
if (_local6 != _local5) {
_local4 = int(nPos / cellHeigth);
_local8 = this[(("c_" + _local5) + "_") + _local4].GetCondition();
_local7 = this[(("c_" + _local6) + "_") + _local4].GetCondition();
switch (_local8) {
case "line" :
EraseLine();
PaxonDie();
break;
case "wall" :
case "border" :
if (_local7 == "free") {
_local9 = true;
}
default :
if (_local7 != "free") {
break;
}
if (bPos > ePos) {
_local10 = _local5;
_local5 = _local6 + 1;
_local6 = _local10 + 1;
}
_local3 = _local6;
for(;;){
if (_local3 >= _local5) {
break;
}
this[(("c_" + _local3) + "_") + _local4].SetCondition("line");
this[(("c_" + _local3) + "_") + _local4].lineDir = "hor";
_local3++;
};
}
}
} else {
_local5 = int(nPos / cellHeigth);
_local6 = int(bPos / cellHeigth);
if (_local6 != _local5) {
_local4 = int(ePos / cellWidth);
_local8 = this[(("c_" + _local4) + "_") + _local5].GetCondition();
_local7 = this[(("c_" + _local4) + "_") + _local6].GetCondition();
switch (_local8) {
case "line" :
EraseLine();
PaxonDie();
break;
case "wall" :
case "border" :
if (_local7 == "free") {
_local9 = true;
}
default :
if (_local7 != "free") {
break;
}
if (bPos > nPos) {
_local10 = _local5;
_local5 = _local6 + 1;
_local6 = _local10 + 1;
}
_local3 = _local6;
for(;;){
if (_local3 >= _local5) {
break;
}
this[(("c_" + _local4) + "_") + _local3].SetCondition("line");
this[(("c_" + _local4) + "_") + _local3].lineDir = "vert";
_local3++;
};
}
}
}
if ((_local8 == "free") and (_local7 != "free")) {
if (_root.myGame.soundOn) {
_parent.myLive.moveSound.start(0, 999999);
}
}
if (_local9) {
_parent.myLive.moveSound.stop();
Fill();
} else {
cPaxX = int(ePos / cellWidth);
cPaxY = int(nPos / cellHeigth);
}
}
function Fill() {
var _local7;
var _local6;
var _local3;
var _local4;
var _local10;
var _local5 = new Array();
var _local8 = new Array();
var _local9 = new Sound();
_local9.attachSound("zalivkawav");
if (_root.myGame.soundOn) {
_local9.start();
}
_local4 = 1;
_local7 = 0;
while (_local7 < rows) {
_local6 = 0;
while (_local6 < columns) {
if ((this[(("c_" + _local6) + "_") + _local7].condition == "free") and (this[(("c_" + _local6) + "_") + _local7].ion == 0)) {
_local8[_local4] = true;
Fill1(_local6, _local7, _local4);
_local4++;
}
_local6++;
}
_local7++;
}
_local6 = 0;
_local7 = 0;
_local5 = _parent.GetEnemys();
_local3 = 0;
while ((_local3 < _local5.length) and ((_local6 + _local7) < 2)) {
if (_local5.Kind != "rear") {
if ((_local5.Kind == "contour") and (this[(("c_" + int(_local5[_local3]._x / cellWidth)) + "_") + int(_local5[_local3]._y / cellHeigth)].GetCondition() != "free")) {
if (_local5.xS > 0) {
_local4 = this[(("c_" + int(_local5[_local3]._x / cellWidth)) + "_") + int((_local5[_local3]._y + 10) / cellHeigth)].ion;
if (_local4 != 0) {
_local8[_local4] = false;
}
_local4 = this[(("c_" + int(_local5[_local3]._x / cellWidth)) + "_") + int((_local5[_local3]._y - 10) / cellHeigth)].ion;
if (_local4 != 0) {
_local8[_local4] = false;
}
} else {
_local4 = this[(("c_" + int((_local5[_local3]._x + 10) / cellWidth)) + "_") + int(_local5[_local3]._y / cellHeigth)].ion;
if (_local4 != 0) {
_local8[_local4] = false;
}
_local4 = this[(("c_" + int((_local5[_local3]._x - 10) / cellWidth)) + "_") + int(_local5[_local3]._y / cellHeigth)].ion;
if (_local4 != 0) {
_local8[_local4] = false;
}
}
} else {
_local4 = this[(("c_" + int(_local5[_local3]._x / cellWidth)) + "_") + int(_local5[_local3]._y / cellHeigth)].ion;
if (_local4 != 0) {
_local8[_local4] = false;
}
}
}
_local3++;
}
cellFilled = 0;
_local3 = 0;
while (_local3 < cellNumber) {
if (_local8[cellArray[_local3].ion]) {
if (cellArray[_local3].GetCondition() == "free") {
cellArray[_local3].SetCondition("wall");
cellFilled++;
}
}
if (cellArray[_local3].GetCondition() == "line") {
cellArray[_local3].SetCondition("wall");
cellFilled++;
}
cellArray[_local3].SetIon(0);
cellArray[_local3].lineDir = "";
_local3++;
}
_parent.AddProgres(cellFilled);
Extinguish();
}
function Fill1(xZ, yZ, ion) {
var _local4;
var _local10 = new Array();
var _local9 = new Array();
var _local12;
var _local6;
var _local8;
var _local11;
var _local7;
_local4 = 1;
_local10[_local4] = xZ;
_local9[_local4] = yZ;
while (_local4 != 0) {
xZ = _local10[_local4];
yZ = _local9[_local4];
_local4 = _local4 - 1;
this[(("c_" + xZ) + "_") + yZ].ion = ion;
_local12 = xZ;
while (this[(("c_" + xZ) + "_") + yZ].condition == "free") {
this[(("c_" + xZ) + "_") + yZ].ion = ion;
xZ++;
}
_local6 = xZ - 1;
xZ = _local12;
while (this[(("c_" + xZ) + "_") + yZ].condition == "free") {
this[(("c_" + xZ) + "_") + yZ].ion = ion;
xZ--;
}
_local11 = xZ + 1;
_local8 = 1;
do {
yZ = yZ + _local8;
xZ = _local11;
while (xZ <= _local6) {
_local7 = false;
while (((this[(("c_" + xZ) + "_") + yZ].condition == "free") and (this[(("c_" + xZ) + "_") + yZ].ion != ion)) and (xZ <= _local6)) {
_local7 = true;
xZ++;
}
if (_local7) {
_local4++;
_local10[_local4] = xZ - 1;
_local9[_local4] = yZ;
}
do {
xZ++;
} while (((this[(("c_" + xZ) + "_") + yZ].condition != "free") or (this[(("c_" + xZ) + "_") + yZ].ion == ion)) and (xZ <= _local6));
}
_local8 = _local8 - 3;
} while (_local8 >= -2);
}
}
function EraseLine() {
var _local2;
_local2 = 0;
while (_local2 < cellNumber) {
cellArray[_local2].EraseLine();
cellArray[_local2].SetIon(0);
_local2++;
}
Extinguish();
}
function NormalizeCountor(m) {
var _local4;
var _local5;
var _local2;
var _local3;
_local4 = int(m._x / cellWidth);
_local5 = int(m._y / cellHeigth);
_local3 = 0;
while (true) {
_local2 = _local4 - _local3;
while (_local2 <= (_local4 + _local3)) {
if (this[(("c_" + _local2) + "_") + (_local5 + _local3)].GetCondition() != "free") {
m._x = ((_local2 > _local4) ? (_local2 * cellWidth) : ((_local2 * cellWidth) + cellWidth));
m._y = (_local5 + _local3) * cellHeigth;
return(undefined);
}
_local2++;
}
_local2 = _local4 - _local3;
while (_local2 <= (_local4 + _local3)) {
if (this[(("c_" + _local2) + "_") + (_local5 - _local3)].GetCondition() != "free") {
m._x = ((_local2 > _local4) ? (_local2 * cellWidth) : ((_local2 * cellWidth) + cellWidth));
m._y = ((_local5 - _local3) * cellHeigth) + cellHeigth;
return(undefined);
}
_local2++;
}
_local2 = (_local5 - _local3) + 1;
while (_local2 < (_local5 + _local3)) {
if (this[(("c_" + (_local4 + _local3)) + "_") + _local2].GetCondition() != "free") {
m._x = (_local4 + _local3) * cellWidth;
m._y = ((_local2 > _local5) ? (_local2 * cellHeigth) : ((_local2 * cellHeigth) + cellHeigth));
return(undefined);
}
_local2++;
}
_local2 = (_local5 - _local3) + 1;
while (_local2 < (_local5 + _local3)) {
if (this[(("c_" + (_local4 - _local3)) + "_") + _local2].GetCondition() != "free") {
m._x = ((_local4 - _local3) * cellWidth) + cellWidth;
m._y = ((_local2 > _local5) ? (_local2 * cellHeigth) : ((_local2 * cellHeigth) + cellHeigth));
return(undefined);
}
_local2++;
}
if (_local3 < 16) {
_local3++;
continue;
}
return(undefined);
}
}
function PutRandom(m, w) {
var _local2;
var _local3;
var _local4;
switch (w) {
case "contour" :
do {
_local2 = random(columns);
_local3 = random(rows);
} while (this[(("c_" + _local2) + "_") + _local3].GetCondition() != "free");
m._x = (_local2 * cellWidth) + cellWidth2;
m._y = (_local3 * cellHeigth) + cellHeigth2;
NormalizeCountor(m);
break;
case "great" :
case "ordinary" :
do {
_local2 = random(columns);
_local3 = random(rows);
} while (this[(("c_" + _local2) + "_") + _local3].GetCondition() != "free");
m._x = (_local2 * cellWidth) + cellWidth2;
m._y = (_local3 * cellHeigth) + cellHeigth2;
break;
case "rear" :
_local4 = 0;
do {
_local4++;
_local2 = random(columns);
_local3 = random(rows);
} while ((this[(("c_" + _local2) + "_") + _local3].GetCondition() != "wall") and (_local4 < 15));
if (_local4 < 15) {
m._x = (_local2 * cellWidth) + cellWidth2;
m._y = (_local3 * cellHeigth) + cellHeigth2;
} else {
m._x = -100;
m._y = -100;
intervalID[intervalID.length] = setInterval(this, "PutReareAgain", 5000, m, intervalID.length);
}
}
}
function PutReareAgain(m, iID) {
var _local2;
var _local3;
var _local4;
if (!_parent.isPaused) {
_local2 = 0;
do {
_local2++;
_local3 = random(columns);
_local4 = random(rows);
} while ((this[(("c_" + _local3) + "_") + _local4].GetCondition() != "wall") and (_local2 < 15));
if (_local2 < 15) {
m._x = (_local3 * cellWidth) + cellWidth2;
m._y = (_local4 * cellHeigth) + cellHeigth2;
clearInterval(intervalID[iID]);
}
}
}
function BoomBonuses(e) {
var _local2;
var _local3;
_local3 = bonuses.length;
_local2 = 0;
while (_local2 < _local3) {
if (e.hitTest(bonuses[_local2])) {
bonuses[_local2]._x = -100;
}
_local2++;
}
}
function PaxonBonuses(e) {
var _local2;
var _local3;
_local3 = bonuses.length;
_local2 = 0;
while (_local2 < _local3) {
if (e.hitTest(bonuses[_local2])) {
bonuses[_local2]._x = -100;
return(bonuses[_local2].condtion);
}
_local2++;
}
}
function RotateContour(e) {
var _local3;
var _local4;
if (Math.abs(e.yS) > 0) {
_local4 = int(e.nY / cellHeigth);
if ((this[(("c_" + int((e.nX + 5) / cellWidth)) + "_") + _local4].condition != "free") and (this[(("c_" + int((e.nX - 5) / cellWidth)) + "_") + _local4].condition != "free")) {
e.xS = Math.abs(e.yS);
if (this[(("c_" + int((e._x - 5) / cellWidth)) + "_") + int(e._y / cellHeigth)].condition == "free") {
e.xS = -e.xS;
}
e.yS = 0;
e.nX = int(e._x / cellWidth) * cellWidth;
e.isAllowGo = false;
} else if ((this[(("c_" + int((e.nX + 5) / cellWidth)) + "_") + _local4].condition == "free") and (this[(("c_" + int((e.nX - 5) / cellWidth)) + "_") + _local4].condition == "free")) {
e.xS = Math.abs(e.yS);
if (this[(("c_" + int((e._x - 5) / cellWidth)) + "_") + int(e._y / cellHeigth)].condition != "free") {
e.xS = -e.xS;
}
e.yS = 0;
e.nX = int(e._x / cellWidth) * cellWidth;
e.isAllowGo = false;
}
} else {
_local3 = int(e.nX / cellWidth);
if ((this[(("c_" + _local3) + "_") + int((e.nY + 5) / cellHeigth)].condition != "free") and (this[(("c_" + _local3) + "_") + int((e.nY - 5) / cellHeigth)].condition != "free")) {
e.yS = Math.abs(e.xS);
if (this[(("c_" + int(e._x / cellWidth)) + "_") + int((e._y - 5) / cellHeigth)].condition == "free") {
e.yS = -e.yS;
}
e.xS = 0;
e.nY = int(e._y / cellHeigth) * cellHeigth;
e.isAllowGo = false;
} else if ((this[(("c_" + _local3) + "_") + int((e.nY + 5) / cellHeigth)].condition == "free") and (this[(("c_" + _local3) + "_") + int((e.nY - 5) / cellHeigth)].condition == "free")) {
e.yS = Math.abs(e.xS);
if (this[(("c_" + int(e._x / cellWidth)) + "_") + int((e._y - 5) / cellHeigth)].condition != "free") {
e.yS = -e.yS;
}
e.xS = 0;
e.nY = int(e._y / cellHeigth) * cellHeigth;
e.isAllowGo = false;
}
}
}
function BoomTest(e) {
var _local7;
var _local8;
var _local5;
var _local4;
var _local6;
var _local3;
BoomBonuses(e);
if (e.Kind == "contour") {
RotateContour(e);
} else {
_local5 = int(e.nX / cellWidth);
_local4 = int(e.nY / cellHeigth);
_local6 = true;
_local3 = 0;
_local3 = CheckBoom(_local5, _local4, e);
if (_local3 > 0) {
e.yS = -e.yS;
e.xS = -e.xS;
e.nX = e._x + e.xS;
e.nY = e._y + e.yS;
} else {
_local3 = CheckBoom(_local5 - 1, _local4, e);
if (_local3 > 0) {
e.nX = e.nX + (_local3 * 2);
e.nY = e._y + e.yS;
e.xS = -e.xS;
} else {
_local3 = CheckBoom(_local5 + 1, _local4, e);
if (_local3 > 0) {
e.nX = e.nX - (_local3 * 2);
e.nY = e._y + e.yS;
e.xS = -e.xS;
_local6 = false;
} else {
_local3 = CheckBoom(_local5, _local4 - 1, e);
if (_local3 > 0) {
e.nY = e.nY + (_local3 * 2);
e.nX = e._x + e.xS;
e.yS = -e.yS;
} else {
_local3 = CheckBoom(_local5, _local4 + 1, e);
if (_local3 > 0) {
e.nY = e.nY - (_local3 * 2);
e.nX = e._x + e.xS;
e.yS = -e.yS;
} else {
_local3 = CheckBoom(_local5 - 1, _local4 - 1, e);
if (_local3 > 0) {
e.yS = -e.yS;
e.xS = -e.xS;
} else {
_local3 = CheckBoom(_local5 - 1, _local4 + 1, e);
if (_local3 > 0) {
e.yS = -e.yS;
e.xS = -e.xS;
} else {
_local3 = CheckBoom(_local5 + 1, _local4 + 1, e);
if (_local3 > 0) {
e.yS = -e.yS;
e.xS = -e.xS;
} else {
_local3 = CheckBoom(_local5 + 1, _local4 + 1, e);
if (_local3 > 0) {
e.yS = -e.yS;
e.xS = -e.xS;
}
}
}
}
}
}
}
}
}
}
if (!_local6) {
e.isAllowGo = false;
}
}
function CheckBoom(c, r, e) {
var _local2;
_local2 = FastCRIntersectionCheckingDif(c, r, e);
if (_local2 > 0) {
this[(("c_" + c) + "_") + r].SetCondition("lineBurn");
if (e.Kind == "great") {
this[(("c_" + c) + "_") + r].BigBoom();
}
e.isAllowGo = false;
}
return(_local2);
}
function FastCRIntersectionCheckingDif(ccX, ccY, C) {
var _local6;
var _local4;
var _local5;
var _local2;
var _local7;
if (ccX < 0) {
_local6 = 0;
_local4 = -cellWidth;
_local5 = this["c_0_" + ccY].maxY;
_local2 = this["c_0_" + ccY].minY;
} else if (ccX > (columns - 1)) {
_local4 = columns * cellWidth;
_local6 = _local4 + cellWidth;
_local5 = this["c_0_" + ccY].maxY;
_local2 = this["c_0_" + ccY].minY;
} else if (ccY < 0) {
_local6 = this[(("c_" + ccX) + "_") + 0].maxX;
_local4 = this[(("c_" + ccX) + "_") + 0].minX;
_local5 = 0;
_local2 = -cellHeigth;
} else if (ccY > (rows - 1)) {
_local6 = this[(("c_" + ccX) + "_") + 0].maxX;
_local4 = this[(("c_" + ccX) + "_") + 0].minX;
_local2 = cellHeigth * rows;
_local5 = _local2 + cellHeigth;
} else {
_local7 = this[(("c_" + ccX) + "_") + ccY];
switch (C.GetKind()) {
case "contour" :
case "great" :
case "ordinary" :
if (_local7.condition == "free") {
return(0);
}
break;
case "rear" :
if (!((_local7.condition == "wall") or (_local7.condition == "border"))) {
break;
}
return(0);
}
_local6 = _local7.maxX;
_local4 = _local7.minX;
_local5 = _local7.maxY;
_local2 = _local7.minY;
}
_local6 = _local6 - C.nX;
_local5 = _local5 - C.nY;
_local4 = _local4 - C.nX;
_local2 = _local2 - C.nY;
if (_local6 < 0) {
if (_local5 < 0) {
return(C.rad2 - ((_local6 * _local6) + (_local5 * _local5)));
}
if (_local2 > 0) {
return(C.rad2 - ((_local6 * _local6) + (_local2 * _local2)));
}
return(C.rad - Math.abs(_local6));
}
if (_local4 > 0) {
if (_local5 < 0) {
return(C.rad2 - (_local4 * _local4));
}
if (_local2 > 0) {
return(C.rad2 - (((_local4 * _local4) + _local2) + _local2));
}
return(C.rad - _local4);
}
if (_local5 < 0) {
return(C.rad - Math.abs(_local5));
}
if (_local2 > 0) {
return(C.rad - _local2);
}
return(C.rad);
}
function Extinguish() {
while (burnArray.length > 0) {
burnArray.shift();
}
burned = false;
cB = 0;
}
function BurnNext(xB, yB) {
if (this[(("c_" + xB) + "_") + yB].lineDir == "hor") {
if ((((xB - 1) == cPaxX) and (yB == cPaxY)) or (((xB + 1) == cPaxX) and (yB == cPaxY))) {
PaxonDie();
return(false);
}
if (this[(("c_" + (xB - 1)) + "_") + yB].condition == "line") {
this[(("c_" + (xB - 1)) + "_") + yB].SetCondition("Burn");
burnArray.push(new CellVector(xB - 1, yB));
}
if (this[(("c_" + (xB + 1)) + "_") + yB].condition == "line") {
this[(("c_" + (xB + 1)) + "_") + yB].SetCondition("Burn");
burnArray.push(new CellVector(xB + 1, yB));
}
} else {
if (((xB == cPaxX) and ((yB - 1) == cPaxY)) or ((xB == cPaxX) and ((yB + 1) == cPaxY))) {
PaxonDie();
return(false);
}
if (this[(("c_" + xB) + "_") + (yB - 1)].condition == "line") {
this[(("c_" + xB) + "_") + (yB - 1)].SetCondition("Burn");
burnArray.push(new CellVector(xB, yB - 1));
}
if (this[(("c_" + xB) + "_") + (yB + 1)].condition == "line") {
this[(("c_" + xB) + "_") + (yB + 1)].SetCondition("Burn");
burnArray.push(new CellVector(xB, yB + 1));
}
}
return(true);
}
function Fire() {
cB = cB + lineSpeed;
if (cB > cellWidth) {
if (lineSpeed < cellWidth) {
cB = cB % cellWidth;
var _local4;
var _local3;
var _local2;
_local4 = burnArray.length;
_local3 = 0;
do {
_local3++;
_local2 = burnArray.shift();
} while (BurnNext(_local2.cX, _local2.cY) and (_local3 <= _local4));
}
}
}
function Heart() {
if (burned) {
Fire();
}
}
function AddBonus(c) {
var _local3;
var _local4;
_local3 = bonuses.length;
_local4 = false;
switch (c) {
case "freez" :
bonuses[_local3] = attachMovie("freez", "bonus" + _local3, getNextHighestDepth());
_local4 = true;
bonuses[_local3].condtion = "freez";
break;
case "ghostEater" :
bonuses[_local3] = attachMovie("ghostEater", "bonus" + _local3, getNextHighestDepth());
_local4 = true;
bonuses[_local3].condtion = "ghostEater";
break;
case "live" :
_parent.attachMovie("ExtraLife", "MyExtraLife", getNextHighestDepth());
_parent.MyExtraLife._x = 220;
_parent.MyExtraLife._y = 174;
var _local5 = new Sound();
_local5.attachSound("add_lifewav");
intervalID[intervalID.length] = setInterval(this, "AddLiveComplete", 500, intervalID.length);
if (_root.myGame.soundOn) {
_local5.start();
}
_parent.AddLive();
break;
case "slow" :
bonuses[_local3] = attachMovie("slow", "bonus" + _local3, getNextHighestDepth());
bonuses[_local3].condtion = "slow";
_local4 = true;
break;
case "fast" :
bonuses[_local3] = attachMovie("fast", "bonus" + _local3, getNextHighestDepth());
bonuses[_local3].condtion = "fast";
_local4 = true;
}
if (_local4) {
bonuses[_local3]._x = cellWidth + random(cellWidth * (columns - 2));
bonuses[_local3]._y = cellHeigth + random(cellHeigth * (rows - 2));
}
}
function AddLiveComplete(iID) {
_parent.MyExtraLife.removeMovieClip();
clearInterval(intervalID[iID]);
}
function PaxonDie() {
_parent.myLive.PaxonDie();
}
function SetCell() {
attachMovie("Cell", "myCell", getNextHighestDepth());
myCell._width = cellWidth;
myCell._height = cellHeigth;
}
function SetCellDimension(w, h) {
cellWidth = int(w);
cellHeigth = int(h);
cellWidth2 = cellWidth / 2;
cellHeigth2 = cellHeigth / 2;
}
function SetFildDimension(w, h) {
columns = int(w);
rows = int(h);
cellNumber = columns * rows;
_parent.SetFullFild(((cellNumber - (columns * 2)) - (rows * 2)) + 4);
}
function GetCellNumbers() {
return(cellNumber);
}
function GetCellCondition(c, r) {
return(this[(("c_" + int(c / cellWidth)) + "_") + int(r / cellHeigth)].GetCondition());
}
var cellArray = new Array();
var burnArray = new Array();
var intervalID = new Array();
var bonuses = new Array();
}
Symbol 271 MovieClip [__Packages.Enemy] Frame 0
class Enemy extends MovieClip
{
var isAllowGo, isTested, _parent, nX, xS, _x, nY, yS, _y, Kind, gotoAndStop, _width, _height, speed, m, point, rad, rad2;
function Enemy () {
super();
isAllowGo = true;
isTested = false;
}
function Heart() {
if (!_parent.isFreez) {
if (_parent.isSlow) {
nX = _x + (xS / _parent.slowFast);
nY = _y + (yS / _parent.slowFast);
} else {
nX = _x + xS;
nY = _y + yS;
}
}
}
function Go() {
var _local2;
if (!_parent.isFreez) {
if (isAllowGo) {
if (_parent.isSlow) {
_x = _x + (xS / _parent.slowFast);
_y = _y + (yS / _parent.slowFast);
} else {
_x = _x + xS;
_y = _y + yS;
}
} else {
_x = nX;
_y = nY;
if (_parent.isSlow) {
nX = _x + (xS / _parent.slowFast);
nY = _y + (yS / _parent.slowFast);
} else {
nX = _x + xS;
nY = _y + yS;
}
_parent._parent.BoomTest(this);
isAllowGo = true;
}
}
}
function SetKind(k) {
var _local2;
Kind = k;
switch (Kind) {
case "ordinary" :
(gotoAndStop(1));// not popped
_width = _parent.eOrdinarW;
_height = _parent.eOrdinarH;
speed = _parent.eOrdinarS;
m = _parent.eOrdinarM;
point = _parent.eOrdinarP;
break;
case "rear" :
(gotoAndStop(2));// not popped
_width = _parent.eRearW;
_height = _parent.eRearH;
speed = _parent.eRearS;
m = _parent.eRearM;
point = _parent.eRearP;
break;
case "great" :
(gotoAndStop(3));// not popped
_width = _parent.eGreatW;
_height = _parent.eGreatH;
speed = _parent.eGreatS;
m = _parent.eGreatM;
point = _parent.eGreatP;
break;
case "contour" :
_width = _parent.eContourW;
_height = _parent.eContourH;
speed = _parent.eContourS;
m = _parent.eContourM;
point = _parent.eContourP;
}
if (_width >= _height) {
(_width);// not popped
} else {
(_height);// not popped
}
gotoAndStop(4)[this] = "rad2";
rad = int(rad2 / 2);
_local2 = (_parent._parent.myStatistic.level * _parent._parent.speedK) + speed;
if (Kind == "contour") {
yS = 0;
xS = _local2;
} else {
yS = int(_local2) * -0.428182669496151;
xS = int(_local2) * -0.903692205091507;
}
if (random(2) == 1) {
yS = -yS;
}
if (random(2) == 1) {
xS = -xS;
}
}
function GetKind() {
return(Kind);
}
}
Symbol 272 MovieClip [__Packages.Cell] Frame 0
class Cell extends MovieClip
{
var condition, ion, _width, _height, _x, _y, minX, maxX, minY, maxY, lineDir, gotoAndStop, _parent;
function Cell () {
super();
}
function EraseLine() {
if ((condition == "line") or (condition == "lineBurn")) {
SetCondition("free");
}
}
function IsValid(i) {
if ((condition == "free") and (ion == 0)) {
ion = i;
return(true);
}
return(false);
}
function SetDimension(w, h, c, r) {
_width = w;
_height = h;
_x = w * c;
_y = h * r;
minX = _x;
maxX = minX + _width;
minY = _y;
maxY = minY + _height;
}
function SetCondition(c) {
switch (c) {
case "free" :
condition = c;
lineDir = "";
(gotoAndStop(1));// not popped
break;
case "wall" :
condition = c;
lineDir = "";
(gotoAndStop(2));// not popped
break;
case "border" :
condition = c;
(gotoAndStop(3));// not popped
break;
case "line" :
condition = "line";
(gotoAndStop(4));// not popped
break;
case "lineBurn" :
if (!_parent._parent.myLive.isGhostEater) {
if (condition == "line") {
var _local4 = new Sound();
_local4.attachSound("udar_wraga");
if (_root.myGame.soundOn) {
_local4.start();
}
condition = "lineBurn";
_parent.burnArray.push(new CellVector(int(_x / _width), int(_y / _height)));
_parent.burned = true;
(gotoAndStop(5));// not popped
}
}
break;
case "Burn" :
condition = "lineBurn";
(gotoAndStop(5));// not popped
}
}
function BigBoom() {
if (!_parent._parent.myLive.isGhostEater) {
if (condition == "wall") {
condition = "free";
lineDir = "";
(gotoAndStop(1));// not popped
_parent._parent.DelProgres();
}
}
}
function SetIon(i) {
ion = i;
}
function GetCondition() {
if (condition == "lineBurn") {
return("line");
}
return(condition);
}
function GetIon() {
return(ion);
}
}
Symbol 273 MovieClip [__Packages.CellVector] Frame 0
class CellVector extends MovieClip
{
var cX, cY;
function CellVector (lcX, lcY) {
super();
cX = lcX;
cY = lcY;
}
}
Symbol 274 MovieClip [__Packages.Statistic] Frame 0
class Statistic extends MovieClip
{
var lives, score, progres, fullFild, realProgres, progresNeeded, progresScore, maxProgres, level, bonusMod, bonusLiveMod, _parent, bonusStep, bonusSteplive;
function Statistic () {
super();
lives = 0;
score = 0;
progres = 0;
fullFild = 0;
realProgres = 0;
progresNeeded = 0;
progresScore = 0;
maxProgres = 0;
level = 1;
bonusMod = 0;
bonusLiveMod = 0;
}
function SetNewLevel(n, pn, ps) {
level = n;
maxProgres = 0;
realProgres = 0;
progres = 0;
progresNeeded = pn;
progresScore = ps;
}
function AddLive() {
if (lives < 99) {
lives++;
}
}
function DelLive() {
if (lives > 0) {
lives--;
} else {
_parent.GameOver();
}
}
function AddScore(s) {
var _local2;
var _local4;
var _local3;
if (score < 9999999) {
score = score + s;
bonusMod = bonusMod + s;
if (bonusMod >= bonusStep) {
bonusMod = bonusMod - bonusStep;
_local4 = random(100);
_local3 = 0;
_local2 = 0;
while (_local2 < bonuses.length) {
if (bonuses[_local2].condition != "live") {
_local3 = _local3 + bonuses[_local2].probability;
if (_local4 < _local3) {
_parent.AddBonus(bonuses[_local2].condition);
break;
}
}
_local2++;
}
}
bonusLiveMod = bonusLiveMod + s;
if (bonusLiveMod >= bonusSteplive) {
bonusLiveMod = bonusLiveMod - bonusSteplive;
_parent.AddBonus("live");
}
}
}
function BonusScore(s) {
var _local2;
_local2 = 0;
while (_local2 < bonuses.length) {
if (bonuses[_local2].condition == s) {
AddScore(bonuses[_local2].point);
break;
}
_local2++;
}
}
function ResetScore() {
score = 0;
bonusMod = 0;
bonusLiveMod = 0;
}
function AddProgres(n) {
var _local5;
var _local4;
var _local2;
if (realProgres < fullFild) {
realProgres = realProgres + n;
progres = int((100 / fullFild) * realProgres);
if (maxProgres < progres) {
AddScore((progres - maxProgres) * progresScore);
_local2 = maxProgres;
maxProgres = progres;
}
if (progres >= progresNeeded) {
_parent.StepLevel(progres);
}
}
}
function DelProgres() {
if (realProgres > 0) {
realProgres--;
progres = int((100 / fullFild) * realProgres);
}
}
function AddBonusKind(dat) {
bonuses[bonuses.length] = new Bonus(dat);
}
function SetFullFild(f) {
fullFild = f;
}
var bonuses = new Array();
}
Symbol 275 MovieClip [__Packages.Bonus] Frame 0
class Bonus extends MovieClip
{
var point, probability, condition;
function Bonus (dat) {
super();
point = int(dat.attributes.point);
probability = int(dat.attributes.probability);
condition = dat.attributes.namemc;
}
}
Symbol 276 MovieClip [__Packages.Timer] Frame 0
class Timer extends MovieClip
{
var my_date, bTime, itsTime;
function Timer () {
super();
}
function ReSet() {
my_date = new Date();
bTime = my_date.getTime();
}
function Heart() {
var _local3;
var _local2;
my_date = new Date();
_local3 = my_date.getTime();
_local3 = _local3 - bTime;
_local2 = int(_local3 / 1000);
itsTime = ((_local2 > 10) ? (String(_local2)) : ("0" + _local2));
_local3 = _local3 % 1000;
_local2 = int(_local3 / 60000);
itsTime = (((_local2 > 10) ? (String(_local2)) : ("0" + _local2)) + ":") + itsTime;
_local3 = _local3 % 60000;
_local2 = int(_local3 / 3600000);
itsTime = (((_local2 > 10) ? (String(_local2)) : ("0" + _local2)) + ":") + itsTime;
}
}
Symbol 277 MovieClip [__Packages.Level] Frame 0
class Level extends MovieClip
{
var progresNeeded, point;
function Level (cradle) {
super();
this.e1 = int(cradle.attributes.e1);
this.e2 = int(cradle.attributes.e2);
this.e3 = int(cradle.attributes.e3);
this.e4 = int(cradle.attributes.e4);
progresNeeded = int(cradle.attributes.progresNeeded);
point = int(cradle.attributes.point);
}
}
Symbol 278 MovieClip [__Packages.GameOver] Frame 0
class GameOver extends MovieClip
{
var bb;
function GameOver () {
super();
bb.onPress = function () {
this._parent._parent.NewContinue();
};
}
}
Symbol 279 MovieClip [__Packages.Game] Frame 0
class Game extends MovieClip
{
var attachMovie, getNextHighestDepth, myWorld, prop, soundOn, gameSound, isGame, myBeginScreen;
function Game () {
super();
attachMovie("World", "myWorld", getNextHighestDepth());
myWorld._visible = false;
_root.btn_sound.swapDepths(10000);
_root.btn_sound._visible = true;
myWorld._x = 3;
myWorld._y = 24;
}
function ReadProperties(cradle) {
var _local3;
var _local2;
prop = cradle;
_local3 = cradle.firstChild.childNodes[0];
myWorld.SetCellDimension(_local3.attributes.cellWidth, _local3.attributes.cellHeigth);
myWorld.SetFildDimension(_local3.attributes.columns, _local3.attributes.rows);
_local3 = cradle.firstChild.childNodes[1];
myWorld.SetPaxSpeed(_local3.attributes.speed);
myWorld.SetPaxDimension(_local3.attributes.mWidth, _local3.attributes.mHeight);
_local3 = cradle.firstChild.childNodes[2].childNodes[0];
myWorld.SetEnemySpeed(_local3.attributes.speed, _local3.attributes.mass, _local3.attributes.point, "ordinary");
myWorld.SetEnemyDimension(_local3.attributes.mWidth, _local3.attributes.mHeight, "ordinary");
_local3 = cradle.firstChild.childNodes[2].childNodes[1];
myWorld.SetEnemySpeed(_local3.attributes.speed, _local3.attributes.mass, _local3.attributes.point, "rear");
myWorld.SetEnemyDimension(_local3.attributes.mWidth, _local3.attributes.mHeight, "rear");
_local3 = cradle.firstChild.childNodes[2].childNodes[2];
myWorld.SetEnemySpeed(_local3.attributes.speed, _local3.attributes.mass, _local3.attributes.point, "great");
myWorld.SetEnemyDimension(_local3.attributes.mWidth, _local3.attributes.mHeight, "great");
_local3 = cradle.firstChild.childNodes[2].childNodes[3];
myWorld.SetEnemySpeed(_local3.attributes.speed, _local3.attributes.mass, _local3.attributes.point, "contour");
myWorld.SetEnemyDimension(_local3.attributes.mWidth, _local3.attributes.mHeight, "contour");
_local3 = cradle.firstChild.childNodes[3];
myWorld.myFild.lineSpeed = int(_local3.attributes.speed);
_local2 = 0;
while (_local2 < 21) {
myWorld.AddLevel(_local2, cradle.firstChild.childNodes[4].childNodes[_local2]);
_local2++;
}
_local3 = cradle.firstChild.childNodes[5];
myWorld.bLevel = int(_local3.attributes.number);
_local3 = cradle.firstChild.childNodes[6];
myWorld.speedK = Number(_local3.attributes.k);
_local3 = cradle.firstChild.childNodes[7];
myWorld.myLive.bonusTime = Number(_local3.attributes.bonusTime);
myWorld.myStatistic.bonusStep = Number(_local3.attributes.step);
myWorld.myStatistic.bonusSteplive = Number(_local3.attributes.steplive);
_local2 = 0;
while (_local2 < 5) {
myWorld.myStatistic.AddBonusKind(_local3.childNodes[_local2]);
_local2++;
}
_local3 = cradle.firstChild.childNodes[8];
myWorld.interval = int(_local3.attributes.v);
}
function StopSound() {
soundOn = false;
gameSound.stop();
}
function PlaySound() {
if (!soundOn) {
soundOn = true;
gameSound.start(0, 999999);
}
}
function BornGame() {
soundOn = false;
isGame = false;
myWorld.BornWorld();
gameSound = new Sound();
gameSound.attachSound("menu_x_1wav");
PlaySound();
}
function BeginGame() {
myBeginScreen._visible = false;
myWorld._visible = true;
isGame = true;
myWorld.BeginGame();
}
function stripWhitespaceDoublePass(XMLnode) {
var _local3 = 0;
while (_local3 < XMLnode.childNodes.length) {
if (XMLnode.childNodes[_local3].nodeType == 3) {
var _local2 = 0;
var _local5 = true;
_local2 = 0;
while (_local2 < XMLnode.childNodes[_local3].nodeValue.length) {
if (XMLnode.childNodes[_local3].nodeValue.charCodeAt(_local2) > 32) {
_local5 = false;
break;
}
_local2++;
}
if (_local5) {
XMLnode.childNodes[_local3].removeNode();
}
}
_local3++;
}
var _local6 = 0;
while (_local6 < XMLnode.childNodes.length) {
stripWhitespaceDoublePass(XMLnode.childNodes[_local6]);
_local6++;
}
}
function GetPressed() {
var _local2 = "nothing";
if (Key.isDown(1)) {
_local2 = "mouseLeft";
}
if (Key.isDown(39)) {
_local2 = "right";
}
if (Key.isDown(37)) {
_local2 = "left";
}
if (Key.isDown(38)) {
_local2 = "up";
}
if (Key.isDown(40)) {
_local2 = "down";
}
if (Key.isDown(32)) {
}
if (isGame) {
return(_local2);
}
return("nothing");
}
}
Symbol 243 Button
on (press) {
_parent.BeginGame();
}
Symbol 248 Button
on (release) {
getURL ("http://www.justfreegames.com?utm_source=Pacxon&utm_medium=flashGame", "_blank");
}
Symbol 253 Button
on (press) {
how_s._visible = true;
}
Symbol 255 Button
on (press) {
if (this.on) {
_root.g_sound.setVolume(0);
} else {
_root.g_sound.setVolume(100);
}
this.on = !this.on;
gotoAndStop (2);
}
Symbol 257 Button
on (press) {
if (this.on) {
_root.g_sound.setVolume(0);
} else {
_root.g_sound.setVolume(100);
}
this.on = !this.on;
gotoAndStop (1);
}
Symbol 258 MovieClip Frame 1
this.stop();
Symbol 265 MovieClip Frame 1
how_s._visible = false;
how_s.useHandCursor = false;
btn_sound.on = true;
Instance of Symbol 264 MovieClip "how_s" in Symbol 265 MovieClip Frame 1
on (press) {
this._visible = false;
}
Symbol 266 MovieClip [Game] Frame 1
#initclip 23
Object.registerClass("Game", Game);
#endinitclip