freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

java掃雷游戲課程設(shè)計實訓(xùn)報告畢業(yè)論文-wenkub

2023-07-09 18:37:11 本頁面
 

【正文】 64。 public Panel MenuPamel = new Panel()。 //踩雷 public Icon icon_bomb_big = new ImageIcon()。/*窗口及算法實現(xiàn)類*/class MainBomb extends JFrame implements ActionListener,MouseListener{ public JTextField text。/*主類*/public class Main{ public static void main(String args[]) { (new MainBomb()).show()。:探雷標記。3負責創(chuàng)建游戲所需要的按鈕。1.。2.java源文件及其功能如表1所示。:地雷方塊上的圖標。二、詳細設(shè)計1.主類Main(1)成員變量(見表2)表2 成員變量描述變量類型備注游戲運行MainBomb臨時變量(2)成員變量(見表3)表3 名稱功能備注main游戲開始(3)import .*。 }}2.挖雷游戲 MainBomb(1)成員變量(見表4)表4成員變量描述變量類型名稱雷數(shù)設(shè)置JTextFieldtext當前方塊數(shù)intBlockNum當前雷數(shù)intBombNum開始JButtonstart踩雷Iconicon_bomb踩雷標記Iconicon_bomb_big雷標記Iconicon_flag疑惑是否有雷Iconicon_question目錄面板PanelMenuPamel主面板PanelmainPanel雷Bomb[][]bombButton該方塊是否有雷boolean周圍無雷方塊周圍的雷數(shù)int周圍的雷數(shù)方塊上的雷標記int探雷標記顯示方塊信息JLabelLabel方塊在雷區(qū)的位置PointP布雷RandomSetset判斷標記是否正確DetermineDetermine是否獲得勝利WinnerWin雷標數(shù)目intcount周圍方塊的雷數(shù)intcount1(2)方法見(表5)表5 方法名功能備注Game創(chuàng)建程序窗口barnewGame新開局actionPerformed處理ActionEvent事件接口方法設(shè)置方塊是否有雷設(shè)置雷的值設(shè)置是雷時的圖標設(shè)置label上的圖標設(shè)置無雷時的圖標設(shè)置label上的圖標設(shè)置有雷時的名字設(shè)置label上的文字設(shè)置周圍的雷數(shù)設(shè)置周圍的雷數(shù)獲取名字返回方塊label上的文字獲取周圍雷數(shù)返回周圍的雷數(shù)設(shè)置雷區(qū)位置設(shè)置屬性P獲取雷區(qū)位置返回屬性P獲取探雷標記返回探雷標記mousePressed處理鼠標按下事件接口方法mouseClicked處理鼠標雙擊事件接口方法mouseReleased處理鼠標釋放事件接口方法mouseExited處理鼠標退出事件接口方法mouseEntered處理鼠標進入事件接口方法MinesSquare創(chuàng)建雷區(qū)gameOver游戲失敗判斷雷標是否正確正確返回true錯誤返回false布雷隨機布雷判斷是否成功成功返回true失敗返回false(3)import .*。 public Label nowBomb,setBomb。 //踩雷標記 public Icon icon_flag = new ImageIcon()。 public Panel mainPanel = new Panel()。 BombNum = 10。 text=new JTextField(10 ,3)。 if(BombNum = 10 amp。 (null,您設(shè)置的地雷數(shù)太多了,請重設(shè)!,錯誤,2)。 (start)。 bombButton=new Bomb[ (int)(BlockNum) ][]。 } for(int i = 0 。 j++ ) { bombButton[ i ][ j ]=new Bomb(i,j)。 } for(int i = 0 。 j++ ) (bombButton[ i ][ j ])。 setLocation(350,200)。i++) { int x =(int)(()*(int)((BlockNum)1))。 } } /*重新開始*/ public void replay() { (當前雷數(shù)+ +BombNum+)。 j (int)(BlockNum) 。 bombButton[ i ][ j ].setText()。 //找到的地雷數(shù) for(int i=0。 j++) { if(bombButton[ i ][ j ].isBomb == true amp。 (this,您挖完了所有的雷,您勝利了!,您勝利了,2)。 j (int)(BlockNum)。 (j 1 = 0)) { if (bombButton[i 1][j 1].isBomb == true) { count += 1。 (j + 1 = (int)(BlockNum)1)) { if (bombButton[i 1][j +
點擊復(fù)制文檔內(nèi)容
黨政相關(guān)相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖片鄂ICP備17016276號-1