In my last post, I explained my logic/thinking behind 2 of the 3 files that make up Tic-Tac-Toe V1: Main.mxml
and GamePiece.mxml
. Click here to play the game (right click to view/download the source). In this post, I’ll breakdown the remaining piece.
GameBoard.mxml
This piece is the real workhorse of the game. It houses not only the board where the pieces are laid out, but also the game logic itself.
Was that the best decision?
Probably not. If I wanted to swap out the game rules but keep the same pieces, I couldn’t do that. It’s not so common with Tic-Tac-Toe, but think of a card game. One deck of 52 cards can play an almost infinite number of games. Would it make much sense to put the Solitaire logic right inside the CardDeck
class file? Nope, it surely wouldn’t. I was in a hurry though so I did. Continue reading “Building Games with Flex: Tic-Tac-Toe V1 Code Explained Pt 2”