Improve gameplay
This commit is contained in:
parent
7412bc8af5
commit
793d9a81e8
1 changed files with 275 additions and 226 deletions
|
|
@ -42,9 +42,8 @@ export class Player extends PlayerBase {
|
|||
(this.aspectRatio = v.aspectRatio),
|
||||
[MoveActionCommand.type]: (c: MoveActionCommand) =>
|
||||
this.character?.handleMovementAction(c),
|
||||
[PrimaryActionCommand.type]: (c: PrimaryActionCommand) => {
|
||||
this.character?.shootTowards(c.position);
|
||||
},
|
||||
[PrimaryActionCommand.type]: (c: PrimaryActionCommand) =>
|
||||
this.character?.shootTowards(c.position, c.charge),
|
||||
};
|
||||
|
||||
constructor(
|
||||
|
|
@ -60,11 +59,7 @@ export class Player extends PlayerBase {
|
|||
}
|
||||
|
||||
protected createCharacter() {
|
||||
const preferredCenter = this.playerContainer.players.find(
|
||||
(p) => p.character?.isAlive && p.team === this.team,
|
||||
)?.center;
|
||||
|
||||
super.createCharacter(preferredCenter ?? vec2.create());
|
||||
super.createCharacter();
|
||||
|
||||
this.objectsPreviouslyInViewArea.push(this.character!);
|
||||
this.queueCommandSend(new CreatePlayerCommand(this.character!));
|
||||
|
|
@ -206,8 +201,4 @@ export class Player extends PlayerBase {
|
|||
this.queueCommandSend(new ServerAnnouncement(announcement));
|
||||
}
|
||||
}
|
||||
|
||||
public destroy() {
|
||||
super.destroy();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue