Patch:Keen jumping (Dreams)

From KeenWiki
Jump to navigation Jump to search

This page contains patches relating to Keen jumping and falling in Keen Dreams. That is, such things as the sprites used, the speeds and sounds. It does not cover patches relating to gameplay such as those that make levels scroll or change keys. It is divided into sections relating to the various sprite properties the patches involved. Being fluent with various sprite patch pages will help when working with these patches.

Unlike in Keen Galaxy, Keens jumping actions are not so easily separated from his falling actions so both are covered here. Keen's jumping in Keen Galaxy is covered on the page Patch:Keen jumping (Galaxy)


Sprite Actions

Unlike in Keen Galaxy where there is only one way for Keen to jump or fall, in Keen Dreams Keen uses different animations depending on whether he jumps straight up, or whether he's jumping to the side. Once Keen has 'chosen' a jump he's locked into it; if he jumps up initially but then moves to the side he will not switch to a horizontal jump animation.

There is one situation in which Keen can start jumping vertically. That is when when standing still. There are also two situations where Keen can start jumping horizontally, the first is when walking and the second when jumping off of poles.

Both of Keen's jump/fall sequences are three actions long and look like they should quickly return Keen to standing. However, due to his 'action type' these 'next action' values are triggered in the game's code. So Keen will not return to standing 'automatically' but must be 'triggered' by hitting the ground.

When Keen is crouching on a one-way-up platform and presses the 'jump' key he will jump down in his third vertical action. He will also automatically enter this action after throwing a Flower Power in any direction while in the air.

There are many situations where Keen can go t his third horizontal action (Near enough to 'fall'). The first is when he is on a pole but level with the ground, whereupon he can simply 'walk' left or right off the pole. The second is when he moves down a pole off its bottom. The third and fourth are when he is pushed by a Carrot Courier and Squasher respectively. The fifth occurs when he is standing on ground that vanishes or a moving platform that he's pushed off of. Finally Keen can simply walk off an edge.

Actions:
$14D2W #Keen jump vertically 1
$14F0W #Keen jump vertically 2
$150EW #Keen jump vertically 3
$152CW #Keen jump horizontally 1
$154AW #Keen jump horizontally 2
$1568W #Keen jump horizontally 3

Sprite actions

#Start jumping vertically
%patch $6D07  [$14D2W]

#Keen jump vertically down...
%patch $6FF7  [$150EW] #...from one-way-up platforms
%patch $2504E [$150EW] #...after shooting horizontally in air
%patch $250A8 [$150EW] #...after shooting up in air
%patch $25102 [$150EW] #...after shooting down in air

#Jump/fall vertically sequence
%patch $24F5E [$14F0W]
%patch $24F7C [$150EW]
%patch $24F9A [$0ED8W]


#Keen jump horizontally while walking
%patch $7099  [$152CW]

#Keen jump horizontally off of poles
%patch $722E  [$152CW]

#Jump/fall horizontally sequence
%patch $24FB8 [$154AW]
%patch $24FD6 [$1568W]
%patch $24FF4 [$0ED8W]

#Keen fall horizontally when...
%patch $730C [$1568W] #...walking off of poles
%patch $73FF [$1568W] #...falling off pole bottoms
%patch $7858 [$1568W] #...pushed by a Carrot Courier
%patch $78C8 [$1568W] #...pushed by a Squasher
%patch $7987 [$1568W] #...standing on ground that vanishes
%patch $79EF [$1568W] #...walking off solid ground


Sprite Behavior

There is only one behavior relating to Keen jumping which is also used when he is falling. It may best be considered a 'Keen in the air' behavior.

Sprite behaviors

#Keen jump vertically
%patch $24F52 $05E81252RL
%patch $24F70 $05E81252RL
%patch $24F8E $05E81252RL

#Keen jump horizontally
%patch $24FAC $05E81252RL
%patch $24FCA $05E81252RL
%patch $24FE8 $05E81252RL


Speed and Jump Height

Keen's jump speeds and heights are controlled in a complex way. The action speeds are not used.

Sprite speeds

#Keen jump vertically
%patch $24F4E [$0000 $0000W]
%patch $24F6C [$0000 $0000W]
%patch $24F8A [$0000 $0000W]

#Keen jump horizontally
%patch $24FA8 [$0000 $0000W]
%patch $24FC6 [$0000 $0000W]
%patch $24FE4 [$0000 $0000W]


Sprite Collision

Keen uses his primary sprite collision when jumping and falling. This is the one that allows him to interact with point items and sprites such as the Tomatooth.

Sprite collisions

#Keen jump vertically
%patch $24F56 $05E817FCRL
%patch $24F74 $05E817FCRL
%patch $24F92 $05E817FCRL

#Keen jump horizontally
%patch $24FB0 $05E817FCRL
%patch $24FCE $05E817FCRL
%patch $24FEC $05E817FCRL


Animations

Keen uses two sets of animations depending on whether he's jumping straight up or horizontally. Each action uses a different animation depending on which way Keen is facing. None of the actions have an animation timer; they are changed in the game's code depending on Keen's movement speed.

Sprite animations

#Keen jump vertically
%patch $24F42 $0064W $005DW
%patch $24F4C $0000W        #Animation speed
%patch $24F60 $0065W $005EW
%patch $24F6A $0000W        #Animation speed
%patch $24F7E $0064W $005DW
%patch $24F88 $0000W        #Animation speed

#Keen jump horizontally
%patch $24F9C $0055W $004DW
%patch $24FA6 $0000W        #Animation speed
%patch $24FBA $0056W $004EW
%patch $24FC4 $0000W        #Animation speed
%patch $24FD8 $0057W $004FW
%patch $24FE2 $0000W        #Animation speed


Sprite-tile interaction

Keen uses a special 'Keen in air' tile collision when jumping and falling. This lets him hit his head on ceilings as well as land on solid ground. It is also used by his shooting in the air actions

Sprite tile interactions

#Keen jump vertically
%patch $24F5A $05E81BEDRL
%patch $24F78 $05E81BEDRL
%patch $24F96 $05E81BEDRL

#Keen jump horizontally
%patch $24FB4 $05E81BEDRL
%patch $24FD2 $05E81BEDRL
%patch $24FF0 $05E81BEDRL


Action type

All of Keen's jumping actions are type 2, which allows them to move smoothly through the air and react quickly. However they must be animated in the gamee's code since these types of action don't animate on their own.

Sprite action types

#Keen jump vertically
%patch $24F46 [$0002W]
%patch $24F64 [$0002W]
%patch $24F82 [$0002W]

#Keen jump horizontally
%patch $24FA0 [$0002W]
%patch $24FBE [$0002W]
%patch $24FDC [$0002W]


Deprotect and stick to ground

Keen has no need for either of these variables while in the air and so has a value of 0 for both in all of his jumping actions.

Sprite deprotect, stick

#Keen jump vertically
%patch $24F48 [$0000W $0000W]
%patch $24F66 [$0000W $0000W]
%patch $24F84 [$0000W $0000W]

#Keen jump horizontally
%patch $24FA2 [$0000W $0000W]
%patch $24FC0 [$0000W $0000W]
%patch $24FDE [$0000W $0000W]