Add player container

This commit is contained in:
schmelczerandras 2020-10-24 10:01:54 +02:00
parent 1cd8f5fbe6
commit b55e927a34
16 changed files with 159 additions and 133 deletions

View file

@ -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 {