Some improvements
This commit is contained in:
parent
d078d67d58
commit
4f75ce7065
12 changed files with 160 additions and 161 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue