Combined Code
frame 1 {
stop();
}
button 8 {
on (release) {
gotoAndPlay(3);
}
}
frame 2 {
stop();
}
frame 3 {
stop();
_this = this;
this.speed = 5;
this.largura = this.monstro_mc._width / 2;
this.altura = this.monstro_mc._height / 2;
this.onEnterFrame = function () {
_this.monstro_mc.gotoAndStop(2);
if (Key.isDown(39)) {
_this.monstro_mc._rotation = -90;
_this.monstro_mc._x += _this.speed;
} else {
if (Key.isDown(37)) {
_this.monstro_mc._rotation = 90;
_this.monstro_mc._x -= _this.speed;
} else {
if (Key.isDown(38)) {
_this.monstro_mc._rotation = 180;
_this.monstro_mc._y -= _this.speed;
} else {
if (Key.isDown(40)) {
_this.monstro_mc._rotation = 0;
_this.monstro_mc._y += _this.speed;
} else {
_this.monstro_mc.gotoAndStop(1);
}
}
}
}
if (_this.cenario_mc.hitTest(_this.monstro_mc._x + _this.largura, _this.monstro_mc._y, true)) {
_this.monstro_mc._x -= _this.speed;
}
if (_this.cenario_mc.hitTest(_this.monstro_mc._x - _this.largura, _this.monstro_mc._y, true)) {
_this.monstro_mc._x += _this.speed;
}
if (_this.cenario_mc.hitTest(_this.monstro_mc._x, _this.monstro_mc._y + _this.altura, true)) {
_this.monstro_mc._y -= _this.speed;
}
if (_this.cenario_mc.hitTest(_this.monstro_mc._x, _this.monstro_mc._y - _this.altura, true)) {
_this.monstro_mc._y += _this.speed;
}
if (_this.monstro_mc.hitTest(_this.fim_mc)) {
_root.gotoAndStop('fim');
this.onEnterFrame = null;
}
};
}
movieClip 18 {
}
movieClip 23 {
}
movieClip 36 {
}
frame 4 {
stop();
}
button 38 {
on (release) {
gotoAndPlay(1);
}
}