Game Development Reference
In-Depth Information
You can't stick with AS2 because it's dead
There's no getting away from the fact that AS3 can be more complicated than AS2. Many tutorials
online that are still written with AS2 code; you'll find many game functions and engines that are
written in AS2; and many developers are still very comfortable with AS2. So why change? The
main problem with AS2 is that it is dead . Adobe does not want to support it any longer and has
been working very hard to convince Flash developers to move up to AS3. In fact, AS3 has many
big advantages over AS2 for game developers; here are a few of them:
Speed : AS3 simply executes much faster than AS2. A brand new Flash virtual machine
was created to run AS3 applications, and it has been optimized for their execution with a
just-in-time compiler. The most limiting factor for the performance of many games is the
speed of the machine they are running on. With AS3, execution speed is two to five
times faster than AS2 (depending on who you ask and what tests they have performed).
Error handling/debugging : With AS2, error handing and debugging was a trial-and-
error process that involved many trace statements and much frustration. AS3 adds a
more powerful compiler that looks for errors in logic as well as syntax and a runtime
error system to help diagnose problems with code that compiles perfectly but does not
work when executed.
Advanced event model : Since many games are not simple procedural programs that
sit and wait for user input, but instead create a world where events occur that need to be
handled within your program, a solid event model is essential. While AS2 used events,
its event model was not very mature. With AS3, events are built into the system, making
their use seem natural and, at the same time, helping developers design software that
more logically and is easier to maintain.
There are many other differences too, but these are some of the ones that will affect you the most
when developing games in AS3. For more information, check the Adobe AS3 migration reference
located at http://help.adobe.com/en_US/AS3LCR/Flash_10.0/index.html?migration.
html&all-classes.html .
What you need to use this topic
You need to own a copy of Flash CS3 or above or of Flex or Flash Builder, or you can download
the Flex SDK and a programming editor (i.e., Flash Develop). Internet access is also required to
download software and to implement some of the viral strategies near the end of this topic.
We will make every attempt to describe how the code in this topic will work in various
development tools, but at some point, you will have to translate a bit of the included code to suit
your development tastes.
Search WWH ::




Custom Search