3 ms·
How to Reflect the Ball at an Angle?
Here's the full code:
https://codepen.io/pelko/pen/MWBpNmL
When a ball collides with bat or walls, I want the ball to be reflected with an angle, how do I do it?
I suspect there's lots of physics to it. So, should I stop this project here? I'd have to probably build a part of game engine…Can anyone help here?
- JoeyBananas 4y agoThere's no physics required if you want the ball to move at a constant velocity.
- moistly 4y agoWhy are so many users not using the “Ask HN” prefix for their questions?
- shivajikobardan 4y agoHow do I use that prefix?
- moistly 4y agoYou write “Ask HN: How to Reflect the Ball at an Angle?” Which is, I note, something you will have seen every day on HN. Hell, there’s even an “Ask” link at the top of the page that shows you endless examples of how to write your question.