Advertisement
Guest User

Untitled

a guest
May 21st, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Fonction qui écrit toutes les variables //
  2.  
  3.         if (x + dx > canvas.width - ballRadius || x + dx < ballRadius) {
  4.             dx = -dx;
  5.         }
  6.         // Si
  7.         if (y + dy < ballRadius) {
  8.             dy = -dy;
  9.         }
  10.         //
  11.         else if (y + dy > canvas.height - ballRadius) {
  12.             // Si balle touche barre, elle repart dans le sens opposé //
  13.             if (x > paddleX-8 && x < paddleX+8 + paddleWidth) {
  14.                 dy = -dy;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement