全文预览

软件技术毕业设计-J2ME贪吃蛇游戏制作(含源程序)

上传者:非学无以广才 |  格式:doc  |  页数:27 |  大小:1040KB

文档介绍
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;

收藏

分享

举报
下载此文档