Flash Game Toolkit

The working journal for the Flash Game Toolkit. Read all about the progress and challenges I encounter in the Open Source Project. The key bits of knowledge I am hoping to gain is how to run an Extreme Programming Project and a large scale project in ActionScript. MacroMedia Flash ActionScript is a great language to prototype games in. The Flash Game Toolkit intends to build the components a board/dice/card game designer would need to put together a game.

Saturday, June 28

Cards and Deck

Breaking my own rule for writing the test cases first, I sat down and wrote these classes tonight. It is obvious that I will need a control class for each and I added the idea of callbacks.

The jumpstart was caused by my own realization that I played a lot of backgammon and solitaire. I would much prefer to play my own versions and be playtesting games. But in order to write the games, I need the library done. I started on cards.

Some testing ideas: tarot, solitaire, ...

Documentation: FlagCard

Public Methods:
Deck GetOwner()
SetOwner( Deck )
bool IsShowing()
SetShowing( bool )
Flip()
GetValue()
SetValue()
GetType()
SetType()

Event Callbacks:
OnShowingChanged()
OnDeckChanged()
OnValueChanged()
OnTypeChanged()

Documentation: FlagDeck

Public Methods:
Player GetOwner()
SetOwner( Player )
Shuffle()
Card ViewCardAt(index)
bool InsertCardAt( Card, index )
Card RemoveCardAt(index)
Card ViewTopCard() - get first card (not removed)
bool Push(Card) - add card to stack (top)
Card Pop() - remove card from stack (top)
Card ViewBottomCard()
bool Unshift( Card ) - add card to stack (bottom)
Card Shift() - get last card (bottom)
IsEmpty()
GetCount()
IsViewAllowed( location )
IsInsertAllowed( location )
IsRemoveAllowed( location )
SetViewAllowed( location )
SetInsertAllowed( location )
SetRemoveAllowed( location )

Event Callbacks:
OnCardsChanged()
OnOwnerChanged()
OnRulesChanged()

Constants
DECKLOCATION_ALL
DECKLOCATION_TOP
DECKLOCATION_BOTTOM
DECKLOCATION_NONE

0 Comments:

Post a Comment

<< Home