Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Fonction qui écrit toutes les variables //
- if (x + dx > canvas.width - ballRadius || x + dx < ballRadius) {
- dx = -dx;
- }
- // Si
- if (y + dy < ballRadius) {
- dy = -dy;
- }
- //
- else if (y + dy > canvas.height - ballRadius) {
- // Si balle touche barre, elle repart dans le sens opposé //
- if (x > paddleX-8 && x < paddleX+8 + paddleWidth) {
- dy = -dy;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement