Add player container
This commit is contained in:
parent
1cd8f5fbe6
commit
b55e927a34
16 changed files with 159 additions and 133 deletions
|
|
@ -1,6 +1,13 @@
|
|||
import { vec2 } from 'gl-matrix';
|
||||
import { Renderer } from 'sdf-2d';
|
||||
import { CharacterBase, CharacterTeam, Circle, Id, UpdateMessage } from 'shared';
|
||||
import {
|
||||
CharacterBase,
|
||||
CharacterTeam,
|
||||
Circle,
|
||||
Id,
|
||||
settings,
|
||||
UpdateMessage,
|
||||
} from 'shared';
|
||||
|
||||
import { BlobShape } from '../shapes/blob-shape';
|
||||
import { ViewObject } from './view-object';
|
||||
|
|
@ -10,15 +17,14 @@ export class CharacterView extends CharacterBase implements ViewObject {
|
|||
|
||||
constructor(
|
||||
id: Id,
|
||||
colorIndex: number,
|
||||
team: CharacterTeam,
|
||||
health: number,
|
||||
head?: Circle,
|
||||
leftFoot?: Circle,
|
||||
rightFoot?: Circle,
|
||||
) {
|
||||
super(id, colorIndex, team, health, head, leftFoot, rightFoot);
|
||||
this.shape = new BlobShape(colorIndex);
|
||||
super(id, team, health, head, leftFoot, rightFoot);
|
||||
this.shape = new BlobShape(settings.colorIndices[team]);
|
||||
}
|
||||
|
||||
public get position(): vec2 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue