nst length = Math.sqrt(wallVec.x * wallVec.x + wallVec.y * wallVec.y);
                    const normal = {x: -wallVec.y / length, y: wallVec.x / length};
                    
                    // Calculate dot product of velocity and normal
                    const dot = ball.velocityX * normal.x + ball.velocityY * normal.y;
                    
                    // Apply reflection
                    ball.velocityX = ball.velocityX - 2 * dot * normal.x;
                    ball.velocityY = ball.velo