CoreJava/exp5/RoleDemo.java

34 lines
866 B
Java
Raw Permalink Normal View History

2024-05-09 09:10:51 +08:00
package exp5;
import com.experiment.DragonSlayer;
import com.experiment.FingerMan;
import com.experiment.SwordSaint;
public class RoleDemo {
public static void main(String[] args){
DragonSlayer d = new DragonSlayer();
SwordSaint s = new SwordSaint();
FingerMan f = new FingerMan();
System.out.println(d.getName()+"加入战斗");
System.out.println(s.getName()+"加入战斗");
System.out.println(f.getName()+"加入战斗");
System.out.println("\n作战开始!\n");
/*交互
* 战斗过程...
* 以后再写^v^
*/
System.out.println("***激烈的战斗过程***\n");
d.finishingMove();
s.finishingMove();
f.finishingMove();
System.out.println("\n全死了!\n");
System.out.println("\n战斗结束\n");
}
}