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

📄 myship.java

📁 太空大战J2ME版本
💻 JAVA
字号:
package game0925;

import javax.microedition.lcdui.*;

/**
 * <p>Title: </p>
 *
 * <p>Description: </p>
 *
 * <p>Copyright: Copyright (c) 2005</p>
 *
 * <p>Company: </p>
 *
 * @author not attributable
 * @version 1.0
 */
public class MyShip extends Sprite {
    public static MyShip self;
    private Image myshipimg = null;
    private Image burstimg = null;
    public MyShip() {
        self=this;
        if (myshipimg == null) {
            myshipimg = ImageTools.getImage("/img/icon.png");
            burstimg = ImageTools.getImage("/img/burst.png");
        }
        width = myshipimg.getWidth();
        height = myshipimg.getHeight();
    }

    /**
     * doMove
     *
     * @todo Implement this game0925.Sprite method
     */




    void doMove() {

    }

    /**
     * paint
     *
     * @param g Graphics
     * @todo Implement this game0925.Sprite method
     */
    public void paint(Graphics g) {
        if (this.isAlive()) {
            if (!this.isHit()) {
                g.drawImage(myshipimg, x, y, Graphics.TOP | Graphics.LEFT);
            } else {
                g.drawImage(burstimg, x, y, Graphics.TOP | Graphics.LEFT);
            }
        }
    }
}

⌨️ 快捷键说明

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