This last week, I put together my first pass at a card game engine.
The card engine supports Decks, Cards, and Undo. Decks can shuffle, add/remove cards, set drag/drop restrictions, and draw in various ways. Cards have info about themselves and can be moved about. The Undo engine allows moves to be undone.
The classes were used to build three solitaire games: The Classic Klondike, Spider, and Fours. The current implementations work but are not heavily tested. The most obvious piece missing is polish.
The game itself just has to layout the positions for multiple decks, establish the drag/drop restrictions, create undo behaviors, check for victory, and in the case of Klondike -- write the autocompletion routine.
Klondike, the last in this series, was working in about 4 hours with 4 more hours of cleanup and refactoring to the card and deck class.
I hope to add animation for the cards next. And the games need sound and general polish. Likely in August.
Note: I used a deck of SVG cards from David Bellot. I was disappointed that Adobe Illustrator would not convert them to the Flash format. I expect to replace the cards and card backs as they are way to big (a bitmap for each one) and look bad (because they are imported from a bitmap).
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment