function animateDucky() { if(!at_end) { ducky4.style.posLeft = ducky4x[count] + ((ducky4x[count+1] - ducky4x[count]) * loopcount/40); ducky4.style.posTop = ducky4y[count] + ((ducky4y[count+1] - ducky4y[count]) * loopcount/40); ducky5.style.posLeft = ducky5x[count] + ((ducky5x[count+1] - ducky5x[count]) * loopcount/40); ducky5.style.posTop = ducky5y[count] + ((ducky5y[count+1] - ducky5y[count]) * loopcount/40); ducky6.style.posLeft = ducky6x[count] + ((ducky6x[count+1] - ducky6x[count]) * loopcount/40); ducky6.style.posTop = ducky6y[count] + ((ducky6y[count+1] - ducky6y[count]) * loopcount/40); if(loopcount<40) { loopcount=loopcount+1; } else { loopcount=0; if(count<8) { count=count+1; } else { at_end=true; } } } }