FTFYJeeper wrote:The variable vy (Vertical Velocity in this case) determines the vertical direction and speedof the ball. When the ball collides with the paddle it checks where on the paddle it has collided; the higher up the collision was the lower it sets the velocity, the lower the collision was the higher it sets the velocity.nice wrote:
Could you explain further what it does? personally I don't really know what's happening
Any good Pong articles?
Re: Any good Pong articles?
Re: Any good Pong articles?
Instead of making multi hitboxes just conver rad to deg and using arctan2.
(not lua) but lua should have radtodeg and arctan2 functions.
Code: Select all
degree = radtodeg(arctan2(vec1.y - vec2.y, vec2.x - vec1.x));
Re: Any good Pong articles?
Rukiri wrote:Instead of making multi hitboxes just conver rad to deg and using arctan2.(not lua) but lua should have radtodeg and arctan2 functions.Code: Select all
degree = math.deg(math.atan2(vec1.y - vec2.y, vec2.x - vec1.x))
Who is online
Users browsing this forum: No registered users and 14 guests