Files
BUT3ProjetJeuGroupe/fr/iut_fbleau/Avalam/Main.java
2026-01-26 13:41:48 +01:00

51 lines
1.5 KiB
Java
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
package fr.iut_fbleau.Avalam;
import javax.swing.*;
/**
* Point dentrée : propose un menu de sélection de mode, puis lance la fenêtre Avalam.
*/
public class Main {
public static void main(String[] args) {
SwingUtilities.invokeLater(() -> {
String[] options = {
"joueur vs joueur",
"joueur vs botidiot",
"joueur vs bot alpha"
};
int choice = JOptionPane.showOptionDialog(
null,
"Choisissez un mode de jeu :",
"Avalam - Mode de jeu",
JOptionPane.DEFAULT_OPTION,
JOptionPane.QUESTION_MESSAGE,
null,
options,
options[0]
);
GameMode mode;
if (choice == 1) mode = GameMode.PVBOT;
else if (choice == 2) mode = GameMode.PVALPHA;
else mode = GameMode.PVP;
// Si alpha choisi : non implémenté, on prévient et on lance en PVP (préparation).
if (mode == GameMode.PVALPHA) {
JOptionPane.showMessageDialog(
null,
"Bot Alpha-Beta non implémenté pour l'instant.\nLancement en joueur vs joueur.",
"Information",
JOptionPane.INFORMATION_MESSAGE
);
mode = GameMode.PVP;
}
new AvalamWindow(mode);
});
}
}