Added multi-jumps to jump method/can_jump interval test
This is an attempt to start resolving #1848 .
As of current this only has added multi-jump capabilities to the jump method. I added in the ability to set various types of multi-jump: set, additive, and limited (additive to a point).
I also added a jump interval timer delay based on ticks of the physics engine being updated.
I believe that there is more work to be done on this. Specifically making it so players can jump off ladders. In the meantime, I would like some critiques on how it is currently coded so that we can ensure that this is inline with the rest of the library.
@FriendlyGecko are you still interested in working on this?
Yes, I am.
However, I am unsure if it is ready/what do we need in order to determine if it is ready.
Items I am considering
- [x] Singular jump/multijump capable from one command
- [x] Multijump with configurable delay
- [x] Multiple styles of multijump
- [x] Capability to jump from ladder (without jumps instantly resetting)
Is there anything else you can think of that would be necessary?
This request also adds an is_on_ground test which we can use to differentiate cases where we want altering behavior based on if the player is on a ladder vs the ground.
NOTE: In order to test this properly in regards to jumping while on a ladder, it is imperative that you alter the default jump_delay time to a number greater than 0 (10 is a good number). Otherwise player will launch like a rocket up the ladder with infinite jumps. The delay functions to limit the player from instantaneously jumping repeatedly and prevents them from just jumping up the entire ladder unchecked.
To further support this, I believe that if we want to merge this, then we need to update the test AND change the default delay_time to 10.
Any chance to add some unit tests for this? Documentation? Examples?
Perhaps not in near-near future, but early July my schedule should be a little more open.
By documentation do you mean within the code or within the rest of the project's documentation? And by examples do you mean like example code showing/explaining how one could use it? If so, then absolutely.
After some discussion: This feature can easily be implemented on the user side. I don't think we want more complexity in these simple physicsengines. We will probably brush them up a bit in 3.x. At that point we could look at something like this.