Game Development Reference
In-Depth Information
There are two types of camel case that you'll be using throughout this topic:
Lower camel case : startsWithLowerCaseLetter. You'll be using this case for package names,
variables, methods, and instances. You'll also be using lower camel case for the names of the
FLA files (for example, dahhkSknh`*bh]).
Upper camel case : StartsWithUpperCaseLetter. You'll use this case for class names and con-
structor method names. You'll also use it for the names of AS class files such as I]ej*]o, which
must be named exactly like the class they define in the file.
Because ActionScript is a case sensitive programming language, keep in mind that helloWorld is dif-
ferent from HelloWorld, which is different still from helloworld. Make sure that you follow all the
capitalization as it appears in the text; otherwise, your programs won't work. If you write a program
that seems perfect in every way but just doesn't run, check your spelling and capitalization! This is one
of the most common mistakes that novice programmers make, and many a programmer will tell you
tales of woe about debugging sessions running till 4 a.m. where the culprit, when eventually smoked
out, was revealed to be a single misspelled or incorrectly capitalized word. The author of this topic
refuses comment!
Summary
Well done! You've written and published your first AS3.0 program! It wasn't so hard, was it? In fact,
congratulate yourself for getting through one of the most difficult chapters in the topic. I've laid the
programming foundations for all the games and projects to come, and you'll find that you'll use this
same format for setting up your programs over and over again in your career as a game designer.
This chapter has covered a lot of theory, and if you are new to programming, you might have found
some of it a bit heavy. I sympathize with you! But you don't necessarily need to completely understand
all the theory to create games. The most important thing is that you know what programming code
you need to use to get the results you want. A deeper understanding will come with time, a lot of trial
and error, and doing as much experimenting with your own projects as you can.
A deep dark secret that most programmers often don't like to share with the rest of the world is that
a great deal of the world's software is built with a little bit of understanding and an awful lot of “copy/
paste.” That's all part of the learning process. Of course, you need to know exactly what bits of code
you need to copy and paste, and how to change them to get the results you want, which is something
only experience (and this topic!) can teach you. But as time goes on, you'll soon recognize the usual
suspects and be copying and pasting to your heart's content along with the best of them.
I encourage you to go back to parts of this chapter that might have been little fuzzy the first time
through to try to get a solid understanding of them before continuing much further. If you don't get it
all just yet, don't worry! If you managed to get the little Hello World program running and you gener-
ally understand what made it work, you're in the game!
In the next chapter, you'll use this same model to start building a simple children's interactive story-
book. See you there!
 
Search Nedrilad ::




Custom Search