logo

Babylon.js Market

By Lawrence

5 minutes

The deck names cards. The seating knows where they go. But run the scene right now and the table just sits there. deck.dealt is sending card ids out, and nothing has moved yet. A poker game's first job is motion. Two cards should slide toward you across the felt and turn over. This lesson makes that happen.

Two playing cards in mid-flight, arcing from the center of an emerald-green felt table down toward the player's edge, fanned slightly apart and face-down showing ornate card backs, motion trails of warm golden light behind them, dramatic overhead spotlight, deep black surround, cinematic and crisp.

Add the Hand entity to the scene

One entity, Hand, carrying a single CardFan:

"Hand": { "components": { "CardFan": { "count": 2, "originZ": -2, "targetZ": -4.5, "spread": 1.8, "selectedBack": 1, "basePath": "/poker" } } }

This sets up two slots. They fly from the center (originZ: -2) down to the player's edge (targetZ: -4.5). They sit 1.8 apart, the same spread the seating layout uses. basePath: "/poker" points at the textures. bjs download already put those in public/poker/ back in Lesson 1.

Continue reading

Unlock the Full Course

Every lesson, the runnable examples, and the finished build — yours to keep.

$9one-time

Was this page helpful?

We read every note — tell us what's working and what isn't.

↑↓ NavigateEnter SelectEsc CloseCtrl+K Open Search