📄 enemyship.java
字号:
import javax.microedition.lcdui.Image;
import javax.microedition.lcdui.game.Sprite;
/*
* Represents the enemy ship sprite
*/
public class EnemyShip extends Sprite {
private int dx = 0;
private int dy = 1;
/*
* Creates an alien ship.
*/
public EnemyShip(Image image) {
super(image);
}
/**
* Creates an alien ship with specified frame width and height.
*
* @param image the image
* @param frameWidth sprite frame width
* @param frameHeight sprite frame height
*/
public EnemyShip(Image image, int frameWidth, int frameHeight) {
super(image, frameWidth, frameHeight);
}
/**
* Creates an alien ship from another Sprite.
*
* @param sprite the Sprite
*/
public EnemyShip(Sprite sprite) {
super(sprite);
}
/**
* @return Returns the dx.
*/
public int getDx() {
return dx;
}
/**
* @param dx The dx to set.
*/
public void setDx(int dx) {
this.dx = dx;
}
/**
* @return Returns the dy.
*/
public int getDy() {
return dy;
}
/**
* @param dy The dy to set.
*/
public void setDy(int dy) {
this.dy = dy;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -