Skip to content

Instantly share code, notes, and snippets.

@kahilkubilay
Created December 26, 2019 23:01
Show Gist options
  • Save kahilkubilay/54e06ba9dd1af3b8a1a72954cfb91b71 to your computer and use it in GitHub Desktop.
Save kahilkubilay/54e06ba9dd1af3b8a1a72954cfb91b71 to your computer and use it in GitHub Desktop.
Javascript İle Oyun Yapımı: Nesnelerin Kontrolü - Top
// oyunun sürekli devam etmesi için gerekli yapı
function gameLoop(){
// topun alacağı değerler
ball.style.top = pxAdd(parseInt(ball.style.top) + 2);
ball.style.left = pxAdd(parseInt(ball.style.left) + 2);
}
setInterval(gameLoop, 20);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment