Frame 1
_global.soundEnabled = true;
Frame 2
if (getBytesLoaded() < getBytesTotal()) {
gotoAndPlay (1);
}
Frame 3
stop();
Key.removeListener(_global.listener);
_global.snd.stop();
_global.listener = new Object();
_global.listener.onKeyUp = function () {
if (Key.getCode() == 32) {
Key.removeListener(_global.listener);
gotoAndPlay (5);
} else {
return(false);
}
};
Key.addListener(_global.listener);
if (_global.soundEnabled) {
_global.snd = new Sound();
_global.snd.attachSound("snd_intro");
_global.snd.start(0, 1000);
}
Frame 5
stop();
Key.removeListener(_global.listener);
_global.listener = new Object();
_global.listener.onKeyUp = function () {
if (Key.getCode() == 32) {
Key.removeListener(_global.listener);
_global.snd.stop();
gotoAndPlay (8);
} else {
return(false);
}
};
Key.addListener(_global.listener);
Frame 8
stop();
Key.removeListener(_global.listener);
_global.snd.stop();
this.juego = this.attachMovie("Game", "mcJuego_0", 0);
this.juego.init();
this.juego.setupLevel();
Frame 10
stop();
removeMovieClip(this.juego);
Key.removeListener(_global.listener);
_global.snd.stop();
_global.listener = new Object();
_global.listener.onKeyUp = function () {
if (Key.getCode() == 32) {
Key.removeListener(_global.listener);
gotoAndPlay (3);
} else {
return(false);
}
};
Key.addListener(_global.listener);
Frame 12
stop();
removeMovieClip(this.juego);
Key.removeListener(_global.listener);
_global.snd.stop();
_global.listener = new Object();
_global.listener.onKeyUp = function () {
if (Key.getCode() == 32) {
Key.removeListener(_global.listener);
gotoAndPlay (3);
} else {
return(false);
}
};
Key.addListener(_global.listener);
if (_global.soundEnabled) {
_global.snd = new Sound();
_global.snd.attachSound("snd_mojojojo_gana");
_global.snd.start();
}
Symbol 43 MovieClip [mcRedRota] Frame 10
stop();
Symbol 59 MovieClip [mcPortadaNivel] Frame 37
stop();
Symbol 59 MovieClip [mcPortadaNivel] Frame 75
stop();
Symbol 59 MovieClip [mcPortadaNivel] Frame 113
stop();
Symbol 94 MovieClip [mcNieveAcumulada] Frame 2
stop();
Symbol 94 MovieClip [mcNieveAcumulada] Frame 4
stop();
Symbol 94 MovieClip [mcNieveAcumulada] Frame 6
stop();
Symbol 94 MovieClip [mcNieveAcumulada] Frame 8
stop();
Symbol 94 MovieClip [mcNieveAcumulada] Frame 10
stop();
Symbol 94 MovieClip [mcNieveAcumulada] Frame 12
stop();
Symbol 94 MovieClip [mcNieveAcumulada] Frame 17
stop();
Symbol 94 MovieClip [mcNieveAcumulada] Frame 19
stop();
Symbol 94 MovieClip [mcNieveAcumulada] Frame 24
stop();
Symbol 94 MovieClip [mcNieveAcumulada] Frame 26
stop();
Symbol 94 MovieClip [mcNieveAcumulada] Frame 31
stop();
Symbol 94 MovieClip [mcNieveAcumulada] Frame 33
stop();
Symbol 98 MovieClip [Path] Frame 1
#initclip 2
ClassPath = function () {
this.container = this.createEmptyMovieClip("clipContainer", 0);
this.canvas = this.container.createEmptyMovieClip("clipCanvas", -1);
this.guides = this.container.createEmptyMovieClip("clipGuides", -2);
this.fps = 24;
this.startY = 100;
this.endY = 361;
this.y = this.startY;
this.startX = 300;
this.beginX = 346.5;
this.x = this.startX;
this.startWidth = 14;
this.amplitude = 120;
this.amplitudeTop = 120;
this.amplitudeBottom = 100;
this.startAngle = 0;
this.cycles = 1;
this.endAngle = (360 * this.cycles) + this.startAngle;
this.angle = this.startAngle;
this.angleStep = (this.endAngle - this.startAngle) / (this.endY - this.startY);
this.speed = 0;
this.maxSpeed = 50 / this.fps;
this.accelerationRate = 50 / this.fps;
this.atStart = true;
this.atEnd = false;
};
ClassPath.prototype = new MovieClip();
Object.registerClass("Path", ClassPath);
ClassPath.prototype.draw = function () {
if (this.atStart) {
this.atStart = false;
this.y = this.startY;
this.x = this.beginX;
this.getBoundaries();
this.x = ((this.beginX + (0 * this.center)) - 0) + (((this.angle < 180) ? (((this.center + this.amplitudeTop) + 14) - 110) : (((this.center + this.amplitudeBottom) - 142) - 110)) * Math.sin((this.angle * Math.PI) / 180));
this.canvas.moveTo(this.x, this.y);
}
if (this.speed < this.maxSpeed) {
this.speed = this.speed + this.accelerationRate;
if (this.speed > this.maxSpeed) {
this.speed = this.maxSpeed;
}
}
this.newY = this.y + this.speed;
if (this.newY < this.endY) {
this.y = this.newY;
} else {
this.y = this.endY;
this.atEnd = true;
}
this.angle = (this.startAngle + (this.angleStep * (this.y - this.startY))) % 360;
this.getBoundaries();
this.x = ((this.beginX + this.center) - 110) + (((this.angle < 180) ? (((this.amplitudeTop + 14) - this.center) + 110) : (((this.center - 110) + this.amplitudeBottom) - 142)) * Math.sin((this.angle * Math.PI) / 180));
};
ClassPath.prototype.getBoundaries = function () {
y = ((-this.y) + 483) / 80;
this.center = (y * y) * y;
y = (this.y - 95) / 42.5;
this.amplitudeTop = (y * y) * y;
this.amplitudeBottom = 1.44 * this.y;
};
ClassPath.prototype.drawGuides2 = function () {
var obj = this.guides;
obj.lineStyle(1, 16711680, 50);
this.y = this.startY;
this.x = this.beginX;
this.getBoundaries();
obj.moveTo((this.beginX - this.amplitudeBottom) + 142, this.startY);
this.y = this.endY;
this.getBoundaries();
obj.lineTo((this.beginX - this.amplitudeBottom) + 142, this.endY);
this.y = this.startY;
this.getBoundaries();
obj.moveTo((this.beginX + this.amplitudeTop) + 14, this.y);
i = 1;
while (i < (this.endY - this.startY)) {
this.y = this.startY + i;
this.getBoundaries();
obj.lineTo((this.beginX + this.amplitudeTop) + 14, this.y);
i++;
}
this.y = this.startY;
this.getBoundaries();
obj.moveTo(this.beginX + (this.startWidth / 2), this.startY);
i = 0;
while (i < (this.endY - this.startY)) {
this.y = this.startY + i;
this.getBoundaries();
obj.lineTo(((this.beginX + (this.startWidth / 2)) + this.center) - 110, this.y);
i++;
}
};
ClassPath.prototype.drawGuides = function () {
var obj = this.guides;
obj.clear();
obj.lineStyle(1, 0, 25);
obj.moveTo(this.startX - this.amplitude, this.startY);
obj.lineTo(this.startX - this.amplitude, this.endY);
obj.moveTo(this.startX, this.startY);
obj.lineTo(this.startX, this.endY);
obj.moveTo(this.startX + this.amplitude, this.startY);
obj.lineTo(this.startX + this.amplitude, this.endY);
};
ClassPath.prototype.drawPath = function () {
var obj = this.canvas;
((this.angle < 180) ? (obj.lineStyle(1, 0)) : (obj.lineStyle(1, 13421772)));
obj.moveTo(this.x, this.y);
obj.lineTo(this.x + 0.5, this.y + 0.5);
};
ClassPath.prototype.getAngle = function (pos) {
var maxAngle = Math.sqrt(this.endAngle - this.startAngle);
var maxPos = (this.endY - this.startY);
var factor = (maxAngle / maxPos);
return(Math.pow(pos * factor, 2));
};
ClassPath.prototype.reset = function () {
this.canvas.clear();
this.y = this.startY;
this.x = this.startX;
this.endAngle = (360 * this.cycles) + this.startAngle;
this.angle = this.startAngle;
this.angleStep = (this.endAngle - this.startAngle) / (this.endY - this.startY);
this.speed = 0;
this.atStart = true;
this.atEnd = false;
};
#endinitclip
Symbol 170 MovieClip Frame 9
stop();
Symbol 173 MovieClip [mcSnowBall] Frame 6
gotoAndPlay (1);
Symbol 173 MovieClip [mcSnowBall] Frame 16
this.stop();
Symbol 228 MovieClip [mcGirlBombon] Frame 13
gotoAndPlay (5);
Symbol 228 MovieClip [mcGirlBombon] Frame 17
gotoAndPlay (1);
Symbol 228 MovieClip [mcGirlBombon] Frame 20
gotoAndPlay (18);
Symbol 228 MovieClip [mcGirlBombon] Frame 36
gotoAndPlay (21);
Symbol 228 MovieClip [mcGirlBombon] Frame 47
gotoAndPlay (51);
Symbol 228 MovieClip [mcGirlBombon] Frame 55
gotoAndPlay (51);
Symbol 228 MovieClip [mcGirlBombon] Frame 71
gotoAndPlay (21);
Symbol 228 MovieClip [mcGirlBombon] Frame 89
gotoAndPlay (21);
Symbol 228 MovieClip [mcGirlBombon] Frame 99
gotoAndPlay (61);
Symbol 231 MovieClip Frame 1
gotoAndPlay (5);
Symbol 231 MovieClip Frame 17
gotoAndPlay (5);
Symbol 246 MovieClip [mcGirlBellota] Frame 17
gotoAndPlay (1);
Symbol 246 MovieClip [mcGirlBellota] Frame 20
gotoAndPlay (18);
Symbol 246 MovieClip [mcGirlBellota] Frame 39
gotoAndPlay (25);
Symbol 246 MovieClip [mcGirlBellota] Frame 46
gotoAndPlay (50);
Symbol 246 MovieClip [mcGirlBellota] Frame 52
gotoAndPlay (50);
Symbol 246 MovieClip [mcGirlBellota] Frame 70
gotoAndPlay (25);
Symbol 246 MovieClip [mcGirlBellota] Frame 89
gotoAndPlay (25);
Symbol 246 MovieClip [mcGirlBellota] Frame 99
gotoAndPlay (60);
Symbol 306 MovieClip [mcGirlBurbuja] Frame 10
gotoAndPlay (6);
Symbol 306 MovieClip [mcGirlBurbuja] Frame 17
gotoAndPlay (1);
Symbol 306 MovieClip [mcGirlBurbuja] Frame 20
gotoAndPlay (18);
Symbol 306 MovieClip [mcGirlBurbuja] Frame 40
gotoAndPlay (25);
Symbol 306 MovieClip [mcGirlBurbuja] Frame 47
gotoAndPlay (51);
Symbol 306 MovieClip [mcGirlBurbuja] Frame 55
gotoAndPlay (51);
Symbol 306 MovieClip [mcGirlBurbuja] Frame 68
gotoAndPlay (25);
Symbol 306 MovieClip [mcGirlBurbuja] Frame 84
gotoAndPlay (25);
Symbol 306 MovieClip [mcGirlBurbuja] Frame 94
gotoAndPlay (59);
Symbol 307 MovieClip [PowerPuffGirl] Frame 1
#initclip 9
ClassPowerPuffGirl = function () {
this.container = this.createEmptyMovieClip("clipContainer", 0);
this.container._x = (this.container._y = 0);
this.ray = new Object();
this.ray.active = false;
this.ray.timeLeft = 0;
this.ray.bonusTimeLeft = 0;
this.protection = new Object();
this.protection.active = false;
this.protection.timeLeft = 0;
this.speed = 0;
this.status = "inactive";
this.currentMovement = "still";
this.facing = "right";
this.newX = 0;
this.newY = 0;
this.timeLeftToRecover = 0;
this.isEnabled = true;
this.selected = true;
this.transformUnselected = {ra:39.84375, ga:39.84375, ba:39.84375, rb:153, gb:153, bb:153};
this.transformSelected = {ra:100, rb:0, ga:100, gb:0, ba:100, bb:0, aa:100, ab:0};
};
ClassPowerPuffGirl.prototype = new MovieClip();
Object.registerClass("PowerPuffGirl", ClassPowerPuffGirl);
ClassPowerPuffGirl.prototype.activateRay = function () {
this.ray.active = (this.isFiring = true);
this.ray.timeLeft = this.ray.duration;
this.ray.clip1._xscale = (this.ray.clip2._xscale = 1);
this.ray.clip1._visible = (this.ray.clip2._visible = true);
this.ray.clip1.play();
this.ray.clip2.play();
};
ClassPowerPuffGirl.prototype.deactivateRay = function () {
this.ray.active = (this.isFiring = false);
this.ray.timeLeft = 0;
this.ray.clip1._visible = false;
this.ray.clip2._visible = false;
this.ray.clip1.stop();
this.ray.clip2.stop();
this.updateMovement("still");
};
ClassPowerPuffGirl.prototype.updateRay = function () {
if (this.ray.clip1._xscale < this.ray.currentLength) {
this.ray.clip1._xscale = (this.ray.clip2._xscale = this.ray.clip1._xscale + (this.ray.currentLength / 3));
}
this.ray.timeLeft = this.ray.timeLeft - 1;
if (this.ray.timeLeft <= 0) {
this.deactivateRay();
}
};
ClassPowerPuffGirl.prototype.activateBonusRay = function () {
this.bonusRayActive = true;
this.ray.currentLength = this.ray.bonusScale;
this.ray.bonusTimeLeft = this.ray.bonusDuration;
this.ray.clip1._xscale = (this.ray.clip2._xscale = this.ray.bonusScale);
};
ClassPowerPuffGirl.prototype.deactivateBonusRay = function () {
this.bonusRayActive = false;
this.ray.currentLength = this.ray.normalScale;
this.ray.clip1._xscale = (this.ray.clip2._xscale = this.ray.normalScale);
};
ClassPowerPuffGirl.prototype.updateBonusRay = function () {
this.ray.bonusTimeLeft = this.ray.bonusTimeLeft - 1;
if (this.ray.bonusTimeLeft <= 0) {
this.deactivateBonusRay();
}
};
ClassPowerPuffGirl.prototype.activateBonusProtection = function () {
if (this.bonusProtectionActive) {
return(undefined);
}
this.bonusProtectionActive = true;
this.protection.timeLeft = this.protection.duration;
this.protection.clip._alpha = 100;
this.protection.clip._visible = true;
this.protection.clip.gotoAndPlay(1);
};
ClassPowerPuffGirl.prototype.deactivateBonusProtection = function () {
this.bonusProtectionActive = false;
this.protection.timeLeft = 0;
this.protection.clip._visible = false;
this.protection.clip.stop();
};
ClassPowerPuffGirl.prototype.updateBonusProtection = function () {
this.protection.timeLeft = this.protection.timeLeft - 1;
if (this.protection.timeLeft < (this.fps * 1.2)) {
this.protection.clip._alpha = ((this.protection.clip._alpha == 100) ? 25 : 100);
}
if (this.protection.timeLeft <= 0) {
this.deactivateBonusProtection();
}
};
ClassPowerPuffGirl.prototype.addEnergy = function (energy) {
if (isNaN(energy) || (energy < 0)) {
return(undefined);
}
this.energy = this.energy + ((this.startEnergy / 100) * energy);
if (this.energy > 100) {
this.energy = 100;
}
if (!this.isEnabled) {
this.setEnabled(true);
this.reset();
}
};
ClassPowerPuffGirl.prototype.substractEnergy = function (energy) {
if ((isNaN(energy) || (energy < 0)) || (this.energy <= 0)) {
return(undefined);
}
this.energy = this.energy - ((this.startEnergy / 100) * energy);
if (this.energy <= 0) {
this.energy = 0;
this.setEnabled(false);
}
};
ClassPowerPuffGirl.prototype.updateRecovery = function () {
this.timeLeftToRecover = this.timeLeftToRecover - 1;
if (this.timeLeftToRecover <= 0) {
this.timeLeftToRecover = 0;
if (this.isEnabled) {
if (!this.selected) {
this.updateMovement("out");
} else {
this.setStatus("waiting");
}
} else {
this.setStatus("exiting");
}
}
};
ClassPowerPuffGirl.prototype.setStatus = function (status) {
if (status == "waiting") {
this.status = status;
this.updateMovement("still");
} else if (status == "recovering") {
this.status = status;
this.timeLeftToRecover = this.timeToRecover;
if (this.isFiring) {
this.deactivateRay();
}
this.updateMovement("recovering");
} else if (status == "exiting") {
this.status = status;
this.setEnabled(false);
this.updateMovement("exiting");
} else if (status == "out_of_game") {
this.status = status;
}
};
ClassPowerPuffGirl.prototype.setSelected = function (selected) {
selected = Boolean(selected);
if (selected == this.selected) {
return(undefined);
}
this.selected = selected;
if (this.selected) {
this.statusColor.setTransform(this.transformSelected);
} else {
this.statusColor.setTransform(this.transformUnselected);
if (this.isEnabled && (this.status != "recovering")) {
this.updateMovement("still");
}
}
};
ClassPowerPuffGirl.prototype.setEnabled = function (enabled) {
this.isEnabled = enabled;
};
ClassPowerPuffGirl.prototype.catchBonus = function () {
this.bonusCatchTimeLeft = bonusCatchDuration;
this.clip.gotoAndPlay("agarra_bonus");
};
ClassPowerPuffGirl.prototype.updateBonusCatch = function () {
this.bonusCatchTimeLeft = this.bonusCatchTimeLeft - 1;
if (this.bonusCatchTimeLeft <= 0) {
this.bonusCatchTimeLeft = 0;
if (this.movement == "still") {
this.clip.gotoAndPlay("vuela_frena");
} else if ((this.movement == "left") || (this.movement == "right")) {
this.clip.gotoAndPlay("vuela_loop");
}
}
};
ClassPowerPuffGirl.prototype.updateExit = function () {
this.updateMovement("exiting");
};
ClassPowerPuffGirl.prototype.reset = function () {
this.x = (this.clip._x = this.startX);
if (!this.selected) {
this.updateMovement("out");
} else {
this.updateMovement("still");
if (this.facing != "right") {
this.updateMovement("right");
}
if (this.status != "waiting") {
this.setStatus("waiting");
}
}
if (this.bonusProtectionActive) {
this.deactivateBonusProtection();
}
if (this.bonusRayActive) {
this.deactivateBonusRay();
}
if (this.isFiring) {
this.deactivateRay();
}
this.timeLeftToRecover = 0;
this.bonusCatchTimeLeft = 0;
this.addEnergy(100);
};
ClassPowerPuffGirl.prototype.updateMovement = function (movement) {
if (movement == "fire") {
this.clip.gotoAndPlay("dispara");
this.currentMovement = "fire";
this.speed = 0;
this.activateRay();
} else if ((movement == "left") && (this.x > this.minX)) {
if (this.facing != "left") {
this.clip._xscale = -this.clip._xscale;
this.facing = "left";
return(undefined);
}
if ((this.currentMovement != "left") && (this.currentMovement != "right")) {
this.clip.gotoAndPlay("vuela_arranca");
this.currentMovement = "left";
}
if (this.speed < this.maxSpeed) {
if (this.speed == 0) {
this.speed = this.startSpeed;
} else {
this.speed = this.speed + this.accelerationRate;
}
if (this.speed > this.maxSpeed) {
this.speed = this.maxSpeed;
}
}
this.newX = this.x - this.speed;
if (this.newX > this.minX) {
this.x = (this.clip._x = this.newX);
} else {
this.x = (this.clip._x = this.minX);
this.updateMovement("still");
}
} else if ((movement == "right") && (this.x < this.maxX)) {
if (this.facing != "right") {
this.clip._xscale = -this.clip._xscale;
this.facing = "right";
return(undefined);
}
if ((this.currentMovement != "left") && (this.currentMovement != "right")) {
this.clip.gotoAndPlay("vuela_arranca");
this.currentMovement = "right";
}
if (this.speed < this.maxSpeed) {
if (this.speed == 0) {
this.speed = this.startSpeed;
} else {
this.speed = this.speed + this.accelerationRate;
}
if (this.speed > this.maxSpeed) {
this.speed = this.maxSpeed;
}
}
this.newX = this.x + this.speed;
if (this.newX < this.maxX) {
this.x = (this.clip._x = this.newX);
} else {
this.x = (this.clip._x = this.maxX);
this.updateMovement("still");
}
} else if (movement == "out") {
if (this.facing != "right") {
this.updateMovement("right");
}
if (this.status != "waiting") {
this.setStatus("waiting");
}
this.x = this.minX - (this.objHit._width * 2);
this.clip._x = this.x;
} else if (movement == "in") {
this.x = this.minX;
this.clip._x = this.x;
} else if (movement == "still") {
if ((this.currentMovement == "left") || (this.currentMovement == "right")) {
this.clip.gotoAndPlay("vuela_frena");
this.currentMovement = "still";
this.speed = 0;
} else if ((this.currentMovement == "fire") || (this.currentMovement == "resting")) {
this.clip.gotoAndPlay("vuela_frena2");
this.currentMovement = "still";
this.speed = 0;
}
} else if (movement == "recovering") {
this.clip.gotoAndPlay("golpeada");
} else if (movement == "exiting") {
if (this.currentMovement != "exiting") {
this.currentMovement = movement;
if (this.facing != "left") {
this.clip._xscale = -this.clip._xscale;
this.facing = "left";
}
this.clip.gotoAndPlay("cansada");
} else {
this.x = this.x - (this.maxSpeed / 2);
if (this.x <= (this.minX - this.objHit._width)) {
this.x = this.minX - this.objHit._width;
this.setEnabled(false);
this.currentMovement = "resting";
this.setStatus("out_of_game");
}
this.clip._x = this.x;
}
}
};
#endinitclip
Symbol 309 MovieClip [mcGirlBurbuja_test] Frame 18
gotoAndPlay (1);
Symbol 310 MovieClip [mcGirlBellotaTest] Frame 18
gotoAndPlay (1);
Symbol 311 MovieClip [Game] Frame 1
#initclip 12
classGame = function () {
this.paths = new Array([], [], [], []);
this.paths[0][0] = {ang:120, cycles:0.025};
this.paths[0][1] = {ang:135, cycles:0.025};
this.paths[0][2] = {ang:150, cycles:0.025};
this.paths[0][3] = {ang:165, cycles:0.025};
this.paths[0][4] = {ang:180, cycles:0.025};
this.paths[0][5] = {ang:195, cycles:0.025};
this.paths[0][6] = {ang:210, cycles:0.025};
this.paths[0][7] = {ang:225, cycles:0.025};
this.paths[1][0] = {ang:135, cycles:0.4};
this.paths[1][1] = {ang:345, cycles:0.25};
this.paths[2][0] = {ang:30, cycles:0.8};
this.paths[2][1] = {ang:45, cycles:0.8};
this.paths[2][2] = {ang:60, cycles:0.8};
this.paths[2][3] = {ang:75, cycles:0.8};
this.paths[2][4] = {ang:90, cycles:0.8};
this.paths[2][5] = {ang:105, cycles:0.8};
this.paths[2][6] = {ang:120, cycles:0.8};
this.paths[2][7] = {ang:135, cycles:0.8};
this.paths[2][8] = {ang:150, cycles:0.8};
this.paths[3][0] = {ang:180, cycles:0.8};
this.paths[3][1] = {ang:195, cycles:0.8};
this.paths[3][2] = {ang:210, cycles:0.8};
this.paths[3][3] = {ang:225, cycles:0.8};
this.paths[3][4] = {ang:240, cycles:0.8};
this.paths[3][5] = {ang:255, cycles:0.8};
this.paths[3][6] = {ang:270, cycles:0.8};
this.paths[3][7] = {ang:285, cycles:0.8};
this.paths[3][8] = {ang:300, cycles:0.8};
this.paths[3][9] = {ang:315, cycles:0.8};
this.paths[3][10] = {ang:330, cycles:0.8};
this.paths[3][11] = {ang:345, cycles:0.8};
this.paths[3][12] = {ang:360, cycles:0.8};
};
ClassGame.prototype = new MovieClip();
Object.registerClass("Game", ClassGame);
ClassGame.prototype.init = function () {
this.cfg = new ClassConfig();
Stage.scaleMode = "noScale";
this.gfx = this.createEmptyMovieClip("clipGfx", 0);
this.frame = 0;
this.frameWait = 0;
this.level = 1;
this.missedBalls = 0;
this.maxMissedBalls = this.cfg.maxMissedBalls;
this.activeBalls = 0;
this.timeSinceLastBonus = 0;
this.timeToNextBall = 0;
this.soundEnabled = _global.soundEnabled;
this.paused = false;
this.processFrame = true;
this.ih = new ClassInputHandler();
this.girls = new Array();
this.girls[0] = this.gfx.attachMovie("PowerPuffGirl", "Girl_0", 38);
this.girls[0].loadProperties(this.cfg.girls.bellota);
this.girls[1] = this.gfx.attachMovie("PowerPuffGirl", "Girl_1", 39);
this.girls[1].loadProperties(this.cfg.girls.burbuja);
this.girls[2] = this.gfx.attachMovie("PowerPuffGirl", "Girl_2", 40);
this.girls[2].loadProperties(this.cfg.girls.bombon);
this.girlsSwap = new Array();
this.girlsSwap[0] = this.gfx.createEmptyMovieClip("GirlSwap_0", 12);
this.girlsSwap[1] = this.gfx.createEmptyMovieClip("GirlSwap_1", 13);
this.girlsSwap[2] = this.gfx.createEmptyMovieClip("GirlSwap_2", 14);
this.currentGirlIndex = 2;
this.girls[this.currentGirlIndex].setEnabled(true);
this.girls[this.currentGirlIndex].setSelected(true);
this.girls[(this.currentGirlIndex + 1) % 3].setEnabled(true);
this.girls[(this.currentGirlIndex + 1) % 3].setSelected(false);
this.girls[(this.currentGirlIndex + 2) % 3].setEnabled(true);
this.girls[(this.currentGirlIndex + 2) % 3].setSelected(false);
this.currentGirl = this.girls[this.currentGirlIndex];
this.MojoJojo = this.gfx.attachMovie("MojoJojo", "Mojo_0", 48);
this.MojoJojo.loadProperties(this.cfg.MojoJojo);
this.snowBalls = new Array();
j = 0;
while (j < this.cfg.totalBalls) {
this.snowBalls[j] = this.gfx.attachMovie("SnowBall", "SnowBall_" + j, 16 + j);
this.snowBalls[j].loadProperties(this.cfg.ball);
this.snowBalls[j].setMovementType("curve", {maxSpeed:100, maxAngle:360});
this.snowBalls[j].reset();
j++;
}
this.bonus = new Array();
this.bonusSwap = new Array();
i = 0;
while (i < 3) {
this.bonus[i] = this.gfx.attachMovie("Bonus", "Bonus_" + i, 21 + i);
this.bonus[i].loadProperties(this.cfg.bonus[i]);
tmp = this.cfg.girls.bellota;
this.bonus[i].loadProperties({startY:tmp.startY, minX:tmp.minX, maxX:tmp.maxX, scale:tmp.scale});
this.bonus[i].deactivate();
this.bonusSwap[i] = this.gfx.createEmptyMovieClip("BonusSwap_" + i, 1 + i);
this.bonus[i + 3] = this.gfx.attachMovie("Bonus", "Bonus_" + (i + 3), 24 + i);
this.bonus[i + 3].loadProperties(this.cfg.bonus[i]);
tmp = this.cfg.girls.burbuja;
this.bonus[i + 3].loadProperties({startY:tmp.startY, minX:tmp.minX, maxX:tmp.maxX, scale:tmp.scale});
this.bonus[i + 3].deactivate();
this.bonusSwap[i + 3] = this.gfx.createEmptyMovieClip("BonusSwap_" + (i + 3), 4 + i);
this.bonus[i + 6] = this.gfx.attachMovie("Bonus", "Bonus_" + (i + 6), 27 + i);
this.bonus[i + 6].loadProperties(this.cfg.bonus[i]);
tmp = this.cfg.girls.bombon;
this.bonus[i + 6].loadProperties({startY:tmp.startY, minX:tmp.minX, maxX:tmp.maxX, scale:tmp.scale});
this.bonus[i + 6].deactivate();
this.bonusSwap[i + 6] = this.gfx.createEmptyMovieClip("BonusSwap_" + (i + 6), 7 + i);
i++;
}
this.panel = this.gfx.attachMovie("Panel", "Panel_0", 100);
this.panel.loadProperties(this.cfg.panel);
this.panel.changeBalls(0);
this.panel.changeBonus(false);
this.panel.loadProperties({callbackObj:this, callbackMethod:"toggleSounds"});
this.sounds = new ClassSoundManager();
this.sounds.loadProperties(this.cfg.sounds);
this.sounds.setLoopingSound("ingame_music");
if (!this.soundEnabled) {
this.toggleSounds(false);
}
if (this.cfg.debug.noSounds) {
this.toggleSounds(false);
}
this.net = this.gfx.attachMovie("mcRed", "Net_0", 44);
this.net._x = 10;
this.net._y = 326;
this.net.stop();
this.brokenNet = this.gfx.attachMovie("mcRedRota", "Net_1", 43);
this.brokenNet._x = 259;
this.brokenNet._y = 373;
this.brokenNet._visible = false;
this.brokenNet.stop();
this.snow = this.gfx.attachMovie("mcNieveAcumulada", "Snow_0", 42);
this.snow._x = 270;
this.snow._y = 390;
this.snow._visible = false;
this.snow.stop();
};
ClassGame.prototype.gameLoop = function () {
if (this.ih.keyReadingMode == 2) {
this.ih.readRawKeys();
}
if (this.cfg.debug.allowPause) {
if (this.paused) {
if (this.ih.getEvent("advance_frame") || (this.ih.getEvent("advance_frame_repeat"))) {
this.processFrame = true;
} else {
this.processFrame = false;
}
}
if (this.ih.getEvent("toggle_pause")) {
this.paused = !this.paused;
if (!this.paused) {
this.processFrame = true;
}
}
}
if (this.processFrame) {
this.frame++;
if (this.cfg.debug.allowKeys) {
this.checkDebugKeys();
}
if (this.checkLoseGame()) {
this.frameWait = 0;
this.onEnterFrame = this.endGame;
} else if (this.checkEndLevel()) {
this.frameWait = 0;
this.onEnterFrame = this.endLevel;
} else {
this.updatePlayer();
this.updateGirls();
this.updateBonus();
this.updateBalls();
this.checkCollisions();
}
}
};
ClassGame.prototype.updatePlayer = function () {
if (this.ih.getEvent("change_girl")) {
this.currentGirl.setSelected(false);
if ((this.currentGirl.status != "recovering") && (this.currentGirl.isEnabled)) {
this.currentGirl.updateMovement("out");
}
this.currentGirlIndex = (++this.currentGirlIndex) % 3;
this.currentGirl = this.girls[this.currentGirlIndex];
this.currentGirl.setSelected(true);
if (this.currentGirl.isEnabled) {
this.currentGirl.updateMovement("in");
}
} else if ((this.currentGirl.isEnabled && (!this.currentGirl.isFiring)) && (this.currentGirl.status != "recovering")) {
if (this.ih.getEvent("fire")) {
this.sounds.play("fire");
this.currentGirl.updateMovement("fire");
} else if (this.ih.getEvent("go_left")) {
this.currentGirl.updateMovement("left");
} else if (this.ih.getEvent("go_right")) {
this.currentGirl.updateMovement("right");
} else if (this.currentGirl.currentMovement != "still") {
this.currentGirl.updateMovement("still");
}
}
};
ClassGame.prototype.updateGirls = function () {
i = 0;
while (i < 3) {
if (this.girls[i].bonusProtectionActive) {
this.girls[i].updateBonusProtection();
if (!this.girls[i].bonusProtectionActive) {
this.panel.changeBonus(false);
}
}
if (this.girls[i].bonusRayActive) {
this.girls[i].updateBonusRay();
if (!this.girls[i].bonusRayActive) {
this.panel.changeBonus(false);
}
}
if (this.girls[i].isFiring) {
this.girls[i].updateRay();
}
if (this.girls[i].status == "recovering") {
this.girls[i].updateRecovery();
if (!this.girls[i].isEnabled) {
this.bonus[i * 3].deactivate();
this.bonus[(i * 3) + 1].deactivate();
this.bonus[(i * 3) + 2].deactivate();
}
} else if (this.girls[i].status == "exiting") {
this.girls[i].updateExit();
} else if (this.girls[i].status == "catching") {
this.girls[i].updateBonusCatch();
} else if (this.girls[i].status == "stopping") {
this.girls[i].updateMovement("still");
}
i++;
}
};
ClassGame.prototype.updateBonus = function () {
this.timeSinceLastBonus++;
i = 0;
while (i < 3) {
if (this.bonus[i * 3].active) {
this.bonus[i * 3].update();
} else if (this.bonus[(i * 3) + 1].active) {
this.bonus[(i * 3) + 1].update();
} else if (this.bonus[(i * 3) + 2].active) {
this.bonus[(i * 3) + 2].update();
}
i++;
}
if ((((this.frame % this.cfg.fps) == 0) && ((this.timeSinceLastBonus / this.cfg.fps) > this.levelData.bonusFrequency)) && ((Math.random() * this.levelData.bonusRange) < 1)) {
this.timeSinceLastBonus = 0;
var girls = new Array();
i = 0;
while (i < 3) {
if (((((this.girls[i].isEnabled && (!this.girls[i].bonusRayActive)) && (!this.girls[i].bonusProtectionActive)) && (!this.bonus[i * 3].active)) && (!this.bonus[(i * 3) + 1].active)) && (!this.bonus[(i * 3) + 2].active)) {
girls.push(i);
}
i++;
}
if (girls.length == 0) {
return(undefined);
}
var chosenGirl = girls[Math.floor(Math.random() * girls.length)];
if (this.girls[chosenGirl].energy == this.girls[chosenGirl].startEnergy) {
energy = {index:1, prob:-1};
ray = {index:2, prob:50};
protection = {index:0, prob:100};
} else {
energy = {index:1, prob:20};
ray = {index:2, prob:60};
protection = {index:0, prob:100};
}
bonusNumber = Math.round(Math.random() * 100);
if (bonusNumber <= energy.prob) {
bonusNumber = energy.index;
} else if (bonusNumber <= ray.prob) {
bonusNumber = ray.index;
} else if (bonusNumber <= protection.prob) {
bonusNumber = protection.index;
}
bonusNumber = (chosenGirl * 3) + bonusNumber;
var width = ((this.bonus[bonusNumber].maxX - this.bonus[bonusNumber].minX) / 2);
var x = ((this.bonus[bonusNumber].minX + ((this.girls[chosenGirl].x < (this.girls[chosenGirl].minX + width)) ? 0 : (width))) + (Math.random() * width));
this.bonus[bonusNumber].moveTo({x:x, y:this.bonus[bonusNumber].y});
this.bonus[bonusNumber].activate();
}
};
ClassGame.prototype.activateBonus = function (bonusNumber) {
if ((this.bonus[bonusNumber].active || (bonusNumber < 0)) || (bonusNumber > 9)) {
return(undefined);
}
var x = (this.bonus[bonusNumber].minX + (Math.random() * (this.bonus[bonusNumber].maxX - this.bonus[bonusNumber].minX)));
this.bonus[bonusNumber].moveTo({x:x, y:this.bonus[bonusNumber].y});
this.bonus[bonusNumber].activate();
};
ClassGame.prototype.updateBalls = function () {
this.timeToNextBall--;
j = 0;
while (j < this.cfg.totalBalls) {
if ((this.snowBalls[j].state != "inactive") && (!this.snowBalls[j].atEnd)) {
this.snowBalls[j].move();
if (this.snowBalls[j].state == "exploding") {
this.snowBalls[j].updateExplosion();
if (this.snowBalls[j].atEnd) {
this.snowBalls[j].reset();
this.activeBalls = this.activeBalls - 1;
}
} else if (this.snowBalls[j].atEnd) {
this.missedBalls++;
if (this.missedBalls < (this.cfg.maxMissedBalls + 1)) {
this.snow.gotoAndPlay("_" + this.missedBalls);
this.panel.changeBalls(this.missedBalls);
}
this.snow._visible = true;
this.snowBalls[j].reset();
this.activeBalls = this.activeBalls - 1;
}
} else if (((this.MojoJojo.energy > 0) && (this.activeBalls < this.levelData.maxActiveBalls)) && ((this.levelData.maxActiveBalls == 1) || ((this.levelData.maxActiveBalls > 1) && ((this.activeBalls == 0) || (this.timeToNextBall < 1))))) {
this.timeToNextBall = this.levelData.minTimeBetweenBalls + (Math.random() * this.levelData.timeRangeBetweenBalls);
var x = {startX:this.snowBalls[j].minX + ((this.snowBalls[j].maxX - this.snowBalls[j].minX) / 2)};
this.snowBalls[j].loadProperties(x);
this.snowBalls[j].reset();
var speed = ((this.cfg.ball.maxSpeed / 3) + Math.floor(Math.random() * ((this.cfg.ball.maxSpeed / 3) * 2)));
var path = ((Math.round(Math.random() * this.levelData.totalBalls) > this.levelData.hardBalls) ? (this.pickPath2(false)) : (this.pickPath2(true)));
this.snowBalls[j].setMovementType("curve", {maxSpeed:speed, startAngle:path.ang, cycles:path.cycles});
this.snowBalls[j].begin();
this.activeBalls = this.activeBalls + 1;
this.mojoJojo.substractEnergy(this.MojoJojo.energyPerBall);
this.panel.changeEnergy("MojoJojo", this.mojoJojo.energy);
}
i = 0;
while (i < 3) {
if (this.snowBalls[j].clip.hitTest(this.girls[i].clip)) {
if ((((this.snowBalls[j].y < this.girls[i].y) && (this.snowBalls[j].getDepth() > this.girls[i].getDepth())) && ((this.snowBalls[j].y + (this.snowBalls[j].clip._height / 2)) > (this.girls[i].y - (this.girls[i].clip._height / 2)))) || (((this.snowBalls[j].y > this.girls[i].y) && (this.snowBalls[j].getDepth() < this.girls[i].getDepth())) && ((this.snowBalls[j].y - (this.snowBalls[j].clip._height / 2)) < (this.girls[i].y + (this.girls[i].clip._height / 2))))) {
this.girls[i].swapDepths(this.girlsSwap[i]);
this.bonus[i * 3].swapDepths(this.bonusSwap[i * 3]);
this.bonus[(i * 3) + 1].swapDepths(this.bonusSwap[(i * 3) + 1]);
this.bonus[(i * 3) + 2].swapDepths(this.bonusSwap[(i * 3) + 2]);
break;
}
}
i++;
}
j++;
}
};
ClassGame.prototype.checkCollisions = function () {
i = 0;
while (i < 9) {
if (this.bonus[i].active) {
if (this.currentGirl.objHit.hitTest(this.bonus[i].objHit)) {
this.currentGirl.catchBonus();
if (this.bonus[i].type == "protection") {
this.currentGirl.activateBonusProtection();
this.bonus[i].deactivate();
this.panel.changeBonus(true);
this.sounds.play("bonus_protection");
} else if (this.bonus[i].type == "ray") {
this.currentGirl.activateBonusRay();
this.bonus[i].deactivate();
this.panel.changeBonus(true);
this.sounds.play("bonus_catch");
} else if (this.bonus[i].type == "energy") {
this.currentGirl.addEnergy(this.bonus[i].energy);
this.bonus[i].deactivate();
this.panel.changeEnergy(this.currentGirl.name, this.currentGirl.energy);
this.sounds.play("bonus_catch");
}
}
}
i++;
}
i = 0;
while (i < 3) {
j = 0;
for ( ; j < this.cfg.totalBalls ; j++) {
if (this.snowBalls[j].state == "rolling") {
if (((this.snowBalls[j].y + ((0 * this.snowBalls[j].clip._height) / 6)) > (this.girls[i].y - (this.girls[i].clip._height / 4))) && ((this.snowBalls[j].y - (this.snowBalls[j].clip._height / 6)) < (this.girls[i].y + (this.girls[i].clip._height / 4)))) {
if (this.girls[i].bonusProtectionActive) {
if (this.snowBalls[j].objHit.hitTest(this.girls[i].protection.objHit)) {
this.sounds.play("ball_destruction");
this.snowBalls[j].blowUp();
}
} else if (((this.girls[i].isEnabled && (this.girls[i].selected)) && (this.girls[i].status != "recovering")) && (this.snowBalls[j].objHit.hitTest(this.girls[i].objHit))) {
this.sounds.play("ball_hits_girl");
this.girls[i].substractEnergy(this.levelData.ball.cost);
this.panel.changeEnergy(this.girls[i].name, this.girls[i].energy);
this.girls[i].setStatus("recovering");
continue;
}
if (this.girls[i].isFiring && (this.girls[i].status != "recovering")) {
if (this.snowBalls[j].objHit.hitTest(this.girls[i].ray.clip1) || (this.snowBalls[j].objHit.hitTest(this.girls[i].ray.clip2))) {
this.sounds.play("ball_destruction");
this.snowBalls[j].blowUp();
}
}
}
}
}
i++;
}
};
ClassGame.prototype.pickPath = function (index) {
if (index == null) {
var type = (Math.random() * 100);
var index;
if (type < 25) {
index = 0;
} else if (type < 30) {
index = 1;
} else if (type < 65) {
index = 2;
} else {
index = 3;
}
}
this.thrownBalls++;
this.hardBalls++;
return(this.paths[index][Math.floor(Math.random() * this.paths[index].length)]);
};
ClassGame.prototype.pickPath2 = function (isHard) {
this.thrownBalls++;
if (isHard) {
this.hardBalls++;
}
var angle = (0 + Math.round(Math.random() * 360));
if (isHard) {
var cycles = (0.75 + (Math.round(Math.random() * 50) / 100));
} else {
var cycles = (0.25 + (Math.round(Math.random() * 50) / 100));
}
return({ang:angle, cycles:cycles});
};
ClassGame.prototype.toggleSounds = function (state) {
if (state != null) {
this.soundEnabled = !state;
}
if (this.soundEnabled) {
this.soundEnabled = false;
this.sounds.setSoundState(false);
this.panel.changeSound(false);
_global.soundEnabled = false;
} else {
this.soundEnabled = true;
this.sounds.setSoundState(true);
this.sounds.play("ingame_music");
this.panel.changeSound(true);
_global.soundEnabled = true;
}
};
ClassGame.prototype.setupLevel = function () {
i = 0;
while (i < 3) {
this.girls[i].reset();
this.panel.changeEnergy(this.girls[i].name, this.girls[i].energy);
this.bonus[i * 3].deactivate();
this.bonus[(i * 3) + 1].deactivate();
this.bonus[(i * 3) + 2].deactivate();
i++;
}
i = 0;
while (i < this.cfg.totalBalls) {
this.snowBalls[i].reset();
i++;
}
this.timeToNextBall = 0;
this.MojoJojo.reset();
this.frameWait = 0;
this.hardBalls = 0;
this.thrownBalls = 0;
this.panel.changeEnergy("MojoJojo", this.MojoJojo.energy);
this.clipLevel = this.gfx.attachMovie("mcPortadaNivel", "mcLevel_0", 105);
this.clipLevel._x = 300;
this.clipLevel._y = 200;
this.clipLevel.gotoAndPlay("nivel" + this.level);
this.levelData = this.cfg.levels[this.level - 1];
if (this.levelData.MojoJojo) {
this.MojoJojo.loadProperties(this.levelData.MojoJojo);
}
if (this.levelData.bonus) {
i = 0;
while (i < 3) {
this.bonus[i].loadProperties(this.levelData.bonus[i]);
this.bonus[i + 3].loadProperties(this.levelData.bonus[i]);
this.bonus[i + 6].loadProperties(this.levelData.bonus[i]);
i++;
}
}
if (this.level == 1) {
this.sounds.play("ingame_music");
}
this.onEnterFrame = this.beginLevel;
};
ClassGame.prototype.beginLevel = function () {
this.frameWait++;
if (this.ih.keyReadingMode == 2) {
this.ih.readRawKeys();
}
if (((this.frameWait > 1) && (this.ih.getEvent("fire"))) || (this.frameWait > (this.cfg.fps * 3))) {
this.clipLevel.removeMovieClip();
this.frameWait = 0;
this.onEnterFrame = this.gameLoop;
}
};
ClassGame.prototype.endLevel = function () {
this.frameWait++;
if (this.ih.keyReadingMode == 2) {
this.ih.readRawKeys();
}
if (((this.frameWait > 1) && (this.ih.getEvent("fire"))) || (this.frameWait > (this.cfg.fps * 1.5))) {
this.frameWait = 0;
this.level++;
if (this.level > 3) {
this.onEnterFrame = null;
_root.gotoAndPlay("ganaste");
} else {
this.onEnterFrame = this.setupLevel;
}
} else if (this.frameWait == 1) {
this.clipLevel._x = 300 - (this.clipLevel._width / 2);
this.clipLevel._y = 200 - (this.clipLevel._height / 2);
}
};
ClassGame.prototype.endGame = function () {
this.frameWait++;
if (this.frameWait == 1) {
this.net._visible = false;
this.brokenNet._visible = true;
this.brokenNet.gotoAndPlay(1);
this.sounds.stopSound("ingame_music");
} else if (this.frameWait > 21) {
this.onEnterFrame = null;
_root.gotoAndPlay("perdiste");
}
};
ClassGame.prototype.checkEndLevel = function () {
i = 0;
while (i < this.cfg.totalBalls) {
if (this.snowBalls[i].state != "inactive") {
return(false);
}
i++;
}
if (this.MojoJojo.energy <= 0) {
return(true);
}
return(false);
};
ClassGame.prototype.checkLoseGame = function () {
if ((((!this.girls[0].isEnabled) && (!this.girls[1].isEnabled)) && (!this.girls[2].isEnabled)) || (this.missedBalls > this.maxMissedBalls)) {
return(true);
}
return(false);
};
ClassGame.prototype.checkDebugKeys = function () {
if (this.ih.getEvent("bonus_protection")) {
this.activateBonus(0 + (this.currentGirlIndex * 3));
} else if (this.ih.getEvent("bonus_energy")) {
this.activateBonus(1 + (this.currentGirlIndex * 3));
} else if (this.ih.getEvent("bonus_ray")) {
this.activateBonus(2 + (this.currentGirlIndex * 3));
} else if (this.ih.getEvent("energy_add")) {
this.currentGirl.addEnergy(10);
this.panel.changeEnergy(this.currentGirl.name, this.currentGirl.energy);
} else if (this.ih.getEvent("energy_substract")) {
this.currentGirl.substractEnergy(10);
this.panel.changeEnergy(this.currentGirl.name, this.currentGirl.energy);
} else if (this.ih.getEvent("toggle_draw_path")) {
i = 0;
while (i < this.cfg.totalBalls) {
this.snowBalls[i].toggleDrawPath();
i++;
}
} else if (this.ih.getEvent("posX_add")) {
this.currentGirl.clip._x = this.currentGirl.clip._x + 1;
trace(this.currentGirl.clip._x);
} else if (this.ih.getEvent("posX_subs")) {
this.currentGirl.clip._x = this.currentGirl.clip._x - 1;
trace(this.currentGirl.clip._x);
} else if (this.ih.getEvent("posY_add")) {
this.currentGirl.clip._y = this.currentGirl.clip._y + 1;
trace(this.currentGirl.clip._y);
} else if (this.ih.getEvent("posY_subs")) {
this.currentGirl.clip._y = this.currentGirl.clip._y - 1;
trace(this.currentGirl.clip._y);
} else if (this.ih.getEvent("scale_add")) {
this.currentGirl.clip._xscale = (this.currentGirl.clip._yscale = this.currentGirl.clip._xscale + 1);
trace(this.currentGirl.clip._xscale);
} else if (this.ih.getEvent("scale_subs")) {
this.currentGirl.clip._xscale = (this.currentGirl.clip._yscale = this.currentGirl.clip._xscale - 1);
trace(this.currentGirl.clip._xscale);
}
};
#endinitclip
Symbol 312 MovieClip [InputHandler] Frame 1
#initclip 3
ClassInputHandler = function () {
this.events = {};
this.events.go_left = {code:37, isPressed:false, wasPressed:false, repeats:true};
this.events.go_right = {code:39, isPressed:false, wasPressed:false, repeats:true};
this.events.fire = {code:32, isPressed:false, wasPressed:false, repeats:false};
this.events.change_girl = {code:90, isPressed:false, wasPressed:false, repeats:false};
this.events.toggle_pause = {code:80, isPressed:false, wasPressed:false, repeats:false};
this.events.advance_frame = {code:96, isPressed:false, wasPressed:false, repeats:false};
this.events.advance_frame_repeat = {code:110, isPressed:false, wasPressed:false, repeats:true};
this.events.bonus_protection = {code:87, isPressed:false, wasPressed:false, repeats:false};
this.events.bonus_energy = {code:69, isPressed:false, wasPressed:false, repeats:false};
this.events.bonus_ray = {code:82, isPressed:false, wasPressed:false, repeats:false};
this.events.energy_add = {code:107, isPressed:false, wasPressed:false, repeats:false};
this.events.energy_substract = {code:109, isPressed:false, wasPressed:false, repeats:false};
this.events.toggle_draw_path = {code:106, isPressed:false, wasPressed:false, repeats:false};
this.events.posX_add = {code:102, isPressed:false, wasPressed:false, repeats:true};
this.events.posX_subs = {code:100, isPressed:false, wasPressed:false, repeats:true};
this.events.posY_add = {code:98, isPressed:false, wasPressed:false, repeats:true};
this.events.posY_subs = {code:104, isPressed:false, wasPressed:false, repeats:true};
this.events.scale_add = {code:105, isPressed:false, wasPressed:false, repeats:true};
this.events.scale_subs = {code:99, isPressed:false, wasPressed:false, repeats:true};
this.keys = new Array();
for (i in this.events) {
ev = this.events[i];
this.keys[ev.code] = {event:i, isPressed:ev.isPressed, wasPressed:ev.wasPressed, repeats:ev.repeats};
}
this.keyReadingMode = 2;
if (this.keyReadingMode == 1) {
Key.addListener(this);
this.getLastKey = Key.getCode;
} else {
this.getLastKey = this.getLastPressedKey;
}
this.frame = 0;
};
ClassInputHandler.prototype = new MovieClip();
Object.registerClass("InputHandler", ClassInputHandler);
ClassInputHandler.prototype.onKeyDown = function () {
var lastKey = this.getLastKey();
if (!this.keys[lastKey]) {
return(undefined);
}
if (this.keys[lastKey].isPressed && (!this.events[this.keys[lastKey].event].wasPressed)) {
this.keys[lastKey].wasPressed = (this.events[this.keys[lastKey].event].wasPressed = true);
return(undefined);
}
this.keys[lastKey].isPressed = (this.events[this.keys[lastKey].event].isPressed = true);
};
ClassInputHandler.prototype.onKeyUp = function () {
var lastKey = this.getLastKey();
if (!this.keys[lastKey]) {
return(undefined);
}
this.keys[lastKey].isPressed = (this.events[this.keys[lastKey].event].isPressed = false);
this.keys[lastKey].wasPressed = (this.events[this.keys[lastKey].event].wasPressed = false);
};
ClassInputHandler.prototype.updateBinding = function (eventToChange, newKey, repeats) {
if (!this.events[eventToChange]) {
return(undefined);
}
this.keys[this.events[eventToChange].code] = false;
this.keys[newKey] = {event:eventToChange, isPressed:false, wasPressed:false, repeats:repeats};
this.events[event] = {code:newKey, isPressed:false, wasPressed:false, repeats:repeats};
};
ClassInputHandler.prototype.getLastPressedKey = function () {
return(this.lastKey);
};
ClassInputHandler.prototype.getKeys = function () {
var keys = "";
for (prop in this.events) {
if (this.events[prop].isPressed && (!this.events[prop].wasPressed)) {
keys = keys + (prop + " ");
}
}
if (keys.length) {
keys = keys + (" " + this.frame);
}
return(keys);
};
ClassInputHandler.prototype.getEvent = function (event) {
if (!this.events[event].isPressed) {
return(false);
}
if (!this.events[event].wasPressed) {
return(true);
}
if (this.events[event].repeats) {
return(true);
}
return(false);
};
ClassInputHandler.prototype.readRawKeys = function () {
this.frame++;
for (prop in this.events) {
var currKey = this.events[prop].code;
if ((Key.isDown(currKey) && (!this.events[prop].isPressed)) || ((Key.isDown(currKey) && (this.events[prop].isPressed)) && (!this.events[prop].wasPressed))) {
this.lastKey = currKey;
this.onKeyDown();
} else if (((!Key.isDown(currKey)) && (this.events[prop].isPressed)) || (((!Key.isDown(currKey)) && (!this.events[prop].isPressed)) && (this.events[prop].wasPressed))) {
this.lastKey = currKey;
this.onKeyUp();
}
}
};
#endinitclip
Symbol 313 MovieClip [Config] Frame 1
#initclip 1
ClassConfig = function () {
this.fps = 24;
this.girls = {burbuja:{}, bombon:{}, bellota:{}};
this.girls.bellota.name = "Bellota";
this.girls.bellota.minX = 258;
this.girls.bellota.maxX = 356;
this.girls.bellota.startX = this.girls.bellota.minX;
this.girls.bellota.startY = 159;
this.girls.bellota.scale = 55;
this.girls.bellota.fps = this.fps;
this.girls.bellota.speed = 0;
this.girls.bellota.maxSpeed = 270 / this.fps;
this.girls.bellota.startSpeed = this.girls.bellota.maxSpeed;
this.girls.bellota.accelerationRate = 40 / this.fps;
this.girls.bellota.decelerationRate = 40 / this.fps;
this.girls.bellota.rayDuration = 0.35 * this.fps;
this.girls.bellota.rayNormalScale = 75;
this.girls.bellota.rayBonusScale = 150;
this.girls.bellota.bonusProtectionDuration = 5 * this.fps;
this.girls.bellota.bonusRayDuration = 5 * this.fps;
this.girls.bellota.bonusCatchDuration = 9;
this.girls.bellota.startEnergy = 100;
this.girls.bellota.timeToRecover = 0.5 * this.fps;
this.girls.bellota.graphicsGirl = "mcGirlBellota";
this.girls.bellota.graphicsRay = "mcRayoBellota";
this.girls.bellota.graphicsRayX = 0;
this.girls.bellota.graphicsRayY = -13;
this.girls.bellota.graphicsRayX2 = 14;
this.girls.bellota.graphicsRayY2 = -8.5;
this.girls.bellota.graphicsProtection = "mcBurbujaBellota";
this.girls.bellota.graphicsProtectionX = 2;
this.girls.bellota.graphicsProtectionY = -1;
this.girls.burbuja.name = "burbuja";
this.girls.burbuja.minX = 188;
this.girls.burbuja.maxX = 376;
this.girls.burbuja.startX = this.girls.burbuja.minX;
this.girls.burbuja.startY = 211;
this.girls.burbuja.scale = 68;
this.girls.burbuja.fps = this.fps;
this.girls.burbuja.speed = 0;
this.girls.burbuja.maxSpeed = 360 / this.fps;
this.girls.burbuja.startSpeed = this.girls.burbuja.maxSpeed * 0.3;
this.girls.burbuja.accelerationRate = 55 / this.fps;
this.girls.burbuja.decelerationRate = 55 / this.fps;
this.girls.burbuja.rayDuration = 0.35 * this.fps;
this.girls.burbuja.bonusProtectionDuration = 5 * this.fps;
this.girls.burbuja.bonusRayDuration = 5 * this.fps;
this.girls.burbuja.bonusCatchDuration = 9;
this.girls.burbuja.rayNormalScale = 90;
this.girls.burbuja.rayBonusScale = 135;
this.girls.burbuja.startEnergy = 100;
this.girls.burbuja.timeToRecover = 0.5 * this.fps;
this.girls.burbuja.graphicsGirl = "mcGirlBurbuja";
this.girls.burbuja.graphicsRay = "mcRayoBurbuja";
this.girls.burbuja.graphicsRayX = 15;
this.girls.burbuja.graphicsRayY = -6;
this.girls.burbuja.graphicsRayX2 = -1;
this.girls.burbuja.graphicsRayY2 = -6.5;
this.girls.burbuja.graphicsProtection = "mcBurbujaBurbuja";
this.girls.burbuja.graphicsProtectionX = 3;
this.girls.burbuja.graphicsProtectionY = -3;
this.girls.bombon.name = "bombon";
this.girls.bombon.minX = 82;
this.girls.bombon.maxX = 447;
this.girls.bombon.startX = this.girls.bombon.minX;
this.girls.bombon.startY = 281;
this.girls.bombon.scale = 84;
this.girls.bombon.fps = this.fps;
this.girls.bombon.speed = 0;
this.girls.bombon.maxSpeed = 450 / this.fps;
this.girls.bombon.startSpeed = this.girls.bombon.maxSpeed * 0.3;
this.girls.bombon.accelerationRate = 45 / this.fps;
this.girls.bombon.decelerationRate = 65 / this.fps;
this.girls.bombon.rayDuration = 0.35 * this.fps;
this.girls.bombon.bonusProtectionDuration = 5 * this.fps;
this.girls.bombon.bonusRayDuration = 5 * this.fps;
this.girls.bombon.rayNormalScale = 100;
this.girls.bombon.rayBonusScale = 190;
this.girls.bombon.bonusCatchDuration = 9;
this.girls.bombon.startEnergy = 100;
this.girls.bombon.timeToRecover = 0.5 * this.fps;
this.girls.bombon.graphicsGirl = "mcGirlBombon";
this.girls.bombon.graphicsRay = "mcRayoBombon";
this.girls.bombon.graphicsRayX = 19;
this.girls.bombon.graphicsRayY = -6;
this.girls.bombon.graphicsRayX2 = 4;
this.girls.bombon.graphicsRayY2 = -2;
this.girls.bombon.graphicsProtection = "mcBurbujaBombon";
this.girls.bombon.graphicsProtectionX = 10;
this.girls.bombon.graphicsProtectionY = -5;
this.MojoJojo = {};
this.MojoJojo.startEnergy = 100;
this.MojoJojo.energyPerBall = this.MojoJojo.startEnergy * 0.5;
this.MojoJojo.graphic = "mcMojoJojo";
this.MojoJojo.x = 357;
this.MojoJojo.y = 94;
this.MojoJojo.scale = 30;
this.ball = {};
this.ball.startX = 344;
this.ball.startY = 100;
this.ball.startScale = 5;
this.ball.endScale = 50;
this.ball.minX = 272;
this.ball.maxX = 355;
this.ball.minY = this.ball.startY;
this.ball.maxY = 360;
this.ball.startSpeed = 10 / this.fps;
this.ball.maxSpeed = 90 / this.fps;
this.ball.accelerationRate = 10 / this.fps;
this.ball.explosionDuration = 9;
this.ball.fps = this.fps;
this.ball.cost = 25;
this.ball.graphicsBall = "mcSnowBall";
this.ball.graphicsDestruction = "";
this.bonus = new Array({}, {}, {});
this.bonus[0].duration = 10 * this.fps;
this.bonus[0].graphic = "mcBonusBunny";
this.bonus[0].type = "protection";
this.bonus[1].duration = 10 * this.fps;
this.bonus[1].graphic = "mcBonusHearth";
this.bonus[1].type = "energy";
this.bonus[1].energy = 10;
this.bonus[2].duration = 10 * this.fps;
this.bonus[2].graphic = "mcBonusStar";
this.bonus[2].type = "ray";
this.panel = {};
this.panel.graphic = "mcPanel";
this.panel.x = 530;
this.panel.y = 60;
this.panel.emptyX = -31.8;
this.panel.fullX = 2.2;
this.totalBalls = 3;
this.maxMissedBalls = 12;
this.levels = new Array({}, {}, {});
this.levels[0].bonus = new Array({}, {}, {});
this.levels[0].bonus[0].duration = 9 * this.fps;
this.levels[0].bonus[1].duration = 9 * this.fps;
this.levels[0].bonus[2].duration = 9 * this.fps;
this.levels[0].bonusFrequency = 3;
this.levels[0].bonusTimeRange = 2;
this.levels[0].totalBalls = 13;
this.levels[0].hardBalls = this.levels[0].totalBalls * 0.15;
this.levels[0].maxActiveBalls = 1;
this.levels[0].minTimeBetweenBalls = 2 * this.fps;
this.levels[0].timeRangeBetweenBalls = 0 * this.fps;
this.levels[0].ball = {cost:25, maxSpeed:85 / this.fps};
this.levels[0].MojoJojo = {energyPerBall:this.MojoJojo.startEnergy / this.levels[0].totalBalls};
this.levels[1].bonus = new Array({}, {}, {});
this.levels[1].bonus[0].duration = 6 * this.fps;
this.levels[1].bonus[1].duration = 6 * this.fps;
this.levels[1].bonus[2].duration = 6 * this.fps;
this.levels[1].bonusFrequency = 4;
this.levels[1].bonusTimeRange = 3;
this.levels[1].totalBalls = 17;
this.levels[1].hardBalls = this.levels[1].totalBalls * 0.2;
this.levels[1].maxActiveBalls = 2;
this.levels[1].minTimeBetweenBalls = 2 * this.fps;
this.levels[1].timeRangeBetweenBalls = 0.5 * this.fps;
this.levels[1].ball = {cost:25, maxSpeed:90 / this.fps};
this.levels[1].MojoJojo = {energyPerBall:this.MojoJojo.startEnergy / this.levels[1].totalBalls};
this.levels[2].bonus = new Array({}, {}, {});
this.levels[2].bonus[0].duration = 3 * this.fps;
this.levels[2].bonus[1].duration = 3 * this.fps;
this.levels[2].bonus[2].duration = 3 * this.fps;
this.levels[2].bonusFrequency = 5;
this.levels[2].bonusTimeRange = 4;
this.levels[2].totalBalls = 22;
this.levels[2].hardBalls = this.levels[2].totalBalls * 0.4;
this.levels[2].maxActiveBalls = 2;
this.levels[2].minTimeBetweenBalls = 1 * this.fps;
this.levels[2].timeRangeBetweenBalls = 1 * this.fps;
this.levels[2].ball = {cost:25, maxSpeed:100 / this.fps};
this.levels[2].MojoJojo = {energyPerBall:this.MojoJojo.startEnergy / this.levels[2].totalBalls};
this.sounds = {};
this.sounds.fire = "snd_rayo";
this.sounds.ball_destruction = "snd_bola_destruccion";
this.sounds.ball_hits_girl = "snd_bola_pisa_chica";
this.sounds.bonus_protection = "snd_bonus_proteccion";
this.sounds.bonus_catch = "snd_bonus_catch";
this.sounds.mojojojo_wins = "snd_mojojojo_gana";
this.sounds.ingame_music = "snd_ingame_music";
};
#endinitclip
Symbol 314 MovieClip [SnowBall] Frame 1
#initclip 5
ClassSnowBall = function () {
this.container = this.createEmptyMovieClip("clipContainer", 0);
this.canvas = this.container.createEmptyMovieClip("clipCanvas", -1);
this.speed = 0;
this.atStart = true;
this.atEnd = false;
this.setMovementType("straight");
this.state = "inactive";
this.explosionTimeLeft = 0;
this.showPath = false;
this.path = new ClassPath();
};
ClassSnowBall.prototype = new MovieClip();
Object.registerClass("SnowBall", ClassSnowBall);
ClassSnowBall.prototype.setMovementType = function (type, props) {
switch (type) {
case "straight" :
this.movementType = type;
this.move = this.moveStraight;
return;
case "sine" :
this.movementType = type;
this.move = this.moveSine;
this.angleFactor = ((((props.maxAngle != null) ? (props.maxAngle) : 225) / (this.maxY - this.startY)) * 1) + ((props.freq != null) ? (props.freq) : 0);
this.angleOffset = ((props.angleOffset != null) ? (props.angleOffset) : 0);
this.movementRadiusMin = 90;
this.movementRadiusMax = 120;
this.movementRadiusDiff = this.movementRadiusMax - this.movementRadiusMin;
this.movementRadius = 120;
this.maxSpeed = ((props.maxSpeed != null) ? (props.maxSpeed) : (180 / this.fps));
return;
case "curve" :
this.movementType = type;
this.move = this.moveCurve;
this.path.startAngle = props.startAngle;
this.path.cycles = props.cycles;
this.path.speed = this.startSpeed;
this.path.maxSpeed = this.maxSpeed;
this.path.reset();
return;
default :
this.movementType = "straight";
this.move = this.moveStraight;
}
};
ClassSnowBall.prototype.moveStraight = function () {
this.clip._visible = true;
if (this.speed < this.maxSpeed) {
this.speed = this.speed + this.accelerationRate;
if (this.speed > this.maxSpeed) {
this.speed = this.maxSpeed;
}
}
this.newY = this.y + this.speed;
if (this.newY < this.maxY) {
this.y = (this.clip._y = this.newY);
} else {
this.y = (this.clip._y = this.maxY);
this.atEnd = true;
}
if (!this.atEnd) {
this.clip._xscale = (this.clip._yscale = this.startScale + (this.scaleFactor * (this.y - this.minY)));
}
};
ClassSnowBall.prototype.moveSine = function () {
if (this.speed < this.maxSpeed) {
this.speed = this.speed + this.accelerationRate;
if (this.speed > this.maxSpeed) {
this.speed = this.maxSpeed;
}
}
this.newY = this.y + this.speed;
if (this.newY < this.maxY) {
this.y = (this.clip._y = this.newY);
} else {
this.y = (this.clip._y = this.maxY);
this.atEnd = true;
}
if (!this.angle) {
this.angle = 0;
}
this.angle = (this.angleOffset + (this.angleFactor * (this.minY - this.y))) % 360;
this.newX = this.startX + (this.movementRadius * Math.sin((this.angle * Math.PI) / 180));
this.x = (this.clip._x = this.newX);
if (!this.atEnd) {
this.clip._xscale = (this.clip._yscale = this.startScale + (this.scaleFactor * (this.y - this.minY)));
}
if (this.showPath) {
this.drawPath();
}
if (this.atStart) {
this.atStart = false;
}
};
ClassSnowBall.prototype.moveCurve = function () {
this.path.draw();
this.newY = this.path.y;
if (this.newY < this.maxY) {
this.y = (this.clip._y = this.newY);
} else {
this.y = (this.clip._y = this.maxY);
this.atEnd = true;
}
this.newX = this.path.x;
this.x = (this.clip._x = this.newX);
if (!this.atEnd) {
this.clip._xscale = (this.clip._yscale = this.startScale + (this.scaleFactor * (this.y - this.minY)));
}
if (this.showPath) {
this.drawPath();
}
if (this.atStart) {
this.atStart = false;
}
};
ClassSnowBall.prototype.reset = function () {
this.clip._visible = false;
this.clip._xscale = (this.clip._yscale = this.startScale);
this.y = (this.clip._y = this.startY);
this.x = (this.clip._x = this.startX);
this.state = "inactive";
this.speed = this.startSpeed;
this.atEnd = false;
this.atStart = true;
this.path.reset();
};
ClassSnowBall.prototype.begin = function () {
this.state = "rolling";
this.clip._visible = true;
this.clip.gotoAndPlay("rolling");
};
ClassSnowBall.prototype.blowUp = function () {
this.state = "exploding";
this.explosionTimeLeft = this.explosionDuration;
this.clip.gotoAndPlay("exploding");
};
ClassSnowBall.prototype.updateExplosion = function () {
this.explosionTimeLeft = this.explosionTimeLeft - 1;
if (this.explosionTimeLeft <= 0) {
this.explosionTimeLeft = 0;
this.atEnd = true;
}
};
ClassSnowBall.prototype.finish = function () {
this.clip._visible = false;
this.state = "inactive";
this.atEnd = true;
};
ClassSnowBall.prototype.drawPath = function () {
if (this.atEnd) {
return(undefined);
}
if (this.atStart) {
this.canvas.moveTo(this.x, this.y);
return(undefined);
}
var obj = this.canvas;
obj.lineStyle(0);
obj.lineTo(this.x, this.y);
};
ClassSnowBall.prototype.toggleDrawPath = function () {
this.showPath = !this.showPath;
this.canvas.moveTo(this.x, this.y);
};
#endinitclip
Symbol 315 MovieClip [Bonus] Frame 1
#initclip 6
ClassBonus = function () {
this.container = this.createEmptyMovieClip("clipContainer", 0);
this.timeLeft = 0;
this.active = false;
};
ClassBonus.prototype = new MovieClip();
Object.registerClass("Bonus", ClassBonus);
ClassBonus.prototype.loadProperties = function (props) {
if (props.graphic != null) {
this.clip = this.container.attachMovie(props.graphic, "clipGraphic", 0);
this.clip.stop();
this.objHit = this.clip;
}
if (props.startY != null) {
this.startY = props.startY;
this.y = (this.clip._y = this.startY);
}
if (props.scale != null) {
this.clip._xscale = (this.clip._yscale = props.scale);
}
if (props.duration != null) {
this.duration = props.duration;
}
if (props.type != null) {
this.type = props.type;
}
if (props.energy != null) {
this.energy = props.energy;
}
if (props.minX != null) {
this.minX = props.minX;
}
if (props.maxX != null) {
this.maxX = props.maxX;
}
if (!this.initialized) {
this.initialized = true;
}
};
ClassBonus.prototype.moveTo = function (pos) {
this.x = (this.clip._x = pos.x);
this.y = (this.clip._y = pos.y);
};
ClassBonus.prototype.activate = function () {
this.timeLeft = this.duration;
this.active = true;
this._visible = true;
this._alpha = 1;
this.clip.gotoAndPlay(1);
};
ClassBonus.prototype.deactivate = function () {
this.timeLeft = 0;
this.active = false;
this._visible = false;
this.clip.stop();
};
ClassBonus.prototype.update = function (props) {
this.timeLeft = this.timeLeft - 1;
if ((this._alpha < 100) && (this.timeLeft > 5)) {
this._alpha = this._alpha + 20;
}
if (this.timeLeft < 6) {
this._alpha = this._alpha - 20;
}
if (this.timeLeft <= 0) {
this.deactivate();
}
};
#endinitclip
Symbol 316 MovieClip [PowerPuffGirl_property_loader] Frame 1
#initclip 10
ClassPowerPuffGirl.prototype.loadProperties = function (props) {
if (props.graphicsGirl != null) {
this.clip = this.container.attachMovie(props.graphicsGirl, "clipGirl", 0);
this.clip.gotoAndPlay("quieta");
this.clip.collision._visible = false;
this.statusColor = new Color(this.clip);
}
if (props.graphicsRay != null) {
this.ray.clip1 = this.clip.attachMovie(props.graphicsRay, "clipRay1", 1);
this.ray.clip2 = this.clip.attachMovie(props.graphicsRay, "clipRay2", 2);
this.ray.clip1.stop();
this.ray.clip2.stop();
this.ray.clip1._x = props.graphicsRayX;
this.ray.clip1._y = props.graphicsRayY;
this.ray.clip2._x = props.graphicsRayX2;
this.ray.clip2._y = props.graphicsRayY2;
this.ray.clip1._visible = (this.ray.clip2._visible = false);
}
if (props.graphicsProtection != null) {
this.protection.clip = this.clip.attachMovie(props.graphicsProtection, "clipProtection", 3);
this.protection.objHit = this.protection.clip.collision;
this.protection.clip._xscale = (this.protection.clip._yscale = 120);
this.protection.clip.gotoAndStop(1);
this.protection.clip._visible = false;
}
if (props.graphicsProtectionX != null) {
this.protection.clip._x = props.graphicsProtectionX;
}
if (props.graphicsProtectionY != null) {
this.protection.clip._y = props.graphicsProtectionY;
}
this.objHit = this.clip.collision;
if (props.startX != null) {
this.startX = props.startX;
this.startY = props.startY;
if (!this.initialized) {
this.x = (this.clip._x = this.startX);
this.y = (this.clip._y = this.startY);
}
}
if (props.x != null) {
this.x = (this.clip._x = props.x);
this.y = (this.clip._y = props.y);
}
if (props.scale != null) {
this.clip._xscale = (this.clip._yscale = props.scale);
}
if (props.minX != null) {
this.minX = props.minX;
}
if (props.maxX != null) {
this.maxX = props.maxX;
}
if (props.maxSpeed != null) {
this.maxSpeed = props.maxSpeed;
}
if (props.startSpeed != null) {
this.startSpeed = props.startSpeed;
}
if (props.accelerationRate != null) {
this.accelerationRate = props.accelerationRate;
}
if (props.decelerationRate != null) {
this.decelerationRate = props.decelerationRate;
}
if (props.startEnergy != null) {
this.startEnergy = props.startEnergy;
this.energy = props.startEnergy;
}
if (props.rayDuration != null) {
this.ray.duration = props.rayDuration;
}
if (props.rayNormalScale != null) {
this.ray.normalScale = props.rayNormalScale;
this.ray.currentLength = this.ray.normalScale;
}
if (props.rayBonusScale != null) {
this.ray.bonusScale = props.rayBonusScale;
}
if (props.rayCost != null) {
this.ray.cost = props.rayCost;
}
if (props.bonusRayDuration != null) {
this.ray.bonusDuration = props.bonusRayDuration;
}
if (props.bonusProtectionDuration != null) {
this.protection.duration = props.bonusProtectionDuration;
}
if (props.bonusCatchDuration != null) {
this.bonusCatchDuration = props.bonusCatchDuration;
}
if (props.timeToRecover != null) {
this.timeToRecover = props.timeToRecover;
}
if (props.name != null) {
this.name = props.name;
}
if (props.fps != null) {
this.fps = props.fps;
}
if (!this.initialized) {
this.initialized = true;
}
};
#endinitclip
Symbol 319 MovieClip [SnowBall_property_loader] Frame 1
#initclip 11
ClassSnowBall.prototype.loadProperties = function (props) {
if (props.graphicsBall != null) {
this.clip = this.container.attachMovie(props.graphicsBall, "clipBall", 0);
this.clip.collision._visible = false;
this.clip.gotoAndStop("");
}
if (props.graphicsDestruction != null) {
this.clipDestruction = this.container.attachMovie(props.graphicsDestruction, "clipDestruction", 1);
this.clipDestruction.gotoAndStop("");
}
this.objHit = this.clip.collision;
if (props.startX != null) {
this.startX = props.startX;
if (!this.initialized) {
this.x = (this.clip._x = this.startX);
}
}
if (props.startY != null) {
this.startY = props.startY;
if (!this.initialized) {
this.y = (this.clip._y = this.startY);
}
}
if (props.x != null) {
this.x = (this.clip._x = props.x);
this.y = (this.clip._y = props.y);
}
if (props.startScale != null) {
this.startScale = props.startScale;
if (!this.initialized) {
this.clip._xscale = (this.clip._yscale = props.startScale);
}
}
if (props.endScale != null) {
this.endScale = props.endScale;
}
if (props.explosionDuration != null) {
this.explosionDuration = props.explosionDuration;
}
if (props.minY != null) {
this.minY = props.minY;
}
if (props.maxY != null) {
this.maxY = props.maxY;
}
if (props.minX != null) {
this.minX = props.minX;
}
if (props.maxY != null) {
this.maxX = props.maxX;
}
if ((((props.startScale != null) || (props.endScale != null)) || (props.minY != null)) || (props.maxY != null)) {
this.scaleFactor = (this.endScale - this.startScale) / (this.maxY - this.minY);
this.angleFactor = 360 / (this.maxY - this.minY);
}
if (props.maxSpeed != null) {
this.maxSpeed = props.maxSpeed;
}
if (props.accelerationRate != null) {
this.accelerationRate = props.accelerationRate;
}
if (props.fps != null) {
this.fps = props.fps;
}
if (!this.initialized) {
this.initialized = true;
}
};
#endinitclip
Symbol 323 MovieClip [buton] Frame 1
stop();
Symbol 323 MovieClip [buton] Frame 2
stop();
Symbol 336 MovieClip [Panel] Frame 1
#initclip 7
ClassPanel = function () {
this.container = this.createEmptyMovieClip("clipContainer", 0);
};
ClassPanel.prototype = new MovieClip();
Object.registerClass("Panel", ClassPanel);
ClassPanel.prototype.loadProperties = function (props) {
if (props.graphic != null) {
this.clip = this.container.attachMovie(props.graphic, "clipGraphic", 0);
this.clip.stop();
}
if (props.emptyX != null) {
this.emptyX = props.emptyX;
}
if (props.fullX != null) {
this.fullX = props.fullX;
}
this.factor = (this.fullX - this.emptyX) / 100;
if (props.x != null) {
this.clip._x = props.x;
}
if (props.y != null) {
this.clip._y = props.y;
}
if (props.callbackObj != null) {
this.callbackObj = props.callbackObj;
this.callbackMethod = props.callbackMethod;
this.clip.soundObjHit.onPress = function () {
this._parent._parent._parent.callbackObj[this._parent._parent._parent.callbackMethod]();
};
}
};
ClassPanel.prototype.changeEnergy = function (who, howMuch) {
this.clip[who].bar._x = this.emptyX + (howMuch * this.factor);
};
ClassPanel.prototype.changeBalls = function (quantity) {
this.clip.balls.gotoAndStop(quantity + 1);
};
ClassPanel.prototype.changeBonus = function (state) {
this.clip.bonus._visible = state;
};
ClassPanel.prototype.changeSound = function (state) {
this.clip.sound._visible = state;
};
#endinitclip
Symbol 338 MovieClip [MojoJojo] Frame 1
#initclip 8
ClassMojoJojo = function () {
this.container = this.createEmptyMovieClip("clipContainer", 0);
this.active = false;
};
ClassMojoJojo.prototype = new MovieClip();
Object.registerClass("MojoJojo", ClassMojoJojo);
ClassMojoJojo.prototype.loadProperties = function (props) {
if (props.graphic != null) {
this.clip = this.container.attachMovie(props.graphic, "clipGraphic", 0);
this.clip.stop();
}
if (props.x != null) {
this.x = (this.clip._x = props.x);
this.y = (this.clip._y = props.y);
}
if (props.scale != null) {
this.clip._xscale = (this.clip._yscale = props.scale);
}
if (props.startEnergy != null) {
this.startEnergy = props.startEnergy;
this.energy = props.startEnergy;
}
if (props.energyPerBall != null) {
this.energyPerBall = props.energyPerBall;
}
};
ClassMojoJojo.prototype.addEnergy = function (energy) {
if (isNaN(energy) || (energy < 0)) {
return(undefined);
}
this.energy = this.energy + ((this.startEnergy / 100) * energy);
if (this.energy > 100) {
this.energy = 100;
}
};
ClassMojoJojo.prototype.substractEnergy = function (energy) {
if ((isNaN(energy) || (energy < 0)) || (this.energy <= 0)) {
return(undefined);
}
this.energy = this.energy - ((this.startEnergy / 100) * energy);
};
ClassMojoJojo.prototype.reset = function () {
this.addEnergy(100);
};
#endinitclip
Symbol 345 MovieClip [SoundManager] Frame 1
#initclip 4
ClassSoundManager = function () {
this.sounds = {};
this.play = this.yesPlay;
};
ClassSoundManager.prototype = new MovieClip();
Object.registerClass("SoundManager", ClassSoundManager);
ClassSoundManager.prototype.setSoundState = function (state) {
this.state = Boolean(state);
if (this.state == true) {
this.play = this.yesPlay;
} else {
stopAllSounds();
this.play = this.noPlay;
}
};
ClassSoundManager.prototype.loadProperties = function (props) {
for (sndName in props) {
this.sounds[sndName] = new Sound();
this.sounds[sndName].attachSound(props[sndName]);
}
};
ClassSoundManager.prototype.yesPlay = function (sound) {
this.sounds[sound].start();
};
ClassSoundManager.prototype.noPlay = function () {
return(undefined);
};
ClassSoundManager.prototype.stopSound = function (sound) {
this.sounds[sound].stop();
};
ClassSoundManager.prototype.setLoopingSound = function (sndName) {
this.sounds[sndName].onSoundComplete = this.loop;
};
ClassSoundManager.prototype.unsetLoopingSound = function (sndName) {
this.sounds[sndName].onSoundComplete = null;
};
ClassSoundManager.prototype.loop = function () {
this.start(0.1);
};
#endinitclip
Symbol 370 MovieClip Frame 1
stop();
Symbol 386 MovieClip Frame 1
stop();
Symbol 394 MovieClip Frame 1
stop();
Symbol 399 MovieClip Frame 1
stop();
Symbol 408 Button
on (press) {
Key.removeListener(_global.listener);
_parent.play();
}
Symbol 409 MovieClip Frame 60
stop();
Symbol 439 Button
on (press) {
Key.removeListener(_global.listener);
_root.play();
}
Symbol 441 MovieClip Frame 100
stop();
Symbol 455 Button
on (press) {
Key.removeListener(_global.listener);
_root.gotoAndPlay("portada");
}
Symbol 456 MovieClip Frame 100
stop();
Symbol 461 MovieClip Frame 100
stop();