Match 
Memory game.

matcho@jumpstation.co.uk

You are free to distributed and use any files in this archive as you deem fit.
(please do not take the piss)

If any of the following give you problems feel free to email me i am happy to help
matcho@jumpstation.co.uk

How to setup your own MATCH web page from scratch.

1. get some images (or draw your own).
   save them in either gif or jpeg format.

2. using a text editor (like the one you are proberly using to read this file)
   add a line for each image you want (remember the first two will be used as the 
   backs of the cards when the game starts.

3. work out how big you grid will be;
    take the number of images minus two (the card backs) and times it by an even number.
    i.e. 10 images - (card backs (2) ) = 8 x 2 = 16
    in this example the ideal grid size would be 4x4 but you could have easily had four 
    of each card (8 x 4 = 32) and the had the grid size 8x4

4. Create an .html/.htm file in a text editor (look at the examples) and add the 
   following 9 lines

<applet code="match.class" name="match" width="360" height="450" >
<param name="packfile" value="dat/testlist.dat">
<param name="cardwidth" value="50">
<param name="cardheight" value="80">
<param name="cardshorz" value="6">
<param name="cardsvert" value="5">
<param name="cardshorzspacing" value="8">
<param name="cardsvertspacing" value="8">
</applet>

where the packfile value is the list file you created in step two (this example will look
for the testlist.dat file in the dat folder.
cardwith value is the with you want the image to be displayed as (best stick with size of image you created).
cardheight value is the height you want the image to be displayed as (best stick with size of image you created).
cardhorz value is the number of cards in the grid horizontaly.
cardvert value is the number of cards in the grid verticaly.
cardshorzspacing value is the size in between cards horizontaly.
cardsvertspacing value is the size in between cards verticaly.
the width and height parameters are calculated accordingly.
This is how big the overall game will appear.

 width = ( (cardhorz x cardwith) + ( (cardhorz+ 1) x cardshorzspacing) )
i.e. ( (6 x 50) + (7 x 8) ) = (300 + 56) = 356 (ish, I used 360 (see above))
 
 height = ( (cardvert x cardheight) + ( (cardvert+ 1) x cardsvertspacing) )
i.e. ( (5 x 80) + (6 x 8) ) = (400 + 48) = 448 (ish, I used 450 (see above)) 

But do not worry, I never did these calculations originaly, I just guessed and tried it and 
when it was wrong just altered the values and tried again.

5. Upload all the necessary files to your website.

the .html file
	whatever you created in step 4

the .class files
	card.class
	IIC.class
	match.class
	waiT.class	
are need to make the game run, make sure you upload them all to the same place as your HTML file

the .dat file
	whatever you created in step 2

the image files
	whatever you created in step 1

6. sit back and relax, your work here is done, learn Java, hack the source code and creat a cheat mode :)

If any of the above steps did not make sense, just have a look at the examples.

Oh, and for the extra strip mode a couple of things are different.
no .dat file and the line
<param name="packfile" value="dat/testlist.dat">
becomes 
<param name="packfile" value="stripfile.jpg">
which is your single image containing all your necessary images.

the strip parameter specifies how many cards are in your strip, including the card backs.
<param name="strip" value="72">

the 
<param name="stripW" value="20">
<param name="stripH" value="24">
lines *MUST* have the correct values for each card in your strip (try changing it and see what happens <g> )

They are only need if the 
<param name="cardwidth" value="55">
<param name="cardheight" value="58">
lines specify a different size.

ERRORs and Problems.

P. I can not see anything where the game should be.
S. Check that your browser is Java enabled and try one of the examples.

P. All I can see is a grey box where the game should be.
S. the browser is Java enabled but it has not yet loaded the game.
   The first time your browser loads a JAva applet it must load the Java VM and this can take time, wait.
   or some files maybe missing, use your browsers java console or just hover the mouse over the grey 
   box and look at the status bar in the browser.

P. The game window says loading followed by a number.
S. The game is trying to load and may be delayed as with any web page.

P. The game window reports "Failed to load DAT file containg the images list, check paths"
S. do what it says try and load the .dat file into the browser from your web site, to see if it is really there.

P. The game window reports "At least one image failed to load, check paths"
S. do what it says try and load the image files into the browser from your web site, to see if they are really there.

P. The game window reports "The number of cards per image is an odd number meaning that they can never be all paired, doh !"
S. Double check your grid calculations and insure that the number of cards is a multiple of two.
   The is no point having three of the same card and only two could ever be paired.

P. The game window reports "Number of cards does not match number of images per card times number of loaded images"
S. Double check your grid calculations 

P. What is the cats name?
S. Fluffy, cos she is !

P. Something not listed here
S. Email me at matcho@jumpstation.co.uk, i am always happy to help :)



A list of interesting file and folders included in the zip file archive (does not include everything)

images 			- folder for images
dat				- folder for dat files
match.java			- all the java source code for you to play with
card.class			- the complied java (part of)
IIC.class			- the complied java (part of)
match.class			- the complied java (part of)
waiT.class			- the complied java (part of)
match_test_normal.html		- test for normal display
match_test_small_small.html	- small cards small layout
match_test_small_big.html	- small cards big layout
match_test_big_small.html	- big cards small layout
match_test_big_big.html		- big cards HUGE layout ;)
match_strip_big.html		- example using strip mode 
match_strip_small.html		- strip mode example
dat\testlist.dat		- the dat file for the test files
images\ministrip		- folder for the strip image
images\packa		- folder for the test images
images\ministrip\strip2.gif	- the single image that gives all the stip images.


remember, information wants to be free.