I am trying to initialise a deck of cards, and display them (I have the images in .gif). The only problem I've encountered is initialising the deck itself. So far, I've tried to create four arrays (one for each suit) as such:
import java.applet.*;
import java.awt.*;
public class deckOfCards extends Applet
{
public void init()
{
image clubs = new image[13];
image hearts = new image[13];
image spades = new image[13];
image diamonds = new image[13];
}
}
and then do something like this for each suit:
for( int i = 0; i <= 13; i++ )
{
clubs[i] = getImage( getDocumentBase(), c(i).gif )
}
(the card files are saved in filenames c1.gif, c2.gif.....c13.gif for each suit)
I get an error saying that symbol "image" can't be found, but doesn't java.awt.image have a class to create the image object and image methods?
Image, with a capital I.Cardobject which has its own image and attributes, or I smell spaghetti code a' cooking.