summaryrefslogtreecommitdiff
path: root/docs/input.txt
diff options
context:
space:
mode:
Diffstat (limited to 'docs/input.txt')
-rw-r--r--docs/input.txt18
1 files changed, 18 insertions, 0 deletions
diff --git a/docs/input.txt b/docs/input.txt
new file mode 100644
index 0000000..d5bc1a7
--- /dev/null
+++ b/docs/input.txt
@@ -0,0 +1,18 @@
+Entities will have an ActionQueue component. The ActionQueue is a set of actions and durations within which those
+actions may be applied. This will solve the issue of buffering inputs as well as having multiple systems control which
+actions an entity might take (for a future AI system, perhaps?).
+
+Let's introduce the jumping mechanics of this game as an example of the system interaction with entities.
+
+When the player presses a key mapped to a Jumping action, a Jump action is queued and expires in 80 milliseconds.
+The JumpSystem consumes the action if the entity is able to "physically" jump:
+- it is in contact with a solid underneath and has zero velocity on the y axis (?) and there is no current Jump component
+- or, there is a Jump component but the "availableJump" counter is greater than zero (it is decremented on consumption
+ of the Jump action), to account for the future of a double jump being possible.
+
+If the JumpSystem does not consume() the action within the allotted 80 milliseconds, the action expires and is removed
+from the queue.
+
+The queue is an action-singleton queue. Meaning, enqueueing an action has the effect of replacing any action of the same
+type whose expiration is earlier than the enqueued action.
+