Pieter Heyvaert
Asteroiden ontwijken Per ontweken asteroide +10 punten Wanneer geraakt = Game Over
var laag1=36; var hoog1=540; var will1=Math.random() var x1=Math.floor((hoog1-laag1+1)*will1); var y1=Math.floor(laag1); var getalK=x1+y1; var nieuweHoogte = getalK + "px";
$("#asteroid").css("visibility","visible"); $("#asteroid").animate({left:'0px'}, 2000,function() {; $("#asteroid").css("visibility","hidden"); $("#asteroid").css("top",nieuweHoogte) $("#asteroid").css({left:'750px'}); punt=parseInt (punt); punt= punt+10; document.getElementById('point').value=(punt); })
$("#up").click(function(){ $("#ship").animate({top:'+=-50px'}); hoogteShip=hoogteShip-50; }); $("#down").click(function(){ $("#ship").animate({top:'+=50px'}); hoogteShip=hoogteShip+50; });
function() {; if((getalK > (hoogteShip-34)) & (getalK < (hoogteShip+40 ))){ $("#asteroid").css("visibility","hidden"); $("#ship").css("visibility","hidden"); $("#rightborder").css("visibility","hidden"); $('#container').css("background-image", "url(../images/gameOver.jpg)"); clearInterval(timer);
$("#restart").click(function(){ window.location.reload(); });