亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? map類的源代碼.txt

?? j2me書中和程序
?? TXT
?? 第 1 頁 / 共 2 頁
字號:
package src;


import java.io.*;
import java.util.Date;
import java.util.Random;

import javax.microedition.lcdui.*;



class Map 
{


	private static int px = 128;

	private static int py = 128;

	private static int picx = 13;

	private static int picy = 13;


	private static int mx = 10;

	private static int my = 9;


	private static int picCount = 14;

	private Image image[];

	
	private int rolex, roley, selectx, selecty;


	private boolean flag = false;


	private int map[][];


	private static int e = 255;

	
	private Image start;

	
	private int imagecount;

	
	private boolean load;


	private boolean flagmap;

	
	private int state;


	private int number;


	private int cx[], cy[], cmc;

	private int sx, sy, ex, ey;

	private boolean clean;


	static int max = 10;

	private int level[];

	private int num;


	private boolean timeFlag;
	
	private Image end;
	
	private int value;
	public int gamex;  
	private int gameCount; 
	

	public Map() 
	{
		rolex = 3;
		roley = 3;

		map = new int[my][mx];
		cx = new int[my * 3];
		cy = new int[my * 3];

		for (int y = 0; y < my; y++) 
		{
			for (int x = 0; x < mx; x++) 
			{
				map[y][x] = e;
			}

		}
		load = false;

		clean = false;

		imagecount = 0;

		flagmap = false;

		level = new int[max];
		num = 0;

		timeFlag = false;
		
		value = 0;
		gamex = 0;
		gameCount = 0;
		
	}

	private int GetGameLevel() 
	{
		int iV;

		Date tDate = new Date();
		Random tRand = new Random(tDate.getTime());

		if ((num == 0) || (num == max)) 
		{
			iV = Math.abs(tRand.nextInt()) % max;
			level[0] = iV;
			num = 1;

		
			return iV;
		}

		while(true) 
		{
			iV = Math.abs(tRand.nextInt()) % max;
			for (int i = 0; i < num; i++) 
			{
				if (level[i] == iV)
					break;

				if (i == (num - 1)) 
				{
					num++;
					level[i + 1] = iV;

					
					return iV;
				}
			}
		}

	}

	public boolean LoadGameLevelMap() 
	{
		InputStream is = null;
		int iT;
		char iC;
		String strFile;

		iT = 0;
		iC = 0;

		timeFlag = false;
		end = null;
		
		value ++;
		
		strFile = "/Res/Data/" + GetGameLevel() + ".llk";

		try 
		{
			is = getClass().getResourceAsStream(strFile);
			for (int y = 0; y < my; y++) 
			{
				for (int x = 0; x < mx; x++) 
				{
					if ((y == 0) || (x == 0) || (y == my - 1)
							|| (x == mx - 1)) 
					{
						map[y][x] = e;
						continue;
					}
					iT = is.read();

					iC = (char) iT;
					map[y][x] = iC;

					
					if (iC < picCount)
						imagecount++;


				}
			}
			is.close();
		}
		catch (java.io.IOException ex) 
		{
			ex.printStackTrace();
			return false;
		}
		
		flagmap = true;

		return true;
	}

	public boolean LoadGameImage() 
	{
		String strFileName;

		if (load)
			return true;
		
		image = new Image[picCount];
		strFileName = "";
		for (int i = 0; i < picCount; i++) 
		{
			try 
			{
				strFileName = "/Res/Icons/" + i + ".png";
				image[i] = Image.createImage(strFileName);
			} 
			catch (java.io.IOException e) 
			{
				e.printStackTrace();
				return false;
			}
		}

		try 
		{
			start = Image.createImage("/Res/Icons/Statusbar.png");
		} 
		catch (java.io.IOException e) 
		{
			e.printStackTrace();
			return false;
		}

		
		load = true;
		return true;
	}

	public void LoadGameEndImg(boolean isSuccessFile) 
	{
		String strFile;

		if (isSuccessFile)
			strFile = "/Res/Icons/End_Success.PNG";
		else
			strFile = "/Res/Icons/End_Failed.PNG";

		try 
		{
			end = Image.createImage(strFile);
		} 
		catch (java.io.IOException e) 
		{
			e.printStackTrace();
			return;
		}
	}

	public int DrawScreen(Graphics g, int iTimeCount, boolean bCleanFlag,boolean bCleanStart) 
	{

		int iRtn;

		iRtn = 0;
		if (flagmap) 
		{
			
			return iRtn;
		}

		if ((bCleanFlag) && (bCleanStart == false)) 
		{
			map[sy][sx] = e;
			map[ey][ex] = e;
			clean = false;

			gameCount += 10;
			
			if (imagecount == 0)
				iRtn = 1;
		}

		PaintGameMap(g);
		PaintCourse(g);
		PaintStatusBar(g, iTimeCount);

		if ((bCleanFlag) && (bCleanStart)) 
		{
			PaintCleanFlag(g);
		}

		
		if (timeFlag) 
		{
			iRtn = 2;
		}

		return iRtn;
	}

	
	public void PaintGameEnd(Graphics g,int iTime) 
	{
		String strGameAmt,strGameLevelValue,strTime;
		
		strTime = String.valueOf(iTime);
		strGameAmt = String.valueOf(gameCount);
		strGameLevelValue = String.valueOf(value);;
		
		try 
		{
			g.drawImage(end, 0, 0, Graphics.LEFT | Graphics.TOP);
			g.setColor(0, 0, 255);
			
			g.drawString(strGameLevelValue, 55, 74, 33);
			g.drawString(strGameAmt, 70, 94, 33);
			g.drawString(strTime, 80, 114, 33);
			
		} catch (Exception ex) 
		{
			ex.printStackTrace();
		
		}
	}

	private void PaintIniMap(Graphics g) 
	{
		
		int iy, ihigh;

		g.setColor(0, 223, 255);
		iy = state * 8;
		ihigh = (8 - state) * 18;
		g.fillRect(0, iy, 128, ihigh);
		

		System.out.println("PaintIniMap: " + state);
	}

	
	public void SetIniMapState(int ms) 
	{
		state = ms;
		if (ms == 0) 
		{
			flagmap = false;
		}

		System.out.println("SetIniMapState: " + ms);
	}

	private void PaintCleanStatus() 
	{
		
		System.out.println("sx:" + sx + "/sy:" + sy);
		System.out.println("ex:" + ex + "/ey:" + ey);

		for (int i = 0; i < cmc; i++) {
			System.out.println("x:" + cx[i] + "/y:" + cy[i]);
		}
		
	}

	public void PaintCleanFlag1(Graphics g) 
	{
		int tx1, ty1, tx2, ty2;

		g.setColor(2, 255, 2);

		tx1 = 0;
		ty1 = 0;
		tx2 = 0;
		ty2 = 0;

		tx1 = cx[0];
		ty1 = cy[0];

		for (int i = 1; i < cmc; i++) 
		{
			tx2 = cx[i];
			ty2 = cy[i];

			
			if ((tx1 == tx2) || (ty1 == ty2))
				continue;

			tx2 = cx[i - 1];
			ty2 = cy[i - 1];

			// up
			if ((ty1 == 0) && (ty2 == 0)) 
			{
				if (tx1 == 0) 
				{
					tx1 = 2;
				} 
				else if (tx1 == mx - 1) 
				{
					tx1 = 5 + tx1 * (tx1 - 1) * 13 + (tx1 - 1) * 2 + 2;
				} 
				else
					tx1 = 5 + tx1 * (tx1 - 1) * 13 + (tx1 - 1) * 2 + 6;
				
				ty1 = 2;
				

				if (tx2 == 0) 
				{
					tx2 = 2;
				} 
				else if (tx2 == mx - 1) 
				{
					tx2 = 5 + tx2 * (tx2 - 1) * 13 + (tx2 - 1) * 2 + 2;
				} 
				else
					tx2 = 5 + tx2 * (tx2 - 1) * 13 + (tx2 - 1) * 2 + 6;
				
				ty2 = 2;

				// down
			} 
			else if ((ty1 == my - 1) && (ty2 == my - 1)) 
			{
				if (tx1 == 0) 
				{
					tx1 = 2;
				} 
				else if (tx1 == mx - 1) 
				{
					tx1 = 5 + tx1 * (tx1 - 1) * 13 + (tx1 - 1) * 2 + 2;
				} 
				else
					tx1 = 5 + tx1 * (tx1 - 1) * 13 + (tx1 - 1) * 2 + 6;
				
				ty1 = 5 + ty1 * (ty1 - 1) * 13 + (ty1 - 1) * 2 + 2;

				if (tx2 == 0) 
				{
					tx2 = 2;
				} 
				else if (tx2 == mx - 1) 
				{
					tx2 = 5 + tx2 * (tx2 - 1) * 13 + (tx2 - 1) * 2 + 2;
				} 
				else
					tx2 = 5 + tx2 * (tx2 - 1) * 13 + (tx2 - 1) * 2 + 6;
				
				ty2 = ty1;

				// left
			} 
			else if ((tx1 == 0) && (tx2 == 0)) 
			{
				if (ty1 == 0)
					ty1 = 2;
				else if (ty1 == my - 1)
					ty1 = 5 + ty1 * (ty1 - 1) * 13 + (ty1 - 1) * 2 + 2;
				else
					ty1 = 5 + ty1 * (ty1 - 1) * 13 + (ty1 - 1) * 2 + 6;
				
				tx1 = 2;

				if (ty2 == 0)
					ty2 = 2;
				else if (ty2 == my - 1)
					ty2 = 5 + ty2 * (ty2 - 1) * 13 + (ty2 - 1) * 2 + 2;
				else
					ty2 = 5 + ty2 * (ty2 - 1) * 13 + (ty2 - 1) * 2 + 6;
				tx2 = 2;
				//right
			} 
			else if ((tx1 == mx - 1) && (tx2 == mx - 1)) 
			{
				if (ty1 == 0)
					ty1 = 2;
				else if (ty1 == my - 1)
					ty1 = 5 + ty1 * (ty1 - 1) * 13 + (ty1 - 1) * 2 + 2;
				else
					ty1 = 5 + ty1 * (ty1 - 1) * 13 + (ty1 - 1) * 2 + 6;
				tx1 = 5 + ty1 * (ty1 - 1) * 13 + (ty1 - 1) * 2 + 2;

				if (ty2 == 0)
					ty2 = 2;
				else if (ty2 == my - 1)
					ty2 = 5 + ty2 * (ty2 - 1) * 13 + (ty2 - 1) * 2 + 2;
				else
					ty2 = 5 + ty2 * (ty2 - 1) * 13 + (ty2 - 1) * 2 + 6;
				tx2 = tx1;
			} 
			else 
			{
				tx1 = 5 + tx1 * (tx1 - 1) * 13 + (tx1 - 1) * 2 + 6;
				ty1 = 5 + ty1 * (ty1 - 1) * 13 + (ty1 - 1) * 2 + 6;
				tx2 = 5 + tx2 * (tx2 - 1) * 13 + (tx2 - 1) * 2 + 6;
				ty2 = 5 + ty2 * (ty2 - 1) * 13 + (ty2 - 1) * 2 + 6;
			}

			g.drawLine(tx1, ty1, tx2, ty2);
			tx1 = cx[i];
			ty1 = cy[i];

			
		}
	}

	public void PaintCleanFlag2(Graphics g) 
	{
		int tx1, ty1, tx2, ty2;

		tx1 = 0;
		ty1 = 0;
		tx2 = 0;
		ty2 = 0;

		tx1 = cx[0];
		ty1 = cy[0];
		g.setColor(2, 255, 2);
		for (int i = 1; i < cmc - 1; i++) {
			tx2 = cx[i + 1];
			ty2 = cy[i + 1];



			if ((tx1 == tx2) || (ty1 == ty2))
				continue;

			tx2 = cx[i];
			ty2 = cy[i];



			if (((tx1 > 0) && (ty1 == 0))|| ((tx1 > 0) && (ty1 == my - 1))) //up down
			{
				tx1 = 5 + (tx1 - 1) * 13 + (tx1 - 1) * 2 + 2;
				if (ty1 != 0)
					ty1 = 5 + (ty1 - 1) * 13 + (ty1 - 1) * 2 + 2;
				
			} 
			else if (((tx1 == 0) && (ty1 > 0)) ||(tx1 == mx - 1) && ty1 > 0) 
			{
				ty1 = 5 + (ty1 - 1) * 13 + (ty1 - 1) * 2 + 2;
				if (tx1 != 0)
					tx1 = 5 + (tx1 - 1) * 13 + (tx1 - 1) * 2 + 2;
			} 
			else if ((tx1 == 0) && (ty1 == 0)) 
			{

			} 
			else 
			{
				tx1 = 5 + (tx1 - 1) * 13 + (tx1 - 1) * 2 + 7;
				ty1 = 5 + (ty1 - 1) * 13 + (ty1 - 1) * 2 + 7;
			}

			//position 2
			if (((tx2 > 0) && (ty2 == 0))|| ((tx2 > 0) && (ty2 == my - 1))) //up down
			{
				tx2 = 5 + (tx2 - 1) * 13 + (tx2 - 1) * 2 + 2;
				if (ty2 != 0)
					ty2 = 5 + (ty2 - 1) * 13 + (ty2 - 1) * 2 + 2;
				
			} 
			else if (((tx2 == 0) && (ty2 > 0)) ||(tx2 == mx - 1) && ty2 > 0) 
			{
				ty2 = 5 + (ty2 - 1) * 13 + (ty2 - 1) * 2 + 2;
				if (tx2 != 0)
					tx2 = 5 + (tx2 - 1) * 13 + (tx2 - 1) * 2 + 2;
			} 
			else if ((tx2 == 0) && (ty2 == 0)) 
			{

			}
			else 
			{
				tx2 = 5 + (tx2 - 1) * 13 + (tx2 - 1) * 2 + 7;
				ty2 = 5 + (ty2 - 1) * 13 + (ty2 - 1) * 2 + 7;
			}

			g.drawLine(tx1, ty1, tx2, ty2);
			tx1 = cx[i];
			ty1 = cy[i];
		}

	}

	//畫連接線
	private void PaintCleanFlag(Graphics g) 
	{
		int tx, ty;
		boolean isMid, isChange;

		//		isChange = false;
		g.setColor(2, 255, 2);
		
		for (int i = 0; i < cmc; i++) 
		{
			tx = cx[i];
			ty = cy[i];
			isMid = false;

			g.setColor(16, 24, 173);
			
			if (((tx > 0) && (ty == 0)) || ((tx > 0) && (ty == my - 1))) //up
																			  // down
			{
				tx = 5 + (tx - 1) * 13 + (tx - 1) * 2 + 4;
				if (ty != 0)
					ty = 5 + (ty - 1) * 13 + (ty - 1) * 2;
				
			} 
			else if (((tx == 0) && (ty > 0)) ||	(tx == mx - 1) && ty > 0) 
			{
				ty = 5 + (ty - 1) * 13 + (ty - 1) * 2 + 4;
				if (tx != 0)
					tx = 5 + (tx - 1) * 13 + (tx - 1) * 2;
			} 
			else if ((tx == 0) && (ty == 0)) 
			{

			} 
			else 
			{
				isMid = true;
				tx = 5 + (tx - 1) * 13 + (tx - 1) * 2 + 2;
				ty = 5 + (ty - 1) * 13 + (ty - 1) * 2 + 2;
			}

			if (isMid) 
			{
				g.fillArc(tx, ty, 10, 10, 45, 360);
				
			}
			else
				g.fillArc(tx, ty, 5, 5, 45, 360);
			
		}
	}

	private void PaintStatusBar(Graphics g, int iTimeCount) 
	{
		String strV;
		int xPos;
		
		try 
		{

			if (iTimeCount > 12) 
			{
				timeFlag = true;
				return;
			}

			
			g.drawImage(start, 0, 113, Graphics.LEFT | Graphics.TOP);
			
			
			g.setColor(24,142,24);
			xPos = 20 + 52 - (iTimeCount * 4);
			g.drawRect(xPos,113 + 4 ,iTimeCount * 4,4);
			g.fillRect(xPos,113 + 4,iTimeCount * 4,4);
			
			
			g.setColor(0, 0, 255);
			
			strV = String.valueOf(value);

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
艳妇臀荡乳欲伦亚洲一区| 亚洲欧美视频在线观看| 欧美一区二区免费观在线| 欧美三级日韩三级国产三级| 91丨porny丨户外露出| 成人av集中营| 色综合色综合色综合| 欧美性猛交xxxxxx富婆| 欧美视频一区在线| 欧美日韩久久久久久| 欧美日本韩国一区二区三区视频| 欧美乱妇23p| 91麻豆精品国产91久久久使用方法| 欧美视频一区在线观看| 91精品国产91综合久久蜜臀| 欧美一级欧美三级| 国产亚洲欧洲997久久综合| 国产精品美女久久久久高潮| 亚洲人妖av一区二区| 亚洲成av人片www| 九一久久久久久| 国产凹凸在线观看一区二区| 99久久99久久久精品齐齐| 色天天综合久久久久综合片| 欧美一区日韩一区| 中日韩av电影| 亚洲成人精品影院| 精品一区二区三区视频在线观看| 国产盗摄视频一区二区三区| 在线影视一区二区三区| 日韩欧美国产一区在线观看| 欧美国产日韩在线观看| 午夜视频一区在线观看| 国内精品第一页| 日本久久一区二区| xfplay精品久久| 一区二区理论电影在线观看| 国产一区二区在线观看视频| 91蝌蚪国产九色| 欧美电影免费观看高清完整版在 | 国产丝袜欧美中文另类| 一区二区三区影院| 久久99精品国产| 欧美日韩高清在线播放| 中文字幕中文乱码欧美一区二区| 香蕉成人伊视频在线观看| 成人中文字幕电影| 欧美一级生活片| 一区二区日韩电影| 97超碰欧美中文字幕| 精品成人在线观看| 午夜精品国产更新| 91麻豆自制传媒国产之光| 欧美大片日本大片免费观看| 一区二区三区四区在线| 不卡在线观看av| 2020国产成人综合网| 视频在线观看国产精品| 欧美亚洲高清一区| 中文字幕欧美日韩一区| 国产一区在线看| 欧美一级片在线观看| 亚洲mv在线观看| 欧美在线看片a免费观看| 国产精品对白交换视频 | 一区二区三区小说| av欧美精品.com| 欧美国产日韩一二三区| 国产伦精品一区二区三区免费迷 | 成人免费高清视频在线观看| 精品精品欲导航| 美女一区二区视频| 欧美精品久久99久久在免费线| 亚洲在线一区二区三区| 91日韩精品一区| 亚洲欧美视频在线观看| 91久久人澡人人添人人爽欧美| 日韩毛片在线免费观看| 本田岬高潮一区二区三区| 国产精品久久久久永久免费观看 | 国产a级毛片一区| 国产精品亲子乱子伦xxxx裸| 成人av网站在线观看| 亚洲欧洲美洲综合色网| 91美女在线观看| 天天影视涩香欲综合网| 日韩视频在线你懂得| 久久精品国产一区二区三| 久久一留热品黄| www.综合网.com| 亚洲美女免费在线| 91精品久久久久久久久99蜜臂| 裸体一区二区三区| 国产亚洲精品福利| 91老师片黄在线观看| 午夜精品aaa| 久久久久青草大香线综合精品| 成人白浆超碰人人人人| 亚洲国产精品久久久久婷婷884 | 国产福利精品一区二区| 亚洲图片激情小说| 欧美精品乱码久久久久久| 久久丁香综合五月国产三级网站 | 欧美色图免费看| 激情综合色播激情啊| 亚洲男帅同性gay1069| 在线综合+亚洲+欧美中文字幕| 久久99热这里只有精品| 亚洲免费电影在线| 日韩欧美一区在线观看| 丰满放荡岳乱妇91ww| 亚洲国产成人av网| 欧美经典一区二区三区| 欧美一a一片一级一片| 激情国产一区二区| 亚洲图片一区二区| 国产农村妇女精品| 91精品国产欧美日韩| 91蜜桃免费观看视频| 国产精一区二区三区| 天天操天天综合网| 亚洲免费视频中文字幕| 亚洲精品一区二区三区在线观看| 色婷婷综合激情| 成人激情视频网站| 国产综合色产在线精品| 亚洲一卡二卡三卡四卡五卡| 国产精品麻豆网站| 久久久不卡网国产精品二区| 欧美午夜一区二区三区免费大片| 成人一区二区三区视频在线观看| 麻豆免费精品视频| 首页国产欧美久久| 亚洲国产精品一区二区www | 日韩国产成人精品| 一区二区国产视频| 亚洲男人的天堂在线观看| 中文一区在线播放| 国产婷婷色一区二区三区四区| 日韩午夜av电影| 91精品国产91热久久久做人人| 欧美影院午夜播放| 欧美在线视频你懂得| 99久精品国产| 91亚洲国产成人精品一区二区三 | 亚洲精品国产高清久久伦理二区| 中文字幕的久久| 国产清纯白嫩初高生在线观看91 | 日韩在线卡一卡二| 偷拍亚洲欧洲综合| 亚洲一区二区av在线| 亚洲一区二区三区视频在线| 亚洲一区二区影院| 亚洲制服丝袜一区| 日韩av网站在线观看| 日韩电影在线免费观看| 日本在线播放一区二区三区| 日韩电影在线看| 美腿丝袜在线亚洲一区| 久久99国产精品成人| 韩国v欧美v亚洲v日本v| 成人免费三级在线| 色婷婷激情综合| 欧美日韩国产高清一区二区| 欧美一级欧美三级在线观看| 日韩精品中文字幕一区二区三区| 26uuu另类欧美亚洲曰本| 亚洲国产成人自拍| 一区二区三区精密机械公司| 亚洲成人午夜影院| 国产在线视频不卡二| www.欧美色图| 欧美精品久久天天躁| 久久久久久免费网| 亚洲卡通动漫在线| 日韩av成人高清| 不卡视频一二三四| 欧美日韩精品免费| 欧美激情综合五月色丁香| 亚洲一区二区三区激情| 国内国产精品久久| 欧美自拍偷拍午夜视频| 欧美成人激情免费网| 亚洲卡通欧美制服中文| 久久国产福利国产秒拍| 色婷婷亚洲精品| 久久综合久久鬼色中文字| 一区二区三区在线视频观看| 久久国产综合精品| 在线一区二区三区做爰视频网站| 欧美xxxxxxxx| 亚洲成人在线网站| thepron国产精品| 欧美成人bangbros| 亚洲一区二区三区小说| 国产成人午夜精品影院观看视频| 欧美色国产精品| 亚洲婷婷在线视频| 国产成人午夜电影网| 日韩一区二区在线免费观看|