77
88import { Container } from 'pixi.js' ;
99import { Tween , Easing } from '@tweenjs/tween.js' ;
10- import { Card , CARD_WIDTH , CARD_HEIGHT , TWEEN_DURATION , CARD_VISIBLE_RATIO } from './Card.js' ;
10+ import { Card , CARD_WIDTH , TWEEN_DURATION , CARD_VISIBLE_RATIO } from './Card.js' ;
1111
1212/**
1313 * Right container for displaying opponent cards in a vertical column on the right edge.
@@ -104,10 +104,11 @@ export class Right extends Container {
104104 cards . reverse ( ) . forEach ( ( card ) => this . addChild ( card ) ) ;
105105
106106 const totalCards = cards . length ;
107- const minPaddingToScreenEdge = CARD_HEIGHT / 3 ;
108- const maxSpacingBetweenCards = CARD_HEIGHT * CARD_VISIBLE_RATIO ;
107+ // Use CARD_WIDTH for spacing since cards are rotated 90 degrees
108+ const minPaddingToScreenEdge = CARD_WIDTH / 3 ;
109+ const maxSpacingBetweenCards = CARD_WIDTH * CARD_VISIBLE_RATIO ;
109110
110- const availableHeight = this . _screen . height - 2 * minPaddingToScreenEdge - CARD_HEIGHT ;
111+ const availableHeight = this . _screen . height - 2 * minPaddingToScreenEdge - CARD_WIDTH ;
111112 const spacingBetweenCards = Math . min ( maxSpacingBetweenCards , availableHeight / ( totalCards - 1 ) ) ;
112113
113114 const totalCardsHeight = ( totalCards - 1 ) * spacingBetweenCards ;
@@ -126,8 +127,8 @@ export class Right extends Container {
126127 // Hover direction: push right (positive X)
127128 card . hoverDirX = 1 ;
128129 card . hoverDirY = 0 ;
129- // Tilt : mirrored - cards at top tilt right (+), cards at bottom tilt left (-)
130- card . angle = - ( index - middleIndex ) * 1 ;
130+ // Base -90 degrees for landscape mode, plus tilt : mirrored - cards at top tilt right (+), cards at bottom tilt left (-)
131+ card . angle = - 90 - ( index - middleIndex ) * 1 ;
131132 } ) ;
132133 }
133134}
0 commit comments