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

📄 besttime.java

📁 J2ME手机游戏,可以下下玩完,很好玩的.
💻 JAVA
字号:
package Src; 
/*
 * 最佳存活时间显示类 
 */
import javax.microedition.lcdui.game.*;
import javax.microedition.lcdui.*;

public class Besttime extends  Canvas   {
	
	private int w,h;
	private RecordRsm rs;
	private String besttime;
	private FugitiveGame midlet;
	private Image img;
 
	Besttime(FugitiveGame midlet)
	{	
	 
		this.midlet=midlet;
		this.setFullScreenMode(true);
		w=this.getWidth();
		h=this.getHeight();		
		rs=new RecordRsm("game");
		try{
			img=Image.createImage("/res/GameBack.png");	 
			}catch(Exception e){}
		if(rs.empty())
		{
			besttime="0";
		}
		else
		{
			besttime=new Integer(rs.getRs()).toString();
		}
		
	}
	  public void keyPressed(int keycode)
	    {
	   
	 	 if(keycode==-7)
		  {
	 		this.midlet.back();
		  }
	 	  
	    }
 
	public void paint(Graphics g)
	{
		g.setColor(0xffffff);
        g.fillRect( 0, 0, w, h );
        
        g.drawImage(img, 0,0,g.TOP|g.LEFT);
        
        g.setColor(0x8A90A1);
        g.drawString("逃亡飞机I版", w/2, h/2-40, g.TOP|g.HCENTER);
        g.drawString("最长存活时间:", w/2, h/2-20, g.TOP|g.HCENTER);
        g.drawString(besttime+".0 秒", w/2, h/2, g.TOP|g.HCENTER);
        g.drawString("返回 ", w-30, h-20, g.TOP|g.LEFT);

    }
}

⌨️ 快捷键说明

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