Microsoft
98-374 · Question #60
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…
The correct answer is B. The failure of the code to reset the ball's position to the boundary on collision. See the full explanation below for the reasoning.
Question
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?
Exhibit
Options
- AThe failure of the code to speed up the ball while it is reversing the direction
- BThe failure of the code to reset the ball's position to the boundary on collision
- CThe failure of the code to wait one frame before reversing the direction of the ball
- DThe failure of the code due to accumulated math errors that break the collision detection
How the community answered
(39 responses)- A8% (3)
- B85% (33)
- C5% (2)
- D3% (1)
Community Discussion
No community discussion yet for this question.
