Created
December 27, 2019 11:24
-
-
Save kahilkubilay/49219efb15e62d8864d4e02f1faaf7c0 to your computer and use it in GitHub Desktop.
Javascript İle Oyun Yapımı: Skor Tablosu
This file contains hidden or 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
// function gameLoop... | |
if(parseInt(ball.style.left) <= 0){ | |
if(++scoreRight === 5){ | |
alert('2. oyuncu kazandı.'); | |
scoreRight = 0; | |
scoreLeft = 0; | |
document.getElementById('scoreLeft').innerHTML = scoreLeft; | |
} | |
document.getElementById('scoreRight').innerHTML = scoreRight; | |
gameChain(); | |
} | |
if(parseInt(ball.style.left) + 16 >= window.innerWidth){ | |
if(++scoreLeft === 5){ | |
alert('1. oyuncu kazandı.'); | |
scoreRight = 0; | |
scoreLeft = 0; | |
document.getElementById('scoreRight').innerHTML = scoreRight; | |
} | |
document.getElementById('scoreLeft').innerHTML = scoreLeft; | |
gameChain(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment