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

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

?? map類的源代碼.txt

?? 連連看游戲的程序
?? 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一区二区三区免费野_久草精品视频
美女诱惑一区二区| 中文字幕中文在线不卡住| 久久久精品欧美丰满| 国产女人aaa级久久久级| 国产精品女主播av| 亚洲一级片在线观看| 午夜欧美在线一二页| 国产在线一区观看| 91一区二区在线观看| 欧美一级一区二区| 日本一区二区三级电影在线观看| 亚洲美女视频在线| 美国毛片一区二区| av成人免费在线| 欧美一卡二卡在线观看| 亚洲欧洲日产国码二区| 奇米影视7777精品一区二区| 国产999精品久久久久久绿帽| 欧美日韩在线一区二区| 国产网红主播福利一区二区| 亚洲午夜激情av| 国产精品一区专区| 欧美福利视频一区| 国产精品成人在线观看| 麻豆一区二区三| 一本大道久久精品懂色aⅴ | 亚洲女人小视频在线观看| 日本在线不卡一区| 99久久精品免费看| 亚洲精品一区二区三区蜜桃下载 | 在线视频欧美区| 久久久精品一品道一区| 午夜精品一区在线观看| 99久久亚洲一区二区三区青草| 欧美电影一区二区三区| 中文字幕一区二区三区在线播放| 蜜桃久久av一区| 91福利在线播放| 国产精品免费aⅴ片在线观看| 日本人妖一区二区| 欧洲精品在线观看| 国产精品福利一区二区| 久久av老司机精品网站导航| 欧美视频日韩视频| 国产精品初高中害羞小美女文| 国产专区综合网| 911精品国产一区二区在线| 亚洲欧美日韩系列| 成人a级免费电影| 久久久久国产精品厨房| 蜜臂av日日欢夜夜爽一区| 亚洲欧洲综合另类| 激情欧美一区二区| 日韩视频一区二区三区| 亚洲a一区二区| 色噜噜久久综合| 亚洲天堂av老司机| 成人黄色av电影| 中文av字幕一区| 国产成人免费9x9x人网站视频| 精品噜噜噜噜久久久久久久久试看 | 日韩制服丝袜av| 欧美色图激情小说| 一区二区三区久久久| 色综合中文字幕| 亚洲精品视频一区| 91美女片黄在线观看| 国产精品二三区| 91影院在线观看| 最新久久zyz资源站| 波多野结衣在线一区| 国产日韩欧美一区二区三区综合| 国产成人超碰人人澡人人澡| 久久综合色天天久久综合图片| 久久99国产精品成人| 精品88久久久久88久久久 | 久久久久国产免费免费| 国产精品123| 国产精品久线在线观看| 成人激情图片网| 国产精品午夜久久| av亚洲精华国产精华精华| ㊣最新国产の精品bt伙计久久| 成人精品视频网站| 亚洲日本在线看| 欧美综合在线视频| 日韩精品视频网| 欧美成人r级一区二区三区| 国产一区二区女| 中日韩av电影| 欧美性猛交xxxxxx富婆| 日韩电影在线看| 精品国产乱码久久久久久影片| 国产毛片一区二区| 国产精品国产馆在线真实露脸 | 亚洲成人免费在线观看| 91精品国产麻豆国产自产在线 | 欧美成人一区二区| 国产精品影音先锋| 亚洲人成亚洲人成在线观看图片 | 一区二区三区 在线观看视频| 在线观看欧美黄色| 欧美aaaaa成人免费观看视频| 26uuu国产电影一区二区| 福利一区二区在线| 一区二区三区小说| 日韩无一区二区| 国产成人综合精品三级| 日韩伦理av电影| 9191成人精品久久| 国产亚洲精品资源在线26u| 不卡一区二区三区四区| 亚洲一区二区成人在线观看| 欧美成人三级电影在线| aaa欧美色吧激情视频| 无码av中文一区二区三区桃花岛| 久久综合资源网| 91蜜桃视频在线| 久久99深爱久久99精品| 亚洲女子a中天字幕| 精品久久久久一区| 99vv1com这只有精品| 日韩av一区二区三区四区| 欧美激情一区二区三区| 欧美日韩一区二区三区不卡| 狠狠色综合色综合网络| 亚洲精品一二三四区| 欧美大肚乱孕交hd孕妇| 91丨porny丨最新| 久久99在线观看| 亚洲五码中文字幕| 国产亚洲精品精华液| 欧美精品久久99| 99国产精品99久久久久久| 精品一区在线看| 一区二区三区电影在线播| 久久综合久久综合亚洲| 91豆麻精品91久久久久久| 国产乱子伦视频一区二区三区| 亚洲午夜视频在线| 国产拍揄自揄精品视频麻豆| 欧美日韩一区三区| 成人久久18免费网站麻豆 | 欧美一区二区三区免费大片| 国产 欧美在线| 美脚の诱脚舐め脚责91| 夜色激情一区二区| 亚洲国产精华液网站w| 欧美一区在线视频| 91蝌蚪国产九色| 国产福利视频一区二区三区| 丝袜美腿亚洲一区| 色先锋久久av资源部| 国产成人精品免费视频网站| 日韩精品成人一区二区在线| 亚洲三级理论片| 欧美激情一区二区三区在线| 日韩三级精品电影久久久| 欧美日韩一区二区三区四区五区| 成人黄色软件下载| 国产成人精品在线看| 国产在线不卡一卡二卡三卡四卡| 日日夜夜精品视频免费| 亚洲天堂中文字幕| 中文字幕中文在线不卡住| 国产拍欧美日韩视频二区| 精品国产三级a在线观看| 91精品在线免费| 欧美裸体bbwbbwbbw| 欧美综合色免费| 色偷偷成人一区二区三区91| 91在线你懂得| 91麻豆自制传媒国产之光| 成人污污视频在线观看| 国产99精品在线观看| 国产成人在线看| 国产精品123区| 国产成人免费视频一区| 国产91清纯白嫩初高中在线观看| 国产精品中文字幕日韩精品| 国产精品一区二区久激情瑜伽| 精品一区免费av| 国产精品一二三四区| 国产超碰在线一区| 成人免费毛片高清视频| 成人综合在线观看| 99在线精品一区二区三区| 91影视在线播放| 欧美在线播放高清精品| 色网站国产精品| 日韩av电影天堂| 一区二区三区小说| 中文字幕中文乱码欧美一区二区| 日韩精品专区在线| 欧美高清激情brazzers| 99精品1区2区| 色吊一区二区三区| 欧美日韩综合在线| 91精品国产高清一区二区三区 | 一区二区三区中文字幕电影|