Skip to content

Commit 1a60468

Browse files
committed
Add note
1 parent 430ddf9 commit 1a60468

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Sources/OctopusKit/Components/Input/Keyboard/KeyboardControlledForceComponent.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ public final class KeyboardControlledForceComponent: OctopusComponent, OctopusUp
2121

2222
// TODO: Tests
2323

24+
// DESIGN: A `resetAccelerationWhenChangingDirection` is probably not needed because the inertia and friction of the physics body should take care of that anyway, right?
25+
2426
public override var requiredComponents: [GKComponent.Type]? {
2527
[KeyboardEventComponent.self,
2628
PhysicsComponent.self]
@@ -101,6 +103,7 @@ public final class KeyboardControlledForceComponent: OctopusComponent, OctopusUp
101103
}
102104

103105
// Did player press a directional arrow key?
106+
104107
// ❕ NOTE: Don't use `switch` or `else` because we want to process multiple keypresses, to generate diagonal forces and also cancel out opposing directions.
105108

106109
let codesPressed = keyboardEventComponent.codesPressed

0 commit comments

Comments
 (0)