A boy plays basketball.
The boy is on a basketball court.
Just because a boy is playing basketball doesn't mean he's on a court.
We have no idea if he is on a basketball court or not, you can play basketball in a number of places.
You can not infer he is on a court.