Make physics more fun

This commit is contained in:
schmelczerandras 2020-10-16 11:48:52 +02:00
parent 155e360c8e
commit 89fafeafd3
41 changed files with 511 additions and 334 deletions

View file

@ -34,7 +34,7 @@ export class KeyboardListener extends CommandGenerator {
if (vec2.squaredLength(movement) > 0) {
vec2.normalize(movement, movement);
}
this.sendCommandToSubcribers(new MoveActionCommand(movement));
this.sendCommandToSubcribers(new MoveActionCommand(movement, true));
}
private normalize(key: string): string {

View file

@ -38,7 +38,7 @@ export class TouchListener extends CommandGenerator {
if (vec2.squaredLength(movement) > 0) {
vec2.normalize(movement, movement);
this.sendCommandToSubcribers(new MoveActionCommand(movement));
this.sendCommandToSubcribers(new MoveActionCommand(movement, false));
}
this.previousPosition = position;
@ -46,7 +46,7 @@ export class TouchListener extends CommandGenerator {
target.addEventListener('touchend', (event: TouchEvent) => {
event.preventDefault();
this.sendCommandToSubcribers(new MoveActionCommand(vec2.create()));
this.sendCommandToSubcribers(new MoveActionCommand(vec2.create(), false));
});
}