Skip to content

Commit 1001c9f

Browse files
committed
feat:pvp
1 parent ce6068e commit 1001c9f

File tree

11 files changed

+447
-189
lines changed

11 files changed

+447
-189
lines changed

packages/renderer/src/scenes/TileMap.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ export class TileMap extends Phaser.Scene {
199199
);
200200
troop.setDepth(troop.y);
201201
actorType === 'D'
202-
? this.opponent_troops.set(id, troop)
202+
? this.opponent_troops.set(id, this.add.existing(troop))
203203
: this.troops.set(id, this.add.existing(troop));
204204
},
205205
);
@@ -554,9 +554,14 @@ export class TileMap extends Phaser.Scene {
554554
tower.healthBar.destroy();
555555
tower.destroy();
556556
});
557+
this.opponent_troops.forEach(troop => {
558+
troop.removeAllListeners();
559+
troop.healthBar.destroy();
560+
troop.destroy();
561+
});
557562
this.troops = new Map();
558563
this.towers = new Map();
559-
564+
this.opponent_troops = new Map();
560565
const tweens = this.tweens.getAllTweens();
561566
tweens.forEach(tween => {
562567
tween.complete();
@@ -567,5 +572,8 @@ export class TileMap extends Phaser.Scene {
567572
this.troops.forEach(skeleton => {
568573
skeleton.update();
569574
});
575+
this.opponent_troops.forEach(skeleton => {
576+
skeleton.update();
577+
});
570578
}
571579
}

src/components/BattleTV/BattleTV.module.css

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,3 +279,55 @@
279279
color: #0a1c2a;
280280
background-color: #aaaaaa;
281281
}
282+
283+
284+
.whiteButton {
285+
align-content: right;
286+
color: #ffffff !important;
287+
font-weight: 400;
288+
font-family: Bai Jamjuree;
289+
font-style: normal;
290+
background-color: inherit !important;
291+
font-size: 2em;
292+
border-bottom: 2px solid white;
293+
border-top: 0;
294+
border-left: 0;
295+
border-right: 0;
296+
transition: 0.5s;
297+
border-radius: 0;
298+
padding: 0 50px;
299+
}
300+
301+
.darkButton {
302+
align-content: right;
303+
color: rgba(234, 234, 234, 0.6);
304+
background-color: inherit !important;
305+
font-family: Bai Jamjuree;
306+
font-weight: 400;
307+
font-style: normal;
308+
border-bottom: 2px solid rgba(234, 234, 234, 0.6);
309+
border-top: 0;
310+
border-left: 0;
311+
border-right: 0;
312+
font-size: 2em;
313+
transition: 0.5s;
314+
border-radius: 0px;
315+
box-shadow: none !important;
316+
padding: 0 50px;
317+
}
318+
319+
.darkButton:hover {
320+
color: #ffffff;
321+
}
322+
323+
.whiteButton:active,
324+
.darkButton:active {
325+
box-shadow: none;
326+
}
327+
328+
.buttonContainer {
329+
display: flex;
330+
flex-direction: row;
331+
justify-content: center;
332+
margin: 1rem;
333+
}

0 commit comments

Comments
 (0)