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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? gameframe.java

?? java編的俄羅斯方塊
?? JAVA
?? 第 1 頁 / 共 3 頁
字號(hào):
package RussiaBlock;/** * <p>Title: RussionBlock</p> * <p>Description: TheSmallGame</p> * <p>Copyright: Copyright (c) 2002</p> * @author sunwei * @version 1.0 */import java.awt.*;import java.awt.event.*;import java.applet.*;class GameFrame extends Frame implements ActionListener,ItemListener{   //游戲框架			    MenuBar m_MenuBar;		Menu m_speed,m_height,m_music;		Menu m_play,m_option,m_about;		MenuItem mi_start,mi_hero,mi_pause,mi_close;		MenuItem mi_setkey;		MenuItem mi_about,mi_readme;		CheckboxMenuItem mi_speed[] = new CheckboxMenuItem[10],		                 mi_height[] = new CheckboxMenuItem[10],		                 mi_bgmusic,mi_sound;		Dialog helpDialog; 		Button btnY;		GameCanvas gameCanvas;		String s[] = {"0","1","2","3","4","5","6","7","8","9"};		public GameFrame(){		super("俄羅斯方塊 V1.0 sunwei");		btnY = new Button("確定");		gameCanvas = new GameCanvas(this);gameCanvas.setSize(450,400);		add(gameCanvas);				m_MenuBar = new MenuBar();		m_play = new Menu("游戲");		mi_start = new MenuItem("新游戲");		mi_pause = new MenuItem("暫停游戲");		mi_hero = new MenuItem("英雄榜");		mi_close = new MenuItem("退出");		mi_pause.disable();		m_play.add(mi_start);		m_play.add(mi_pause);		m_play.addSeparator();		m_play.add(mi_hero);		m_play.addSeparator();		m_play.add(mi_close);		m_MenuBar.add(m_play);		mi_start.addActionListener(this);		mi_hero.addActionListener(this);		mi_pause.addActionListener(this);		mi_close.addActionListener(this);		m_option = new Menu("選項(xiàng)");		m_speed = new Menu("速度設(shè)置");		m_height = new Menu("高度設(shè)置");		mi_setkey = new MenuItem("鍵盤設(shè)置");		m_music = new Menu("音效設(shè)置");		mi_bgmusic = new CheckboxMenuItem("聲音");		mi_sound = new CheckboxMenuItem("音樂");		for(int i = 0; i<mi_speed.length;i++){			mi_speed[i] = new CheckboxMenuItem(s[i]);			mi_height[i] = new CheckboxMenuItem(s[i]);			m_speed.add(mi_speed[i]);			m_height.add(mi_height[i]);			mi_speed[i].addItemListener(this);			m_height.add(mi_height[i]);			mi_height[i].addItemListener(this);					}		mi_speed[0].setState(true);		mi_height[0].setState(true);		mi_bgmusic.setState(true);		mi_sound.setState(true);		m_option.add(m_speed);		m_option.add(m_height);		m_option.addSeparator();		m_option.add(m_music);		m_option.addSeparator();		m_option.add(mi_setkey);		m_music.add(mi_bgmusic);		m_music.add(mi_sound);		m_MenuBar.add(m_option);		mi_bgmusic.addActionListener(this);		mi_sound.addActionListener(this);		mi_setkey.addActionListener(this);				m_about=new Menu("幫助");		mi_readme = new MenuItem("幫助");		mi_about=new MenuItem("關(guān)于...");		m_about.add(mi_readme);		m_about.addSeparator();		m_about.add(mi_about);		m_MenuBar.add(m_about);		mi_about.addActionListener(this);		mi_readme.addActionListener(this);		this.setMenuBar(m_MenuBar);		btnY.addActionListener(this);        this.addWindowListener(new WindowAdapter(){	               public void windowClosing(WindowEvent e){	                         ((Frame)e.getWindow()).dispose();	                          gameCanvas.getThread().stop();                              System.exit(0);	                }		 });	}	public void actionPerformed(ActionEvent e){            //加入菜單的動(dòng)作		if(e.getSource() == mi_start){		   mi_pause.enable();		   if(!gameCanvas.getThread().isAlive()){			  gameCanvas.getThread().start();			  gameCanvas.reset();		    }		   else gameCanvas.reset();		 }else 		if(e.getSource() == mi_pause){		   if(gameCanvas.getPause()==true){			  gameCanvas.setPause(false);			  mi_pause.setLabel("繼續(xù)游戲");		    }else{ 		      gameCanvas.setPause(true);			  mi_pause.setLabel("暫停游戲");			}		 }else 		if(e.getSource() == mi_hero){		   BlockDialog heroDialog = new BlockDialog(this,"英雄榜",false);		   heroDialog.setBounds(200,150,270,260);		   heroDialog.show();		 }else 		if(e.getSource() == mi_close){		   gameCanvas.getThread().stop();		   this.dispose();		   System.exit(0);		 }else 		if(e.getSource() == mi_setkey){		   SetDialog setDialog = new SetDialog(this,"鍵盤設(shè)定",true);		   setDialog.setBounds(200,150,330,220);		   setDialog.show();		 }else 		if(e.getSource() == mi_about){		   helpDialog=new Dialog(this,"關(guān)于",false);		   Panel p1=new Panel();		   Panel p3=new Panel();		   p1.add(new Label("俄羅斯方塊 v1.0  作者:sunwei"));		   p3.add(new Label("謝謝使用!"));		   helpDialog.add("North",p1);		   helpDialog.add("Center",p3);		   Panel p2 = new Panel();		   p2.add(btnY);		   helpDialog.add("South",p2);		   helpDialog.setSize(300,200);		   helpDialog.setBounds(200,150,200,130);		   helpDialog.show();           helpDialog.addWindowListener(new WindowAdapter() {	               public void windowClosing(WindowEvent e) {	                                 helpDialog.dispose();	               }			});		 }else 		if(e.getSource() == btnY){		   helpDialog.dispose();		}	}	public void itemStateChanged(ItemEvent e){          		int i,j;		for(i = 0; i < mi_speed.length; i++){		    if(e.getSource() == mi_speed[i]){         //設(shè)置速度		       for(j = 0; j < mi_speed.length; j++)		           mi_speed[j].setState(false);		       mi_speed[i].setState(true);		       gameCanvas.setSpeed(i);		       break;		    }		  }		 for(i = 0; i < mi_height.length; i++){		    if(e.getSource() == mi_height[i]){         //設(shè)置高度		       for(j = 0; j < mi_height.length; j++)		           mi_height[j].setState(false);		       mi_height[i].setState(true);		       gameCanvas.setHeight(i);		       break;	         }	      }	}} class Block{   //方塊類    		private int cubeEach = 4;                          //小方塊的個(gè)數(shù)	private int cubeKind = 7;                           //大方塊的種類	private int cubeWidth = 20;                           //小方塊的寬	private int cubeHeight = 20;                            //小方塊的高	private int bgX = 200,bgY = 50;                          //背景起始位置	private int currentX = 4,currentY = 0;                    //大方塊起始位置	private int bgWidth = 11,bgHeight = 19;                       //背景寬和高	public byte[][] bgInformation = new byte[this.getbgWidth()][this.getbgHeight()];      private byte[][]                                              //保存背景信息的數(shù)組        line = new byte[][]{        	{1, 1, 1, 1},			{0, 0, 0, 0},			{0, 0, 0, 0},			{0, 0, 0, 0}		},	    square = new byte[][]{			{1, 1, 0, 0},			{1, 1, 0, 0},			{0, 0, 0, 0},			{0, 0, 0, 0}		},		l = new byte[][]{			{1, 1, 1, 0},			{1, 0, 0, 0},			{0, 0, 0, 0},			{0, 0, 0, 0}		},		turnL = new byte[][]{			{1, 1, 1, 0},			{0, 0, 1, 0},			{0, 0, 0, 0},			{0, 0, 0, 0}		},		s = new byte[][]{			{1, 1, 0, 0},			{0, 1, 1, 0},			{0, 0, 0, 0},			{0, 0, 0, 0}		},		turnS = new byte[][]{			{0, 1, 1, 0},			{1, 1, 0, 0},			{0, 0, 0, 0},			{0, 0, 0, 0}		},		t = new byte[][]{			{0, 1, 0, 0},			{1, 1, 1, 0},			{0, 0, 0, 0},			{0, 0, 0, 0}		},		currentBlock = new byte[][]{			{0, 0, 0, 0},			{0, 0, 0, 0},			{0, 0, 0, 0},			{0, 0, 0, 0}		},		nextBlock = new byte[][]{			{0, 0, 0, 0},			{0, 0, 0, 0},			{0, 0, 0, 0},			{0, 0, 0, 0}		};    private Color currentBlockColor,nextBlockColor;              //保存顏色變量	private byte[][][] cube = new byte [][][]{ line,square,l,turnL,s,turnS,t };	private Color colors[] = { Color.red,Color.orange,Color.gray,Color.green,                               Color.blue,Color.pink,Color.magenta,Color.white };                                   /* 以下是方塊的方法 */    public int getBGX()       { return this.bgX;       }	public int getBGY()       {	return this.bgY;       }	public int getbgWidth()   { return this.bgWidth;   } 	public int getbgHeight()  { return this.bgHeight;  }	public int getCubeKind()  { return this.cubeKind;  }	public int getCubeEach()  { return this.cubeEach;  }                         		public int getCubeWidth() { return this.cubeWidth; }	public int getCubeHeight(){ return this.cubeHeight;}	public int getCurrentX()  { return this.currentX;  }	public int getCurrentY()  { return this.currentY;  }	public void setCurrentXY(int x,int y){ this.currentX = x; this.currentY = y;}	public Color getCurrentBlockColor(){ return this.currentBlockColor; }	public Color getNextBlockColor(){ return this.nextBlockColor; }	public byte[][] getCurrentBlock(){ return this.currentBlock; }	public byte[][] getNextBlock(){ return this.nextBlock; }		/* 以下是方塊的動(dòng)作 */	public void reset(){                                     		int random = (int)(Math.random()*7);		this.currentBlock = this.cube[random];		this.currentBlockColor = this.colors[random];	}	public void setNextBlock(){		int random = (int)(Math.random()*7);	    this.nextBlock = this.cube[random];	    this.nextBlockColor = this.colors[random];	}	public void setCurrentBlock(){		this.currentBlock = this.nextBlock;		this.currentBlockColor = this.nextBlockColor;	}	public boolean goLeft(){		if(this.isBound(this.currentX - 1, this.currentY, this.getCurrentBlock())){		   this.currentX--;return true;		}		else return false;	}	public boolean goRight(){		if(this.isBound(this.currentX + 1, this.currentY, this.getCurrentBlock())){		   this.currentX++;return true;		}		else return false;	}	public boolean goDown(){		if(this.isBound(this.currentX, this.currentY + 1, this.getCurrentBlock())){		   this.currentY++;return true;		}		else return false;	}	public boolean goTurn(){		if(this.isBound(this.currentX,this.currentY,this.getTurnBlock())){		   currentBlock = this.getTurnBlock();		   return true;		}		else for(int i = 1; i<4; i++)		         if(this.isBound(this.currentX - i,this.currentY,this.getTurnBlock())){			        this.currentX = this.currentX - i;			        currentBlock = this.getTurnBlock();			        return true;		          }		 return false;	}		/* 獲得旋轉(zhuǎn)的方塊 */	public byte[][] getTurnBlock(){		byte[][] turnBlock = new byte[getCubeEach()][getCubeEach()];	    	boolean goReturn = false;	    	int x, y;	    	for(y = 0; y < getCubeEach(); y++){	    		for(x=0; x < getCubeEach(); x++)	    			turnBlock[getCubeEach()-1-x][y] = this.currentBlock[y][x]; 	    	}	    	for(y = 0; y < getCubeEach(); y++) {                        	    		for(x=0; x < getCubeEach(); x++)	    			if(turnBlock[y][x] == 1) {                                	    				goReturn = true;	    				break;	    			}	    		if(goReturn) break;	    	}	    	int temp = y;	    	for(; y < getCubeEach(); y++) {	                         	    		for(x=0; x < getCubeEach(); x++)	    			turnBlock[y-temp][x] = turnBlock[y][x];	    	}	    	for(y = getCubeEach()-temp; y < getCubeEach(); y++) {		    		for(x=0; x < getCubeEach(); x++)	    			turnBlock[y][x] = 0;	    	}	    	return turnBlock;	}		/* 判斷邊界 */	public boolean isBound(int locateX, int locateY, byte[][] block){		int tempx, tempy;		if((locateX >= 0)&&(locateX <= this.getbgWidth())&&(locateY >=0)&&(locateY < this.getbgHeight())) {				for(int x = 0; x < this.getCubeEach(); x++)				for(int y = 0; y < this.getCubeEach(); y++) {					tempx = locateX + x;					tempy = locateY + y;					if(block[y][x] == 1) {						if((tempx >= this.getbgWidth()) || (tempy >= this.getbgHeight()))							return false;						else if(block[y][x] == this.bgInformation[tempx][tempy])							return false;					}				}			return true;		} else				return false;	}		/* 刪行 */	public void delLine(int position){		int x,y;		if(position == 0){		   for(x = 0; x < this.getbgWidth(); x++)		       this.bgInformation[x][0] = 0;		}else { for(y = position; y > 0; y--)		           for(x = 0; x < this.getbgWidth(); x++)

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲色大成网站www久久九九| 亚洲不卡在线观看| 久久久www成人免费无遮挡大片| 91精品啪在线观看国产60岁| 日本精品裸体写真集在线观看| 91丨porny丨最新| 一区二区三区四区不卡视频| 成人免费在线播放视频| 国产精品久久久99| 国产精品久久777777| 中文字幕一区视频| 亚洲男同1069视频| 精品国产污网站| 久久久久国色av免费看影院| 国产丝袜欧美中文另类| 国产精品福利电影一区二区三区四区| 中文字幕不卡一区| 亚洲男同性恋视频| 爽好多水快深点欧美视频| 日本午夜精品视频在线观看 | 免费观看30秒视频久久| 亚洲高清不卡在线| 久久精品国产亚洲5555| 国产一区啦啦啦在线观看| 成人夜色视频网站在线观看| 99国产精品久久久| 欧美视频在线不卡| 精品美女在线观看| 国产精品网站在线观看| 亚洲精品成a人| 蜜臀av一区二区三区| 丁香桃色午夜亚洲一区二区三区| 91蜜桃网址入口| 狠狠色狠狠色综合| 成人app下载| 欧美无乱码久久久免费午夜一区| 日韩三级.com| 国产精品入口麻豆九色| 亚洲成人免费看| 国产综合久久久久久鬼色| 99久久综合国产精品| 欧美精品久久99久久在免费线 | 欧美日韩卡一卡二| 国产黄色精品视频| 欧美三区免费完整视频在线观看| 欧美一级欧美三级在线观看 | 精品一区中文字幕| 色综合色综合色综合| 日韩视频免费直播| 亚洲天堂免费在线观看视频| 日本三级亚洲精品| 91小视频免费看| 精品成人私密视频| 亚洲一卡二卡三卡四卡无卡久久 | 亚洲欧美一区二区三区久本道91| 日韩二区三区四区| av网站免费线看精品| 欧美精品v日韩精品v韩国精品v| 国产亚洲制服色| 偷偷要91色婷婷| av在线免费不卡| 精品福利一二区| 亚洲大尺度视频在线观看| 国产成人亚洲精品狼色在线| 欧美日韩在线播放三区| 欧美自拍偷拍一区| 国产精品蜜臀在线观看| 日韩成人免费看| 日本高清不卡一区| 中文字幕国产精品一区二区| 麻豆91在线观看| 欧美日韩视频一区二区| 中文字幕欧美一| 国产成人精品三级| 日韩欧美国产综合一区 | 精品福利一区二区三区免费视频| 亚洲精品国产a| 国产成人精品一区二| 欧美成人官网二区| 日韩电影一区二区三区| 色综合天天综合色综合av| 国产亚洲成aⅴ人片在线观看| 美女视频一区在线观看| 欧美日韩高清不卡| 亚洲午夜电影网| 色综合亚洲欧洲| 综合av第一页| 99视频热这里只有精品免费| 色婷婷香蕉在线一区二区| 国产精品久久久久一区| 国产精品白丝av| 久久久亚洲综合| 国产做a爰片久久毛片| 欧美成人激情免费网| 开心九九激情九九欧美日韩精美视频电影 | 国产不卡在线播放| 久久久久久亚洲综合| 久久精品噜噜噜成人av农村| 91精品国产色综合久久ai换脸| 五月天激情小说综合| 制服丝袜国产精品| 久久久精品免费观看| 国产一区啦啦啦在线观看| 久久精品亚洲一区二区三区浴池 | 欧美福利电影网| 日本在线不卡视频| 欧美一级片在线| 韩国av一区二区三区| 精品剧情在线观看| 国产美女一区二区三区| 久久久久综合网| 懂色av一区二区三区蜜臀| 中文字幕乱码久久午夜不卡| 成人综合婷婷国产精品久久蜜臀| 国产亚洲精品aa| 99久久精品国产毛片| 亚洲黄色小说网站| 欧美日韩精品欧美日韩精品一 | 国产又黄又大久久| 中文文精品字幕一区二区| 成人综合婷婷国产精品久久蜜臀| 日韩美女视频一区| 欧美三级日本三级少妇99| 亚洲成av人在线观看| 日韩女优视频免费观看| 国产福利一区二区三区在线视频| 国产精品乱码久久久久久| 欧美专区日韩专区| 蜜桃久久久久久久| 国产欧美日韩激情| 色婷婷综合中文久久一本| 亚洲超碰精品一区二区| 日韩欧美电影一区| 成人精品gif动图一区| 亚洲黄色免费电影| 91精品国产综合久久久蜜臀图片 | 欧美在线小视频| 麻豆免费看一区二区三区| 久久久久久久精| 色婷婷国产精品久久包臀| 石原莉奈在线亚洲二区| 国产色一区二区| 日本久久精品电影| 久久精品999| 亚洲欧美日韩国产手机在线 | 99re热这里只有精品免费视频| 午夜亚洲福利老司机| 久久久久99精品一区| 欧美午夜一区二区三区 | av在线综合网| 免费av成人在线| 国产精品久久久久久久久久久免费看| 欧美三级视频在线| 粉嫩aⅴ一区二区三区四区五区| 亚洲综合自拍偷拍| 久久综合999| 欧美午夜免费电影| 大胆欧美人体老妇| 日韩二区在线观看| 亚洲精选免费视频| 91原创在线视频| 国内精品伊人久久久久av影院 | 美女网站色91| 亚洲一区二区在线视频| 亚洲国产精品99久久久久久久久 | 亚洲男同1069视频| 精品国精品自拍自在线| 欧美亚洲一区二区在线| 成人久久18免费网站麻豆 | 国产精品国模大尺度视频| 4438成人网| 色综合久久中文字幕| 国产精品一区二区三区网站| 性做久久久久久久免费看| 日韩美女视频19| 国产欧美日韩综合精品一区二区| 欧美乱妇23p| 在线亚洲+欧美+日本专区| 国产91精品精华液一区二区三区| 日韩精品久久理论片| 亚洲综合男人的天堂| 国产精品久久久久久久久久久免费看 | 丁香天五香天堂综合| 久99久精品视频免费观看| 亚洲成人7777| 亚洲午夜精品17c| 亚洲婷婷综合色高清在线| 久久久久综合网| 精品剧情在线观看| 日韩一区和二区| 欧美人牲a欧美精品| 欧洲国内综合视频| 色综合天天综合网国产成人综合天 | 精品一区二区免费视频| 亚洲v日本v欧美v久久精品| 亚洲色图色小说| 亚洲日本欧美天堂| 国产精品久久毛片av大全日韩| 精品国产免费人成电影在线观看四季 | 欧美日韩国产免费一区二区 |