From KeenWiki
Jump to navigation Jump to search

Balls, also known as Jack Balls are harmless read spherical enemies found in Keen 3. This page lists patches relating to Ball 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

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

Keen 3

#Ball sprite type:
%patch $3E7D $08

Sprite Behavior

The Ball uses the same type of behavior as the Jack, 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.

$4C0BW Bounce off things
$6A00W Ball collision

When spawned

%patch $3EA0 {$4BBDW}

Ball collision

%patch $3EA5 {$6A00W}

Speed and Jump Height

The default speed of Balls is +-400. When spawned Balls 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 Ball 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 Balls 'very much more unpredictable and annoying.

Starting speeds

%patch $3ECA [$0190W] #If spawned above/left of Keen (Move right)
%patch $3EC3 [$FE70W] #If spawned below right of Keen (Move left)
%patch $3EEA [$0190W] #If spawned above Keen (Move down)
%patch $3EE3 [$FE70W] #If spawned below Keen (Move up)

In level

%patch $4C1E [$FE70W] #Ball bounce left speed
%patch $4C2A [$0190W] #Ball bounce right speed
%patch $4C36 [$FE70W] #Ball bounce upwards speed
%patch $4C42 [$0190W] #Ball bounce downwards speed

Sprite Collision

Balls 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.

Ball collision

%patch $3EA5 {$6A00W}


When spawned

%patch $3EEF [$006DW] #Start