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 />

Reading the main but<strong>to</strong>n is simply a case of reading for LEFT, UP, RIGHT, DOWN and<br />

ENTER. In most games targeting a PPC this should provide sufficient user input options.<br />

Listing 20.5 shows how a movie clip can be moved around using the main but<strong>to</strong>n control.<br />

1 onClipEvent(enterFrame){<br />

2 if (Key.isDown(Key.LEFT)) _x -= 2;<br />

3 if (Key.isDown(Key.RIGHT)) _x += 2;<br />

4 if (Key.isDown(Key.UP)) _y -= 2;<br />

5 if (Key.isDown(Key.DOWN)) _y += 2;<br />

6<br />

7 }<br />

if (Key.isDown(Key.ENTER)) _parent.entercount++;<br />

Listing 20.5<br />

Summary<br />

PocketPCs are a growing market for <strong>Flash</strong> games. Although more suited <strong>to</strong> turn-based games it is<br />

possible <strong>to</strong> create simple action games. It is very likely that the processors in these machines will<br />

soon be more than capable of action game displays. There has never been a better time <strong>to</strong> start<br />

developing mobile content with <strong>Flash</strong>. In this chapter you were introduced <strong>to</strong> the key features.<br />

326

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

Saved successfully!

Ooh no, something went wrong!