public class AbyssWarrior{
//无参构造方法
public AbyssWarrior(){}
public static void main(String args[]){
//创建输入对象
Scanner scanner = new Scanner(System.in);
//创建升级类对象
UpGrade upgrade = new UpGrade();
//初始化等级和经验值
upgrade.setGrade(1);
upgrade.setExperience(0);
System.out.println("亲爱的勇士,欢迎来到深渊大陆。");
do{
System.out.println("输入 开启深渊 就可以开始冒险啦");
String s = scanner.nextLine();
if (s.equals("开启深渊")){
upgrade.difficultyValue();
}else{
System.out.println("你输入的操作指令有误");
}
} while (upgrade.getGrade() != 20);
System.out.println("满级达成!!!");
}
}
|
|