What is the word ball in this sentence?

The young boy played ball in the yard.

adverb?

Ball is a noun, the direct object of the verb, played.

It answers the question "What?" after the verb. Therefore, it must be a direct object.

Adverbs tell when, where, why, and how.