Patch:Sprite motion parameter
The sprite motion parameter is the name for a variable that controls three aspects of Keen Galaxy sprites. The variable may have a value between 0 and 4 inclusive. Basically it controls when various things are run.
The three variables affected are 1.) when the sprite behavior is run, 2.) When the sprite speed is run and 3.) When the sprite action is run.
Per frame vs per action
How a sprite behaves varies depending on whether something is run once per action or once per game frame. There are 35 game frames in every second. How this affect the three variables above is as follows:
Motion: If motion is run once then the sprite will move in a series of jerks, like an inchworm, as all the motion is used at once. (The sprite 'jumps from position A to position B) If the motion is run every game frame, then it is redrawn 35 times a second, giving it the appearance of smooth motion. (The sprite moves from position A to 1/35th near B, then 2/35ths...)
Behavior: If the behavior is run constantly the sprite responds instantly to anything it should, such as Keen being close.This however eats up memory. Complex behaviors should be run once per action, and there are some behaviors like throwing projectiles that must be run once per action. (35 shots per second would quickly crash the game.)
Action: usually the 'animation speed' controls how long the current action lasts. If it is not used then the sprite will stay in its current action for a varying amount of time. This is useful in that a sprite can sit or fall for as long as it needs to.
Values
The five values and what they do are as follows:
0: Behavior run once, smooth movement, animation speed controls action length. Used for smoothly moving sprites like walking Keen or moving platforms.
1: Behavior and movement are run once, animation speed controls action length. Commonly used, e.g. Inchworms.
2: Behavior run once, BUT animation speed and movement speed are ignored. Used for sprites that need to sit\fall for varying amounts of time. Stunned sprites use this, allowing them to fall until they react to hitting the ground. While the action movement speed is ignored, other motion programmed in any of the sprite behaviours, if any, is smooth.
3: Behavior run continuously, motion is jerky, animation speed controls action length. This is for responsive things that mover jerkily and as such is rare. The landing blue bird in Keen 4 uses this (When close to the ground it 'jerks' down to land.)
4: Behavior run continuously, motion is smooth, animation speed controls action length. This is for responsive sprites that must move smoothly, like the Mad Mushroom (Turn to face Keen, bounce off floors)