From KeenWiki
Jump to: navigation, search

Spindreds are enemies found in Keen 5, aboard the Omegamatic. They are diamond-like beings that bounce on both the floors and the ceilings. They hit a surface three times and then move to the opposite surface, hit it three times, and then come back and do the same again.

Sprite Type

Spindreds use sprite type 18 which is used only by the Spindred and doesn't affect anything else.

Patch: Keen 5
#Spindred sprite type
%patch $128B1 $12

Sprite Actions

Spindreds have four actions, repeating in a loop. They are spawned using the first of these.

$2A7CW #Spindred 1
$2A9AW #Spindred 2
$2AB8W #Spindred 3
$2AD6W #Spindred 4

Patch: Keen 5
#When spawned
%patch $128D8 $2A7CW
#Bouncing loop
%patch $32DD8 $2A9AW %patch $32DF6 $2AB8W %patch $32E14 $2AD6W %patch $32E32 $2A7CW

Sprite Behavior

The Spindred has only one behavior, and it uses this all the time, during all four of its actions.


Patch: Keen 5
%patch $32DCC $11C40CA6RL 
#Spindred 1
%patch $32DEA $11C40CA6RL
#Spindred 2
%patch $32E08 $11C40CA6RL
#Spindred 3
%patch $32E26 $11C40CA6RL
#Spindred 4

Speed and Bounce Height

The only speed that matters to the Spindred are its bounce heights, defined in its code. Animation motion is not used at all. It is also possible to change the direction the Spindred initially moves in (Whether it bounces towards the ceiling or the floor.) This must be +-1, it cannot be 0.

Patch: Spindred speeds
#Initial Spindred direction
%patch $128D5 $0001W
#Jump heights
%patch $12A65 $FFD8W
#Small floor jump height
%patch $12A18 $0028W
#Small ceiling jump height

Patch: Animation motion
#Spindred bouncing
%patch $32DC8 $0000W $0000W %patch $32DE6 $0000W $0000W %patch $32E04 $0000W $0000W %patch $32E22 $0000W $0000W

Number of bounces on floor and ceiling

This patch controls how many bounces the Spindred will make on the floor or ceiling before it 'reverses direction' Each is a separate patch.

Patch: Keen 5
#Number of roof bounces before going to floor:
%patch $129E5 $03
#Number of floor bounces before going to roof:
%patch $12A32 $03

Spindred 'sticks' to floors and ceilings

This patch makes the Spindred appear to not bounce, but instead 'stick' to floors and ceilings for a short time. This is done by making jump heights small so individual jumps aren't seen. The 'stick time' can be made longer by increasing the number of floor or ceiling bounces (See above.)

Patch: Spindred 'sticks' to floors and ceilings
#Spindred 'sticks' to floors and ceilings
%patch $12A65 $FFF8W
#Small floor jump height
%patch $12A18 $0008W
#Small ceiling jump height

Sprite Collision

The Spindred does not have its own collision, simply using a general 'kill and block shots' collision used by many sprites.

Collision values

The Spindred uses a general collision for everything it does. This collision kills Keen if he touches the Spindred, but also blocks his shots.

Patch: Keen 5 collision values
%patch $32DD0 $11C40D61RL 
#Kill and block shots
%patch $32DEE $11C40D61RL
#Kill and block shots
%patch $32E0C $11C40D61RL
#Kill and block shots
%patch $32E2A $11C40D61RL
#Kill and block shots


The Spindred's animations are quite simple; it has four animations, one for each bouncing action.

Patch: Keen 5
%patch $31A46 $01A8W
#Spindred cache start
%patch $31A9A $01ABW
#Cache end
#Spindred bounce
%patch $32DBC $01A8W $01A8W %patch $32DC6 $0008W
#Animation speed
%patch $32DDA $01A9W $01A9W %patch $32DE4 $0008W
#Animation speed
%patch $32DF8 $01AAW $01AAW %patch $32E02 $0008W
#Animation speed
%patch $32E16 $01ABW $01ABW %patch $32E20 $0008W
#Animation speed


The Spindred uses three sounds, produced in four situations. The first sound is used for small floor and ceiling jumps while the remaining two are used when the Spindred 'reverses direction'. It is possible to stop any of these four sounds playing.

Patch: Keen 5
#Spindred sounds
%patch $129FC $25
#Spindred slam into ground from roof
%patch $12A0A $1C
#Spindred small ceiling bounce
%patch $12A49 $10
#Spindred slam into ceiling from floor
%patch $12A57 $1C
#Spindred small floor bounce
#Don't play Spindred sounds
%patch $129FB $EB $0A
#Don't play Spindred slam into ground from roof sound
%patch $12A09 $EB $0A
#Don't play Spindred small ceiling bounce sound
%patch $12A48 $EB $0A
#Don't play Spindred slam into ceiling from floor sound
%patch $12A56 $EB $0A
#Don't play Spindred small floor bounce sound

Sprite positioning

The Spindred spawns half a tile up from where it is placed. This si not strictly necessary, but is a cosmetic fix.

Patch: Keen 5
#Spindred spawn height
%patch $128CD $FF80W
#1/2 tile up

Clipping and foreground

The Spindred has a foreground variable of 0, meaning it appears behind all sprites and foreground tiles. This is likey because it needs to slam into floors and ceilings and thus avoid fore errors.

Patch: Spindred foreground variable
#Spindred foreground variable
%patch $128BB $0000W

Sprite-tile interaction

The Spindred has only one tile interaction, and that is the one that makes it bounce off of floors and ceilings. It of course uses this all the time.

Patch: Keen 5
%patch $32DD4 $11C40D86RL 
%patch $32DF2 $11C40D86RL
%patch $32E10 $11C40D86RL
%patch $32E2E $11C40D86RL

Action type

The Spindred uses action type 3 for all its actions; this ensures it can react instantly when needed, but also move smoothly through the air.

Patch: Keen 5
%patch $32DC0 $0003W
%patch $32DDE $0003W
%patch $32DFC $0003W
%patch $32E1A $0003W

Deprotect and stick to ground

The Spindred has values of 0 for both variables in all its actions. This is because it does not need to move on hills or deprotect its animations.

Patch: Keen 5 Change Motion
%patch $32DC2 $0000W $0000W
%patch $32DE0 $0000W $0000W
%patch $32DFE $0000W $0000W
%patch $32E1C $0000W $0000W

Sprite spawn code

Only partial code for the Spindred is available, notice there are three types of Spindred, one for each difficulty. the Spindred cache is set in $C7 $06 $C299W $0001W.

Patch: Keen 5
#Location of initiation code
%patch $F55E $56AW
#Easy Spindred (At $F2BA)
%patch $F560 $560W
#Normal Spindred (At $F2B0)
%patch $F562 $556W
#Hard Spindred (At $F2A6)
#Spindred Initiation code
%patch $F2A6 $83 $3E $6F6CW $03 $7D $03 $E9 $00F7W $83 $3E $6F6CW $02 $7D $03 $E9 $00EDW $57 $56 $9A $11C40C5DRL $83 $C4 $04 $C7 $06 $C299W $0001W $E9 $00DAW