Patch:Galaxy actions

From KeenWiki
Jump to: navigation, search

This page is about sprite actions in Keen Galaxy and Dreams. Unlike in Vorticons, in Galaxy and Dreams there are two main components of a sprite, it's code, which behaves as in Vorticons, containing most of the decisions a sprite must make (What to do when faced with a wall, hit by a shot, etc) and actions, which define simpler things, such as animations to use, most speeds and pointers to more code.

Each action is 30 bytes long and consists of the following:

Int     Description         Values
Int 0:  Left sprite         Valid sprite chunks
Int 2:  Right sprite        Valid sprite chunks
Int 4:  Type                0-4
Int 6:  Deprotect Animation 0/1
Int 8:  Stick to Ground     0/1
Int 10: Delay (Anim speed)  0-8000
Int 12: H anim move amount  +- any value
Int 14: V anim move amount  +- any value
Int 16: Behavior            Start of behavior codes
Int 18: Behavior segment    Segment values
Int 20: Check sprites       Start of check sprite codes
Int 22: Check segment       Segment values only
Int 24: Check tiles         Start of check tile code
Int 26: Check segment       Segment values
Int 30: Next action         Valid actions

Actions can be treated like text strings, with pointers to them. They are located in the text segment of the executable, usually in chunks. More information can be gained from each value's page: Patch:Sprite animations, Patch:Sprite behavior, Patch:Sprite collision, Patch:Sprite tile check, Patch:Galaxy Action Parameters.

Differences in Biomenace

While Biomenace uses the same engine as Keen actions in it are 32 bytes long (And extra two bytes exists before the next action value.) Action strings are also located only at addresses divisible by $10 ($22F30, $22F40...) This allows the Next Action value to work differently than in Keen. The value is the actual address of the next action minus some value, divided by $10. As an example, to point to an action at $22F30 the value $2A06 is used in the freeware Biomenace 1. This is ($22F30 + $7110) / $10.