This page covers patches relating to the Teleporter sprites in Keen 5. These are created when Keen uses the secret teleporter. As such they are not a 'proper' sprite but rather a temporary entity. It can still be manipulated like an ordinary sprite however. There are two distinct teleporter sprites, the 'upper zap' and the 'lower zap' defined by their position relative to the teleporter.
- 1 Sprite Type
- 2 Sprite Actions
- 3 Sprite Behavior
- 4 Speed and Jump Height
- 5 Sprite Collision
- 6 Animations
- 7 Sounds
- 8 Sprite positioning
- 9 Clipping and foreground
- 10 Sprite-tile interaction
- 11 Action type
- 12 Deprotect and stick to ground
- 13 Sprite spawn code
Teleporter zaps use sprite type 24, which is used only by them and does not affect anything else. The upper and lower zaps are spawned in different places and can, in principle, use different sprite types.
#Teleporter sprite type %patch $FEB3 $18 #Upper zap %patch $FF06 $18 #Lower zap
There are four actions associated with teleporter sprites; two each for the upper and lower zaps. Both are created simultaneously when Keen uses the teleporter and remain active in two frame loops until Keen wins the level.
Actions: $1A6EW #Teleporter upper zap 1 $1A8CW #Teleporter upper zap 2 $1AAAW #Teleporter lower zap 1 $1AC8W #Teleporter lower zap 2
#Spawn (When Keen teleports) %patch $FEDE [$1A6EW] #Upper zap %patch $FF2E [$1AAAW] #Lower zap #Upper zap loop %patch $31DCA [$1A8CW] #Upper zap %patch $31DE8 [$1A6EW] #Upper zap #Lower zap loop %patch $31E06 [$1AC8W] #Lower zap %patch $31E24 [$1AAAW] #Lower zap
The teleporter zaps have no behaviors at all,t hey are entirely for show. (Keen winning the level and exiting is triggered by something else.)
#Upper zap %patch $31DBE $00000000L #Nothing %patch $31DDC $00000000L #Nothing #Lower zap %patch $31DFA $00000000L #Nothing %patch $31E18 $00000000L #Nothing
The teleporter zaps do not move in any way.
#Upper zap %patch $31DBA [$0000W $0000W] %patch $31DD8 [$0000W $0000W] #Lower zap %patch $31DF6 [$0000W $0000W] %patch $31E14 [$0000W $0000W]
The teleporter zaps have no collision at all, as again, they are entirely for display purposes.
Keen 5 collision values
#Upper zap %patch $31DC2 $00000000L #Nothing %patch $31DE0 $00000000L #Nothing #Lower zap %patch $31DFE $00000000L #Nothing %patch $31E1C $00000000L #Nothing
The teleporter zaps' animations are one of the few important properties they have as this is their primary purpose, display.
#Cache %patch $31A56 [$0122W] #Teleport cache start %patch $31AAA [$0125W] #Cache end #Teleport upper zap %patch $31DAE $0122W $0122W %patch $31DB8 $0006W #Animation speed %patch $31DCC $0123W $0123W %patch $31DD6 $0006W #Animation speed #Teleport lower zap %patch $31DEA $0124W $0124W %patch $31DF4 $0006W #Animation speed %patch $31E08 $0125W $0125W %patch $31E12 $0006W #Animation speed
There are two sounds related to the teleporter, it is not currently known under what conditions they play. Both however can be blocked.
#Sound %patch $D40D $29 #Teleport 1 %patch $D645 $29 #Teleport 2
#Don't play Teleport 1 sound %patch $D40C $EB $0A #Don't play Teleport 2 sound %patch $D644 $EB $0A
The two zaps spawn relative to Keen. The upper zap spawns five tiles above him and 8 pixels left, while the lower one spawns 8 pixels up. Notice that all three values are 'reversed'; that is, negative even though they appear positive here.
#Spawn heights %patch $FEC1 [$0080W] #Lower zap: 8 pixels left %patch $FED4 [$0500W] #Upper zap: 5 tiles up %patch $FF24 [$0080W] #Lower zap: 8 pixels up
The teleporter zaps have a foreground variable of 3, meaning it appears in front of all tiles and sprites, as expected given they are used for display. They have no clipping as expected of something that can appear over solid tiles.
#Teleporter zaps foreground variables %patch $FEAA [$0003W] #Upper zap %patch $FEFD [$0003W] #Lower zap
#Teleporter zaps clipping variables %patch $FEAF [$0000W] #Upper zap %patch $FF02 [$0000W] #Lower zap
The teleporter zaps have no need to interact with tiles and use a generic 'avoid solid tiles' collision
#Upper zap %patch $31DC6 $090B17B5RL #Solid %patch $31DE4 $090B17B5RL #Solid #Lower zap %patch $31E02 $090B17B5RL #Solid %patch $31E20 $090B17B5RL #Solid
All actions relating to the teleporter zaps are type 0, since they do not move and simply sit in one place.
#Upper zap %patch $31DB2 [$0000W] %patch $31DD0 [$0000W] #Lower zap %patch $31DEE [$0000W] %patch $31E0C [$0000W]
The teleporter zaps do not use either of these two variables.
#Upper zap %patch $31DB4 [$0000W $0000W] %patch $31DD2 [$0000W $0000W] #Lower zap %patch $31DF0 [$0000W $0000W] %patch $31E0E [$0000W $0000W]
The teleporter's spawn code is exceedingly simple. It merely sets the teleporter zap cache so that the game does not crash when Keen teleports. As such the complete spawn code is only two lines.
#Location of initiation code %patch $F5BE [$651W] #Teleporter (At $F3A1) #Teleporter Initiation code- set cache %patch $F3A1 $C7 $06 $C2A9W $0001W