added som ebasic speech bubbles
This commit is contained in:
parent
05379c8001
commit
c51f5f4aa9
5 changed files with 83 additions and 3 deletions
|
@ -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) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue