A plays the joke. A laughs.
B is teased or tricked by the joke.
The joke is being played by A, onto B.
In grammar, A is the subject of the sentence, and B is the direct object of the sentence.
You can say: "A played a joke on B," if it already happend or "A is playing a joke on B." if it is happening now or in the immediate future.
I hope this helps!