Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
当球从角落或左右两侧击中球拍时,球从一侧进入球拍并从另一侧射出。我该如何解决这个问题?谢谢..
我的代码:
if (CGRectIntersectsRect(ball.frame,paddle.frame)) { [self bounceBall]; } - (void) bounceBall { direction.x *= 1; direction.y *=-1; }
这将有助于您解决上述问题。