这是我写的一个j2me的名为《黄金甲》的一个RPG游戏

源代码在线查看: tools.java

软件大小: 1060 K
上传用户: zhangchao0219
关键词: j2me RPG
下载地址: 免注册下载 普通下载 VIP

相关代码

				/*
				 * Tools.java
				 *
				 * Created on 2005年12月13日, 下午2:05
				 *
				 * To change this template, choose Tools | Options and locate the template under
				 * the Source Creation and Management node. Right-click the template and choose
				 * Open. You can then make changes to the template in the Source Editor.
				 */
				package Engine;
				import javax.microedition.lcdui.Image;
				import javax.microedition.lcdui.Graphics;
				import java.util.*;
				
				/**
				 * * @author YBGame_xu
				 */
				public final class Tools {
				    public static final int GRAPHICS_TOP_LEFT=Graphics.TOP | Graphics.LEFT;
				    private static final Random randomizer=new Random();
				    public static int[] Numerics=new int[10];
				    //将数组的长度增加
				
				    public final static String[] expandArray(String[] oldArray, int expandBy){
				        String[] newArray=new String[oldArray.length+expandBy];
				        System.arraycopy(oldArray, 0,newArray, 0, oldArray.length);
				        return newArray;
				    }
				    public final static Image[][]expandArray(Image[][] oldArray,int expandBy){
				        Image[][] newArray=new Image[oldArray.length+expandBy][];
				        System.arraycopy(oldArray, 0, newArray, 0, oldArray.length);
				        return newArray;
				    }
				    public final static Image[]expandArray(Image[] oldArray,int expandBy){
				        Image[] newArray=new Image[oldArray.length+expandBy];
				        System.arraycopy(oldArray, 0, newArray, 0, oldArray.length);
				        return newArray;
				    }
				    public final static int getRand(int min,int max){
				        int r=Math.abs(randomizer.nextInt());
				        return (r% ((max-min + 1))) + min;
				    }
				    public final static int setNumerics(int s){
				        if (s==0){
				            Numerics[0]=0;
				            return 0;
				        }
				        int t;
				        int j=-1;
				        while(s>0){
				            t=s%10;
				            Numerics[++j]=t;
				            s=s/10;
				        }
				        return j;
				    }
				}
							

相关资源