summaryrefslogtreecommitdiff
path: root/engine
diff options
context:
space:
mode:
authorElizabeth Hunt <elizabeth.hunt@simponic.xyz>2023-08-26 13:54:39 -0600
committerElizabeth Hunt <elizabeth.hunt@simponic.xyz>2023-08-26 13:54:39 -0600
commit594921352c8d82fe5f1a6201a4d5f9fbd9b719fc (patch)
tree7021df52266930234b001dbe648040a6fee2d999 /engine
parent2fbe0f0595d06800c1a648a4168b57471d395ee4 (diff)
downloadjumpstorm-594921352c8d82fe5f1a6201a4d5f9fbd9b719fc.tar.gz
jumpstorm-594921352c8d82fe5f1a6201a4d5f9fbd9b719fc.zip
make fetchHadler synchronous only
Diffstat (limited to 'engine')
-rw-r--r--engine/systems/Input.ts8
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);
}
}
}