На основе этого кода придумал игру: поймай квадратик
<!DOCTYPE HTML>
<html>
<body onload = "move(document.getElementById('a'))">
<script>
var b;
function move(el) {
var i = 0, fading = 180;
el.style.left = 0;
el.style.top = 0;
function fc() {
el.style.left = (Math.cos(i/180*Math.PI) * el.parentNode.clientWidth*fading/180) + "px";
el.style.top = (Math.abs(Math.sin((i-fading/2)/180*Math.PI) * el.parentNode.clientHeight)) + "px";
i++;
fading -= 0.125;
if(fading <= 0) {clearInterval(b); alert("Вы проиграли!"); document.getElementById("a").onclick = function() {alert("Поздно!")}}
};
b = setInterval(fc, 10);
}
</script>
<div style = "height: 295px; width: 320px; position: absolute; left: 295px">
<div style="height: 40px; width: 40px; background-color: blue; position: absolute; left: 0px; top: 0px" id = "a" onclick = "alert('Вы выиграли!'); clearInterval(b); this.onclick = function() {}"></div>
</div>
</body>
</html>