And yes it is an enclosed area (has an eruv) and it is not leveled to the ground like soccer.
R Yehoshua Neuwirth in Shmirat Shabbat KeHilchata (vol. 1, p. 189 in the 2002 edition) allows basketball if
- played on a hard surface such as asphalt or concrete (but not on earth or grass)
- in an area with an eiruv
- one doesn't retrieve a ball which would have lodged in a tree (neither by hand, with a stick or by shaking the tree)
There is a question whether playing sports is in the spirit of Shabbat, especially for older kids or adults. The answer will often be dependent on your specific community and its norms, and is best answered by your local rav.
Also see further sources here.