diamond.java

来自「一款支持蓝牙传输的游戏」· Java 代码 · 共 38 行

JAVA
38
字号
import java.io.IOException;
import javax.microedition.lcdui.Image;
import javax.microedition.lcdui.game.Sprite;
/*
 * Diamond.java
 *
 * Created on 2007年3月25日, 下午8:21
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

/**
 *
 * @author MissYou
 */
public class Diamond extends Target{
    
    private static final int PERVALUE = 1000;
    /** Creates a new instance of Stone */
    public Diamond() {
        super();
    }
    
    public Diamond( int x, int y, int size ) {
        String filename = "/D" + String.valueOf(size) + ".png";
        try{        
            super.setAll( x, y, size, new Sprite(Image.createImage(filename)) );
        }catch( IOException ioe ){
            System.out.println("Can't load Stone file.");
        }
    }
    
    public int getRelValue(){
        return getSize()*PERVALUE;
    }
}

⌨️ 快捷键说明

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