The Gemara in Sanhedrin 24b records a direct dispute over precisely this question: Rami bar Ḥama holds that gambling is a form of robbery because it rests on asmachta — the loser never fully consents to pay since he assumes he will win, so winnings are not legally acquired — while Rav Sheshet disagrees, ruling that gambling is not asmachta at all since both players enter with full awareness they might lose, and instead disqualifies gamblers for a different reason, namely that they do not engage in productive society.
Following Rav Sheshet's reasoning, the Arukh HaShulchan (Choshen Mishpat 207:23) observes that Mishneh Torah, Robbery and Lost Property 6:11 treats gambling winnings taken from a fellow Jew as only rabbinic robbery — described as the "dust of robbery" — grounding it not in the asmachta mechanism but in the idea that money changes hands through mere sport and jest rather than a genuine transaction, which suggests the Rambam himself did not apply the asmachta theory to gambling.
A significant dissenting voice appears in Shulchan Arukh, Choshen Mishpat 207, where the Rema cites an opinion that gambling occupies a unique third category of asmachta: unlike conditions that depend on others' cooperation (full asmachta) or entirely on one's own action (no asmachta), gambling depends on neither party, and precisely because neither player can predict the outcome, each fully resolves to transfer money on the chance — making the commitment binding and the winnings legally acquired.
The practical bottom line stated in both Tur, Choshen Mishpat 207 and Shulchan Arukh, Choshen Mishpat 207 is that where players wager with coins set aside in advance, the winnings are collectible, but if play was on credit, the loser cannot be compelled to pay — a ruling that reflects the unresolved tension between the asmachta and robbery frameworks that runs through all these sources.