Click here to Skip to main content
15,921,716 members

Comments by Member 11238660 (Top 2 by date)

Member 11238660 17-Nov-14 6:03am View    
I'm aware that the physics make no sense, but Pong has always been like that. It has really bizzare unreal physics to make the game more challenging and fun.
Member 11238660 16-Nov-14 23:01pm View    
I think I figured out what the intersectY is. It seems like it's actually the value of the Paddle's Y middlepoint position MINUS Ball's Y Position (if the ball hit anywhere between the middle and the top part of the paddle) or the Paddle's Y middlepoint position PLUS Ball's Y Position. Which means it would always give a value between -50 and 50 depending on where it hits (my paddles are 100 pixels in height).

Unfortunately, I did apply the formula in the link but to no prevail. Despite being inside the IF statement of a collision, sometimes it actually goes through the paddle even though it detected a collision due to this formula, and the angles are all messed up with it flying off at random directions.

So I guess that formula is not the correct way to do it then. Do you have any other method of achieving a way to bounce the ball off at angles?

If all else fails, I'll resort to splitting the paddle into 3 sections and applying an angle based off on that, though that wouldn't replicate the true nature of pong since it bounces at a different angle based on each individual pixel of the paddle.