Add basic multiplayer
This commit is contained in:
parent
0f0a1eaf67
commit
46a48e7c15
113 changed files with 1362 additions and 754 deletions
19
frontend/src/scripts/objects/character-view.ts
Normal file
19
frontend/src/scripts/objects/character-view.ts
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
import { vec2 } from 'gl-matrix';
|
||||
import { CharacterBase, CommandExecutors } from 'shared';
|
||||
import { RenderCommand } from '../commands/types/render';
|
||||
import { BlobShape } from '../shapes/blob-shape';
|
||||
|
||||
export class CharacterView extends CharacterBase {
|
||||
private shape = new BlobShape();
|
||||
|
||||
protected commandExecutors: CommandExecutors = {
|
||||
[RenderCommand.type]: (c: RenderCommand) => {
|
||||
this.shape.setCircles([this.head, this.leftFoot, this.rightFoot]);
|
||||
c.renderer.addDrawable(this.shape);
|
||||
},
|
||||
};
|
||||
|
||||
public get position(): vec2 {
|
||||
return this.head.center;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue