Game Development Reference
In-Depth Information
Adobe has done a great deal with each successive generation of the Flash Player to improve perfor-
mance, but this is a major handicap for game developers who depend on squeezing every iota of pro-
cessing power out of a system to maximize performance in their games. This is why 3D Flash games,
which require a vast amount of processing power to calculate geometry, struggle to compete with
the rich graphic splendor of 3D on the game consoles (such as the Xbox, PlayStation, and Wii.) The
consoles use custom compilers that optimize all the game code to run directly as machine language
on their specific processors.
If you're thinking of eventually getting into game design for the consoles, however, you're still in
pretty good shape with Flash: the skills you'll learn by programming in AS3.0 can be directly applied to
programming for consoles when you're ready to take that step. The AS3.0 programming environment
is also probably the most user-friendly programming environment you can learn in. And, hey, make
a game with Flash, post it on the Web, and you've got a potential worldwide audience for it—that's
power!
Naming conventions
Before this chapter closes, let's take a quick look at an aspect of programming practice called naming
conventions .
You might have noticed something peculiar about the kinds of names that you gave the file, class, and
method names. Have a look at the choice of file name for the FLA:
dahhkSknh`
Does it look a little strange to you? It should. You'll notice that the h is lowercase and the W is upper-
case, and there's no space between the two words. This is a style of giving things names that program-
mers affectionately call camel case (also known as humpBackNotation) . Can you guess why it's called
that? I'm sure you can!
With camel case you can write a compound phrase using more than one word. The words are not
separated with blank spaces, and the phrase is still easily readable you and by AS3.0. Blank spaces in
the middle of compound names are the programming equivalent to foxes in a chicken coop—avoid
them at all cost! The AS3.0 code compiler throws its hands in the air when it encounters a blank space
where there shouldn't be one, so camel case was developed by programmers as an efficient way of
writing compound words or phrases without spaces.
Camel case is an important feature of naming conventions, which are rules that programmers decide
on before they start a project about the style they'll use for creating package, variable, class, object,
method, and file names. By strictly sticking to these naming conventions, programmers are better able
to dodge the easy-to-make errors that come from misspelling or incorrectly capitalizing any elements
in their code. They can also easily see what kind of programming object they're dealing with simply by
the way it's been capitalized.
 
Search Nedrilad ::




Custom Search