Game Development Reference
In-Depth Information
a font and improves performance, but this technique really has to
be applied on a case-by-case basis. Sometimes, such as when deal-
ing with numeric values that have far too many possible combina-
tions, it is simply not feasible to use anything other than a
standard text field. However, if your approach is to use as few of
these as possible, you should find a good balance between flexibil-
ity and optimization.
Motion Tweens
Although Adobe does not recommend against it, I have found
through tests that the new Motion Tweens introduced in Flash CS4
and Flash Player 10 are not especially efficient for use on iOS
devices. Unlike the classic tweens of previous versions, which were
ultimately converted to keyframe animations on export, the new
Motion Tweens are converted into code, utilizing a number of
classes in the fl.motion package. As of this writing, they appear to
use enough overhead to make the very animations they are created
to execute choppy. At some point in a future version, the collective
efforts of Apple to improve the iPhone and Adobe to improve their
export process from Flash may yield a Motion Tween that will run
fine in that environment. It is best to stick with either a keyframed
animation or a basic script-based tweening package such as
The Drawing API, Masks, and Blends
Although it does not come up often in game development, Adobe
recommends avoiding the entire drawing API for runtime creation
of vector shapes. Slightly more prevalent in games are masks and
use of blend modes for certain graphical effects. It is best to avoid
using them altogether. If they are absolutely necessary to achieve a
visual effect, they should be handled the same way as filters; place
them inside a DisplayObject, cache them to the GPU, and then
leave them alone.
Runtime Loaded SWFs
A common technique in Flash development is to spread content out
over a number of SWFs, so as to not incur the entire load of a site or
game up front when streaming over the Internet. It is less common
in smaller games, where it makes sense to bundle everything
together, but in larger games that have a lot of artwork and audio, it
is a better practice to deploy across multiple files. Not only does this
mean that content is only downloaded when needed, but it makes
multideveloper projects easier by clearly demarcating one code base
from another. Unfortunately, this ability is not available in Flash
Search Nedrilad ::

Custom Search