en gros raccourci voilà sans la main ni les autres fonctions/variables
@Override
protected void paintComponent(Graphics graphics) {
Graphics2D g = (Graphics2D) graphics;
if ((catégories == 5) && (batiment1 == 0) && (batiment2 == 0) && (batiment3 == 0) && (batiment4 == 0) && (batiment5 == 0))
{
//remise à 0 de l'affichage
g.setColor(java.awt.Color.WHITE);
g.fillRect(longueur2, 0, 70, hauteur);
//Transports
Transports(g, longueur2 + 10, 25);
//Parc
Parc(g, longueur2 + 10, 125); //unreported exception IOException; muste be caught or declared to be thrown
//batiment 3
ACHANGER(g, longueur2 + 10, 225);
//si batiment1 = 1
}
if (batiment5 == 2)
{
if ((x < longueur2) && (y < hauteur2))
{
Parc(g, x, y); //unreported exception IOException; muste be caught or declared to be thrown
repaint();
}
}
}
public void Parc(Graphics2D g,int x, int y) throws IOException
{
BufferedImage pictureparc = ImageIO.read(new File("src/jeuisnavant/Parc.png"));
BufferedImageOp bio = null;
g.drawImage(pictureparc, bio, i, i);
if ((x < longueur2) && (y < hauteur2)) //si clic sur la map
{
catégories = 0;
batiment5 = 0;
}
}