resobj.java~7~

来自「利用Java 开发的一个手机版的潜艇游戏。游戏实现的重点就是屏幕的绘制滚动技术和」· JAVA~7~ 代码 · 共 46 行

JAVA~7~
46
字号
package mysubmarine;

import java.io.IOException;
import java.util.Random;

import javax.microedition.lcdui.Image;

/**
 * <p>Title: 一个简单的潜艇游戏</p>
 *
 * <p>Description: </p>
 *
 * <p>Copyright: Copyright (c) 2005</p>
 *
 * <p>Company: Star Group</p>
 *
 * @author not attributable
 * @version 1.0
 */
public class ResObj {
    public ResObj() {
    }

    public static Image createImage(String url) {
        Image image = null;
        try {
            image = Image.createImage(url);
        } catch (IOException e) {
            e.printStackTrace();
        }

        return image;
    }

    public static int createRandom(int scale) {
        Random rand = new Random();
        rand.setSeed(System.currentTimeMillis());
        //int returnValue = (rand.nextInt() << 1 >>> 1) % scale;
        int returnValue = rand.nextInt() % scale;

        rand = null;
        return returnValue;
    }

}

⌨️ 快捷键说明

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