Comunidad de diseño web y desarrollo en internet online

Problemas con un juegesito:

Citar            
MensajeEscrito el 04 Abr 2007 12:48 pm
Bien,Bien, pues he hecho un juego en el que llevas un robot, y entonces tienes que ir matando enemigos. Voy por lo de disparar... ahora mismo llevo en la biblioteca:

-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!"

Por burflip

16 de clabLevel



Genero:Masculino  

firefox
Citar            
MensajeEscrito el 06 Abr 2007 12:23 pm
Weno.. el fallo era muy tonto... aqui está el codigo por si alguien tiene el mismo problema que yo:

Código :

var speed:Number = 25;
var velocity:Number = 5;
var activation:Boolean = false;
var balas:Number = 9;
// ---
Mouse.hide();
// ---
function laserUpdate():Void {
   if (activation == true) {
      removeMovieClip(laser);
      activation = false;
   }
}
controller.onRelease = function() {
   if (balas>=1) {
      attachMovie("disparo", "laser", 1);
      laser._x = this._x;
      laser._y = this._y;
      activation = true;
      balas--;
   }
   else {
      attachMovie("recargar", "recarga", 1);
      recarga._x = _xmouse;
      recarga._y = _ymouse;
   }
};
this.onEnterFrame = function() {
   laserUpdate();
   palabras.text = balas;
   controller._x = _xmouse;
   controller._y = _ymouse;
   //robot.swapDepths(1);
   if (Key.isDown(87)) {
      robot._rotation = 360;
      back._y += velocity;
   }
   else if (Key.isDown(83)) {
      robot._rotation = 180;
      back._y -= velocity;
   }
   else if (Key.isDown(65)) {
      robot._rotation = 270;
      back._x += velocity;
   }
   else if (Key.isDown(68)) {
      robot._rotation = 90;
      back._x -= velocity;
   }
   if (Key.isDown(Key.SPACE)) {
      balas = 9;
   }
}; 

Por burflip

16 de clabLevel



Genero:Masculino  

firefox

 

Cristalab BabyBlue v4 + V4 © 2011 Cristalab
Powered by ClabEngines v4, HTML5, love and ponies.