Make physics more fun
This commit is contained in:
parent
155e360c8e
commit
89fafeafd3
41 changed files with 511 additions and 334 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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));
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue