Game Development Reference
In-Depth Information
As with any effect, creating good shader effects is mostly a matter of using images that
work well with the effect. I had it easy with a well-designed menu screen that works well
with both particle and shader effects. Imagine if you had only flat-colored dummy graph-
ics—it wouldn't look nearly as good. Effects in themselves can't work magic. You have to
provide good input for shaders and particle effects to generate good output.
While it's tempting to start designing effects early, the development of effects should
really be deferred until the project has all of the features and most of the artwork. By that
time, you have established that the game runs well and there's spare performance to be
taken up by effects.
Being able to verify that the game still runs smoothly even with the newly added effects
and on older devices will also save you a lot of time not designing the uber-effect you
want, and that you may eventually have to scale down or remove entirely due to perform-
ance issues. And with most of the artwork finalized, it'll be a lot easier to design great-
looking effects, too.
Keep in mind that even simple effects like Brightness and Contrast can have a significant
impact on performance, depending on which device you test them on. And do test effects
on the device, because the Simulator is very slow to begin with.
That's also another reason to defer implementing effects until late in the project: adding
effects can easily make the Simulator unusable even for simple tests, let alone actually
playing the game.
Tip Remember that you don't have to use the Effect node if you want to apply
an effect to a specific sprite. Just select the sprite in question, and switch to the
Item Properties tab to find the effects user interface at the bottom of the CCS-
prite properties, just below the blend modes. Unlike the Effect node, effects ap-
plied directly to a sprite will not affect the sprite's child nodes.
Summary
You've learned how to create sprite frame keyframe animations, and you've enhanced the
SoftBodyDrawNode to work with sprite frame animations. You also know how to
override the setSpriteFrame: property setter in order to run custom code when a
specific sprite frame is displayed.
Search WWH ::




Custom Search