public void destroyApp(boolean unconditional) { exit(); }
public void exit() { System.gc(); destroyApp(false); notifyDestroyed(); } }
Displayable1.java内容:
package temps;
import javax.microedition.lcdui.*; import java.util.Random; import javax.microedition.lcdui.game.*; /** * Title: * * Description: * * Copyright: Copyright (c) 2005 * * Company: * * @author not attributable * @version 1.0 */ public class Displayable1 extends GameCanvas implements Runnable { private boolean isPlay; // Game Loop runs when isPlay is true private long delay; // To give thread consistency private int currentX, currentY; // To hold current position of the 'X' private int width; // To hold screen width private int height; // To hold screen height private Random random=new Random(System.currentTimeMillis()); private final int[] sequence={0,1,2,1,0,1,2,1,0,1,2,1,1,1,1,1,1}; private int counter=0; private int enemyX,enemyY; private int enemyDirect=0; private boolean isdown=false;
private boolean isalive=true;
// Sprites to be used private Sprite playerSprite; private Sprite backgroundSprite; private Sprite enemySprite;