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.
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 program the ships?
Thanks.