Book Image

Flash Game Development by Example

By : Emanuele Feronato
Book Image

Flash Game Development by Example

By: Emanuele Feronato

Overview of this book

<p>You can't call yourself a Flash game developer unless you know how to build certain essential games, and can quickly use the skills and techniques that make them up.<br /><br />Flash Game Development by Example is an ultra-fast paced game development course. Learn step-by-step how to build 10 classic games. Each game introduces new game development skills, techniques, and concepts. By the end of the book you will have built ten complete games &ndash; and have the skills you need to design and build your own game ideas.<br /><br />The book starts with simple well known puzzle games: Concentration and Minesweeper. After learning the basics of game design you&rsquo;ll introduce AI with a four-in-a-row game. Then as you build your own versions of old arcade games such as Snake, Tetris, and Astro Panic. The book ends with a collection of modern casual classics.</p>
Table of Contents (17 chapters)
Flash Game Development by Example
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Where to Go Now
Index

Splitting the code


There are three reasons why you should always split the code: first, this practice improves script readability. Remember that script readability is everything when you aren't working on your projects for a while. It's easier to see what this script is supposed to do:

connectToServer();
displaySplashScreen();
startTheMusic();

rather than this one:

// connecting to server
...
... // big set of instructions to connect to the server
...
// display splash screen
...
... // big set of instructions to display the splash screen
...
// starting the music
...
... // big set of instructions to start the music
...

With the first method, the one you'll be using from now on, you can easily see what the script does just looking at the first three lines. You don't have to read anything more unless you want to check how the functions connect to the server, display splash screen or start the music. The second script is not as intuitive, although there are comments, especially if a lot of...