hi,
the following script is an example of a "simple collision-detection"
the line 8(..tar1.style.posLeft+=5) is for moving the object1 to the left...Is it possible to use
<marquee behavior=alternate>object1</marquee> within the function ?
I was just thinking of using ten or more "marquees" of different speed
as "bullets" to shoot targets(tar2)
<script>
document.bgColor="pink";
var a =setInterval('start()',100)
function start()
{
tar1=document.all.im1;
tar2=document.all.im2;
tar1.style.posLeft+=5;
if((tar1.style.posLeft <= tar2.style.posLeft+tar2.style.posWidth && tar1.style.posLeft >= tar2.style.posLeft)
&&(tar1.style.posTop<=tar2.style.posTop+tar2.style.posHeight && tar1.style.posTop >= tar2.style.posTop))
{
tar2.style.visibility="hidden";
document.all.ses.src='daha.wav'
clearInterval(a)
}
}
</script>
<bgsound src="#" id=ses loop=1 autostart="false">
<img src="kap.gif" name=im1 style="position:absolute;top:100;left:100;"><br><br>
<img src="kizss.gif" name=im2 style="position:absolute;top:100;left:300;"><br><br>
