02.02.2013 Views

Flash MX 2004 Games : Art to ActionScript

Flash MX 2004 Games : Art to ActionScript

Flash MX 2004 Games : Art to ActionScript

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>Flash</strong> <strong>MX</strong> <strong>2004</strong> <strong>Games</strong><br />

...<br />

moveX = 0;<br />

_root.RightScore++;<br />

The final stage of the game is saved as ‘Examples\Chapter01\Pingpong05.fla’.<br />

How <strong>to</strong> improve it<br />

To finish the game there needs <strong>to</strong> be a beginning and an end. The beginning would give instructions<br />

for key presses and the end would show the final score. In this simple example we will exclude<br />

these details but you are encouraged <strong>to</strong> develop the game further <strong>to</strong> include these aspects as your<br />

skills progress.<br />

Playing against the computer<br />

It would be nice if the player could compete with the computer. To achieve this one of the bats<br />

could be under computer control, so the clip event for the bat would judge where the ball would<br />

hit the bat and move the bat accordingly. Although this is a little complicated it should be within<br />

your capabilities after completing Section 3 of this book. When the computer is in control it may<br />

be impossible for the player <strong>to</strong> win. It is your job as a developer <strong>to</strong> set the skill level so a player is not<br />

frustrated but is challenged. Setting the game play level so that a player is progressively challenged<br />

as their skill level develops is one of the hardest aspects of game play development but one of the<br />

most important.<br />

Summary<br />

This was a quick look at creating a <strong>Flash</strong> game; hopefully it gave you an overview. If you found<br />

the code confusing then don’t worry, we will be going at a much slower pace in the later chapters<br />

when looking at <strong>ActionScript</strong>. In principle, I want you <strong>to</strong> take away from this chapter an initial<br />

awareness of the <strong>Flash</strong> interface, how <strong>to</strong> use some of the drawing <strong>to</strong>ols, the use of symbols and<br />

where <strong>to</strong> enter bits of <strong>ActionScript</strong>. As you progress through the book you will be encouraged<br />

<strong>to</strong> enter your own code and develop the examples that you will find in later chapters. Nothing<br />

improves your skill more than trying it out yourself. Practice really does make, if not perfect, then<br />

at least much better.<br />

14

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!