Skip to content

Commit

Permalink
Minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Golen87 committed Apr 26, 2024
1 parent 99d395c commit 6d1a42a
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion automation/neu-template.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"height": 845,
"minWidth": 960,
"minHeight": 570,
"fullScreen": false,
"fullScreen": true,
"alwaysOnTop": false,
"icon": "src/public/icon.png",
"enableInspector": false,
Expand Down
6 changes: 4 additions & 2 deletions src/components/Card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,12 +144,14 @@ export class Card extends Button {
});
}

removeFromGame(index: number) {
removeFromGame(index: number, immediate: boolean) {
if (immediate) return this.destroy();

this.enabled = false;

this.scene.tweens.add({
targets: this,
x: "+=1500",
x: "+=1920",
duration: 700,
delay: index * 100,
ease: "Cubic.easeInOut",
Expand Down
6 changes: 4 additions & 2 deletions src/components/Deck.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ export class Deck extends Phaser.GameObjects.Container {
this.minMoveCount = level.minMove;
this.minTurnCount = level.minTurn;

this.clearHand(true);

this.cardSlots = [];
for (let i = 0; i < level.cards; i++) {
this.cardSlots.push({
Expand Down Expand Up @@ -150,9 +152,9 @@ export class Deck extends Phaser.GameObjects.Container {
});
}

clearHand() {
clearHand(immediate = false) {
this.cards.forEach((card, index) => {
card.removeFromGame(this.handSize - index);
card.removeFromGame(this.handSize - index, immediate);
});
this.cards = [];
}
Expand Down
Binary file modified src/public/banner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 6d1a42a

Please sign in to comment.