Whenever a pair of tiles are matched and removed from the screen,
a game edition can remove the tiles using a variety of special effects. These effects
are set and adjusted using applet parameters. If no special effects are desired,
tiles will simply vanish when matched.
There are two types of removal effects; motion and transition. Motion effects control movement of the tile off the screen. Transition effects cause the tile to vanish, but in a gradual and interesting way.
Motion and transition effects can be used independently or in combination (i.e. one motion effect combined with one transition effect).
Note that transition effects require more computer power to render, and may have an unappealing look on some systems (depending on how Java graphics are implemented on the system, and the number of bits used for color).
See Some Sample Effects
Motion effects are used to move matched tiles off of the screen.
There are four types of motion available: Coast, Fly, Swirl and Wander.
"Coast" is a smooth movement, at a constant speed in a single direction.
"Fly" is an accelerating movement in a single direction.
"Swirl" is an acceleration movement in an outward spiral.
"Wander" is an random, zig zagging movement.
Transition effects are used to gradually remove tiles from the
screen. There are four types of transition effects; Fade, Dissolve, Twinkle and Waver.
"Fade" is a smooth, even transition where the image gradually becomes more and more transparent until it disappears.
"Dissolve" is an uneven transition, where different pixels in the image become transparent sooner than others.
"Twinkle" can be even or uneven (i.e. it can apply simultaneously to the whole image, or to different pixels in the image at different times). It involves first changing pixels to a predetermined color, then fading them away. When applied evenly it is more appropriately called termed a "Glow".
"Waver" is an uneven but regular transition where waves pass accross the image, making it gradually fade out then in then further out, until it disappears.
All effects are controled by nine parameters.
If you wish to use effects, allowEffects should be set to "yes". This is the default, so if you intend to use effects this parameter does not need to be explicitly set.
If you wish effecst to be active when the player first begins the game, effectsOption should be set to "yes". This is the default, so if you intend to use effects this parameter does not need to be explicitly set. If set to "no", the player must use the options screen to turn effects on.
The effect parameter declares the motion and transition effects to be applied when tiles are matched. This is done by creating a string describing the effects, such as "Fly", "Dissolve", or "Coast Fade". Any motion effect may optionally be followed by a direction; "up", "down", "right" or "left". If no direction is specified, the initial direction for any particular tile will be random. The "twinkle" effect should be followed by a color.
When combining a motion and transition effect, simply include both (e.g. "Fly right Twinkle Yellow").
For a transition effect, steps determines the number of discrete steps (frames) a transition animation can use. A larger number of steps will result in a smoother animation, but will require more system resources (slowing down the player's computer). Note that this parameter has no impact on motion effects.
effectLapse determines the number of milliseconds between each frame of animation (for any type of effect, motion or transition). A shorter amount of time (i.e. a smaller number) will result in a smoother animation, but will also tie up the player's computer resources. A larger number will provide larger intervals of time for the player's computer to perform tasks other than animation, but will make the animation more choppy. Generally, this parameter should be left at the default of 10 until computer systems increase in speed.
effectSimul determiens the maximum number of tiles which can be animated at one time. Any tiles matched while this limit has been reached will simply vanish from the screen without a removal effect. This condition has been included to prevent the game from too severely bogging down slower systems with excessive animations. This number can be increased as computer systems become faster.
Three parameters control different aspects of each type of effect; effectParm1, effectParm2 and effectParm3. Note that there are not separate parameters for motion and transition effects, so if the two are used in combination you cannot vary the motion effect without changing the transition effect, and vice versa.
The meanings of the different parameters for each effect are summarized as follows:
|Coast||Minimum speed||Maximum speed||N/A|
|Fly||Minimum acceleration||Maximum acceleration||N/A|
|Swirl||Minimum acceleration||Maximum acceleration||Angle of force, relative to the current direction of motion, measured in radians|
|Wander||Minimum acceleration||Maximum acceleration||Chance of changing direction|
|Dissolve||Number of transparency steps||N/A||N/A|
|Twinkle||Number of "glow" steps||Number of glow/transparency steps|
|Waver||Size of bands (in pixels)||Number of transparency steps||N/A|
You can use the directions to achieve different effects. "Coast Up" looks sort of like a balloon. "Coast Down" looks like something sinking in water, as opposed to "Fly Down" which looks like something dropping through the air.
Tight spirals (effectParm3 = 0.5 or -0.5) look cool at first, but they can become very annoying unless you make the tile move fast. A looser spiral gets the tile off the screen faster even if the tile accelerates slowly.
Even if you increase the chance of changing direction up to 1, the default acceleration (min 5, max 10) will send the tile off the screen with only a bit of wiggle. To get a "serious" wandering effect, you need to reduce the acceleration (effectParm1 and effectParm2); lower accelerations will cause more eratic motions.
Generally, you can use low values for parameters one and two without
changing the effect much, unless you are trying for a "glow". Use a large
number of steps to get a dilute twinkle, lower values to get a more even glow.
Compare Twinkle Parameters
This effect generally looks best with a larger number of steps and with smaller bands.
The number of steps to use in a fade is purely a matter of taste
(as well as computer power). In dissolve, use a large number of steps and a small
value for effectParm1 to get a diffuse dissolve. The closer effectParm1 is to the
number of steps, the more the Dissolve becomes like a Fade.
Back to the Host Kit Main Page