Game Development Reference
In-Depth Information
libraries are efficient about componentizing themselves so that
only the classes that you need active for your application are
included; the TweenLite/TweenMax animation platform by Jack
Doyle is a great example of this architecture. In general, however,
be mindful of how much code ends up in your final SWF
it does
As of this writing, Apple has a 20-MB limit on the size of the application
that can be downloaded to an iOS device over a carrier
This means applications and games larger than 20 MB must be down-
loaded either through iTunes or over a Wi-Fi connection. While this prob-
ably isn
re right at or just
over this threshold with your app, cleaning up unused code means you
t a deal breaker for most of the people, if you
get that much more exposure from customers who can download it from
Keep Your Display List Shallow
While this doesn
t come up too often in game development,
another way to increase performance of the renderer is to keep
your display list from branching too deeply. Depending on the type
of game you are creating, this might have extensive implications or
none at all. Just keep in mind that every layer deeper you go into
the display list increases rendering and processing time.
Don ' t Use Events Where You Can Easily Use
Function calls require less memory than using the event model hier-
archy, especially when using bubble or capture events that must tra-
verse the display list. This is not to suggest that the event model
should be thrown out altogether
events are still required for listen-
ing for input and for any number of other common ActionScript tasks
such as ENTER_FRAME loops, and individual events used wisely help
maintain flexibility for re-purposing code. However, there are some
cases in which a method would work just as well and will decrease
overhead. This is particularly helpful for events that would otherwise
get dispatched over and over again in a game loop. Perhaps the
enemy Sprites in a game broadcast information about themselves
repeatedly throughout gameplay. Rather than dispatching an event
every time, a method could be passed to each enemy Sprite to call on
their recipients. Consider the following two examples:
Search Nedrilad ::

Custom Search