Applying Animation in Games


Applying Animation in Games

Now that you have a basic understanding of the basic types of animation, you're probably wondering which is best for games. I've already alluded to the fact that cast-based animation is more efficient and often gives you more control over game graphics, but the truth is that most games use a combination of the two animation techniques. Each technique offers its own unique benefits, so combining the techniques gives you capabilities that would be hard to get by using one of them alone.

A good example of how games often require the use of more than one animation technique is an animation of a person walking. You obviously need to be able to alter the position of the person so that he appears to be moving across a landscape. This requires cast-based animation because you need to move the person independently of the background on which he appears. However, if we let it go at this, the person would appear to just be sliding across the screen because he isn't making any movements that simulate walking. To effectively simulate walking, the person needs to move his arms and legs like a real person does when walking. This requires frame-based animation because you need to show a series of frames of the leg and arm movements. The end result is an object that can both move and change its appearance, which is where the two animation techniques come together.

This technique of combining cast-based and frame-based animation is very common in 2D games, and will form the basis of the sprite enhancements you make to the game engine in the next two hours.



Sams Teach Yourself Game Programming in 24 Hours
Sams Teach Yourself Game Programming in 24 Hours
ISBN: 067232461X
EAN: 2147483647
Year: 2002
Pages: 271

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net