开发者

deflect the ball in same incoming direction

开发者 https://www.devze.com 2023-02-23 05:40 出处:网络
ballVelocity.y = -ballVelocity.y this above statement makes the ball deflect ,similar to pong game but开发者_运维问答 ..
ballVelocity.y = -ballVelocity.y

this above statement makes the ball deflect ,similar to pong game but开发者_运维问答 ..

I am stuck in making the ball deflect the same direction as the incoming direction ..


Negate the x velocity as well, as in ballVelocity.x = -ballVelocity.x.

0

精彩评论

暂无评论...
验证码 换一张
取 消