Add player container
This commit is contained in:
parent
1cd8f5fbe6
commit
b55e927a34
16 changed files with 159 additions and 133 deletions
|
|
@ -97,12 +97,11 @@ export class PlayerCharacterPhysical
|
|||
name: string,
|
||||
killCount: number,
|
||||
deathCount: number,
|
||||
public readonly colorIndex: number,
|
||||
team: CharacterTeam,
|
||||
private readonly container: PhysicalContainer,
|
||||
startPosition: vec2,
|
||||
) {
|
||||
super(id(), name, killCount, deathCount, colorIndex, team, settings.playerMaxHealth);
|
||||
super(id(), name, killCount, deathCount, team, settings.playerMaxHealth);
|
||||
|
||||
this.head = new CirclePhysical(
|
||||
vec2.add(vec2.create(), startPosition, PlayerCharacterPhysical.headOffset),
|
||||
|
|
@ -176,7 +175,6 @@ export class PlayerCharacterPhysical
|
|||
const projectile = new ProjectilePhysical(
|
||||
vec2.clone(this.center),
|
||||
20,
|
||||
this.colorIndex,
|
||||
strength,
|
||||
this.team,
|
||||
velocity,
|
||||
|
|
|
|||
|
|
@ -34,14 +34,13 @@ export class ProjectilePhysical
|
|||
constructor(
|
||||
center: vec2,
|
||||
radius: number,
|
||||
colorIndex: number,
|
||||
public strength: number,
|
||||
public team: CharacterTeam,
|
||||
team: CharacterTeam,
|
||||
private velocity: vec2,
|
||||
public readonly originator: PlayerCharacterPhysical,
|
||||
readonly container: PhysicalContainer,
|
||||
) {
|
||||
super(id(), center, radius, colorIndex, strength);
|
||||
super(id(), center, radius, team, strength);
|
||||
this.object = new CirclePhysical(center, radius, this, container, 0.9);
|
||||
|
||||
this.moveOutsideOfObject();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue