From KeenWiki
Jump to navigation Jump to search

This page covers patches relating to the Bobbas in Keen 6. These are large, red, jumping enemies that almost never appear levels. They are related to the much more common Babobba.

Sprite Type

Bobbas use sprite type 14, used by no other sprite and not affecting any other sprite type, while its shot is type 4; which is used by all enemy projectiles.

Keen 6

#Bobba sprite type
%patch $11E60 $0E #Bobba
%patch $11EFA $04 #Bobba's fireball

Sprite Actions

The Bobba's actions are somewhat complex. They are spawned jumping and then go to falling, which they continue to do until they land on the ground, in which case it can either land or land and shoot a fireball. After landing or shooting Bobba return to jumping.

The Bobba's shot starts as a twinkle in its eye, a four frame sequence that ends with it turning into a fireball. The fireball enters a four frame sequence which is stays in until it hits a solid tile, at which point it enters a 3 frame smashing sequence and vanishes.

$2D86W  #Bobba jump
$2DA4W  #Bobba fall
$2DC2W  #Bobba land
$2DE0W  #Bobba shoot
$2DFEW  #Bobba eye twinkle 1
$2E1CW  #Bobba eye twinkle 2
$2E3AW  #Bobba eye twinkle 3
$2E58W  #Bobba eye twinkle 4
$2E76W  #Bobba fireball 1
$2E94W  #Bobba fireball 2
$2EB2W  #Bobba fireball 3
$2ED0W  #Bobba fireball 4
$2EEEW  #Bobba fireball smash 1
$2F0CW  #Bobba fireball smash 2
$2F2AW  #Bobba fireball smash 3

Keen 6

#When spawned
%patch $11EA9 [$2D86W]

#While jumping
%patch $33AD2 [$2DA4W]

#While falling
%patch $33AF0 [$2DA4W]

#When hitting the ground
%patch $1207C [$2DC2W] #Land without shooting
%patch $11F45 [$2DE0W] #Land and shoot

#While landed
%patch $33B0E [$2D86W]

#While shooting
%patch $33B2C [$2D86W]

#Bobba's shot
%patch $11F2A [$2DFEW]

#Eye twinkle
%patch $33B4A [$2E1CW]
%patch $33B68 [$2E3AW]
%patch $33B86 [$2E58W]
%patch $33BA4 [$2E76W]

%patch $33BC2 [$2E94W]
%patch $33BE0 [$2EB2W]
%patch $33BFE [$2ED0W]
%patch $33C1C [$2E76W]

#When fireball hits walls
%patch $120C8 [$2EEEW]

#Fireball smash sequence
%patch $33C3A [$2F0CW]
%patch $33C58 [$2F2AW]
%patch $33C76 [$0000W]

Sprite Behavior

The Bobba has only two behaviors of its own. The first is used by the landing Bobba, making it shoot, and the second by the last frame of the shot-sparkle, playing a sound. The two airborne frames use generic 'move through the air' behavior while all other actions have no behavior.

$08F41765RL #Move through the air
$11CF01D8RL #Landed Bobba
$11CF01C7RL #Sparkle turn into fireball

Keen 6

%patch $33AC6 $08F41765RL

%patch $33AE4 $08F41765RL

%patch $33B02 $11CF01D8RL

%patch $33B20 $00000000L

#Shot (Sparkle)
%patch $33B3E $00000000L
%patch $33B5C $00000000L
%patch $33B7A $00000000L
%patch $33B98 $11CF01C7RL

#Shot (Fireball)
%patch $33BB6 $00000000L
%patch $33BD4 $00000000L
%patch $33BF2 $00000000L
%patch $33C10 $00000000L

#Shot (Fireball busting)
%patch $33C2E $00000000L
%patch $33C4C $00000000L
%patch $33C6A $00000000L

Number of jumps before shooting

The number of jumps required before the Bobba lands and shoots is actually part of the tile collision. By default after three jumps the Bobba shoots and resets its counter to 0.

Keen 6

#Bobba bounce
%patch $11EDA [$0003W] #Number of bounces before shooting
%patch $11EE1 [$0000W] #Reset bounce value

Bobba never shoots

This patch actually relates to tile collision. It prevents the Bobba for going to shooting when it lands.

Keen 6

#Bobba never shoots
%patch $11ED3 $EB $78

Spark-to-fireball behavior

This is the behavior used by the Bobba's eye-spark as it turns into a fireball. All it does is play the shooting sound. This is done so that the shooting sound happens not when the Bobba creates the eye-spark, but rather when the spark becomes a fireball.

Keen 6

#Spark-to-fireball behavior
%patch $11EB7 $55 $8B $EC $B8 [$001FW]  $50 $9A $183B09F1RL    $83 $C4 $02 $5D

Speed and Jump Height

The Bobba's speeds are set in its code as opposed to its animation motion and some cannot currently be patched. However the fireball's speeds are set in its animation motion, and can be altered.

Keen 6

#Bobba jump speeds
%patch $11FE2 [$FFE0W] #Height

Animation motion

%patch $33AC2 [$0000W $0000W]

%patch $33AE0 [$0000W $0000W]

%patch $33AFE [$0000W $0000W]

%patch $33B1C [$0000W $0000W]

#Eye twinkle
%patch $33B3A [$0000W $0000W]
%patch $33B58 [$0000W $0000W]
%patch $33B76 [$0000W $0000W]
%patch $33B94 [$0000W $0000W]

%patch $33BB2 [$0030W $0000W]
%patch $33BD0 [$0030W $0000W]
%patch $33BEE [$0030W $0000W]
%patch $33C0C [$0030W $0000W]

#Smashed fireball
%patch $33C2A [$0000W $0000W]
%patch $33C48 [$0000W $0000W]
%patch $33C66 [$0000W $0000W]

Bobba jumps vertically only

This patch stops the Bobba from jumping horizontally; it will only jump up-and-down.

Keen 6

#Bobba jumps vertically only
%patch $11FDE $18

Sprite Collision

The Bobba is quite simple, it is immortal and deadly to Keen, as are its shots.

Collision values

There are two collisions used by the Bobba and related sprites. The first is one unique to the Bobba itself, used for all its actions. This kills Keen and blocks his shots. The second is a generic 'lethal to Keen' collision used by the moving fireball. The eye twinkle and smashing fireball are harmless.

Keen 6 collision values

%patch $33ACA $11CF0306RL #Bobba

%patch $33AE8 $11CF0306RL #Bobba

%patch $33B06 $11CF0306RL #Bobba

%patch $33B24 $11CF0306RL #Bobba

#Eye sparkle
%patch $33B42 $00000000L  #Nothing
%patch $33B60 $00000000L  #Nothing
%patch $33B7E $00000000L  #Nothing
%patch $33B9C $00000000L  #Nothing

%patch $33BBA $08F417EERL #Kill Keen
%patch $33BD8 $08F417EERL #Kill Keen
%patch $33BF6 $08F417EERL #Kill Keen
%patch $33C14 $08F417EERL #Kill Keen

#Smashed fireball
%patch $33C32 $00000000L  #Nothing
%patch $33C50 $00000000L  #Nothing
%patch $33C6E $00000000L  #Nothing

Default collision code

This is the complete collision code for the Bobba. It responds to Keen's sprite type on line 1, running the 'kill Keen' code and to Keen's shot type at the end of line 2, running the 'turn sprite into a smashed shot' code. Note however that if shot the Bobba will turn to face the shot unless the shot's horizontal direction is 0. (This check is made in line 3.)

Keen 6

#Bobba collision code
%patch $11FF6 $55 $8B $EC $56 $57 $8B $7E $06 $8B $76 $08 $83 $3C [$02] {$75} $09
              $9A $0AA213CARL     $5F $5E $5D $CB $83 $3C [$03] {$75} $17 $56 $9A
              $0CA60EC2RL     $83 $C4 $02 $83 $7C {$0E} [$00] {$74} $08 $8B $44 $0E
              $F7 $D8 $89 $45 $0E $5F $5E $5D $CB

Win game if shooting Bobba

This patch alters the Bobba's collision code so that it is still lethal but wins the game if shot once.

Keen 6

#Bobba wins game if shot once
%patch $11FF6 $55 $8B $EC $56 $57 $8B $7E $06 $8B $76 $08 $83 $3C [$02] {$75} $09
              $9A $0AA213CARL     $5F $5E $5D $CB $83 $3C [$03] {$75} $06 $C7 $06
              {$75ACW}  [$000CW]  $5F $5E $5D $CB

Bobba doesn't turn around if shot

This patch prevents the Bobba from turning to face keen if shot from the side.

Keen 6

#Bobba doesn't turn around if shot
%patch $12021 $EB


The Bobba's animations are straightforward. Six are used for jumping, falling and landing (Two per action.) with the shooting action using the same animations as the landing action. The landing\shooting animation speed controls how long the Bobba rests between jumps.

The eye twinkle has two animations, repeated twice. The animation speed controls how long it takes to become a fireball. (This shouldn't in total be longer than the shooting time or the twinkle will be left behind when the Bobba jumps.) The fireballs uses four animations, but oddly, the smashed fireball's three frames use the same animation as one of the fireball frames, making the smashed fireball seem to freeze for a moment before vanishing. This suggests that originally the fireball smash had its own animations that were cut from the game.

Keen 6 Animations

%patch $3243C [$0192W] #Bobba cache start
%patch $3248C [$019DW] #Bobba cache end

%patch $33AB6 $0193W $0196W
%patch $33AC0 $0008W        #Animation speed

%patch $33AD4 $0194W $0197W
%patch $33ADE $0008W        #Animation speed

%patch $33AF2 $0192W $0195W
%patch $33AFC $0014W        #Time spent standing

%patch $33B10 $0192W $0195W
%patch $33B1A $0028W        #Time spent shooting

#Eye twinkle
%patch $33B2E $0198W $0198W
%patch $33B38 $0008W        #Animation speed
%patch $33B4C $0199W $0199W
%patch $33B56 $0008W        #Animation speed
%patch $33B6A $0198W $0198W
%patch $33B74 $0008W        #Animation speed
%patch $33B88 $0199W $0199W
%patch $33B92 $0008W        #Animation speed

%patch $33BA6 $019AW $019AW
%patch $33BB0 $0008W        #Animation speed
%patch $33BC4 $019BW $019BW
%patch $33BCE $0008W        #Animation speed
%patch $33BE2 $019CW $019CW
%patch $33BEC $0008W        #Animation speed
%patch $33C00 $019DW $019DW
%patch $33C0A $0008W        #Animation speed

#Fireball smash
%patch $33C1E $019DW $019DW
%patch $33C28 $0008W        #Animation speed
%patch $33C3C $019DW $019DW
%patch $33C46 $0008W        #Animation speed
%patch $33C5A $019DW $019DW
%patch $33C64 $0008W        #Animation speed

Clipping and foreground

The Bobba has a value of 0 for its foreground variable, possibly because this places it behind all foreground tiles and it must jump against walls and floors. Its shot however has a value of 2, placing it in front of many sprites and foreground tiles, making it more obvious in-game.

Foreground variables

#Foreground variables
%patch $11E6A [$0000W] #Bobba
%patch $11F40 [$0002W] #Bobba's fireball

Sprite-tile interaction

The Bobba's tile interaction values are currently not know.

Bobba fall interaction code

This is the complete code for the falling Bobba tile interaction. On the first line left walls are checked for and, if found, the Bobba's direction is set to right. (It turns.) At the end of line 2 the same is done for right walls. The sum total of this is to make the falling Bobba turn when it hits walls.

At the start of line 4 ceilings are checked for. If found the Bobba's vertical speed is set to 0, that is, it stops moving upwards. At the end of line 4 floors are checked for. If found then sound $1B is played and the Bobba's action changes to landed. The remaining three lines of code simply draw the sprite.

Keen 6

#Falling Bobba tile interaction code
%patch $1202F $55 $8B $EC $56 $8B $76 $06 $83 $7C {$38} [$00] {$74} $0F $C7 $44 $0E
              [$0001W]  $8B $44 $16 $F7 $D8 $89 $44 $16 $EB $13 $83 $7C {$3C} [$00]
              {$74} $0D $C7 $44 $0E [$FFFFW] $8B $44 $16 $F7 $D8 $89 $44 $16 $83
              $7C {$3A} [$00] {$74} $05 $C7 $44 $18 [$0000W]  $83 $7C {$36} [$00] {$74} $19
              $B8 [$001BW]  $50 $9A $183B09F1RL     $83 $C4 $02 $B8 [$2DC2W]  $50
              $56 $9A $08F41297RL     $83 $C4 $04 $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

Sprite positioning

The Bobba's shot appears at a specific vertical position relative to its top left corner. Depending on whether the Bobba is shooting right or left then it also appears slightly right of it.

Keen 6

#Bobba shot position
%patch $11F00 [$00B0W] #Vertical
%patch $11F15 [$0100W] #Horizontal if shooting right
%patch $11F20 [$00B0W] #Horizontal if shooting left


The Bobba has three sounds, one when jumping, one when when the sparkle in its eye becomes a fireball and the one when it lands on the ground. All three can be blocked. When blocking the Bobba's fireball sound it is easier to set the Bobba's eye-spark behavior to $00000000L than to just block the sound since all the behavior does is play a sound. (See behavior section.)

Keen 4

%patch $11EBB $1F     #Bobba fireball appear sound
%patch $11FE5 $1A     #Bobba jump sound
%patch $12070 $1B     #Bobba land sound

#Don't play sounds
%patch $11EBA $EB $0A #Don't play Bobba fireball appear sound
%patch $11FE4 $EB $0A #Don't play Bobba jump sound
%patch $1206F $EB $0A #Don't play Bobba land sound

Action type

When jumping the Bobba must move smoothly and animate. This action is type 3. Falling requires smooth movement and reacting to the ground and so it type 2. The moving fireball must move smoothly through air and is type 1. All other actions are more basic and thus type 0.

Sprite action types

%patch $33ABA [$0003W]

%patch $33AD8 [$0002W]

%patch $33AF6 [$0000W]

%patch $33B14 [$0000W]

#Shot (Sparkle)
%patch $33B32 [$0000W]
%patch $33B50 [$0000W]
%patch $33B6E [$0000W]
%patch $33B8C [$0000W]

#Shot (Fireball)
%patch $33BAA [$0001W]
%patch $33BC8 [$0001W]
%patch $33BE6 [$0001W]
%patch $33C04 [$0001W]

#Shot (Fireball busting)
%patch $33C22 [$0000W]
%patch $33C40 [$0000W]
%patch $33C5E [$0000W]

Deprotect and stick to ground

The Bobba 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

%patch $33ABC [$0000W $0000W]

%patch $33ADA [$0000W $0000W]

%patch $33AF8 [$0000W $0000W]

%patch $33B16 [$0000W $0000W]

#Shot (Sparkle)
%patch $33B34 [$0000W $0000W]
%patch $33B52 [$0000W $0000W]
%patch $33B70 [$0000W $0000W]
%patch $33B8E [$0000W $0000W]

#Shot (Fireball)
%patch $33BAC [$0000W $0000W]
%patch $33BCA [$0000W $0000W]
%patch $33BE8 [$0000W $0000W]
%patch $33C06 [$0000W $0000W]

#Shot (Fireball busting)
%patch $33C24 [$0000W $0000W]
%patch $33C42 [$0000W $0000W]
%patch $33C60 [$0000W $0000W]