Cita: function moverDisparoEnem(shootLeft,shootTop,miid) {
var shooty = document.getElementById(miid);
shooty.style.visibility = "visible";
shooty.style.marginTop = shootTop + "px";
shooty.style.marginLeft = shootLeft + "px";
AQUI PONDRIA EL HITTEST
if (shootTop <= 500) {
setTimeout("moverDisparoEnem("+shootLeft+","+(shoo tTop+10)+",'"+miid+"')",40);
}else {
var juego = document.getElementById("juego");
juego.removeChild(shooty);
}
}
este es el codigo que se lanza para mover el disparo de un enemigo (de los cuales hay muchos por cierto...)
como se supone quie debo considerar los otros elementos si la propia funcion mueveDisparoEnem no recive tal informacion :S
(y no olvidemos que esto se esta ejecutando constantemente, unas cuantas veces por segundo...)