Created
          December 27, 2019 10:38 
        
      - 
      
- 
        Save kahilkubilay/27ba9798612f697daaccaa4b3727197f 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
    
  
  
    
  | //gameLoop function.... | |
| if(parseInt(ball.style.left) <= 0){ | |
| scoreRight++; | |
| document.getElementById('scoreRight').innerHTML = scoreRight; | |
| gameChain(); | |
| } | |
| if(parseInt(ball.style.left) + 16 >= window.innerWidth){ | |
| scoreLeft++; | |
| document.getElementById('scoreLeft').innerHTML = scoreLeft; | |
| gameChain(); | |
| } | |
| } | |
| function gameChain(){ | |
| ball.style.top = window.innerHeight/2 + 'px'; | |
| ball.style.left = (window.innerWidth/2) - (16/2) + 'px'; | |
| } | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment