diff options
| author | Elizabeth Hunt <me@liz.coffee> | 2026-03-07 15:01:14 -0800 |
|---|---|---|
| committer | Elizabeth Hunt <me@liz.coffee> | 2026-03-07 15:10:27 -0800 |
| commit | f643f0afb8c7d91a7a39ff96f58b95baac985ce0 (patch) | |
| tree | cfc13e8b8a53d968929b02224e3a7c8c01e35ec5 /docs/input.txt | |
| parent | f2135acc9accdc938035d753ee6e79c865fd44e2 (diff) | |
| download | dyl-f643f0afb8c7d91a7a39ff96f58b95baac985ce0.tar.gz dyl-f643f0afb8c7d91a7a39ff96f58b95baac985ce0.zip | |
Some really good refactoring happening in here
Diffstat (limited to 'docs/input.txt')
| -rw-r--r-- | docs/input.txt | 18 |
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. + |
