10-22-2022, 10:29 PM
Yeah I think the math is there now, but programming is a different story. So far I've failed to get this to work. The bounces sometimes go in the wrong direction, the ball goes through the line sometimes. The problem seems to be that the calculations are sometimes using wrong info, backwards +/- values etc so I'll need to sort all that out. One thing I'll be thrilled to get right is breaking up a frame. Sometimes the ball is moving at say 10 pixels per frame and it could go past the line by 7 pixels for example. I'd like to somehow correctly break that into two parts so that the ball bounces back those 7 pixels in the new direction. If that makes sense.