⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 animal.java

📁 一个仙剑的源代码
💻 JAVA
字号:
import javax.microedition.lcdui.Graphics;
import javax.microedition.lcdui.Image;

//--------------------------------------------------------------------------------------------------------
//游戏名称: 仙剑奇侠传
//作者: 张卫国
//E-mail: weiguo2000@hotmail.com
//创建于:2006/7/18--2006/8/3  by Weiguo
//
//--------------------------------------------------------------------------------------------------------

public class Animal {
	private String name = "";
	private int[][] AnimalS = {
			//HP,attack,defend,magicDefend,heroaddmoney,heroaddexperience	
			{18,19,12,0,2,1},
			{25,27,18,0,4,2}
			};
	private String AnimalNames[] = {"超级泡泡","超级大象"};
	
	private int AnimalType;
	public int ehp;	
	public int eattack;
	public int defend;
	public int magicDefend;	
	public int emoney;
	public int eexperience;	
	public int x = 0,
			   y = 0;
	private Image img = null;
	
	public boolean bDead  = false; //是否死亡
	public int DecreaseHP = 0;
	
	public Animal(int type) {		
		this.AnimalType = type;
		this.name 		= AnimalNames[AnimalType];
		this.ehp 		= AnimalS[AnimalType][0];
		this.eattack 	= AnimalS[AnimalType][1];
		this.defend  	= AnimalS[AnimalType][2];
		this.magicDefend= AnimalS[AnimalType][3];
		this.emoney  	= AnimalS[AnimalType][4];
		this.eexperience= AnimalS[AnimalType][5];
		this.img 		= XianJianImage.imgEnemy[AnimalType];
	}
	public void setPosition(int x,int y){
		this.x = x;
		this.y = y;
	}
	public String getName(){
		return this.name;
	}
	public void draw(int xtmp,int ytmp,Graphics g) {		
	      g.drawImage(img, xtmp+x-8, ytmp+y-8, Graphics.TOP | Graphics.LEFT);   
	}
	public void rend(int xtmp,int ytmp,Graphics g) {		
	      g.drawImage(img, xtmp, ytmp, Graphics.HCENTER | Graphics.BOTTOM);   
	}
}

⌨️ 快捷键说明

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