Some improvements

This commit is contained in:
schmelczerandras 2020-09-12 12:18:11 +02:00
parent d078d67d58
commit 4f75ce7065
12 changed files with 160 additions and 161 deletions

View file

@ -21,13 +21,7 @@ export class Character extends GameObject {
constructor(private game: IGame) {
super();
this.light = new CircleLight(
vec2.create(),
40,
this.shape.boundingCircleRadius * 2,
vec3.fromValues(0.67, 0.0, 0.33),
2
);
this.light = new CircleLight(vec2.create(), 30, vec3.fromValues(0.67, 0.0, 0.33), 2);
this.addCommandExecutor(StepCommand, this.stepHandler.bind(this));
this.addCommandExecutor(RenderCommand, this.draw.bind(this));
@ -115,7 +109,7 @@ export class Character extends GameObject {
private setPosition(value: vec2) {
this.shape.position = value;
this.light.center = value;
this.light.center = vec2.add(vec2.create(), value, vec2.fromValues(150, 0));
}
public stepHandler(c: StepCommand) {

View file

@ -10,7 +10,7 @@ export class Lamp extends GameObject {
constructor(center: vec2, radius: number, color: vec3, lightness: number) {
super();
this.light = new CircleLight(center, radius, radius, color, lightness);
this.light = new CircleLight(center, radius, color, lightness);
this.addCommandExecutor(RenderCommand, this.draw.bind(this));
this.addCommandExecutor(MoveToCommand, this.moveTo.bind(this));