From KeenWiki
Jump to navigation Jump to search

Jacks are dangerous spiky enemies found in Keen 3. This page lists patches relating to Jack sprites. It is divided into sections relating to the various sprite properties the patches involve. Being fluent with various sprite patch pages will help when working with these patches.

Sprite Type

Jacks use sprite type 9 which means they kill Keen on contact, but don't really interact with any other sprites.

Keen 3

#Jack sprite type:
%patch $3EFF $09

Sprite Behavior

The Jack uses the same behavior as the Ball, it rebounds off solid tiles in a predictable manner, always following the same path. This behavior never changes. It also uses the 'do nothing' collision, meaning it itself will not interact with any sprites and relies on other sprites (Such as Keen) interacting with it.

$4BBDW Bounce off things
$6A00W Jack collision

When spawned

%patch $3F22 {$4BBDW}

Jack collision

%patch $3F27 {$6A00W}

Jack chases Keen

This patch makes the Jack chase Keen, trying to head towards Keen's head. The first three blue values are the animation speed, number of animation frames used and animation respectively. The next four blue values are the left, right, down and upwards speeds in that order. Finally the brown highlighted bytes can be deleted if the patcher desires a Jack that can 'ghost' through tiles.

Starting speeds

#Jack chases Keen
%patch $4BBD $55 $56 $57 $A1 $61 $53 $C1 $E8 [$03] $83 $E0 [$03] $83 $C0 [$6E] $A3
             $38 $99 $66 $A1 $14 $99 $66 $3B $06 $0A $71 $7F $08 $C7 $06 $30
             $99 [$003CW]  $EB $06 $C7 $06 $30 $99 [$FFC4W]  $66 $A1 $18 $99 $66
             $3B $06 $0E $71 $7F $08 $C7 $06 $32 $99 [$003CW]  $EB $06 $C7 $06
             $32 $99 [$FFC4W]  {$E8 $16F3W}  $5F $5E $5D $C3

Speed and Jump Height

The default speed of Jacks is +-400. When spawned Jacks use their starting speeds to head toward Keen by default. They have a second set of speeds that are their 'rebound' speeds, by default these are the same as their starting speeds, but this need not be true.

Since it moves both horizontally and vertically at the same time (diagonally) both an h and v speed will change when the Jack bounces. Paths will be regular if all speeds are the same (By default 400, meaning the movement angle is 45 degrees.), less regular if h and v speeds differ by a simple amount (If he h speeds are twice the v speeds the angle will be 22.5 degrees or two tiles across for one tile u/d) and if the speeds are not in a simple ration to each other (One is 4/7 of the other.) then the paths will be very complex and hard to predict in-game, this can be used to make Jacks 'very much more dangerous.

Starting speeds

%patch $3F4C [$0190W] #If spawned above/left of Keen (Move right)
%patch $3F45 [$FE70W] #If spawned below right of Keen (Move left)
%patch $3F6C [$0190W] #If spawned above Keen (Move down)
%patch $3F65 [$FE70W] #If spawned below Keen (Move up)

In level

%patch $4BE2 [$FE70W] #Jack bounce left speed
%patch $4BEE [$0190W] #Jack bounce right speed
%patch $4BFA [$FE70W] #Jack bounce upwards speed
%patch $4C06 [$0190W] #Jack bounce downwards speed

Sprite Collision

Jacks don't interact with any other sprites. (See above.) As such there is little that can be done without changing the collision code it uses.

Jack collision

%patch $3F27 {$6A00W}


When spawned

%patch $3F71 [$006EW] #Start

In level

%patch $4BCE [$006EW] #When moving
%patch $4BCB $03    #And next 3 frames