-Grafico (Animacion de un Boton)
-MC controller (es una mirilla)
-Boton go (es un boton circular normal y corriente)
-MC laser (es una explosion)
-Grafico (Una loseta de lo que sera el suelo)
-Grafico (contiene la palabra "recarga!!")
-MC recarga (para cuando te quedas sin balas)
-MC robot (personaje principal)
-MC suelo (muchas losetas juntas)
Tengo 2 Frames. en el F1 esta el siguiente codigo:
Código :
stop();
go.onRelease = function() {
gotoAndStop(2)
}
Y en el F2 esta este:
Código :
var speed:Number = 25;
var velocity:Number = 5;
var activation:Boolean = false;
var balas:Number = 9
function laserUpdate() {
if (activation == true) {
removeMovieClip(laser)
activation = false
}
}
_root.onEnterFrame = function() {
laserUpdate()
palabras.text = balas
Mouse.hide()
controller._x = _xmouse
controller._y = _ymouse
controller.onRelease = function() {
if (balas >= 1) {
this._parent.attachMovie("disparo", "laser", 1)
this.laser._x = controller._x
this.laser._y = controller._y
activation = true
balas --
} else {
this._parent.attachMovie("recargar", "recarga",1)
this.recarga._x = _xmouse
this.recarga._y = _ymouse
}
}
this.robot.swapDepths(1);
if (Key.isDown(87)) {
this.robot._rotation = 360;
this.back._y += velocity;
} else if (Key.isDown(83)) {
this.robot._rotation = 180;
this.back._y -= velocity;
} else if (Key.isDown(65)) {
this.robot._rotation = 270;
this.back._x += velocity;
} else if (Key.isDown(68)) {
this.robot._rotation = 90;
this.back._x -= velocity;
}
if (Key.isDown(Key.SPACE)) {
balas = 9
}
};
Nose xk cuando le doy a disparar desaparece el muñeco( las coordenadas x e y me salen "undefined", y la explosion sale con x e y 0...
Ayuda plis!"
