The use of the prepositional phrase in this sentence is adjective, because it is part of the noun phrase - the basketball on the roof.
If it weren't a part of the phrase, it would probably be an adverb, but this way, it is not.
1: John and susie both like to read books
2: Elephants and Lions life in Africa
3: never
4: whale
5: science
6: retreat
7: nectarine
8: supper
9: rooster