|
7 | 7 |
|
8 | 8 | import { Container, Graphics } from 'pixi.js'; |
9 | 9 | import { Tween, Easing } from '@tweenjs/tween.js'; |
10 | | -import { Card, CARD_WIDTH, CARD_HEIGHT, TWEEN_DURATION } from './Card.js'; |
| 10 | +import { Card, CARD_WIDTH, CARD_HEIGHT, CARD_MAX_TABLE_ANGLE, TWEEN_DURATION } from './Card.js'; |
11 | 11 |
|
12 | 12 | /** |
13 | 13 | * Table container for displaying cards in the center play area. |
@@ -72,7 +72,7 @@ export class Table extends Container { |
72 | 72 | // Card positions are at center, so add half card size to keep cards fully inside |
73 | 73 | this._bounds.minX = paddingX + CARD_WIDTH / 3; |
74 | 74 | this._bounds.maxX = this._screen.width - paddingX - CARD_WIDTH / 3; |
75 | | - this._bounds.minY = paddingY + CARD_HEIGHT / 2; |
| 75 | + this._bounds.minY = paddingY + CARD_HEIGHT / 3; |
76 | 76 | this._bounds.maxY = this._screen.height - paddingY - (2 * CARD_HEIGHT) / 3; |
77 | 77 |
|
78 | 78 | this._drawBounds(); |
@@ -128,12 +128,7 @@ export class Table extends Container { |
128 | 128 |
|
129 | 129 | for (let i = 0; i < this._quadrantCards.length; i++) { |
130 | 130 | const qb = this._getQuadrantBounds(i); |
131 | | - this._boundsGraphics.rect( |
132 | | - qb.minX, |
133 | | - qb.minY, |
134 | | - qb.maxX - qb.minX, |
135 | | - qb.maxY - qb.minY |
136 | | - ); |
| 131 | + this._boundsGraphics.rect(qb.minX, qb.minY, qb.maxX - qb.minX, qb.maxY - qb.minY); |
137 | 132 | this._boundsGraphics.stroke({ width: 2, color: 0xff0000 }); |
138 | 133 | } |
139 | 134 | } |
@@ -182,17 +177,17 @@ export class Table extends Container { |
182 | 177 | // CCW is negative in Pixi.js, CW is positive |
183 | 178 | let angle; |
184 | 179 | switch (quadrantIndex) { |
185 | | - case 0: // top-left: CCW 0 to 20 (angle -20 to 0) |
186 | | - angle = Math.random() * -20; |
| 180 | + case 0: // top-left: CW 0 to CARD_MAX_TABLE_ANGLE |
| 181 | + angle = Math.random() * CARD_MAX_TABLE_ANGLE; |
187 | 182 | break; |
188 | | - case 1: // top-right: CW 0 to 20 (angle 0 to 20) |
189 | | - angle = Math.random() * 20; |
| 183 | + case 1: // top-right: CCW 0 to CARD_MAX_TABLE_ANGLE |
| 184 | + angle = Math.random() * -CARD_MAX_TABLE_ANGLE; |
190 | 185 | break; |
191 | | - case 2: // bottom-left: CW 0 to 20 (angle 0 to 20) |
192 | | - angle = Math.random() * 20; |
| 186 | + case 2: // bottom-left: CCW 0 to CARD_MAX_TABLE_ANGLE |
| 187 | + angle = Math.random() * -CARD_MAX_TABLE_ANGLE; |
193 | 188 | break; |
194 | | - case 3: // bottom-right: CCW 0 to 20 (angle -20 to 0) |
195 | | - angle = Math.random() * -20; |
| 189 | + case 3: // bottom-right: CCW 0 to CARD_MAX_TABLE_ANGLE |
| 190 | + angle = Math.random() * -CARD_MAX_TABLE_ANGLE; |
196 | 191 | break; |
197 | 192 | default: |
198 | 193 | angle = 0; |
|
0 commit comments