Thread: Java game
View Single Post
Old 10-12-2002, 04:01 PM   PM User | #1
katja
New to the CF scene

 
Join Date: Oct 2002
Location: Gothnburg, Sweden
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
katja is an unknown quantity at this point
Unhappy Java game

Hello! I'm trying to write a game in Java. The Sea Battle game where you should hit and sink the opponents ships...
It has to be in a field 10x10 squares and i had written the code for a square. Here it is:
import java.awt.*;
import javax.swing.*;

public class Tile extends JButton{
public Tile() {
super("");
}
public void paintComponent (Graphics g) {
g.setColor (getForeground());
}
}

But i have know idea what to do next. I know I should put them in a Grid Layout, but how the hell should I programm the ships?
katja is offline   Reply With Quote