📄 npc.java
字号:
import javax.microedition.lcdui.Image;
import javax.microedition.lcdui.game.Sprite;
public class Npc extends Sprite {
int type = 0;// 类型,友好型,中立,敌对;还是不会动的箱子0,1,2renwunpc,3;
Image im = null;
String npcName = null;
int maxHp = 0;
int cHp = 0;
int atc = 0;
int def = 0;
int skill = 0;
int skillhert = 0;
int position[] = new int[2];// 位置以及占据的宽度影响的范围;触发的敌人;
int exp = 0;
int station = 0;
int gold = 0;
public Npc(Image im, int type, int position[]) {
super(im);
this.im = im;
this.type = type;
for (int i = 0; i < position.length; i++)
this.position[i] = position[i];
}
public Npc(Image im, int type, int position[], int hp, int atc, int def,
int skill) {
super(im);
this.im = im;
this.type = type;
for (int i = 0; i < position.length; i++)
this.position[i] = position[i];
this.maxHp = hp;
this.cHp = hp;
this.atc = atc;
this.def = def;
this.skill = skill;
skillhert = 100 * skill;
}
public Npc(Image im, int type, int fw, int fh, int position[], int hp,
int atc, int def, int skill) {
super(im, fw, fh);
this.im = im;
this.type = type;
for (int i = 0; i < position.length; i++)
this.position[i] = position[i];
this.maxHp = hp;
this.cHp = hp;
this.atc = atc;
this.def = def;
this.skill = skill;
skillhert = 100 * skill;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -