|
||
| Inside Technique : Using the Explorer Solitaire library : Creating the data file Now that Mr. Conner is looking over your shoulder every now and then, you realize you had better start with doing some real work. The first item on your list that you tackle is the data file canfield.sol. This game data file is a simple comma delimited file designed for use with the Tabular Data Control. This file contains one Header line, containing the Field Names, followed by one line holding the Game Parameters separated by commas, then one line for each cardpile in the game (other than the deck), containing the comma separated Cardpile Parameters. Let us take a line by line look at this file : Line 1 : The Field Names This line contains the Field Names that the TDC uses to access the data, and so should be left unchanged for every game you design using the Explorer Solitaire library. Line 2 :The Game Parameters The following Game Parameters in order : The value "D" indicating that this line is a Deck definition holding Game Parameters and not Cardpile Parameters, followed by the x and y co-ordinates of the deck("10" each), followed by the deck Structure ("P" for Packed), the the Deck Type ("1" for single deck), then the Redeals ("-1" for Unlimited Redeals), then the EmptyGIF ("O"), then the Win Screen ("winner.htm"),then a blank field(this field normally holds Grouping information, but the Deck does not support Group movement), followed by the Deck AutoTarget ("PW" for the Waste Pile), and finally the Deal ("1" for a 1-card deal to the Waste Pile). Lines 3-6 :The Foundation Parameters Here the first field represents Pile Type ("F" for Foundation), followed by the x and y co-ordinates of each pile, then the Structure ("P" for Packed), then Face-down and Face-up cards (both "0"), then the EmptyGIF ("X" - Foundations usually have an X mark when they are empty), then the Build ("XUS" - FiXed Base Card, Build Up in Suit), then the Grouping ("NN" - Neither a Group Source nor a Group Target), then AutoTarget info ("NY" - is an AutoTarget Source but not a Target), then MaxLength ("13" cards on each foundation means the game is won). Lines 7-10 :The Tableau Parameters A quick recap - "P" for Tableau Pile,then the x and y co-ordinates, then the structure ("V" for vertical), then Face-down cards ("0"), then Face-up cards ("1"), then the EmptyGIF ("O"), the Build ("YDA" - anY base card, then build Down by Alternating Colour),the Grouping ("YY" - Group Sources as well as targets), then AutoTarget info (AutoTarget Source but not target). Line 11 :The Reserve Pile Pile Type is "PR", the rest of the parameters are pretty standard, except for EmptyGIF which is set to the value "trans", or the transparent gif provided with the Explorer Solitaire library. Since the Reserve pile cannot be built on, there is no point in showing a marker like "X" or "O" if the pile is empty, therefore a transparent gif is used. The Reserve pile is initially dealt 13 Face-up cards. Line 12 :The Waste Pile Pile Type of "PW", while the rest of the parameters are standard. Note that the Waste pile is initially dealt one Face-up card. Alright!! Your data file is ready, and now it will take only a few minutes more to write your web page. In the next page, we will look at how to quickly whip up a game page.
Page 1:Using the Explorer Solitaire library © 1997-2000 InsideDHTML.com, LLC. All rights reserved. |