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

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

?? sliding block.txt

?? 5個用java編寫的小游戲源碼
?? TXT
?? 第 1 頁 / 共 3 頁
字號:
					(offyy==originalY)) {
				redoLimit = originalRedoLimit;
				if (historyCount<redoLimit)
					slide.redoButton.enable();
			} else {
				slide.redoButton.disable();
			}
			pointHistory[historyCount-1].x = offxx;
			pointHistory[historyCount-1].y = offyy;
			pieceHistory[historyCount-1] = currentPiece;
		} 
		else if(offx!=0 || offy!=0) {
			System.out.println("Move " + String.valueOf(step+1) + ": " + 
					currentPiece.cid+
					", "+String.valueOf(offx)+","+
					String.valueOf(offy));

			originalRedoLimit = 0;
			if (historyCount<redoLimit)
				if (pieceHistory[historyCount].cid==currentPiece.cid) {
					// save information about now-current move 
					// for future reinstatement of forward history
					originalRedoLimit = redoLimit;
					originalX = pointHistory[historyCount].x;
					originalY = pointHistory[historyCount].y;
				}
			pieceHistory[historyCount] = currentPiece;
			pointHistory[historyCount++] = new Point(offx,offy);
			redoLimit = historyCount;

			slide.backButton.enable();
			slide.redoButton.disable();
			reduceHistory();
			step++;
			slide.showcounter();
		}

		if (isSolution()) {
			System.out.println("SOLUTION - "+String.valueOf(step));
			if (step>minStep && minStep>0)
				slide.showMsg("Done!");
			if (minStep==0)
				slide.showMsg("Done - please report results!");
			if (step==minStep)
				slide.showMsg("Complete with minimum moves!!");
			if (step<minStep)
				slide.showMsg("Minimum IMPROVED!!!");
		}

		borderpaint(slide.getGraphics());

		currentPiece = null;
		if(dPoint.x!=offx*unit || dPoint.y!=offy*unit)
			slide.sound.play();
		painting = false;
	}

	//----------------------------------------------------------------
	public void backHistory(){
		if(dragFlag) return;
		if(historyCount <= 0) return;
		Point p = pointHistory[--historyCount];
		pieceHistory[historyCount].move(-p.x,-p.y);
		slide.paint(slide.getGraphics());
		slide.sound.play();
		step--;
		slide.showcounter();
		System.out.println("Back " + String.valueOf(step+1) + ": "+
				pieceHistory[historyCount].cid+", "+
				String.valueOf(-p.x)+", "+String.valueOf(-p.y));
		slide.redoButton.enable();
		if (historyCount==0) slide.backButton.disable();

		originalRedoLimit = 0;
	}

	//----------------------------------------------------------------
	public void forwardHistory(){
		if(dragFlag) return;
		if(historyCount == redoLimit) return;
		Point p = pointHistory[historyCount];
		System.out.println("Forward " + String.valueOf(step+1) + ": " + 
				pieceHistory[historyCount].cid+", "+
				String.valueOf(p.x)+", "+String.valueOf(p.y));
		pieceHistory[historyCount++].move(p.x,p.y);
		slide.paint(slide.getGraphics());
		slide.sound.play();
		step++;
		slide.showcounter();
		slide.backButton.enable();
		if (historyCount == redoLimit) slide.redoButton.disable();

		originalRedoLimit = 0;
	}

	//----------------------------------------------------------------
	private void reduceHistory(){
		if(historyCount >= maxHistory){
			System.out.println("Reduce history");
			int i=0;
			for(int j=maxHistory/2; j<maxHistory; i++,j++){
				pieceHistory[i] = pieceHistory[j];
				pointHistory[i] = pointHistory[j];
			}
			historyCount = i;
			redoLimit = i;
		}
	}

	//----------------------------------------------------------------
	private boolean isSolution(){
		char c;
		for (int j=0;j<ay;++j) for (int i=0;i<ax;++i) {
			c = targetBlocks[i][j].charAt(0);
			if (c=='.' || c=='#') continue;
			if (blocks[i][j] == null) return false;
			if (targetBlocks[i][j].indexOf(blocks[i][j].piece.cid) >= 0)
				continue;
			return false;
		}
		return true;
	}

	//----------------------------------------------------------------
	public void setBlockShape(){
		for(int j=ay;--j>=0;) for(int i=ax;--i>=0;) {
			Block bk = null;
			char c = '.';
			try{
				bk = blocks[i][j];
				c = bk.piece.cid;
			} catch( Exception e ){ continue; }
			try{
				if(blocks[i-1][j].piece.cid==c) bk.linkW=true;
			} catch( Exception e ){}
			try{
				if(blocks[i+1][j].piece.cid==c) bk.linkE=true;
			} catch( Exception e ){}
			try{
				if(blocks[i][j-1].piece.cid==c) bk.linkN=true;
			} catch( Exception e ){}
			try{
				if(blocks[i][j+1].piece.cid==c) bk.linkS=true;
			} catch( Exception e ){}
		}
	}

	//----------------------------------------------------------------
	public boolean isinside(int xx, int yy) {
		if( xx < 0 || xx >= ax )
			return false;
		if( yy < 0 || yy >= ay )
			return false;
		Block blk = blocks[xx][yy];
		if( blk != null && blk.outside)
			return false;
		return true;
	}

	//----------------------------------------------------------------
	// returns true if is a blocking block
	public boolean isblocking(int xx, int yy) {
		if( xx < 0 || xx >= ax )
			return false;
		if( yy < 0 || yy >= ay )
			return false;
		Block blk = blocks[xx][yy];
		if( blk != null && blk.outside)
			return true;
		return false;
	}

	private void borderpaint(Graphics g){
		int thick = 4;
		int bWidth;
		int nwDelta[],swDelta[],neDelta[],seDelta[];
		Color borderColor;

		if (isSolution()) {
			borderColor = slide.msgcolor;
			bWidth = thick;
		} else {
			borderColor = slide.shadowDark;
			bWidth = 1;
		}
		nwDelta = new int[thick+1];
		swDelta = new int[thick+1];
		neDelta = new int[thick+1];
		seDelta = new int[thick+1];
		
		for(int j=ay;--j>=0;){
			int y0 = y + unit*j;
			for(int i=ax;--i>=0;){
				int x0 = x + unit*i;
				if( ! isinside(i,j) ) {
					continue;
				}
				for (int b=0;b<=thick;b++) 
					nwDelta[b]=swDelta[b]=neDelta[b]=seDelta[b] = b+1;
				if (isinside(i-1,j-1)) 
					for (int b=0;b<=thick;b++) nwDelta[b] = 1-nwDelta[b];
				if (isinside(i-1,j+1)) 
					for (int b=0;b<=thick;b++) swDelta[b] = 1-swDelta[b];
				if (isinside(i+1,j-1)) 
					for (int b=0;b<=thick;b++) neDelta[b] = 1-neDelta[b];
				if (isinside(i+1,j+1)) 
					for (int b=0;b<=thick;b++) seDelta[b] = 1-seDelta[b];

				if( ! isinside(i-1,j) ) { 
					for (int b=0;b<=thick;b++) {
						if (b==0)
							g.setColor(slide.shadowLight);
						else if (b>bWidth)
							g.setColor(slide.backcolor);
						else
							g.setColor(borderColor);
						g.drawLine(x0-b-1,y0-nwDelta[b],
								x0-b-1,y0+unit-1+swDelta[b]);
					}
				}
				if( ! isinside(i+1,j) ) { 
					for (int b=0;b<=thick;b++) {
						if (b==0)
							g.setColor(slide.shadowLight);
						else if (b>bWidth)
							g.setColor(slide.backcolor);
						else
							g.setColor(borderColor);
						g.drawLine(x0+unit+b,y0-neDelta[b],
								x0+unit+b,y0+unit-1+seDelta[b]);
					}
				}
				if( ! isinside(i,j-1) ) { 
					for (int b=0;b<=thick;b++) {
						if (b==0)
							g.setColor(slide.shadowLight);
						else if (b>bWidth)
							g.setColor(slide.backcolor);
						else
							g.setColor(borderColor);
						g.drawLine(x0-nwDelta[b],y0-1-b,
								x0+unit-1+neDelta[b],y0-1-b);
					}
				}
				if( ! isinside(i,j+1) ) { 
					for (int b=0;b<=thick;b++) {
						if (b==0)
							g.setColor(slide.shadowLight);
						else if (b>bWidth)
							g.setColor(slide.backcolor);
						else
							g.setColor(borderColor);
						g.drawLine(x0-swDelta[b],y0+unit+b,
								x0+unit-1+seDelta[b],y0+unit+b);
					}
				}
			}
		}
		for(int j=ay;--j>=0;){
			int y0 = y + unit*j;

			for(int i=ax;--i>=0;){
				int x0 = x + unit*i;
				if( isblocking(i,j) ) {
					Block blk = blocks[i][j];
					if( blk.image != null) {
						boolean flg = g.drawImage(blk.image, 
							x0, y0, blk.width*unit*blk.wFactor, 
							blk.height*unit*blk.hFactor, 
							slide.shadowLight, null);
					}
				}
			}
		}
	}

	//----------------------------------------------------------------
	public void paint(Graphics g){

		borderpaint( g);

//		g.setColor( slide.backcolor );
//		g.fillRect(x,y,width,height);

//		g.setColor( slide.shadowLight );
//		g.drawLine(x,y+height,x+width,y+height);
//		g.drawLine(x+width,y,x+width,y+height);
//		g.drawLine(x-1,y+height+1,x+width+1,y+height+1);
//		g.drawLine(x+width+1,y-1,x+width+1,y+height+1);
//		g.setColor( slide.shadowDark );
//		g.drawLine(x-1,y-1,x-1,y+height-1);
//		g.drawLine(x-1,y-1,x+width-1,y-1);
//		g.drawLine(x-2,y-2,x-2,y+height);
//		g.drawLine(x-2,y-2,x+width,y-2);

		for(int j=ay;--j>=0;){
			for(int i=ax;--i>=0;){
				Block blk = blocks[i][j];
				if( blk == null ) {
					g.setColor( slide.backcolor );
					g.fillRect(x+i*unit, y+j*unit, unit, unit);
				} else if( ! blk.outside ) {
					blk.paint(g);
				}
			}
		}
	}

	//----------------------------------------------------------------
	public void paintHint(Graphics g){
		char c;
		int hWidth = 4;

		if (hintBlocks==null) return;
		g.setColor( slide.hintcolor );
		for(int v=ax; --v>=0;){
			c = hintBlocks[v][0];
			if(c!='.' && c!='#'){
				g.fillRect(x+v*unit,y-10,unit,hWidth);
			}else{
				g.clearRect(x+v*unit,y-10,unit,hWidth);
			}
			c = hintBlocks[v][ay-1];
			if(c!='.' && c!='#'){
				g.fillRect(x+v*unit,y+height+(10-hWidth),unit,hWidth);
			}else{
				g.clearRect(x+v*unit,y+height+(10-hWidth),unit,hWidth);
			}
		}
		for(int w=ay; --w>=0;){
			c = hintBlocks[0][w];
			if(c!='.' && c!='#'){
				g.fillRect(x-10,y+w*unit,hWidth,unit);
			}else{
				g.clearRect(x-10,y+w*unit,hWidth,unit);
			}
			c = hintBlocks[ax-1][w];
			if(c!='.' && c!='#'){
				g.fillRect(x+width+(10-hWidth),y+w*unit,hWidth,unit);
			}else{
				g.clearRect(x+width+(10-hWidth),y+w*unit,hWidth,unit);
			}
		}
	}


	//----------------------------------------------------------------
	private	void loadData(String filename){
		URL		url;
		DataInputStream file;
		try {
			url = new URL( slide.getDocumentBase(), filename );
			System.out.println("Load: "+url);
			file = new DataInputStream( url.openStream() );
		} catch( MalformedURLException e ) {
			slide.showStatus( "file name error : " + filename );
			return;
		} catch( IOException e ) {
			slide.showStatus( "file open error : " + filename );
			return;
		}

		try {
			slide.nextfile = null;
			String line; 
			StringBuffer str = new StringBuffer("");
			int	y = 0;
			MediaTracker mTracker;
			mTracker = new MediaTracker(slide);

		    nextline:
			for(;;) {
				line=file.readLine();
				if( line == null )
					break;
				if( ';' == line.charAt(0) )
					continue;
//				System.out.println( "line:"+line );

				StringTokenizer st = new StringTokenizer(line);
				try {
					String tk = st.nextToken();
					if( tk.equals("size") ) {
						tk = st.nextToken();
						ax = (Integer.valueOf(tk)).
								intValue();
						tk = st.nextToken();
						ay = (Integer.valueOf(tk)).
								intValue();
//						System.out.println("\tboard size=" + String.valueOf(ax) + "," + String.valueOf(ay));
						blocks = new Block[ax][ay];
						targetBlocks = new String[ax][ay];
						continue nextline;
					}
					if (tk.equals("image") ) {
						tk = st.nextToken();
						int row = (Integer.valueOf(tk)).intValue();

						tk = st.nextToken();
						int col = (Integer.valueOf(tk)).intValue();
						
						tk = st.nextToken();
						blocks[col][row].image = 
							slide.getImage(slide.getCodeBase(),tk);

						tk = st.nextToken();
						blocks[col][row].hFactor = 
								(Integer.valueOf(tk)).intValue();

						tk = st.nextToken();
						blocks[col][row].wFactor = 
							(Integer.valueOf(tk)).intValue();
						
						mTracker.addImage(blocks[col][row].image,0,
							blocks[col][row].wFactor*unit,
							blocks[col][row].hFactor*unit);

						continue nextline;
					}
					if (tk.equals("label") ) {
						tk = st.nextToken();
						char x = tk.charAt(0);
						int k;
						for (k=piecen;--k>=0;) {
							if (pieces[k].cid == x) break;
						}
						tk = st.nextToken();
						if (k>=0)
							pieces[k].setLabel(tk);
						continue nextline;
					}
					if (tk.equals("labeloffset") ) {
						tk = st.nextToken();
						char x = tk.charAt(0);
						int k;
						for (k=piecen;--k>=0;) {
							if (pieces[k].cid == x) break;
						}
						tk = st.nextToken();
						int offsetX = (Integer.valueOf(tk)).intValue();
						tk = st.nextToken();
						int offsetY = (Integer.valueOf(tk)).intValue();
						if (k>=0)
							pieces[k].setLabelOffset(offsetX,offsetY);
						continue nextline;
					}
					if (tk.equals("color") ) {

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩伦理电影网| 国产日韩欧美电影| 日韩一区二区免费高清| 欧美情侣在线播放| 亚洲综合在线视频| 中文字幕欧美一| 亚洲猫色日本管| 亚洲成av人**亚洲成av**| 日本不卡一区二区三区| 久久99精品久久只有精品| 国产69精品久久久久777| 91在线视频网址| 精品视频一区二区不卡| 欧洲一区二区三区免费视频| 欧美不卡视频一区| 国产精品盗摄一区二区三区| 成人欧美一区二区三区| 亚洲小说欧美激情另类| 日本三级亚洲精品| 成人h动漫精品| 日韩精品在线一区| 中文字幕精品在线不卡| 天天综合色天天| 国产成人精品一区二区三区网站观看| 成人爽a毛片一区二区免费| 欧美亚洲国产怡红院影院| 久久婷婷一区二区三区| 午夜精品成人在线视频| 色又黄又爽网站www久久| 欧美精品一区二区三区蜜桃 | 国产亚洲一区二区三区在线观看| 亚洲一区二区三区四区五区中文 | 中文一区一区三区高中清不卡| 日韩av在线免费观看不卡| 91久久精品国产91性色tv| 日韩欧美二区三区| 视频一区欧美精品| 日韩欧美国产一区二区三区| 青青青爽久久午夜综合久久午夜 | 一区精品在线播放| 在线视频欧美区| 亚洲午夜精品17c| 欧美日韩一区久久| 午夜精品久久久久久久久久久| 欧美性欧美巨大黑白大战| 亚洲成在人线在线播放| 久久精品亚洲精品国产欧美| 国产精品自拍网站| 国产欧美久久久精品影院| 国产精品一区三区| 成人免费一区二区三区在线观看| 一本到不卡精品视频在线观看| 亚洲美女少妇撒尿| 欧美三级电影一区| 精品一二三四区| 久久久激情视频| 在线看国产一区| 久久丁香综合五月国产三级网站| 欧美mv日韩mv国产网站app| 国产美女精品在线| 中文字幕在线观看不卡| 欧美一区二区日韩一区二区| 国产精品影视在线观看| 亚洲一区二区三区四区在线| 精品国产露脸精彩对白| 欧美日韩aaaaaa| 国产麻豆视频一区| 日韩精品免费专区| 亚洲国产精品精华液ab| 精品国产乱子伦一区| 欧美视频在线观看一区二区| a在线播放不卡| 成人av在线观| eeuss鲁片一区二区三区在线观看 eeuss鲁片一区二区三区在线看 | 久久精品欧美一区二区三区不卡 | 日韩国产一区二| 天天综合天天做天天综合| 国产人成亚洲第一网站在线播放 | 久久福利视频一区二区| 免费成人你懂的| 久久狠狠亚洲综合| 久久成人精品无人区| 国产最新精品精品你懂的| 蜜桃av一区二区三区| 蜜桃视频在线观看一区二区| 免费观看30秒视频久久| 久久99蜜桃精品| 国产69精品久久99不卡| 国产原创一区二区| 久久激五月天综合精品| 九九国产精品视频| 国产成人综合在线| 成人免费毛片嘿嘿连载视频| 国产a精品视频| 99久久99久久综合| 日韩精品一二三区| 国产在线一区二区| 成人激情午夜影院| 欧美三级一区二区| 91精品国产综合久久久久| 678五月天丁香亚洲综合网| 欧美久久久久久久久| wwww国产精品欧美| 国产精品卡一卡二卡三| 亚洲一区二区三区中文字幕在线| 午夜激情久久久| 99国产精品视频免费观看| 91啪亚洲精品| 日韩一级大片在线| 洋洋av久久久久久久一区| 国产成人午夜精品5599| 91精品久久久久久久久99蜜臂| 国产性做久久久久久| 亚洲一区二区五区| youjizz国产精品| 日韩欧美黄色影院| 亚洲成av人综合在线观看| 国产寡妇亲子伦一区二区| 欧美日韩国产综合视频在线观看| 国产精品国产三级国产普通话蜜臀| 一区二区三区成人| 在线一区二区视频| 中文字幕欧美三区| 国产精品一二三四区| 这里只有精品免费| 一区二区三区日本| 欧美日韩国产a| 亚洲国产成人91porn| 99re成人精品视频| 久久久精品免费免费| 日韩精品一区第一页| 日韩欧美一区二区不卡| 中文字幕一区二区三区色视频 | 欧美aa在线视频| 欧美性感一区二区三区| 国产精品每日更新| 成人av在线网站| 国产精品电影一区二区| 色先锋资源久久综合| 精品国产乱码久久久久久久| 日本不卡1234视频| 884aa四虎影成人精品一区| 亚洲一区二区三区四区五区黄| 91久久香蕉国产日韩欧美9色| 中文字幕五月欧美| 91福利社在线观看| 免费在线观看成人| 国产精品嫩草影院av蜜臀| bt7086福利一区国产| 亚洲理论在线观看| 日韩一区和二区| 国产91精品一区二区麻豆亚洲| 亚洲成人动漫在线免费观看| 日韩精品一区二区三区四区视频 | 婷婷开心激情综合| 日韩欧美国产麻豆| 日本亚洲免费观看| 亚洲综合在线电影| 精品区一区二区| 色乱码一区二区三区88| 麻豆精品在线播放| 国产欧美一区在线| 宅男在线国产精品| 久久99精品一区二区三区| 亚洲视频小说图片| 欧美人妖巨大在线| 色噜噜狠狠色综合欧洲selulu| 经典三级视频一区| 亚洲在线视频网站| 国产精品天天摸av网| 欧美一级高清片| 欧美猛男男办公室激情| 91老司机福利 在线| 91丨国产丨九色丨pron| 国产精品一区二区果冻传媒| 日韩精品福利网| 天天亚洲美女在线视频| 亚洲免费观看视频| 国产精品免费视频一区| 久久久亚洲午夜电影| 精品国产一区二区亚洲人成毛片| 欧美精选午夜久久久乱码6080| 色综合网站在线| 色综合久久久久综合体| 欧美日韩一区二区三区四区五区 | 色综合久久中文字幕| 在线日韩一区二区| 91麻豆免费观看| 欧美日韩午夜在线| 精品va天堂亚洲国产| 国产精品每日更新在线播放网址| 国产婷婷色一区二区三区四区| 日韩美女天天操| 2023国产精品| 亚洲午夜精品久久久久久久久| 亚洲午夜久久久久久久久电影网| 麻豆91免费看| 一本久道中文字幕精品亚洲嫩| 欧美一级黄色大片| 久久久99精品免费观看|