npc.java

来自「j2me角色扮演的游戏代码」· Java 代码 · 共 42 行

JAVA
42
字号
import javax.microedition.lcdui.Image;
import javax.microedition.lcdui.game.Sprite;
/*
 * Created on 2005-7-10
 *
 * TODO To change the template for this generated file go to
 * Window - Preferences - Java - Code Style - Code Templates
 */

/**
 * @author Yongzi
 *
 * TODO To change the template for this generated type comment go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
public class Npc extends Sprite{

	String name;                        //人物姓名或道具名称
	String message1;                    //对话1
	String message2;                    //对话2
	int npcx;                          //人物或道具在地图上的X坐标
	int npcy;                          //人物或道具在地图上的Y坐标
//	int isren;                         //是人物还是道具,1是人物,0是道具
//	boolean addbool=false;            //判断是否添加特殊道具
	Image img;
	public Npc(Image arg0,int width, int height, String myname,String mymessage1,int x,int y,String mymessage2,Image imagetemp) {
		super(arg0,width,height);
		name=myname;
		message1=mymessage1;
		npcx=x;
		npcy=y;
		message2=mymessage2;	
		img=imagetemp;	
		this.setPosition(npcx,npcy);
	}

	public Npc (Image img ,int x, int y) {
		super(img,x,y);
	}

}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?