diff --git a/pongwars/index.html b/pongwars/index.html index 7fb98b2..3b8782c 100644 --- a/pongwars/index.html +++ b/pongwars/index.html @@ -1,177 +1,176 @@ - - Pong wars | Koen van Gilst - - - + #made a { + color: #172b36; + } + + - -
- -
-

- made by Koen van Gilst | source on - github -

-
- + +
+ +
+

+ made by Koen van Gilst | source on + github +

+
+ - + if ( + t.x + t.dx > canvas.width - squareSize / 2 || + t.x + t.dx < squareSize / 2 + ) { + t.dx = -t.dx; + } + if ( + t.y + t.dy > canvas.height - squareSize / 2 || + t.y + t.dy < squareSize / 2 + ) { + t.dy = -t.dy; + } + + t.x += t.dx; + t.y += t.dy; + } + + updateScoreElement(); + // suddenDeathCoeff = Math.min((elapsedSec()/60/3)**15, 1); + requestAnimationFrame(draw); + } + + requestAnimationFrame(draw); +