diff --git a/front/dist/resources/icons/icon_talking.svg b/front/dist/resources/icons/icon_talking.svg
new file mode 100644
index 00000000..2f1d03e3
--- /dev/null
+++ b/front/dist/resources/icons/icon_talking.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/front/src/Phaser/Entity/Character.ts b/front/src/Phaser/Entity/Character.ts
index e1fd3a5a..c6fd0c4a 100644
--- a/front/src/Phaser/Entity/Character.ts
+++ b/front/src/Phaser/Entity/Character.ts
@@ -31,6 +31,7 @@ const interactiveRadius = 35;
export abstract class Character extends Container {
private bubble: SpeechBubble | null = null;
private readonly playerName: Text;
+ private readonly iconTalk: Phaser.GameObjects.Image;
public PlayerValue: string;
public sprites: Map;
protected lastDirection: PlayerAnimationDirections = PlayerAnimationDirections.Down;
@@ -97,6 +98,11 @@ export abstract class Character extends Container {
this.playerName.setOrigin(0.5).setDepth(DEPTH_INGAME_TEXT_INDEX);
this.add(this.playerName);
+ this.iconTalk = new Phaser.GameObjects.Image(scene, 0, -45, 'iconTalk')
+ .setScale(0.15)
+ .setVisible(false);
+ this.add(this.iconTalk);
+
if (isClickable) {
this.setInteractive({
hitArea: new Phaser.Geom.Circle(0, 0, interactiveRadius),
@@ -156,6 +162,10 @@ export abstract class Character extends Container {
});
}
+ public showIconTalk(show: boolean = true): void {
+ this.iconTalk.setVisible(show);
+ }
+
public addCompanion(name: string, texturePromise?: Promise): void {
if (typeof texturePromise !== "undefined") {
this.companion = new Companion(this.scene, this.x, this.y, name, texturePromise);
diff --git a/front/src/Phaser/Game/GameScene.ts b/front/src/Phaser/Game/GameScene.ts
index 23a211a6..215797bb 100644
--- a/front/src/Phaser/Game/GameScene.ts
+++ b/front/src/Phaser/Game/GameScene.ts
@@ -245,6 +245,7 @@ export class GameScene extends DirtyScene {
loadCustomTexture(this.load, texture).catch((e) => console.error(e));
}
}
+ this.load.svg('iconTalk', '/resources/icons/icon_talking.svg');
if (touchScreenManager.supportTouchScreen) {
this.load.image(joystickBaseKey, joystickBaseImg);
@@ -630,6 +631,7 @@ export class GameScene extends DirtyScene {
let oldPeerNumber = 0;
this.peerStoreUnsubscribe = peerStore.subscribe((peers) => {
+ console.log(peers);
const newPeerNumber = peers.size;
if (newPeerNumber > oldPeerNumber) {
this.playSound("audio-webrtc-in");