Frame 3
_root.sprite_start = function (origin) {
origin.damage = 0;
origin.action = "";
origin.nodamage = 0;
origin.attack = false;
origin.attack_push = false;
origin.group = 1;
origin.inertia_x = 0;
origin.inertia_y = 0;
origin.acceleration = 0;
origin.inertia_limit = 8;
};
_root.sprite_collision = function (origin) {
origin.temp_x = origin._x;
origin.temp_y = origin._y;
origin._x = origin._x + origin.inertia_x;
origin._y = origin._y + origin.inertia_y;
for (i in origin._parent) {
if (typeof(origin._parent[i].colision) == "movieclip") {
if (origin._parent[i].ghost != true) {
if (origin.colision != origin._parent[i].colision) {
if (origin.colision.hitTest(origin._parent[i].colision)) {
origin._x = origin.temp_x;
origin._y = origin.temp_y;
return(origin._parent[i]);
}
}
}
}
}
};
_root.group_collision = function (origin, group) {
for (i in origin._parent) {
if (typeof(origin._parent[i].colision) == "movieclip") {
if (origin._parent[i].group == group) {
if (origin.colision.hitTest(origin._parent[i].colision)) {
origin._parent[i].collision = origin;
return(origin._parent[i]);
}
}
}
}
};
_root.sprite_nodamage = function (origin, time) {
if (origin._parent.nodamage > 0) {
origin._parent._alpha = 40;
origin._parent.damage = 0;
origin._parent.nodamage = origin._parent.nodamage - 1;
} else {
origin._parent._alpha = 100;
if (origin._parent.damage > 0) {
origin._parent.vida = origin._parent.vida - origin._parent.damage;
origin._parent.nodamage = time;
}
}
};
_root.generate_loot = function (origin, type, ammount) {
_root.i++;
var _local4 = "coin" + _root.i;
origin._parent.attachMovie("coin", "coin" + _root.i, this.getNextHighestDepth(), {_x:origin._x, _y:origin._y});
};
_root.sprite_remove = function (target) {
target.removeMovieClip();
target.unloadMovie();
};
_root.sprite_animation = function (origin) {
if (!origin.attack) {
if ((origin.inertia_x != 0) && (origin.suelo)) {
if ((origin.look_at == "right") && (origin.animation != "right")) {
origin.gotoAndPlay("right");
} else if ((origin.look_at == "left") && (origin.animation != "left")) {
origin.gotoAndPlay("left");
}
} else if (origin.look_at == "right") {
origin.gotoAndPlay("stay_right");
} else {
origin.gotoAndPlay("stay_left");
}
} else if (origin.attack && (origin.animation != "attack")) {
if (origin.look_at == "right") {
trace("right!!");
origin.gotoAndPlay("attack_right");
}
if (origin.look_at == "left") {
origin.gotoAndPlay("attack_left");
}
}
};
_root.sprite_change_direction = function (target) {
if (target.look_at == "right") {
target.look_at = "left";
} else {
target.look_at = "right";
}
};
_root.sprite_inertia = function (origin) {
if (origin.inertia_x > 0) {
origin.inertia_x = origin.inertia_x - 1;
}
if (origin.inertia_x < 0) {
origin.inertia_x = origin.inertia_x + 1;
}
};
_root.IA_move_left_right = function (origin) {
if (origin.look_at == "right") {
origin.move_right();
}
if (origin.look_at == "left") {
origin.move_left();
}
};
_root.sprite_player = function (origin) {
if (Key.isDown(32)) {
origin.attack = true;
}
if (Key.isDown(39)) {
if (!origin.attack) {
origin.move_right();
}
} else if (Key.isDown(37)) {
if (!origin.attack) {
origin.move_left();
}
}
if (Key.isDown(38)) {
origin.move_up();
} else if (Key.isDown(40)) {
origin.move_down();
}
};
_root.sprite_attack = function (origin) {
origin.attack = true;
};
_root.sprite_move_right = function (origin) {
origin.inertia_x = origin.inertia_x + 2;
origin.look_at = "right";
if (origin.inertia_x >= origin.inertia_limit) {
origin.inertia_x = origin.inertia_limit;
}
};
_root.sprite_move_left = function (origin) {
origin.inertia_x = origin.inertia_x - 2;
origin.look_at = "left";
if (origin.inertia_x <= (-origin.inertia_limit)) {
origin.inertia_x = -origin.inertia_limit;
}
};
_root.sprite_init_jump = function (origin) {
if (origin.suelo && (origin.jumping > 2)) {
origin.jump = 20;
}
origin.jumping = 1;
};
_root.sprite_jump = function (origin) {
if (origin.jump > 0) {
origin.inertia_y = origin.inertia_y - 6;
origin.jump = origin.jump - 1;
}
origin.jumping++;
if (origin.jumping > 100) {
origin.jumping = 50;
}
trace(origin.jumping);
};
_root.sprite_gravity = function (origin) {
origin.inertia_y = origin.inertia_y + 6;
origin.suelo = false;
if (_root.sprite_collision(origin)) {
origin.suelo = true;
}
origin.inertia_y = 0;
};
gotoAndStop ("intro");
Instance of Symbol 16 MovieClip in Frame 3
onClipEvent (enterFrame) {
if (Key.isDown(32)) {
_root.gotoAndStop("fase1");
}
}
Instance of Symbol 68 MovieClip "marcador" in Frame 4
onClipEvent (load) {
gold = 0;
vida_total = 7;
vida_actual = 4;
}
onClipEvent (enterFrame) {
if (_root.frame_objetivo) {
_root.gotoAndStop(_root.frame_objetivo);
_root.frame_objetivo = undefined;
}
}
Symbol 5 MovieClip Frame 1
_visible = false;
stop();
Symbol 8 MovieClip Frame 1
this._visible = false;
stop();
Instance of Symbol 5 MovieClip in Symbol 13 MovieClip [coin] Frame 1
onClipEvent (load) {
_root.sprite_start(this._parent);
this._parent.ghost = true;
this._parent.group = 3;
}
onClipEvent (enterFrame) {
this._parent.inertia_y = this._parent.inertia_y + 8;
_root.sprite_collision(this._parent);
if (_root.group_collision(this._parent, 1)) {
_root.marcador.gold = _root.marcador.gold + 5;
_root.sprite_remove(this._parent);
}
this._parent.inertia_y = 0;
}
Symbol 13 MovieClip [coin] Frame 21
gotoAndPlay (1);
Instance of Symbol 5 MovieClip in Symbol 24 MovieClip Frame 1
onClipEvent (enterFrame) {
if (!Key.isDown(38)) {
_root.pulsa_arriba = false;
}
if (Key.isDown(38) && (!_root.pulsa_arriba)) {
_root.pulsa_arriba = true;
for (i in this._parent._parent) {
if (typeof(this._parent._parent[i].colision) == "movieclip") {
if (this._parent._parent[i].player == true) {
if (this._parent.hitTest(this._parent._parent[i].colision)) {
_root.frame_objetivo = this._parent.frame_objetivo;
trace(_root.frame_objetivo);
_root.salida = this._parent.salida;
}
}
}
}
}
}
Symbol 38 MovieClip Frame 1
animation = "right";
Instance of Symbol 5 MovieClip in Symbol 38 MovieClip Frame 1
onClipEvent (load) {
_root.sprite_start(this._parent);
this._parent.look_at = "right";
this._parent.player = true;
this._parent.move_up = function () {
_root.sprite_init_jump(this);
};
this._parent.move_right = function () {
_root.sprite_move_right(this);
};
this._parent.move_left = function () {
_root.sprite_move_left(this);
};
}
onClipEvent (enterFrame) {
_root.sprite_player(this._parent);
_root.sprite_jump(this._parent);
_root.sprite_inertia(this._parent);
_root.sprite_nodamage(this._parent, 40);
_root.sprite_animation(this._parent);
_root.sprite_collision(this._parent);
_root.sprite_gravity(this._parent);
}
Symbol 38 MovieClip Frame 9
gotoAndPlay ("right");
Symbol 38 MovieClip Frame 10
animation = "left";
Symbol 38 MovieClip Frame 18
gotoAndPlay ("left");
Symbol 38 MovieClip Frame 19
animation = "stay_left";
stop();
Symbol 38 MovieClip Frame 21
animation = "stay_right";
stop();
Symbol 38 MovieClip Frame 23
animation = "attack";
Instance of Symbol 8 MovieClip in Symbol 38 MovieClip Frame 23
onClipEvent (enterFrame) {
for (i in this._parent._parent) {
if (typeof(this._parent._parent[i].colision) == "movieclip") {
if (this._parent._parent[i].enemigo == true) {
if (this.hitTest(this._parent._parent[i].colision)) {
trace(this._parent._parent[i].colisiona);
this._parent._parent[i].life = 0;
trace(this._parent._parent[i].damage);
trace(this._parent._parent[i]);
}
}
}
}
}
Symbol 38 MovieClip Frame 27
attack = false;
animation = false;
Symbol 38 MovieClip Frame 28
animation = "attack";
Instance of Symbol 8 MovieClip in Symbol 38 MovieClip Frame 28
onClipEvent (enterFrame) {
for (i in this._parent._parent) {
if (typeof(this._parent._parent[i].colision) == "movieclip") {
if (this.hitTest(this._parent._parent[i].colision)) {
trace(this._parent._parent[i].colisiona);
if (this._parent._parent[i].enemigo == true) {
this._parent._parent[i].life = 0;
trace(this._parent._parent[i].damage);
trace(this._parent._parent[i]);
trace("Contra que choca");
trace(this._parent._parent._parent[i].colision);
}
break;
}
trace("Contra que choca");
trace(this._parent._parent._parent[i].colision);
}
}
}
Symbol 38 MovieClip Frame 32
attack = false;
animation = false;
Symbol 52 MovieClip Frame 1
animation = "right";
Instance of Symbol 5 MovieClip in Symbol 52 MovieClip Frame 1
onClipEvent (load) {
_root.sprite_start(this._parent);
this._parent.life = 2;
this._parent.enemigo = true;
this._parent.look_at = "right";
this._parent.move_right = function () {
_root.sprite_move_right(this);
};
this._parent.move_left = function () {
_root.sprite_move_left(this);
};
}
onClipEvent (enterFrame) {
_root.IA_move_left_right(this._parent);
_root.sprite_inertia(this._parent);
_root.sprite_nodamage(this._parent);
_root.sprite_animation(this._parent);
if ((object_collision = _root.sprite_collision(this._parent))) {
_root.sprite_change_direction(this._parent);
if ((object_collision.group != this._parent.group) && (this._parent.invulnerable < 1)) {
object_collision.damage = object_collision.damage + 1;
}
}
_root.sprite_gravity(this._parent);
if (this._parent.life < 1) {
_root.generate_loot(this._parent, "coin", 1);
_root.sprite_remove(this._parent);
}
}
Symbol 52 MovieClip Frame 17
gotoAndPlay ("right");
Symbol 52 MovieClip Frame 18
animation = "left";
Symbol 52 MovieClip Frame 34
gotoAndPlay ("left");
Instance of Symbol 5 MovieClip in Symbol 53 MovieClip Frame 1
onClipEvent (enterFrame) {
for (h in this._parent._parent) {
if (typeof(this._parent._parent[h]) == "movieclip") {
if (this._parent._parent[h].player) {
this._parent._parent._x = (-this._parent._parent[h]._x) + 256;
this._parent._parent._y = (-this._parent._parent[h]._y) + 240;
break;
}
}
}
if (_root.salida) {
if (typeof(this._parent._parent[_root.salida]) == "movieclip") {
for (h in this._parent._parent) {
if (typeof(this._parent._parent[h]) == "movieclip") {
if (this._parent._parent[h].player) {
this._parent._parent[h]._x = this._parent._parent[_root.salida]._x;
this._parent._parent[h]._y = this._parent._parent[_root.salida]._y;
}
}
}
}
_root.salida = undefined;
}
for (h in this._parent._parent) {
if (typeof(this._parent._parent[h]) == "movieclip") {
if (this._parent._parent[h].player) {
this._parent._parent._x = (-this._parent._parent[h]._x) + 256;
this._parent._parent._y = (-this._parent._parent[h]._y) + 240;
break;
}
}
}
}
Instance of Symbol 24 MovieClip "puerta" in Symbol 54 MovieClip Frame 1
onClipEvent (load) {
frame_objetivo = "fase2";
salida = "puerta";
}
Instance of Symbol 65 MovieClip in Symbol 68 MovieClip Frame 1
onClipEvent (enterFrame) {
gotoAndStop(this._parent.vida_actual);
}
Instance of Symbol 24 MovieClip "puerta" in Symbol 80 MovieClip Frame 1
onClipEvent (load) {
frame_objetivo = "fase1";
salida = "puerta";
}
Instance of Symbol 24 MovieClip "puerta" in Symbol 81 MovieClip Frame 1
onClipEvent (load) {
frame_objetivo = "fase1";
salida = "puerta";
}