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

📄 pcanvas.java

📁 商业游戏代码
💻 JAVA
📖 第 1 页 / 共 4 页
字号:
						g.drawImage(flash[Math.abs(rd.nextInt())%3],145-Math.abs(rd.nextInt())%15,174+Math.abs(rd.nextInt())%15-5,Graphics.LEFT|Graphics.TOP);
					}
				}
				break;
			}
			break;
		case G_SELECT://模式选择
			clearscreen(g, 0xFFFFFF);
			mainui(g,"模式选择");

			g.setColor(0x000000);
			g.drawRect(0,HEIGHT / 8 +20+count*20,WIDTH-1,20-1);
			if(count==0){
				g.setColor(0x000000);
			}else{
				g.setColor(0x666666);
			}
			g.drawString("简单", WIDTH / 2, HEIGHT / 8+20+2, Graphics.HCENTER| Graphics.TOP);
			if(count==1){
				g.setColor(0x000000);
			}else{
				g.setColor(0x666666);
			}
			g.drawString("困难", WIDTH / 2, HEIGHT / 8+20+2+20, Graphics.HCENTER| Graphics.TOP);
//#ifdef _BT
			if(count==2){
				g.setColor(0x000000);
			}else{
				g.setColor(0x666666);
			}
			g.drawString("蓝牙联网", WIDTH / 2, HEIGHT / 8+20+2+20+20, Graphics.HCENTER| Graphics.TOP);
			
//#endif
			pcommand(g, "确定", "返回");
			break;
		case G_HELP:
			clearscreen(g, 0xFFFFFF);
			mainui(g,"说明");
			g.setColor(0xFFFFFF);
			g.fillRect(WIDTH-8,HEIGHT / 8+20,6,HEIGHT*7/8-50);
			g.setColor(0x000000);
			g.drawRect(WIDTH-8,HEIGHT / 8+20,6,HEIGHT*7/8-50);
			g.drawLine(WIDTH-5,HEIGHT / 8+25,WIDTH-5,HEIGHT-35);
			g.setClip(0, HEIGHT / 8+20,WIDTH,HEIGHT*7/8-50);
			for(int i=0;i<help.length;i++){
				g.drawString(help[i],(WIDTH-10)/2, HEIGHT / 8+20+i*20-count*20,Graphics.HCENTER|Graphics.TOP);
				g.fillRect(WIDTH-8,HEIGHT / 8+20+count*(HEIGHT*7/8-70)/(help.length-1),6,20);
			}
			g.setClip(0,0,WIDTH,HEIGHT);
			pcommand(g, "", "返回");
			break;
		case G_SET:
			clearscreen(g, 0xFFFFFF);
			mainui(g,"设置");
			g.setColor(0x000000);
			g.drawString("声音设置", WIDTH / 2 - 30, HEIGHT / 2, Graphics.HCENTER| Graphics.BOTTOM);
			g.setColor(0xFF0000);
			if(soundon){
				g.drawString("开", WIDTH / 2+30, HEIGHT / 2, Graphics.HCENTER| Graphics.BOTTOM);
			}else{
				g.drawString("关", WIDTH / 2+30, HEIGHT / 2, Graphics.HCENTER| Graphics.BOTTOM);
			}
			pcommand(g, "改变", "返回");
			break;
		case G_ABOUT:
			clearscreen(g, 0xFFFFFF);
			mainui(g,"关于");
			g.drawImage(about,WIDTH / 2, HEIGHT / 2,Graphics.HCENTER| Graphics.VCENTER);
			pcommand(g, "", "返回");
			break;
		case G_TOP:
			clearscreen(g, 0xFFFFFF);
			mainui(g,"记录");
			g.setColor(0x000000);
			g.drawString("名次",WIDTH*3/40,HEIGHT / 8+20+2,Graphics.HCENTER| Graphics.TOP);
			g.drawString("分数",WIDTH*12/40,HEIGHT / 8+20+2,Graphics.HCENTER| Graphics.TOP);
			g.drawString("名字",WIDTH*29/40,HEIGHT / 8+20+2,Graphics.HCENTER| Graphics.TOP);
			for(int i=0;i<3;i++){
				if(name[i]!=null){
					g.setColor(0x000000);
					g.drawRect(0,HEIGHT / 8 +20 +20+i*30,WIDTH-1,25-1);
					g.setColor(0xFF0000);
					g.drawString(""+(i+1),WIDTH*3/40,HEIGHT / 8+20+20+2+i*30,Graphics.HCENTER| Graphics.TOP);
					g.drawString(""+score[i],WIDTH*12/40,HEIGHT / 8+20+20+2+i*30,Graphics.HCENTER| Graphics.TOP);
					g.drawString(name[i],WIDTH*29/40,HEIGHT / 8+20+2+20+2+i*30,Graphics.HCENTER| Graphics.TOP);
				}
			}
			pcommand(g, "", "返回");
			break;
			
//#ifdef _BT
		case G_NET:
			clearscreen(g, 0xFFFFFF);
			mainui(g,"蓝牙联网");

			g.setColor(0x000000);
			g.drawRect(0,HEIGHT / 8 +20+count*20,WIDTH-1,20-1);
			if(count==0){
				g.setColor(0x000000);
			}else{
				g.setColor(0x666666);
			}
			g.drawString("加入游戏", WIDTH / 2, HEIGHT / 8+20+2, Graphics.HCENTER| Graphics.TOP);
			if(count==1){
				g.setColor(0x000000);
			}else{
				g.setColor(0x666666);
			}
			g.drawString("建立游戏", WIDTH / 2, HEIGHT / 8+20+2+20, Graphics.HCENTER| Graphics.TOP);
			g.setColor(0x666666);
			g.drawString("请确认您的蓝牙功能",WIDTH / 2, HEIGHT / 8+20+2+50, Graphics.HCENTER| Graphics.TOP);
			g.drawString("已经打开并且可见性",WIDTH / 2, HEIGHT / 8+20+2+70, Graphics.HCENTER| Graphics.TOP);
			g.drawString("全部",WIDTH / 2, HEIGHT / 8+20+2+90, Graphics.HCENTER| Graphics.TOP);
			pcommand(g, "确定", "返回");
			break;
		case G_SERVER:
			clearscreen(g, 0xFFFFFF);
			mainui(g,"客户端");
			if(count<0){
				g.setColor(0x666666);
				g.drawString("加入其他蓝牙手机建",WIDTH / 2, HEIGHT / 8+20+2, Graphics.HCENTER| Graphics.TOP);
				g.drawString("立的游戏,在此搜索",WIDTH / 2, HEIGHT / 8+20+2+20, Graphics.HCENTER| Graphics.TOP);
				g.drawString("其他蓝牙主机",WIDTH / 2, HEIGHT / 8+20+2+20*2, Graphics.HCENTER| Graphics.TOP);
				pcommand(g, "搜索", "返回");
			}else{
				if(client.getAddsize()<1){
					char[] cha={'查','找','服','务','中','.','.','.'};
					int w=g.getFont().charWidth(cha[0]);
					g.setColor(0x666666);
					for(int i=0;i<cha.length;i++){
						if(loadcount%9==i){
							g.drawChar(cha[i],WIDTH / 2-4*w+i*w,HEIGHT / 8+20-2+20,Graphics.LEFT| Graphics.TOP);
						}else{
							g.drawChar(cha[i],WIDTH / 2-4*w+i*w,HEIGHT / 8+20+2+20,Graphics.LEFT| Graphics.TOP);
						}
					}
					pcommand(g, "搜索", "返回");
				}else{
					g.setColor(0x666666);
					g.drawString("搜索到的地址:", WIDTH / 2, HEIGHT / 8, Graphics.HCENTER| Graphics.TOP);
					g.setColor(0x000000);
					g.drawRect(0,HEIGHT / 8 +20+count*20,WIDTH-1,20-1);
					for(int i=0;i<client.getAddsize();i++){
						if(count==i){
							g.setColor(0x000000);
						}else{
							g.setColor(0x666666);
						}
						g.drawString(client.getAdd(i), WIDTH / 2, HEIGHT / 8+20+2+20*i, Graphics.HCENTER| Graphics.TOP);
					}
					g.setColor(0x666666);
					g.drawString("左软键开始游戏",WIDTH / 2, HEIGHT / 8+30+2+20*client.getAddsize(), Graphics.HCENTER| Graphics.TOP);
					pcommand(g, "连接", "返回");
				}
			}
			break;
		case G_CLIENT:
			clearscreen(g, 0xFFFFFF);
			mainui(g,"服务器端");
			
			g.setColor(0x666666);
			g.drawString("我的地址:", WIDTH / 2, HEIGHT / 8+20, Graphics.HCENTER| Graphics.TOP);
			g.drawString(server.getAdd(), WIDTH / 2, HEIGHT / 8+20+2+20, Graphics.HCENTER| Graphics.TOP);
			
			char[] cha={'等','待','其','他','玩','家','加','入','.'};
			int w=g.getFont().charWidth(cha[0]);
			g.setColor(0x666666);
			for(int i=0;i<cha.length;i++){
				if(loadcount%10==i){
					g.drawChar(cha[i],WIDTH / 2-4*w+i*w,HEIGHT / 8+20-2+20+20,Graphics.LEFT| Graphics.TOP);
				}else{
					g.drawChar(cha[i],WIDTH / 2-4*w+i*w,HEIGHT / 8+20+2+20+20,Graphics.LEFT| Graphics.TOP);
				}
			}

			pcommand(g, "", "退出");
			
			break;
//#endif
		case G_START:
			clearscreen(g, 0xFFFFFF);
			//大机型
			g.drawImage(plat,WIDTH/2,HEIGHT/2,Graphics.HCENTER|Graphics.VCENTER);
			g.drawImage(pic, WIDTH / 2, HEIGHT / 2-2, Graphics.HCENTER| Graphics.VCENTER);
			break;
		case G_PLAY:
			clearscreen(g, 0xFFFFFF);
			//大机型
			g.drawImage(plat,WIDTH/2,HEIGHT/2,Graphics.HCENTER|Graphics.VCENTER);
			if(prompt<0){
				doc.render(g);
				if(count%2==0){
					doc.paintp(g, (int)point,(int)prepoint,pointpic[0+level-4],pointpic[2+level-4]);
				}else{
					doc.paintp(g, (int)point,(int)prepoint,pointpic[0+level-4],pointpic[4+level-4]);
				}
			}else{
				g.drawImage(pic, WIDTH / 2, HEIGHT / 2-2, Graphics.HCENTER| Graphics.VCENTER);
			}
//			doc.minimap(g);//画小地图
//#ifdef _BT
			if(isServer>0){
				g.setClip(76+0*7,13-(0%3),6,7);
				g.drawImage(num,76+0*7-(Integer.parseInt(data)/10)*6,13-(0%3),Graphics.LEFT|Graphics.TOP);
				g.setClip(76+1*7,13-(1%3),6,7);
				g.drawImage(num,76+1*7-(Integer.parseInt(data)%10)*6,13-(1%3),Graphics.LEFT|Graphics.TOP);
				g.setClip(0,0,WIDTH,HEIGHT);
			}
//#endif
			int _x[]={23,27,29,27,23,18,16,18};
			int _y[]={188,190,194,199,200,199,194,190};
			g.setColor(0x000000);
			g.drawLine(22,193-(HEIGHT-208)/2,_x[count],_y[count]-(HEIGHT-208)/2);
			
			int l = (int) limitime / 1000;
			int all=(int)onetime[stage]/1000;
			g.setClip(26,181-(HEIGHT-208)/2,l*106/all,18);
			g.drawImage(time,26,181-(HEIGHT-208)/2,Graphics.LEFT|Graphics.TOP);
			
			g.setClip(0,0,WIDTH,HEIGHT);
			if(l<=10){
				if(soundindex!=1&&isp&&l==10)
					playsound(1,false);
				if(count%2==0)
					g.drawImage(alarm,16,187-(HEIGHT-208)/2,Graphics.LEFT|Graphics.TOP);
			}
			
			if(tool){
				g.drawImage(toolpic,146,182-(HEIGHT-208)/2,Graphics.LEFT|Graphics.TOP);
			}
			//画分数
			for(int i=0;i<6;i++){
				g.setClip(116+i*7,13-(i%3),6,7);
				g.drawImage(num,116+i*7-index[i]*6,13-(i%3),Graphics.LEFT|Graphics.TOP);
			}
			
			break;
		case G_TYPE:
			clearscreen(g, 0xFFFFFF);
			mainui(g,"选择类型");

			if(view){
				g.setColor(0xFF0000);
				g.drawString("正确答案是: "+gametype[typeindex[correct]],WIDTH / 2, HEIGHT / 8+2, Graphics.HCENTER| Graphics.TOP);
			}else{
				g.setColor(0x000000);
				g.drawRect(0,HEIGHT / 8 +20+count*20,WIDTH-1,20-1);
			}
			for(int i=0;i<5;i++){
				if(count==i){
					g.setColor(0x000000);
				}else{
					g.setColor(0x666666);
				}
				g.drawString(gametype[typeindex[i]],WIDTH / 2, HEIGHT / 8+20+2+i*20, Graphics.HCENTER| Graphics.TOP);
			}
			pcommand(g, "继续", "取消");
			break;
		case G_END:
			clearscreen(g, 0xFFFFFF);
			mainui(g,"输入名字");
			g.setColor(0xFFFFFF);
			g.fillRect(WIDTH / 2 - 60, HEIGHT / 3 - 4, 120, 20);
			g.setColor(0x000000);
			g.drawRect(WIDTH / 2 - 60, HEIGHT / 3 - 4, 120, 20);
			if (myname != null) {
				String _myname = myname.toString();
				if (loadcount % 2 == 0 && myname.length() <= 10) {
					_myname = myname.toString() + "_";
				}
				g.drawString(_myname, WIDTH / 2 - 56, HEIGHT / 3, Graphics.LEFT| Graphics.TOP);
			}
			font(g);
			if(myname.length()>0&&myname != null){
				pcommand(g, "确定", "删除");
			}else{
				pcommand(g, "确定", "退出");
			}
			break;
		case G_WIN:
			clearscreen(g, 0xFFFFFF);
			mainui(g,"购买保险");
			g.setColor(0x000000);
			g.drawString("保险可加1/6的", WIDTH / 2, HEIGHT / 2 - 40, Graphics.HCENTER| Graphics.BOTTOM);
			g.drawString("时间,需5000分。", WIDTH / 2, HEIGHT / 2 - 20, Graphics.HCENTER| Graphics.BOTTOM);
			g.drawString("是否购买保险?", WIDTH / 2, HEIGHT / 2, Graphics.HCENTER| Graphics.BOTTOM);
			g.drawImage(toolpic,WIDTH / 2,HEIGHT/2+30,Graphics.HCENTER|Graphics.BOTTOM);
			if (count == 0&&!tool&&score[3]>=5000)
				g.setColor(0xFF0000);
			else
				g.setColor(0x000000);
			g.drawString("否", WIDTH / 2-20, HEIGHT / 2 + 50, Graphics.HCENTER| Graphics.BOTTOM);
			if (count == 1&&!tool&&score[3]>=5000)
				g.setColor(0xFF0000);
			else
				g.setColor(0x000000);
			g.drawString("是", WIDTH / 2+20, HEIGHT / 2 + 50, Graphics.HCENTER| Graphics.BOTTOM);
			pcommand(g, "继续", "退出");
			break;
		case G_OVER:
			clearscreen(g, 0xFFFFFF);
			mainui(g,"胜利");
			if(count<(HEIGHT*7/16+100)){
				g.setColor(0x000000);
				g.setClip(0, HEIGHT / 8+20,WIDTH,HEIGHT*7/8-50);
				for(int i=0;i<dev.length;i++){
					g.drawString(dev[i],(WIDTH-10)/2, HEIGHT -20+i*20-count*2,Graphics.HCENTER|Graphics.TOP);
				}
				g.setClip(0,0,WIDTH,HEIGHT);
			}else{
				if(count%2==0){
					g.setClip(WIDTH/2-54,HEIGHT/2-16,107,32);
					g.drawImage(last,WIDTH/2-54,HEIGHT/2-16,Graphics.LEFT|Graphics.TOP);
					g.setClip(0,0,WIDTH,HEIGHT);
				}
			}
			pcommand(g, "确定", "");
			break;
		case G_LOST:
			clearscreen(g, 0xFFFFFF);
			mainui(g,"失败");
			if(count%2==0){
				g.setClip(WIDTH/2-54,HEIGHT/2-16,107,32);
				g.drawImage(last,WIDTH/2-54,HEIGHT/2-16-32,Graphics.LEFT|Graphics.TOP);
				g.setClip(0,0,WIDTH,HEIGHT);
			}
			pcommand(g, "确定", "");
			break;
		case G_PAUSE:
			clearscreen(g, 0xFFFFFF);
			//大机型
			g.drawImage(menu,WIDTH/2,HEIGHT/2,Graphics.HCENTER|Graphics.VCENTER);
			g.setClip(98,35,42,16);
			g.drawImage(menu_text,98,35-6*16,Graphics.TOP|Graphics.LEFT);
			g.setClip(98,174,42,16);
			g.drawImage(menu_text,98,174-7*16,Graphics.TOP|Graphics.LEFT);
			switch(count){
			case 0:
				g.setClip(98,35,42,16);
				g.drawImage(menu_text,98,35-(count+8)*16,Graphics.TOP|Graphics.LEFT);
				g.setClip(0,0,WIDTH,HEIGHT);
				if(loadcount<8){
					g.drawImage(flash[Math.abs(rd.nextInt())%3],84+loadcount*7,35+Math.abs(rd.nextInt())%8+2,Graphics.LEFT|Graphics.TOP);
				}else{
					for(int i=0;i<5;i++){
						g.drawImage(flash[Math.abs(rd.nextInt())%3],145-Math.abs(rd.nextInt())%15,35+Math.abs(rd.nextInt())%15-5,Graphics.LEFT|Graphics.TOP);
					}
				}
				break;
			case 1:
				g.setClip(98,62,42,16);
				g.drawImage(menu_text,98,62-count*16,Graphics.TOP|Graphics.LEFT);
				g.setClip(0,0,WIDTH,HEIGHT);
				if(loadcount<8){
					g.drawImage(flash[Math.abs(rd.nextInt())%3],84+loadcount*7,62+Math.abs(rd.nextInt())%8+2,Graphics.LEFT|Graphics.TOP);
				}else{
					for(int i=0;i<5;i++){
						g.drawImage(flash[Math.abs(rd.nextInt())%3],145-Math.abs(rd.nextInt())%15,62+Math.abs(rd.nextInt())%15-5,Graphics.LEFT|Graphics.TOP);
					}
				}
				break;
			case 2:
				g.setClip(98,91,42,16);
				g.drawImage(menu_text,98,91-count*16,Graphics.TOP|Graphics.LEFT);
				g.setClip(0,0,WIDTH,HEIGHT);
				if(loadcount<8){
					g.drawImage(flash[Math.abs(rd.nextInt())%3],84+loadcount*7,91+Math.abs(rd.nextInt())%8+2,Graphics.LEFT|Graphics.TOP);
				}else{
					for(int i=0;i<5;i++){
						g.drawImage(flash[Math.abs(rd.nextInt())%3],145-Math.abs(rd.nextInt())%15,91+Math.abs(rd.nextInt())%15-5,Graphics.LEFT|Graphics.TOP);
					}
				}
				break;
			case 3:
				g.setClip(98,119,42,16);
				g.drawImage(menu_text,98,119-count*16,Graphics.TOP|Graphics.LEFT);
				g.setClip(0,0,WIDTH,HEIGHT);
				if(loadcount<8){
					g.drawImage(flash[Math.abs(rd.nextInt())%3],84+loadcount*7,119+Math.abs(rd.nextInt())%8+2,Graphics.LEFT|Graphics.TOP);
				}else{
					for(int i=0;i<5;i++){
						g.drawImage(flash[Math.abs(rd.nextInt())%3],145-Math.abs(rd.nextInt())%15,119+Math.abs(rd.nextInt())%15-5,Graphics.LEFT|Graphics.TOP);
					}
				}
				break;
			case 4:
				g.setClip(98,147,42,16);
				g.drawImage(menu_text,98,147-count*16,Graphics.TOP|Graphics.LEFT);
				g.setClip(0,0,WIDTH,HEIGHT);
				if(loadcount<8){
					g.drawImage(flash[Math.abs(rd.nextInt())%3],84+loadcount*7,147+Math.abs(rd.nextInt())%8+2,Graphics.LEFT|Graphics.TOP);
				}else{
					for(int i=0;i<5;i++){
						g.drawImage(flash[Math.abs(rd.nextInt())%3],145-Math.abs(rd.nextInt())%15,147+Math.abs(rd.nextInt())%15-5,Graphics.LEFT|Graphics.TOP);
					}
				}
				break;
			case 5:
				g.setClip(98,174,42,16);
				g.drawImage(menu_text,98,174-(count+4)*16,Graphics.TOP|Graphics.LEFT);
				g.setClip(0,0,WIDTH,HEIGHT);
				if(loadcount<8){
					g.drawImage(flash[Math.abs(rd.nextInt())%3],84+loadcount*7,174+Math.abs(rd.nextInt())%8+2,Graphics.LEFT|Graphics.TOP);
				}else{
					for(int i=0;i<5;i++){
						g.drawImage(flash[Math.abs(rd.nextInt())%3],145-Math.abs(rd.nextInt())%15,174+Math.abs(rd.nextInt())%15-5,Graphics.LEFT|Graphics.TOP);
					}
				}
				break;
			}
			break;

		}

	}


	// -------------------------------------清屏--------------------------------
	private void clearscreen(Graphics g, int color) {
		g.setClip(0, 0, WIDTH, HEIGHT);
		g.setColor(color);
		g.fillRect(0, 0, WIDTH, HEIGHT);
	}

	// -------------------------------------笑脸--------------------------------
//	Draw a smile.
	public int comHigh = 60; //到COM2US LOGO的距离
	private void drawSmile(Graphics g) {
		// TODO 自动生成方法存根 
	     //计算水深,实际上是smile高-depth. 多出来的w_water.getHeight() * n,一方面使涨幅加大,另外也使waterDepth可以为负。
	    int  waterDepth = w_smile.getHeight() - (w_smile.getHeight() + w_water.getHeight()*1)* loadcount/8;
	    
	    //上涨的主体水面
	    g.setClip ((WIDTH - w_smile.getWidth()) / 2, (HEIGHT - w_smile.getHeight()) / 2+comHigh, w_smile.getWidth(), w_smile.getHeight() - 1);
	    g.setColor (0x00DB0000);
	    g.fillRect ((WIDTH - w_water.getWidth()) / 2, ((HEIGHT - w_smile.getHeight()) / 2) + waterDepth+comHigh, w_water.getWidth(), (w_smile.getHeight() - waterDepth) - 1);
	    
	    //以下是在水平以上w_water.getHeight()/2处形成三种不同波浪,产生动态效果
	    if ((waterDepth % 3) >= 2) {//画WATER图上面一条线,形成一道波浪
	        g.clipRect ((WIDTH - w_water.getWidth()) / 2, ((HEIGHT - w_smile.getHeight()) / 2) + waterDepth+comHigh, w_water.getWidth(), (w_water.getHeight() / 2) - 2);
	        g.drawImage (w_water, (WIDTH - w_water.getWidth()) / 2, ((HEIGHT - w_smile.getHeight()) / 2) + waterDepth + comHigh, 0);
	    }
	     else if ((waterDepth % 3) >= 1) {//用矩形填充,形成水平面
	        g.setColor (0x00FFFFFF);
	        g.fillRect ((WIDTH - w_water.getWidth()) / 2, ((HEIGHT - w_smile.getHeight()) / 2) + waterDepth+comHigh, w_water.getWidth(), w_water.getHeight() / 4);
	    }
	     else {//画WATER图下面一条线,形成相反方向的波浪
	        g.clipRect ((WIDTH - w_water.getWidth()) / 2, ((HEIGHT - w_smile.getHeight()) / 2) + waterDepth+comHigh, w_water.getWidth(), (w_water.getHeight() / 2) - 2);
	        g.drawImage (w_water, (WIDTH - w_water.getWidth()) / 2, ((((HEIGHT - w_smile.getHeight()) / 2) + waterDepth) - (w_water.getHeight() / 2)) - 1+comHigh, 0);
	    }
	    
	    g.setClip (0, 0, WIDTH, HEIGHT);
//	    g.setColor (0x00FFFFFF);
//	    g.fillRect ((LCD_WIDTH - w_smile.getWidth()) / 2, ((LCD_HEIGHT - w_smile.getHeight()) / 2) - w_water.getHeight()+comHigh, w_smile.getWidth(), w_water.getHeight());
	    g.drawImage (w_smile, (WIDTH - w_smile.getWidth()) / 2, (HEIGHT - w_smile.getHeight()) / 2+comHigh, 0);
	    
	    //眨眼
	    if ((waterDepth < -7) && (waterDepth >= -14)) {
	        g.drawImage (w_eye, ((WIDTH - w_smile.getWidth()) / 2) + 25, (HEIGHT - w_smile.getHeight()) / 2+comHigh, 0);
	    }
	}


	// -------------------------------------载入资源--------------------------------

	private final void loadLogo() {
		try {
			imgmonternet = Image.createImage("/monternet.png");
			imgbbox = Image.createImage("/bbox.png");
			imgcom2us = Image.createImage("/com2us.png");
			slogan = Image.createImage("/slogan.png");
			title= Image.createImage("/title.png");
			
			w_water=Image.createImage("/w_water.png");
			w_smile=Image.createImage("/w_smile.png");
			w_eye=Image.createImage("/w_eye.png");
			
		} catch (Exception e) {

		}
	}
	
	private void releaseres(){
		imgmonternet =null;
		imgbbox =null;
		imgcom2us =null;
		slogan =null;
		title=null;
		
		w_water=null;
		w_smile=null;
		w_eye=null;
		
		System.gc();
	}

	// -------------------------------------载入资源--------------------------------
	private void loadres() {
		try {
			switch(loadcount){
			case 0:
				loadcount++;
				menu=Image.createImage("/menu.png");
				Thread.sleep(500);
				break;
			case 1:
				loadcount++;
				menu_text=Image.createImage("/menu_text.png");
				Thread.sleep(500);
				break;
			case 2:
				loadcount++;
				flash[0]=Image.createImage("/flash0.png");
				flash[1]=Image.createImage("/flash1.png");
				flash[2]=Image.createImage("/flash2.png");
				Thread.sleep(500);
				break;
			case 3:
				loadcount++;
				plat=Image.createImage("/plat.png");
				Thread.sleep(500);
				break;
			case 4:
				loadcount++;
				pointpic[0]=Image.createImage("/point0.png");
				pointpic[1]=Image.createImage("/point3.png");
				pointpic[2]=Image.createImage("/point1.png");
				pointpic[3]=Image.createImage("/point4.png");
				pointpic[4]=Image.createImage("/point2.png");
				pointpic[5]=Image.createImage("/point5.png");
				Thread.sleep(500);

⌨️ 快捷键说明

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