ttpg-darrell 1.0.13 → 1.0.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -60,7 +60,7 @@ class SimpleCardGarbageHandler {
60
60
  }
61
61
  // Discard.
62
62
  if (deck) {
63
- const toFront = false;
63
+ const toFront = true;
64
64
  const offset = 0;
65
65
  const animate = true;
66
66
  const flipped = false;
@@ -73,6 +73,13 @@ class SimpleCardGarbageHandler {
73
73
  const above = snapPoint.getGlobalPosition().add([0, 0, 10]);
74
74
  const animationSpeed = 0;
75
75
  obj.setPosition(above, animationSpeed);
76
+ // Orient when starting a new discard pile.
77
+ const wantFaceUp = this._shuffleAfterDiscard ? false : true;
78
+ if (obj.isFaceUp() !== wantFaceUp) {
79
+ // Apply instant rotation, flip method animates.
80
+ const rot = obj.getRotation().compose([0, 0, 180]);
81
+ obj.setRotation(rot);
82
+ }
76
83
  obj.snapToGround();
77
84
  obj.snap(); // apply snap point rotation
78
85
  }
@@ -57,7 +57,7 @@ export class SimpleCardGarbageHandler {
57
57
  }
58
58
  // Discard.
59
59
  if (deck) {
60
- const toFront = false;
60
+ const toFront = true;
61
61
  const offset = 0;
62
62
  const animate = true;
63
63
  const flipped = false;
@@ -70,6 +70,13 @@ export class SimpleCardGarbageHandler {
70
70
  const above = snapPoint.getGlobalPosition().add([0, 0, 10]);
71
71
  const animationSpeed = 0;
72
72
  obj.setPosition(above, animationSpeed);
73
+ // Orient when starting a new discard pile.
74
+ const wantFaceUp = this._shuffleAfterDiscard ? false : true;
75
+ if (obj.isFaceUp() !== wantFaceUp) {
76
+ // Apply instant rotation, flip method animates.
77
+ const rot = obj.getRotation().compose([0, 0, 180]);
78
+ obj.setRotation(rot);
79
+ }
73
80
  obj.snapToGround();
74
81
  obj.snap(); // apply snap point rotation
75
82
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ttpg-darrell",
3
- "version": "1.0.13",
3
+ "version": "1.0.16",
4
4
  "description": "TTPG TypeScript library",
5
5
  "main": "./build/cjs/index.js",
6
6
  "module": "./build/esm/index.js",