added som ebasic speech bubbles

This commit is contained in:
kharhamel 2020-04-12 19:35:51 +02:00
parent 05379c8001
commit c51f5f4aa9
5 changed files with 83 additions and 3 deletions

View file

@ -1,6 +1,6 @@
import {GameManagerInterface} from "./GameManager";
import {UserInputEvent, UserInputManager} from "../UserInput/UserInputManager";
import {getPlayerAnimations, PlayerAnimationNames} from "../Player/Animation";
import {getPlayerAnimations} from "../Player/Animation";
import {Player} from "../Player/Player";
import {NonPlayer} from "../NonPlayer/NonPlayer";
@ -65,7 +65,6 @@ export class GameScene extends Phaser.Scene implements GameSceneInterface{
this.otherPlayers.add(new NonPlayer(this, 400, 600));
this.physics.add.collider(this.player, this.otherPlayers, (player: Player, otherPlayer: NonPlayer) => {
console.log("Don't touch me!");
otherPlayer.fleeFrom(player)
});
@ -120,6 +119,10 @@ export class GameScene extends Phaser.Scene implements GameSceneInterface{
this.player.move(0, 0)
}
if(activeEvents.get(UserInputEvent.Shout)) {
this.player.say('HEHO!');
}
//updates other players
this.otherPlayers.getChildren().forEach((otherPlayer: NonPlayer) => {