Frame 1
stop();
onEnterFrame = function () {
if (Key.isDown(37)) {
personagem.direcao = "esquerda";
if (personagem._x < 200) {
colisao._x = colisao._x + personagem.vel;
inimigo._x = inimigo._x + inimigo.vel;
mao._x = mao._x + mao.vel;
} else {
personagem._x = personagem._x - personagem.vel;
}
if ((!personagem.caindo) && (!personagem.psubindo)) {
personagem.gotoAndStop(personagem.direcao + "a");
}
}
if (Key.isDown(39)) {
personagem.direcao = "direita";
if (personagem._x > 250) {
colisao._x = colisao._x - personagem.vel;
inimigo._x = inimigo._x - inimigo.vel;
mao._x = mao._x - mao.vel;
} else {
personagem._x = personagem._x + personagem.vel;
}
if ((!personagem.caindo) && (!personagem.psubindo)) {
personagem.gotoAndStop(personagem.direcao + "a");
}
}
if ((!personagem.pcaindo) && (!personagem.psubindo)) {
if (Key.isDown(38)) {
personagem.pi = personagem._y;
personagem.gotoAndStop(personagem.direcao + "p");
personagem.psubindo = true;
}
}
if (personagem.psubindo) {
if (personagem.pi <= (personagem._y + 100)) {
if ((personagem.pi >= personagem._y) && (personagem.pi <= (personagem._y + 70))) {
personagem._y = personagem._y - 10;
}
if ((personagem.pi > (personagem._y + 70)) && (personagem.pi <= (personagem._y + 100))) {
personagem._y = personagem._y - 5;
}
} else {
personagem.psubindo = false;
personagem.pcaindo = true;
}
}
};
Instance of Symbol 18 MovieClip "personagem" in Frame 1
onClipEvent (load) {
var pcaindo = false;
var psubindo = false;
var pi = 0;
var direcao = "direita";
var vel = 10;
var raio = 32;
var vida = 3;
}
onClipEvent (enterFrame) {
if (!_root.colisao.plataforma.hitTest(_x, _y, true)) {
if (!psubindo) {
_y = (_y + 10);
pcaindo = true;
}
}
if (pcaindo) {
if (_root.colisao.plataforma.hitTest(_x, _y, true)) {
pcaindo = false;
}
}
while (_root.colisao.paredes.hitTest(_x - raio, _y, true) || (_root.colisao.paredes.hitTest(_x - raio, _y - 50, true))) {
_x = (_x+1);
}
while (_root.colisao.paredes.hitTest(_x + raio, _y, true) || (_root.colisao.paredes.hitTest(_x + raio, _y - 50, true))) {
_x = (_x-1);
}
}
Instance of Symbol 23 MovieClip "inimigo" in Frame 1
onClipEvent (load) {
var vel = 10;
var direcao = "direita";
var morto = 1;
}
onClipEvent (enterFrame) {
if (this.hitTest(_root.personagem._x, _root.personagem._y, true) && (_root.personagem.pcaindo)) {
this.gotoAndStop("morto");
direcao == "parado";
}
if (this.hitTest(_root.personagem) && (!_root.personagem.pcaindo)) {
_root.colisao._x = 0;
_root.personagem._x = 52.3;
_root.personagem._y = 141.5;
_root.mao._x = 423.8;
this._x = 769.3;
_root.personagem.vida = _root.personagem.vida - 1;
if (_root.personagem.vida <= 0) {
_root.gotoAndStop("gameover");
}
}
if (direcao == "direita") {
_x = (_x + 2);
}
if (direcao == "esquerda") {
_x = (_x - 2);
}
if (_root.colisao.paredes.hitTest(_x, _y, true)) {
((direcao == "direita") ? ((direcao = "esquerda")) : ((direcao = "direita")));
}
}
Instance of Symbol 37 MovieClip "mao" in Frame 1
onClipEvent (load) {
var vel = 10;
}
onClipEvent (enterFrame) {
if (this.hitTest(_root.personagem)) {
_root.colisao._x = 0;
_root.personagem._x = 52.3;
_root.personagem._y = 141.5;
_root.mao._x = 423.8;
_root.inimigo._x = 769.3;
_root.personagem.vida = _root.personagem.vida - 1;
if (_root.personagem.vida <= 0) {
_root.gotoAndStop("gameover");
}
}
}
Frame 2
stop();
Symbol 17 MovieClip Frame 20
_root.personagem.gotoAndStop(_root.personagem.direcao);
Symbol 18 MovieClip Frame 1
stop();
Instance of Symbol 16 MovieClip in Symbol 18 MovieClip Frame 3
onClipEvent (enterFrame) {
if (!Key.isDown(39)) {
_root.personagem.gotoAndStop(_root.personagem.direcao);
}
}
Instance of Symbol 16 MovieClip in Symbol 18 MovieClip Frame 4
onClipEvent (enterFrame) {
if (!Key.isDown(37)) {
_root.personagem.gotoAndStop(_root.personagem.direcao);
}
}
Symbol 23 MovieClip Frame 1
stop();