Patch:Keen jumping (Vorticons)
This page contains patches relating to the player jumping in Keen Vorticons. This is a complex action with many intricacies. Broadly jumping can be divided into three sections, preparing to jump, jumping and falling through the air. More patches affecting the player can be found at Patch:Keen (Keen 1), Patch:Keen (Keen 2) and Patch:Keen (Keen 3). Closely related to jumping is walking.
Falling is a continuation of jumping and so is also treated here.
Keen's jump behavior is triggered in two distinct situations. The first is when standing\walking on solid ground. The second is more cryptic, it triggers when Keen is standing, walking or something similar; but not on solid ground. In Keen 2\3 this happens when Keen is on moving platforms. In all three Vorticons episodes this can also happen if Keen is just landing with his pogo equipped but then stops it and jumps. (A tricky maneuver.)
Keen exits jumping by going to the falling behavior; though this is a bit disingenuous. When Keen goes to falling he in fact releases all his jump speeds, meaning he is moving up in the air. (The actual jump behavior will only get him 3 pixels off the ground.)
|Patch: Keen 1 jump related behaviors|
|Patch: Keen 2 jump related behaviors|
|Patch: Keen 3 jump related behaviors|
The pre-jump pause
As noted above, Keen's jump speeds are mainly effective after he has stopped jumping, when he is using falling code. The jump itself is quite short, (24 tics by default,) and is used to build up vertical speed as well as play the jumping animation sequence. (These are explained in the following sections.
Changing the length of the pre-jump pause will drastically affect the jump, so care should be taken.
|Patch: The pre-jump pause|
Keen jumps instantly
This patch allows Keen to jump (nearly) as soon as the jump key is pressed. This actually reduces the pre-jump pause to 4 tics, about 10% of its normal length. The jump height is then increased to compensate for this. The animations are not changed however which means that using this patch Keen will use only one frame when jumping instead of 6.
|Patch: The pre-jump pause|
Keen's jump speeds are curious and complex. When jumping left or right a check is made on Keen's horizontal speed. If his speed is less than a certain amount (by default his walking speed.) then he will have his jump speed set to a certain value; otherwise he will use his current horizontal speed. What this means is that is Keen is moving slower than he can walk he will jump as fast as he can walk; but if he is moving faster than he can walk (for example, when slipping on ice.) he will jump at that faster speed instead. See Patch:Jump conditions.
Changing the checks ($7E\$7D) to $90 $90 will make all of Keen's jumps the same horizontal speed. The checks will have to be changed if Keen's walking speeds are altered.
Keen's jump height as it is set by default is twice the number of tiles he can jump. (It is 6, he can jump 3 tiles high.) However it is also affected by the length of his pre-jump pause; if this is made longer he will jump higher, if it is made shorter he will jump lower. This must be taken into account if the pause is altered. (See section above.)
|Patch: Keen's jump height - Keen 1|
|Patch: Keen's jump height - Keen 2|
|Patch: Keen's jump height - Keen 3|
There are two types of animation involved in jumping; starting and actual. The starting animations are set before Keen jumps and should match those of the actual jumping animations to ensure a smooth jump.
When jumping Keen's animations depend heavily on the pre-jump pause length. (See section above.) By default the initial left\right animation is set, as well as an animation speed, and the number of frames used is the pause length divided by the animation speed. By default the pause is $24 long and the animation speed is 6. (36/6 = 6 frames are used.)
Thus the simplest way to make Keen use less animation frames when jumping is to increase the animation speed (so it takes longer per frame.)
|Patch: Keen's jump animations|
Keen makes a sound when jumping. It can be blocked.
|Patch: Keen 1's jump sound|
|Patch: Keen 2's jump sound|
|Patch: Keen 3's jump sound|