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

A simple game, about an hour’s work and just over 1 K; it may not be the latest hot<br />

game for the Playstation but it should keep them occupied for the seconds it takes <strong>to</strong> load<br />

your game.<br />

Tetris – simple concept, terrific gameplay<br />

Figure 13.8 Developing Tetris<br />

The game of ‘Tetris’ uses five layers:<br />

Control: Containing all the <strong>ActionScript</strong>.<br />

KeyDetec<strong>to</strong>r: Containing a blank but<strong>to</strong>n <strong>to</strong> test for key presses.<br />

Score&Time: Containing the text boxes that display score and time.<br />

Tiles: Containing the main playing pieces.<br />

Bg: Containing the background panels.<br />

The coding for the game makes extensive use of arrays of game data. The game is initialized<br />

by duplicating movie clips containing a single tile and placing these all over the game board. The<br />

displayed frame for each of these movie clips is controlled by the game logic and the value is s<strong>to</strong>red<br />

in the arrays. Reading these arrays controls all the collision detection. For more details on the<br />

198

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

Saved successfully!

Ooh no, something went wrong!