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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

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

As you get experienced using a CG program you will be able <strong>to</strong> create a short animation for a<br />

<strong>Flash</strong> game sprite very quickly.<br />

Importing the animation in<strong>to</strong> <strong>Flash</strong><br />

One method for creating animation that will be suitable <strong>to</strong> use in <strong>Flash</strong> is <strong>to</strong> use one of the specialist<br />

exporters. Vecta3D and Swift3D both work well with 3D Studio Max animations, while Flicker is<br />

a plugin for Lightwave. Unfortunately both these options involve you spending another US$200–<br />

US$500. If you use it regularly then no problem, but if you only use it rarely then here’s a couple<br />

of techniques that you might like <strong>to</strong> consider that don’t involve extra cost.<br />

The first method is <strong>to</strong> use bitmaps in <strong>Flash</strong>. Although <strong>Flash</strong> is a vec<strong>to</strong>r package it does handle<br />

bitmaps fairly well. All computer animation programs have an option <strong>to</strong> save an animation as a<br />

sequence of frames. When saving the frames it is important <strong>to</strong> consider the on-screen size in pixels<br />

of the bitmaps. Unlike vec<strong>to</strong>r images bitmaps have a definite size, if you create the bitmaps <strong>to</strong>o<br />

big then you can resize them in <strong>Flash</strong>, unfortunately this will incur a performance hit and a files<br />

size hit. Create them <strong>to</strong>o small and the picture quality will be poor. If the little guy is going <strong>to</strong><br />

be 200 pixels high then render the animation with the little guy 200 pixels high. Most computer<br />

animation packages will allow you <strong>to</strong> save off an alpha sequence, a silhouette of the animation.<br />

You need the alpha <strong>to</strong> cut out the bitmap so that an irregular-shaped bitmap can be placed over a<br />

background. An alternative approach is <strong>to</strong> render a png sequence that can contain an alpha.<br />

When importing artwork in<strong>to</strong> <strong>Flash</strong> you choose ‘File/Import…’. Make sure you are on a clear<br />

layer and navigate <strong>to</strong> the folder where the colour images have been rendered. Select the first in<br />

the sequence. <strong>Flash</strong> prompts you with a dialog box.<br />

Figure 4.12 Multiple bitmaps dialog box<br />

Each consecutive file in the sequence of images is placed on a new frame of the current layer.<br />

Repeat this action on a new layer for the alpha sequence if your images use a separate alpha.<br />

If the alpha images are larger than the colour images then use scale <strong>to</strong> size them down using<br />

‘Window/Design Panels/Transform’ or the context menu ‘Panels/Transform’.<br />

Make sure that ‘Constrain’ is checked and type in 50 per cent if the image was rendered at<br />

double the size. You will need <strong>to</strong> repeat this for each image in the sequence. Once the sequence is<br />

sized appropriately, make sure it is in exact alignment with the colour image. To do this, zoom in<br />

so that the bitmaps fill the stage area. Make the stage as big as possible by minimizing the Actions<br />

and Properties windows. Use the magnifying glass <strong>to</strong>ol by dragging a rectangle around the bitmaps.<br />

54

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

Saved successfully!

Ooh no, something went wrong!