Game Development Reference
In-Depth Information
Preparing animation
It is impossible to imagine a modern game without animation. The game world should
be alive to compel attention. There are two major types of animation: based on pro-
gramming code and frame based stored in animation sprites. The first type requires
some programming algorithm to move or transform a graphic object; in most cases,
this is a linear process. An object is moved from location A to location B with prede-
termined speed, its size is increased, and its alpha channel is changed. Such type of
the animation with automatic incrimination is called motion tween in Adobe Flash. At
a more complex level, the object has curved trajectories and moves with some accel-
eration and there is inertia in its movement; the games in which such interpretation is
used require advanced control on an element's dynamics; first of all, I'm talking about
various physics puzzles.
Frame-based animation on the other hand is a way to beautify the motion. Besides
the automatic animation successfully moving a sprite around the screen, the illustra-
tion inside the sprite would be still; for example, a character would not step. Several
images to illustrate the walking cycle are needed so that the game can form animation
sprites. This is a bunch of images, portraying various phases of motion. Modern SDKs
usually have rich collections of methods to work with the animation sprites. They can
be played in the order in which they are stored in the animation sheet, or they can be
organized by using an array with a custom order, which is very useful because more
complicated animation sequences can be created with a minimum number of images.
Here are some tricks: if there is a portion of opposing movements (for example, a
character is showing up from a hatch and then hides back), the animation sheet can
include only half the frames, displaying the motion in one direction; the other part
would be constructed from the same frames but played backward. A pause in an an-
imation of given duration can be organized by simple repetition of one of the sprites.
Another interesting option of non-linear frames are extra frames , which helps to deal
with sameness of animation cycles. Each gesture and movement an object makes in
the real world is pretty unique. Take for example a passerby walking in the street, his
legs make steps in cycles; the cycles are pretty similar, but not quite the same. There
is a beautiful metaphor:
"Sometimes a butterfly lands on the shoulder, so step at this moment is a little bit dif-
ferent."
Search WWH ::




Custom Search