Patch:Blorb

From KeenWiki
Jump to navigation Jump to search

This page covers patches relating to the Blorbs in Keen 6. Blorbs are reddish, blob-like enemies that float around several levels in the game.


Sprite Type

Blorbs use sprite type 22, used only by them. This type does not interact with any other sprite types.

Keen 6

#Blorb sprite type
%patch $123B0 $16 #Blorb


Sprite Actions

Blorbs have only three actions, a 3-action loop where they float and bounce off of tiles. They never do anything else.

$3164W  #Blorb 1
$3182W  #Blorb 2
$31A0W  #Blorb 3

Keen 6

#When spawned
%patch $12417 [$3164W]

#Floating loop
%patch $33EB0 [$3182W]
%patch $33ECE [$31A0W]
%patch $33EEC [$3164W]


Sprite Behavior

The Blorb has no behavior of its own by default.

Keen 6

#Blorb bouncing
%patch $33EA4 $00000000L
%patch $33EC2 $00000000L
%patch $33EE0 $00000000L


Speed

It appears that the speed of Blorbs is entirely defined by their animation motion, though it is known they bounce off of tiles.

Keen 6 Animation motion

#Blorb floating h\v speeds
%patch $33EA0 [$0008W $0008W]
%patch $33EBE [$0008W $0008W]
%patch $33EDC [$0008W $0008W]


Sprite Collision

The Blorb does not have a collision of its own, instead it uses a general 'deadly to Keen' collision used by many sprites. This also means that the Blorb is indestructible as it can't interact with Keen's shots.

Keen 6 collision values

#Blorb collision values
%patch $33EA8 $08F417EERL
%patch $33EC6 $08F417EERL
%patch $33EE4 $08F417EERL


Animations

The Blorb has three animations, one for each of its floating frames. It uses the same animation no matter what direction it is facing. This makes it one of the simpler enemies, animation-wise.

Keen 6 Animations

#Cache
%patch $3243A [$018FW] #Blorb cache start
%patch $3248A [$0191W] #Blorb cache end

#Floating animations
%patch $33E94 $018FW $018FW #Blorb 1
%patch $33E9E $0014W        #Animation speed
%patch $33EB2 $0190W $0190W #Blorb 2
%patch $33EBC $0014W        #Animation speed
%patch $33ED0 $0191W $0191W #Blorb 3
%patch $33EDA $0014W        #Animation speed


Sounds

The Blorb has four sounds, one for hitting ceilings, floors, left and right walls. By default these are all the same and all can be blocked.

Keen 6

#Blorb sounds
%patch $12438 $06     #Blorb hit floors sound
%patch $12451 $06     #Blorb hit ceilings sound
%patch $12468 $06     #Blorb hit right walls sound
%patch $12481 $06     #Blorb hit left walls sound

#Don't play Blorb sounds
%patch $12437 $EB $0A #Don't play Blorb hit floors sound
%patch $12450 $EB $0A #Don't play Blorb hit ceilings sound
%patch $12467 $EB $0A #Don't play Blorb hit right walls sound
%patch $12480 $EB $0A #Don't play Blorb hit left walls sound


Sprite positioning

The Blorb spawns 8 pixels or 0.5 tiles higher then where it is placed in-level. This is strange since it does not need to touch the ground when spawned. As such this variable can be ignored by default.

Keen 6

#Bipship spawn height
%patch $123CC [$FF80W] #0.5 tiles upwards


Clipping and foreground

The Blorb's foreground variable is set to 0, meaning it appears behind most sprites and foreground tiles. It has a clipping of 2, meaning it treats sloped tiles like solid tiles, this aids in its bouncing and avoids 'slope sliding'.

Keen 6 Foreground

#Blorb foreground variable
%patch $123BA $0000W

#Blorb clipping
%patch $12414 $0002W


Sprite-tile interaction

The Blorb's tile interaction controls its movement and sound and is responsible for how it acts in-level.

Keen 6

#Blorb bouncing
%patch $33EAC $11CF0735RL
%patch $33ECA $11CF0735RL
%patch $33EE8 $11CF0735RL


Complete tile interaction code

This is the complete tile interaction code for the Blorb. On the first line it checks for a floor. If found then its vertical direction is set to -1 (Up) and sound 6 is played on line 2. The ceiling check is then skipped.

Ceilings are checked for on line 3 and if found the Blorb's vertical direction is set to 1 (Down) and sound six played in the same line. Nothing is skipped after this.

On line 4 right walls are checked for and if found the Blorb moves left and plays sound 6 on line 5 and the left wall check is skipped. On line 6 left walls are checked for and if found the Blorb moves right, again playing sound 6 on line 6.

The remaining code draws the Blorb's sprite image.

Keen 6

#Blorb tile interaction code
%patch $12425 $55 $8B $EC $56 $8B $76 $06 $83 $7C {$36} [$00] {$74} $13 $C7 $44 $10
              [$FFFFW]  $B8 [$0006W]  $50 $9A $183B09F1RL     $83 $C4 $02 $EB $17
              $83 $7C {$3A} [$00] {$74} $11 $C7 $44 $10 [$0001W]  $B8 [$0006W]  $50 $9A
              $183B09F1RL     $83 $C4 $02 $83 $7C {$3C} [$00] {$74} $13 $C7 $44 $0E
              [$FFFFW]  $B8 [$0006W]  $50 $9A $183B09F1RL     $83 $C4 $02 $EB $17
              $83 $7C {$38} [$00] {$74} $11 $C7 $44 $0E [$0001W]  $B8 [$0006W]  $50 $9A
              $183B09F1RL     $83 $C4 $02 $FF $74 $20 $33 $C0 $50 $FF $74 $1E
              $FF $74 $0C $FF $74 $0A $8B $C6 $05 $46 $00 $50 $9A $16081770RL
                  $83 $C4 $0C $5E $5D $CB


Probability, randomness and initial directions

The Blorb can start a level moving either right or left, with a 50:50 chance of doing either and independently moving up or down again with a 50:50 chance of either. This gives it four possible initial directions to move with a 25% chance of each option.

Keen 6

#Chance of initially moving right
%patch $123D7 $80

#Chance of initially moving down
%patch $123F5 $80


Action type

As the Blorb needs to move smoothly through the air it uses type 1 actions.

Sprite action types

#Blorb bouncing
%patch $33E98 [$0001W]
%patch $33EB6 [$0001W]
%patch $33ED4 [$0001W]


Deprotect and stick to ground

The Blorb has no need for either of these variables and so has a value of 0 for both in all of its actions.

Sprite deprotect, stick

#Blorb bouncing
%patch $33E9A [$0000W $0000W]
%patch $33EB8 [$0000W $0000W]
%patch $33ED6 [$0000W $0000W]


Sprite spawn code

Only partial spawn code for the Blorb is available.

In the spawning code the last blue highlighted value is the sprite action the sprite uses as it proceeds to act in-level. $C7 $02 $xxxxW sets the sprite activity, $C7 $47 $06 $xxxxW sets the clipping, $C7 $47 $20 $xxxxW sets the foreground vaiable, $C7 $07 $xxxxW sets the sprite type. Finally $D3 $E0 $05 $xxxx is how far down (Or more usually up) the sprite is spawned from where it is placed. This is necessary for sprites that walk on the ground as they can only be placed in the level at multiples of 16 pixels high while their actual height can be anything.

The Blorb starts the level moving either left or right with a 50:50 chance of either and independently moving up or down again with a 50:50 chance of either. This gives it four possible initial directions to move with a 25% chance of each option. $C7 $47 $10 $xxxxW is the vertical direction the sprite starts moving in, either $0001W (Facing down), $FFFFW (Facing up) or $0000W (Neither, never used.) $C7 $47 $0E $xxxxW is the horizontal direction.

Keen 6

#Bipship spawn code
%patch $117C3 $55 $8B $EC $33 $C0 $50 $9A $069A1E25RL     $83 $C4 $02 $8B $1E
              $66 $A9 $C7 $07 [$001AW]  $C7 $47 $02 [$0001W]  $8B $46 $06 $B1 $08
              $D3 $E0 $89 $47 $0A $8B $46 $08 $D3 $E0 $05 [$FE80W]  $89 $47 $0C
              $9A $1CF30034RL     $3D [$0080W]  $7D $0B $8B $1E $66 $A9 $C7 $47
              $0E [$0001W]  $EB $09 $8B $1E $66 $A9 $C7 $47 $0E [$FFFFW]  $8B $1E
              $66 $A9 $8B $47 $0E $BA $0014W  $F7 $EA $89 $47 $16 $B8 [$2A5CW]
              $50 $53 $9A $08F41219RL     $83 $C4 $04 $5D $CB