java小游戏代码
第一次写java小游戏代码
初学者的第一次尝试
都是很基础的知识
import java.util.Random;
public class Hero {
private String name;
private String [] skill;
private int[] skillHurts;
private double hp;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String[] getskill() {
return skill;
}
public void setskill(String[] skill) {
this.skill = skill;
}
public int[] getSkillHurts() {
return skillHurts;
}
public void setSkillHurts(int[] skillHurts) {
this.skillHurts = skillHurts;
}
public double gethp() {
return hp;
}
public void sethp(double hp) {
this.hp = hp;
}
public Hero() {
super();
}
public Hero(String name,String[] skill,int[] skillHurts,double hp) {
super();
this.name = name;
this.skill = skill;
this.skillHurts = skillHurts;
this.hp = h