public class GameDisplayable extends FullCanvas implements Runnable {
/** 主控制线程 */ Thread MainThread = null;
/** 游戏时钟间隔 毫秒为单位 */ public static long timeinterval = 20; public static boolean Isstable = true;
/* 用于游戏时钟的变量 */ public static long timeold = 0; public static long timenow = 0; public long interval = 0; public static long frames_per_second = 0; int count = 0; long second = 0; public static boolean running = true;
public GameDisplayable() { // 开始主线程 Thread MainThread = new Thread(this); MainThread.start(); }
public void run() { while (running) { timenow = System.currentTimeMillis(); interval = timenow - timeold;
public class GameMIDlet extends MIDlet { GameDisplayable displayable = null;
/** 游戏时钟间隔 毫秒为单位 */ public static long timeinterval = 0;
//用于游戏时钟的变量 public static long timeold = 0; public static long timenow = 0; public long interval = 0; public static long frames_per_second=0; int count=0; long second =0; public static boolean running = false; static boolean exitApp =false;
public GameMIDlet() { displayable = new GameDisplayable(); running =true; }