Skip to content
Snippets Groups Projects
Commit 22421606 authored by Charlie Darques's avatar Charlie Darques
Browse files

ajout méthode display menu principal

parent 9a424fcf
Branches
No related tags found
No related merge requests found
......@@ -4,21 +4,25 @@ package bitFight;
import java.util.Scanner;
public class Menu {
String name;
String titre;
String texte;
public Menu(String titre,String texte){
this.titre=titre;
this.texte=texte;
public Menu(String name){
this.name=name;
}
public void display(){
System.out.println(this.titre);
System.out.println(this.texte);
System.out.println(this.name);
System.out.println("Welcome to BitFight!");
System.out.println("Enter your player name : ");
Scanner sc = new Scanner(System.in);
String playerName = sc.nextLine();
if (playerName != null) {
System.out.println("Hello, " + playerName + "!");
}
sc.close();
}
public boolean validate(){
public boolean check(){
Scanner sc= new Scanner(System.in);
String c= sc.nextLine();
if(c== null){
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment