From 46b8f7bcc7204406c906a24c8fb9628c07db6fd8 Mon Sep 17 00:00:00 2001 From: Dabit Date: Tue, 10 Mar 2026 14:50:41 +0100 Subject: [PATCH] =?UTF-8?q?feat(01-02):=20add=20ball=20physics=20=E2=80=94?= =?UTF-8?q?=20movement,=20wall=20bounce,=20zone=20deflection,=20and=20Game?= =?UTF-8?q?Config?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add GameConfig with initialBallSpeed (220px/s), speedIncrement (18px/s), paddleSpeed (400px/s) - Add Physics.serveBall(): centers ball, sets random angle (-45 to +45 deg), random left/right dir - Replace Physics.update() skeleton with full ball movement and wall bounce logic - Add Physics._checkPaddleCollision() with 5-zone angle deflection and speed increment per hit - Ball exits left/right bounds → immediate re-serve from center - Ball pushed out of paddle on collision to prevent double-hit next frame - Add on-canvas speed debug display (Phase 1 verification aid) --- index.html | 106 +++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 99 insertions(+), 7 deletions(-) diff --git a/index.html b/index.html index aaf836c..c0c9e1a 100644 --- a/index.html +++ b/index.html @@ -13,6 +13,12 @@