Patch:Platform (Keen 2)

From KeenWiki
Jump to: navigation, search

Platforms are useful sprites found in Keen 2 and Keen 3. This page lists patches relating to Platform sprites in Keen 2, which moves horizontally. 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

Platforms use sprite type 7 which means they push Keen about and Keen can stand on them. They also keep moving when off-screen, unlike most sprites, which means that the patterns they move in cannot be disrupted by Keen in any fashion. This also differentiates them from Scrubs.

Patch: Keen 2
#Platform sprite type:
%patch $3D9F $07
#H platform

Sprite Position

The platform spawns three pixels above where it is placed in-level.

Patch: Keen 2
#How far up\down vertical platform spawns
%patch $3DBA $FC

Sprite Behavior

The platform behavior is quite simple. There are two behaviors, the first moves and reverses direation when it hits walls. The other pauses for a time before resuming movement. Platforms will pause when they hit walls then continue moving in the opposite direction.

The platform collision is 'do nothing' meaning that they do not interact with any other sprites unless this is changed.

$467CW Move and reverse direction when hitting stuff
$46BFW Pause
$61A2W Platform collision

Patch: When spawned
%patch $3DC8 $4C47W 
#Move (H platform)

Patch: In level
%patch $46BA $46BFW 
#Pause, (If hits left walls)
%patch $46DB $467CW
#After pausing
%patch $3DCD $61A2W
#H Platform collision

Speed and Jump Height

The default speed of Platforms is +-75. When spawned Platforms will head right. The speeds are changed in the movement behavior, NOT the pausing behavior (The speed is changed just before the platform pauses.)

It is possible to change the initial speed to down, but not yet possible to make the platform fully functional as a vertical platform.This should be easy enough if it is wanted.

Patch: Starting speeds
%patch $3DD6 $20 $004BW 
#H plat, move right (Use $22 for down)

Patch: In level
%patch $469E $004BW 
#Platform hit left walls (Move right)
%patch $46AC $FFB5W
#Platform hit right walls (Move left)

Sprite Collision

Platforms use the 'do nothing' collision, which means they do not interact with any sprites and rely on other sprites to interact with them.

Patch: Keen 2
%patch $3DCD $61A2W 
#H Platform collision


Patch: When spawned
%patch $3DD2 $007EW 
#H Start

Patch: In level
%patch $468B $007EW 
%patch $4688 $01
#And next frame
%patch $4684 $05
#Animation speed