Patch:Gravity

From KeenWiki
Jump to: navigation, search

Gravity is what pulls objects down in the game. In Keen Vorticons this is a constant acceleration to a maximum downwards speed. How gravity works in Keen galaxy and Dreams is unknown, but it likely to be similar.

In Keen Vorticons gravity is a single subroutine that must called by something in order for that object to experience gravity. It is thus possible to make something ignore gravity with a simple patch as well as make custom gravity codes and make various objects use it.


Change strength of gravity

There are three variables to alter to change the game's gravity; the acceleration, which controls how fast objects reach maximum downwards speed, and two values that set the maximum speed. Changing the acceleration will change the jump height of everything in-game, while changing the maximum fall speed will change the 'pace' of the game (Increasing it will make things fall faster, making the game seem faster.)

Patch: Keen 1
#Change the game's gravity:
%patch $2C37 $03
#Acceleration (How fast jumps/falls change)
%patch $2C3C $00C8W
#Max fall speed 1
%patch $2C44 $00C8W
#Max fall speed 2

Patch: Keen 2
#Change the game's gravity:
%patch $5A79 $03
#Acceleration (How fast jumps/falls change)
%patch $5A7E $00C8W
#Max fall speed 1
%patch $5A86 $00C8W
#Max fall speed 2

Patch: Keen 3
#Change the game's gravity:
%patch $62C1 $03
#Acceleration (How fast jumps/falls change)
%patch $62C6 $00C8W
#Max fall speed 1
%patch $62CE $00C8W
#Max fall speed 2


Disable gravity

These patches completely disable gravity for the entire game. While it is possible to disable gravity for certain sprites specifically these patches will affect everything. Unless this is treated carefully the game quickly becomes unplayable.

Patch: Keen 1
#Disable gravity:
%patch $2C2A $C3

Patch: Keen 2
#Disable gravity:
%patch $5A6C $C3

Patch: Keen 3
#Disable gravity:
%patch $62B4 $C3


Sideways gravity

This patch creates a 'breeze' in levels; a sort of sideways gravity that pulls everything sideways all the time. Note that this patch will be incompatible with any other patches that use the $55EF line to free up space, such as the 'shoot up\down patch', so check your patchfile before adding this patch.

The value marked in blue is the 'breeze', set here to very low rightwards. Negative values will pull things left. This aptch can also be part of an 'automatic level scrolling' patch.

Patch: Keen 1
#Levels have a breeze (Pull ALL sprites and Keen in one direction steadily)
%patch $55EF $EB $4A %patch $4D1E $E9 $08D0W %patch $55F1 $B8 $0000W $A3 $823EW $B8 $0040W $A3 $823CW $33 $C0 $E9 $F724W