VALENÇA, Brazil — The white-bearded, dreadlocked master and his bushy-haired student face off in an open-sided compound set amid cacao trees and coffee bushes.

The two are in constant motion, swinging back and forth in what is called the ginga — the fundamental movement of the Brazilian combat game capoeira. At times, the way they feint and kick, and roll under and over and around each other, looks like choreographed dance.

But then one side does something the other is not expecting, and it becomes clear that this is a game of strategy, not a planned dance. Mestre Cobra Mansa’s ginga transforms into the movement of a staggering drunk, then a marionette whose puppeteer has suddenly let the string go slack. Then he’s in a handstand. From there, a leg strikes out like a lightning bolt, stopping just short of hitting his opponent’s face.

The circle of men and women surrounding the combatants are engaged in a hypnotic call-and-response song about an encounter with a dangerous snake. It’s intoned to the beat of Afro-Brazilian drums and the twang of single-stringed gourd instruments called berimbaus.