<script language=javascript>
<!--
function earthquake()
{
   for (var i=0;i<=10;i++)
      {
         code(i);        
      }
   for (var i=10;i>=0;i--)
      {
         code(i);      
      }
}

function code(i)
{
   var z1=Math.round(Math.random());
   var z2=Math.round(Math.random());
   if (z1==0) var x=-i;
   else x=i;
   if (z2==0) var y=-i;
   else y=i;
   for (var c=0;c<=80;c++)
      {
         if(c==0 && i>5) c=50;
         self.moveBy(x,y);
         self.moveBy(-x,-y);
      }
}
-->
</script>

<center><input type=button value=Start onClick=earthquake()><center>
Published in: JavaScript
Download

Related snippets