www.pudn.com > ch8-spaceshooter.rar > UFOMissile.java


/* 
 * UFOMissile.java 
 * 
 * Copyright 2001 SkyArts. All Rights Reserved. 
 */ 
import javax.microedition.lcdui.*; 
 
/** 
 * UFOMissile类  
 * 
 * @author  Hideki Yonekawa 
 * @version 1.0 
 */ 
class UFOMissile extends Sprite { 
	/** 构造函数 */ 
	UFOMissile() { 
		//设定宽度与高度 
		width = 2; 
		height = 2; 
	} 
 
	/** 移动Sprite时所调用的方法 */ 
	void doMove() { 
		if(this.isAlive) { 
			y = y + height +5; 
		} 
	} 
 
	/** 描绘Sprite所调用的方法 */ 
	void doDraw(Graphics g) { 
		if(isAlive) { 
			g.setColor(0x00FFFF00); 
			g.fillArc(x, y, 5, 5, 0, 360); 
		} 
	} 
}