diff options
Diffstat (limited to 'engine/systems/Input.ts')
-rw-r--r-- | engine/systems/Input.ts | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/engine/systems/Input.ts b/engine/systems/Input.ts index 4a5a3c3..8a68905 100644 --- a/engine/systems/Input.ts +++ b/engine/systems/Input.ts @@ -75,13 +75,17 @@ export class Input extends System { PhysicsConstants.MAX_JUMP_TIME_MS ) { const mass = entity.getComponent<Mass>(ComponentNames.Mass).mass; - entity.getComponent<Forces>(ComponentNames.Forces)?.forces.push({ + + const jumpForce = { fCartesian: { fy: mass * PhysicsConstants.PLAYER_JUMP_ACC, fx: 0 }, torque: 0 - }); + }; + entity + .getComponent<Forces>(ComponentNames.Forces) + ?.forces.push(jumpForce); } } } |