请教高手!!j2me
内存不足问题!!
import javax.microedition.lcdui.*;
import javax.microedition.lcdui.game.*;
public class SpriteCanvas extends GameCanvas implements Runnable{
private Image spriteImage;
private Sprite sprite;
private int spriteWidth;
private int spriteHeight;
private int spriteX;
private int spriteY;
private int[][] frame_seq={{0,1,2,2,1,0},
{3,4,5,5,4,3},
{6,7,8,8,7,6},
{9,10,11,11,10,9}};
private int now_seq;
private Graphics g;
private int offsetX;
private int offsetY;
private boolean isRun;
public SpriteCanvas(){
super(true);
try{
spriteImage=Image.createImage( "/sp.png ");//load image;
sprite=new Sprite(spriteImage,24,32);//create sprite
}
catch(Exception e){
e.printStackTrace();
}
spriteWidth=sprite.getWidth();
spriteHeight=sprite.getHeight();
now_seq=2;
sprite.setFrameSequence(frame_seq[now_seq]);
g=this.getGraphics();
offsetX=3;
offsetY=3;
isRun=true;
}
public void run(){
try{
while(isRun){
new Thread().sleep(20);