Development


In an ideal world, the artist would completely develop the graphics for a project before the programmer began to make the pieces function together. But in the real world, it is often necessary for several parts of a project to be developed simultaneously . Although this does entail more people-hours to complete the project, it also makes it possible for the project to be completed sooner.

Because the storyboarding was actually done in Flash, I used the symbols from Figure 25.1 to implement the basic functionality while the artist developed the real artwork. When the artist finished with his part, the code and artwork were merged. This merger happened about a quarter of the way through programming efforts.

I always wrote and tested code on Player 1's tank, controls, target, and fire button. At first I tried to keep Player 2's symbols in sync with Player 1's, but this quickly became completely impractical . Instead, I made the fire buttons toggle which player's turn it was but left making Player 2's game play functionality for the end.

Note

How often it is practical to update two sets of code depends on how different they are. If you had more than two instances of a dynamic object, it would probably be worth integrating them into one movie clip, of which multiple instances could exist.


In the sections that follow, I'll walk you through the steps and the decisions necessary to create a game of this complexity. One of the primary characteristics of a ballistics -type game is that the animation is programmatic rather than involving motion and shape tweens. An example of what's possible when the animation is created dynamically is the capability to affect an object with gravity and wind as it moves and scales over time.

Any Flash 5 project can take advantage of ActionScript's object-oriented programming capabilities. Objects such as Math(), Mouse(), and Sound(), as well as dynamically created objects, will be used.

Although there are techniques for coding in Flash 5 movies that can be exported in Flash 4 format, many of the functions used in this project enable functionality that isn't possible at all in Flash 4. Examples include startDrag(), stopDrag(), attachMovie(), removeMovieClip(), localToGlobal(), getBytesLoaded(), getBytesTotal(), and hitTest().



Inside Flash
Inside Flash MX (2nd Edition) (Inside (New Riders))
ISBN: 0735712549
EAN: 2147483647
Year: 2005
Pages: 257
Authors: Jody Keating

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net