Patch:Keen dying (Dreams)

From KeenWiki
Jump to: navigation, search

This page contains patches relating to Keen's death in Keen Dreams, its causes and effects as well as patches that affect dying Keen's sprite. Other pages relating to Keen's death in other games can be found at Patch:Dead Keen.

In Keen Dreams Keen can die in a number of ways, the three most basic being: falling out of the level bottom, lethal sprites and lethal tiles. In all cases Keen will use the same 'death code'. When killed Keen will begin a 'death sequence' that will eventually end with the level being lost.

This page is split into three sections; the first is Keen's death code itself, the second containing patches relating to dead Keen's sprites and a third dealing with miscellaneous things that happen on dying.


Death code

Keen Dreams has a remarkably simple death code for the player. When called it first checks if god mode is enabled, if so the code is skipped. If not if plays sound $0C and changes Keen's sprite action to the first frame of his dying sequence. Nothing else is changed, the life count is not affected (here) or the game ended.

Patch: Keen Dreams
#Keen die code
%patch $7650 $83 $3E $6FAAW $00 $75 $24 $B8 $000CW $50 $9A $10BB1282RL $44 $44 $8B $1E $34 $70 $C7 $47 $06 $0000W $B8 $10D6W $50 $FF $36 $34 $70 $9A $07C50255RL $83 $C4 $04 $CB


Misc

What dying sets keys to

If Keen dies his keys are set to zero by default.

Patch: Keen Dreams
#On dying set keys to 0
%patch $5DC6 $7122W $0000W


Dead Keen's sprite frames

This section contains patches that relate to Keen after he has died, his death animations and how they act.


Sprite Actions

Keen's dying in Dreams is quite simple. There are three actions, each of which is part of a simple sequence that is triggered when Keen is killed and ends with the Didn't make it past window. Note that the last action goes to itself; this keeps Keen doing the same thing and doesn't matter because the level is paused when the window appears.

Actions:
$10D6W #Keen die 1
$10F4W #Keen die 2
$1112W #Keen die 3

Patch: Keen Dreams
#Keen killed
%patch $766C $10D6W
#Death sequence
%patch $24B62 $10F4W %patch $24B80 $1112W %patch $24B9E $1112W


Sprite Behavior

Keen's dying sequence has only one behavior used by the very last action of the sequence. This behavior loses the level and it is losing the level that changes everything else. (Such as decreasing Keen's life count.)

Patch: Keen Dreams
#Keen dying behaviors
%patch $24B56 $00000000L %patch $24B74 $00000000L %patch $24B92 $05E81079RL


Dead Keen's behavior code

The behavior of dead Keen is very simple; it sets the level state to 4, that is, it loses the level.

Patch: Keen Dreams
#Keen dead behavior
%patch $6EF9 $55 $8B $EC $56 $8B $76 $06 $83 $C6 $4C $C7 $06 $705AW $0004W $5E $5D $CB


Sprite Collision

Dead Keen has no sprite collision. This is needed to prevent him getting stuck in a 'death loop'.

Patch: Keen Dreams
#Keen dead sprite collision
%patch $24B5A $00000000L %patch $24B78 $00000000L %patch $24B96 $00000000L


Animations

Keen's death sequence involves three separate frames, each with a different animation. The animation is the same no matter which way Keen is facing. The first two frames are quite rapid while the last takes considerable time. When it's animation is up the Didn't make it past window will appear.

Patch: Keen Dreams
#Keen die
%patch $24B46 $0087W $0087W %patch $24B50 $0014W
#Animation speed
%patch $24B64 $0088W $0088W %patch $24B6E $0014W
#Animation speed
%patch $24B82 $0089W $0089W %patch $24B8C $0078W
#Animation speed


Sounds

Keen makes a sound each time he dies. This is the only death related sound and it can be blocked.

Patch: Keen Dreams
#Sounds
%patch $7658 $0C
#Keen die sound
#Don't play sounds
%patch $7657 $EB $09
#Don't play Keen die sound


Sprite-tile interaction

Dying Keen uses a special tile interaction also used when doing things like napping. This stops Keen going to falling or other such distractions and lets him complete his death sequence.

Patch: Keen Dreams
#Keen dead tile collision
%patch $24B5E $05E81ABARL %patch $24B7C $05E81ABARL %patch $24B9A $05E81ABARL