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.

Figure 16.1 The traditional game Reversi<br />

Figure 16.2 Placing a new piece<br />

Chapter 16: Board games<br />

go. So that’s the basic game. Where do we begin programming this game as a solo player against<br />

the computer game?<br />

Methods for board games<br />

First we need <strong>to</strong> reduce the problem in<strong>to</strong> manageable chunks. How are we going <strong>to</strong> play the<br />

game?<br />

1 Build and display the board.<br />

2 Check for user input.<br />

3 If the user places his piece legally, update the placed square and then update the board.<br />

245

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

Saved successfully!

Ooh no, something went wrong!