[CODE]<html>
<head>
<title>
</title>
<style>
#fone{
position:absolute;
left:150px;
top:500px;
}
#line{
position:absolute;
left:80;
top:20;
background-color:gray;
border-left: 2px solid black;
border-right:2px solid black;
width:250;
height:700;
z-index:1;
}
#hyp{
position:absolute;
left:100px;
top:100px;
}</style>
<script>
var xpos2 = 200;
var ypos2 = 100;
var x=30;
var y =30;
var rx =100;
var ry=100;
var i=40;
var timer;
function stoptimer()
{
clearTimeout(timer);
}
function en()
{
obj=document.getElementById(“hyp”);
obj.style.display=”none”;
}
function ens()
{
xpos2=100;
ypos2 =100;
obj=document.getElementById(“hyp”);
obj.style.left=xpos2 +”px”;
obj.style.top=ypos2 +”px”;
}
function goleft()
{
obj=document.getElementById(“hyp”);
obj.style.left=rx;
obj.style.top=ry +”px”;
var pp = parseInt(obj.style.top);
if(pp > 500)
{
en();
}
else
{
obj=document.getElementById(“hyp”);
var pl = parseInt(obj.style.top);
obj.style.left = rx + “px”;
;
randnum= Math.floor(Math.random()*6)+1;
ry=ry+randnum;
obj=document.getElementById(“hyp”);
i++;
obj.style.left=(rx-1)-i;
obj.style.top = ry + “px”;
timer=setTimeout(“goleft()”,10);
}
}
function raset()
{
obj=document.getElementById(“hyp”);
obj.style.left=rx;
obj.style.top=ry +”px”;
var pp = parseInt(obj.style.top);
if(pp > 600)
{
en();
}
else
{
randnum= Math.floor(Math.random()*6)+15;
ry=ry+randnum;
obj=document.getElementById(“hyp”);
i++;
obj.style.left=(rx+i)+i;
obj.style.top=ry +”px”;
timer=setTimeout(“raset()”,10);
var pp = parseInt(obj.style.top);
var bb = parseInt(obj.style.left);
if (bb > 200)
{
goleft();
}
}
}
function move(x,y){
xpos2=x;
ypos2 =y;
obj=document.getElementById(“hyp”);
obj.style.left=xpos2 +”px”;
obj.style.top=ypos2 +”px”;
}
function stoptimer()
{
clearTimeout(timer);
}
</script></head><body onload=”raset();”
onunload=”stoptimer();” ><div id=’line’><div><img id=”fone” src=’2c.gif’
onclick=”move(9, 7)” />
<img id=”hyp” src=’3c.gif’ />
I am new to Javascript, although I know several other languages, and no matter how hard I try I just can’t seem to get the hang of it.
here I have an image object that I need to bounce off the side of the window border in a random arc that still has a chance of hitting the img object at the bottom of the page, however the object shoots-out when it hits the border what am I doing wrong