HitTest problema

  • perloader
  • Newbie
  • Newbie
  • No Avatar
  • Registrado: Oct 28, 2007
  • Mensajes: 10
  • Status: Offline

Nota Octubre 28th, 2007, 7:23 am

i ve cansado 2 diferentes códigos sólo hacer mi roca vaya a la izquierda a la derecha en ambos sentidos derecha a la izquierda cuando se pulse la blackL _mc o blackR_mc bar, pero no funciona ¿hay algo malo en mi código? AYUDA POR FAVOR

1,

var MOVE_LEFT: Número = -5;
var MOVE_RIGHT: Número = 5;
var current_direction: Número = MOVE_LEFT;

moveRock función (): Void (
this.rock_mc._x = this.rock_mc._x + current_direction;
if (this.rock_mc_. x <0) (
current_direction = MOVE_RIGHT;
rock_mc.gotoAndStop ( "derecho");
) Else if (this.rock_mc._x> 550) (
current_direction = MOVE_LEFT;
rock_mc.gotoAndStop ( "izquierda");
)
)

2.La presente un hit cuando la imagen en movimiento se gire a la derecha pero no lo que quiero ser, quiero golpear la barra.

moveRock función (): Void (
this.rock_mc._x = this.rock_mc._x-10;
/ / for (i: Número = 0; i <495; + i)
if (this.rock_mc. hitTest (_root.blackL_mc)) (
this.rock_mc._x = 500;

)
)
  • Anonymous
  • Bot
  • No Avatar
  • Registrado: 25 Feb 2008
  • Mensajes: ?
  • Loc: Ozzuland
  • Status: Online

Nota Octubre 28th, 2007, 7:23 am

  • perloader
  • Newbie
  • Newbie
  • No Avatar
  • Registrado: Oct 28, 2007
  • Mensajes: 10
  • Status: Offline

Nota Octubre 29th, 2007, 12:35 am

AYUDA POR FAVOR!
  • perloader
  • Newbie
  • Newbie
  • No Avatar
  • Registrado: Oct 28, 2007
  • Mensajes: 10
  • Status: Offline

Nota Octubre 29th, 2007, 7:32 am

¿alguien sabe?
  • zhaojany
  • Student
  • Student
  • Avatar de Usuario
  • Registrado: Ago 03, 2006
  • Mensajes: 78
  • Status: Offline

Nota Noviembre 3rd, 2007, 7:32 pm

No tan claro acerca de lo que usted dice :(
Y en el segundo bloque de código que usted ha dicho "golpeó la imagen en movimiento". ¿Qué dosis se refiere a la "imagen en movimiento"? la roca?
  • IceCold
  • Guru
  • Guru
  • Avatar de Usuario
  • Registrado: Nov 05, 2004
  • Mensajes: 1254
  • Loc: Ro
  • Status: Offline

Nota Noviembre 5th, 2007, 10:52 pm

no exactamente seguro de lo que realmente quieren, pero usted puede tratar de Chang el código en lo siguiente:
Código: [ Select ]
if (this.rock_mc.hitTest(_root.blackL_mc)) {
  this.rock_mc._x = _root.blackL_mc._x - this.rock_mc._width; }
  1. if (this.rock_mc.hitTest(_root.blackL_mc)) {
  2.   this.rock_mc._x = _root.blackL_mc._x - this.rock_mc._width; }
“True mastery transcede any particular art. It stems from mastery of oneself - the ability, developed throgh self-discipline, to be calm, fully aware, and complety in tune with oneself and the surroundings. Then, and only then, can a person know himself. ”

Publicar Información

  • Total de mensajes en este tema: 5 mensajes
  • Usuarios navegando por este Foro: No hay usuarios registrados visitando el Foro y 44 invitados
  • No puede abrir nuevos temas en este Foro
  • No puede responder a temas en este Foro
  • No puede editar sus mensajes en este Foro
  • No puede borrar sus mensajes en este Foro
  • No puede enviar adjuntos en este Foro
 
 

© 2011 Unmelted, LLC. Ozzu® es una marca registrada de Unmelted, LLC