Skip to main content

F045 — Deal Animation

Business Rule

When a deal is triggered (HOLE stage), each hole card flies out from the card shuffler sprite in the top-right corner of the game canvas and travels to its assigned position within the relevant hand panel. Cards are launched in sequence with staggered delays so each one is visually distinct. The animation gives the player a clear sense of cards being physically dealt from a shoe. Community cards are not dealt with this animation — they appear via a flip reveal in place.

Technical Design

Card Shuffler (Shoe) Sprite

The card shuffler is a three-layer composite: The card-in-shoe sprite sits at (1118, 79) with:
  • angle: -59°
  • skewY: -0.3
  • scale: (0.58, 0.6)

Animation Sequence

Each hole card goes through two phases:

Phase 1 — Quick Launch from Shoe (~100 ms)

The card group snaps from the shoe position toward a mid-air launch point near (1090, 150) while the angle sweeps from -59°-40°. This phase is linear and brief, simulating the card being pushed out.

Phase 2 — Main Flight to Target (~300–500 ms, path-dependent)

Five parallel tweens run simultaneously: Flight duration is dynamically calculated from the Euclidean distance between the launch point and the card’s final position:
Typical flight time: 300–500 ms at normal speed (PLAY_SPEED = 1).

Stagger Delays

Cards are launched in order with a stagger interval based on their index:
CARD_FLY_STEP = 300 ms — interval between successive card launches.

Timing Constants

V6 Implementation Notes

V6 should replicate this using Phaser 3’s this.tweens.add(). Key differences from v5 (Phaser 2):
  • Use this.tweens.add({ targets, x, y, angle, duration, ease: 'Sine.easeOut' }) instead of game.add.tween
  • Phaser 3 has no native skewY — omit skew or approximate with scaleX oscillation
  • Use this.time.addEvent({ delay, callback }) for the stagger scheduling
  • The shoe sprite should already exist in the v6 atlas (desktop_glass_ui or main_game_desktop) — confirm frame name before implementing
  • Launch sequence: start from shoe card position (1118, 79) with angle: -59, tween to mid-air waypoint (1090, 150) at -40°, then continue to final hand-panel target

V6 Canvas Coordinates

The v6 canvas is 1280 × 720 (landscape). The v5 canvas was the same resolution for desktop. Shoe position (1181, 49) transfers directly.

Mathematics

Dynamic flight duration:
Where (cx, cy) is the hand container origin and (tx, ty) is the card’s local position within the container. For a card in hand 1 at approximately (200, 400):

Acceptance Criteria

Version Parity

V5 Source References