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.

A simple example<br />

Figure 17.1 Developing ‘Examples/Chapter17/FatCat01.fla’<br />

Chapter 17: Platformers<br />

The code for this example is mainly located in three places. An initialization script on frame 1<br />

of the main timeline contains the following code:<br />

1 //Set initial parameters<br />

2 DEBUG_GAME = true;<br />

3 Cat.orgX = Cat._x;<br />

4 Cat.orgy = Cat._y;<br />

5 Cat.tracemotion = false;<br />

6 s<strong>to</strong>p();<br />

Listing 17.1<br />

Notice that here we are just setting some initial values and some debug parameters. As you will<br />

know from the chapter on debugging, getting feedback information as your game plays is vital <strong>to</strong><br />

creating a stable game. By setting a simple Boolean value <strong>to</strong> true or false we can quickly set the<br />

debugging level of a game.<br />

261

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

Saved successfully!

Ooh no, something went wrong!