Add better object updates

This commit is contained in:
schmelczerandras 2020-10-17 18:35:09 +02:00
parent fd80a299b6
commit e83c58e1a5
29 changed files with 289 additions and 123 deletions

View file

@ -1,6 +1,6 @@
import { vec2 } from 'gl-matrix';
import { Drawable, Renderer } from 'sdf-2d';
import { CommandExecutors, Id, Random, PlanetBase } from 'shared';
import { CommandExecutors, Id, Random, PlanetBase, UpdateMessage } from 'shared';
import { RenderCommand } from '../commands/types/render';
import { Polygon } from '../shapes/polygon';
import { ViewObject } from './view-object';
@ -18,6 +18,10 @@ export class PlanetView extends PlanetBase implements ViewObject {
(this.shape as any).randomOffset = Random.getRandom();
}
public update(message: Array<UpdateMessage>): void {
throw new Error('Method not implemented.');
}
public step(deltaTimeInMilliseconds: number): void {
(this.shape as any).randomOffset += deltaTimeInMilliseconds / 4000;
}