当前位置:首页|资讯

Java小练习——文字格斗小游戏

作者:二进制扭蛋机发布时间:2024-10-12

public class Player { private String name; private double hp = 10; public void hurt(double ah){ this.hp = this.hp - ah; } // 判断玩家是否死亡 public void death(){ if (this.hp <= 0){ System.out.println(this.name+"已死亡,游戏结束"); } } // 让玩家决定自己的名字 public Player(String...【查看原文】


Copyright © 2024 aigcdaily.cn  北京智识时代科技有限公司  版权所有  京ICP备2023006237号-1