Game Development Reference
In-Depth Information
There is no time like the present to program a game and see it come to life. In fact, there has
never been a time with better tools, more mature delivery mechanisms, or even a wider audience
for games than there is today. Since some fairly easy avenues now exist to both distribute and
get feedback on your work, there is no reason to let a half-finished first game sit on your hard
drive any longer, and there is no reason not to move on from there and make your second game.
Who this topic is for
Anyone!
OK, well, anyone who wants to make games. Actually, anyone who wants to make games and
has some programming experience, preferably with an objected-oriented language like
ActionScript 2 or 3.0 (AS2 or AS3), C++, C#, Java, or JavaScript. Since we want to dive right into
making some games, we are not going to spend much time trying to teach you the basics of
programming. Intuitive learners (like yourself, of course) should be able to pick up most of the
major programming concepts by following the code and descriptions, but we can't slow down to
dwell on them too much. We want to make some games, and to make games, we need to write
some AS3 code.
So we're not starting at the beginning?
Sure, we are. We start at the beginning of programming games in AS3. Other sources can teach
you the basics of programming in AS3, such as Foundation ActionScript 3.0 for Flash and Flex
(ISBN: 978-1-4302-1918-7) and Foundation Game Design with Flash (ISBN: 978-1-4302-1821-0),
both from friends of ED. In this topic, we want to teach you the basic concepts behind writing some
reusable game code to make some enjoyable games that can be built on, modified, and improved.
Having said that, we will need to teach you some basic AS3 concepts as we go along. Again,
intuitive readers should be able to pick up the concepts with ease, so we will move quickly over
them.
Comparing AS3 and AS2
“AS3” is short for ActionScript 3.0, and it is the core programming language for Flash and Flex
games and applications. It is a complete rewrite of ActionScript 2, so if you only know AS2, you
will have to bring yourself up to speed on AS 3.0 programming basics before starting this topic.
Flash has included a simple programming language since Flash 4 was released in the late 1990s.
Macromedia introduced ActionScript with Flash 5, and the language evolved through several
minor iterations to the final version of ActionScript 2 with Flash 8. ActionScript 2 was a good
language. You could develop with object-oriented methodologies, use event models, access
bitmaps, and so on. However, it was a rewrite of a rewrite, and performance suffered because of
all the legacy functions that it had to support and because the code was interpreted rather than
compiled. As you can imagine, this backward compatibility, while a great advantage for
application support, also limited the performance of the Flash Player running in the web browser.
At that point, the Flash development team went back the drawing board to rewrite ActionScript as
a brand new language. They rebuilt it from the ground up, attempting to fix many of the problems
that AS2 (and its associated baggage) carried with it. When they were finished, they had created
a language in AS3 that had significant advantages over AS2.
Search WWH ::




Custom Search