⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 serpentgame.java

📁 Position.java :辅助类 SerpentGameCanvas.java :游戏主控类 Maze.java :迷宫 SerpentGame.java :应用主控类 Serpent.java
💻 JAVA
字号:
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
import java.io.*;

public class SerpentGame extends MIDlet
{
	private Display display;
	
	public SerpentGame()
	{
		display = Display.getDisplay(this);
	}
	
	public void startApp()
	{
		try {
			SerpentGameCanvas t = new SerpentGameCanvas(this);
			display.setCurrent(t);
		}
        catch(Exception ex)
        {
            ex.printStackTrace();
//			System.err.println(ex.getMessage());
        }
	}
	
	public void pauseApp()
	{
	}

	public void destroyApp(boolean unconditional)
	{
	}

	public void showGameOver(int score, int stage)
	{
		try {
			TextBox t = new TextBox("Game Over", "Congratulation!!\nYou got score\n   "+score+"\nYou arrive stage\n   "+stage, 256, 0);
			display.setCurrent(t);
		}
        catch(Exception ex)
        {
            ex.printStackTrace();
        }
	}
		
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -