java.util.Timer;Рimport javax.microedition.lcdui.Alert;Рimport javax.microedition.lcdui.AlertType;Рimport javax.microedition.lcdui.Canvas;Рimport javax.microedition.mand;Рimport javax.microedition.mandListener;Рimport javax.microedition.lcdui.Displayable;Рimport javax.microedition.lcdui.Graphics;Рimport javax.microedition.lcdui.Image;Рimport javax.microedition.midlet.MIDletStateChangeException;Рpublic class GameCtrl extends Canvas mandListener{Р?private mand mand;Р?private mand mand;Р?private final SnakeMIDlet midlet;Р?private Graphics graph;Р?private Timer timer = new Timer();Р?private NextFrame nextFrame;Р?// 游戏结束标志Р?public boolean isGameOver = false;Р?Р?// 游戏开始标志Р?public boolean isGameRun = false;Р?Р?// 游戏积分Р?public int score = 0;Р?// 屏幕尺寸Р?public int width = 0;Р?public int height = 0;