What error causes the ping-pong effect?

You plan to write an XNA code segment in C# to reverse the direction of the ball when it
collides with a screen boundary.
You write the following code segment.

When you run the code, you discover that sometimes the ball gets stuck at the boundary
resulting in a ping-pong effect back and forth.
What error causes the ping-pong effect?

You plan to write an XNA code segment in C# to reverse the direction of the ball when it
collides with a screen boundary.
You write the following code segment.

When you run the code, you discover that sometimes the ball gets stuck at the boundary
resulting in a ping-pong effect back and forth.
What error causes the ping-pong effect?

A.
The failure of the code to speed up the ball while it is reversing the direction

B.
The failure of the code to reset the ball’s position to the boundary on collision

C.
The failure of the code to wait one frame before reversing the direction of the ball

D.
The failure of the code due to accumulated math errors that break the collision detection



Leave a Reply 0

Your email address will not be published. Required fields are marked *