Created
December 26, 2019 22:52
-
-
Save kahilkubilay/0d4d5ab5740db007c00e2a80b2f6e569 to your computer and use it in GitHub Desktop.
Javascript İle Oyun Yapımı: Nesnelerin Kontrolü - Çubuk
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
document.onkeydown = function(e){ | |
switch(e.keyCode){ | |
// sol çubuk | |
case 87: | |
console.log('w tusuna basildi'); | |
break; | |
case 83: | |
console.log('s tusuna basildi'); | |
// sağ çubuk | |
case 38: | |
console.log('yukarı ok tuşuna basıldı'); | |
break; | |
case 40: | |
console.log('aşağı ok tuşuna basıldı'); | |
break;} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment