【正文】
/ 設(shè)置主面板的大小 (null)。 (fractionLable, )。 newlyButton = new JButton(再來一局 )。 rows++) { // diamondsButton[cols][rows] = new // JButton((grid[cols + 1][rows + 1]))。 (centerPanel, Center)。// 異常處理 } } public void init() { mainFrame = new JFrame(JKJ 連連看 )。 private static final String imgDir = c:/img。 // 退出 ,重列,重新開始按鈕 JLabel fractionLable = new JLabel(0)。 return false。 import 。 import 。 import 。 32 致謝 參考文獻(xiàn) [1] 劉寶林 .Java 程序設(shè)計與案例習(xí)題解答與實(shí)驗指導(dǎo) [M]. [2] 王鵬 何云峰 .Swing 圖形界面開發(fā)與案例分析 [M]. [3](美) Karl Avedal , Danny Ayers, Timothy Briggs. JSP 編程指南 [M]. 電子工業(yè)出版社 , 2020,47125. [4](美) Mark Linsenbardt. JSP 在數(shù)據(jù)庫中的應(yīng)用與開發(fā) [M]. 希望電子出版社,2020,210236. 33 [5] Dianne Phelan, Building a simple web database application[C].IEEE International Professional Communication Conference, 2020, 7986. [6](美) Karl Avedal,Danny Ayers,Timothy 編程指南 [M].電子工業(yè)出版社 ,2020,47125. [7] Dianne Phelan, Building a simple web database application[C].IEEE International Professional Communication Conference, 2020, 7986. [8] Altendorf. Eric, Hohman. Moses, Zabicki. Roman. Using J2EE on a large, webbased project[J]. IEEE ,19(02):8189. 附錄 源代碼 import 。連連看游戲就是典型。算法的具體的邏輯設(shè)計圖圖下圖所示: 圖 IsNotLineConnection 上面算法的 邏輯是先判斷兩個點(diǎn)之間的的兩條連通路徑之間除起始點(diǎn)外時候有其他的圖像塊,如果沒有就判斷兩個圖像塊之間的直線是否可通,如果可通函數(shù)返回值為真,不可通函數(shù)返回值為假。針對同行的兩個相同的顏色的圖像塊來說又可分為兩種情況,即:在同一行相鄰和同一行不相鄰的情況,不相臨的情況下有可以分為兩種,能消去的和不能消去的。這個過程具有大量的工作量,應(yīng)仔細(xì)對每個程序細(xì)節(jié)進(jìn)行分析思考、編寫程序并調(diào)試,做到程序簡潔清楚,盡量避免可能潛在的程序錯誤,并在必要的地方加以注釋,以便于程序閱讀和修改。 } if(()==exitButton) (0)。 break。 } } } } public void rowPassOne() { 25 if (x0i) { for (j=x01。i )//判斷第一按鈕同左側(cè)空按鈕之間有沒按鈕 { if (grid[x0][i]!=0) { k=0。n=y+1 。 } if (y0y) { for (n=y0。 } } if (xi) { for (j=x+1。 } } } } } for (i=0。 n==x1) { remove()。 } } if (y==j ) { linePassOne()。 } else{ k=1。amp。 cols 6。 = grid。 19 randomBuild()。 // 不可見 (false)。 (name)。 if (saveUserData(().trim(), sex, new String(()), new String(()))) (false)。 (confirm)。 (pass2)。 (cb1)。 (new JLabel(確認(rèn)密碼 :, ))。 } 13 注冊界面 圖 系統(tǒng)主界面 為了能夠在同一頁面中管理多個頁面,本系統(tǒng)的主界面采用了框架技術(shù)。 ()。 (register)。 } else { (login, 用戶名或密碼錯誤!, 錯誤提示 , )。)。 (new FlowLayout())。 在菜單功能模塊中針對每個菜單的命令進(jìn)行了詳細(xì)的解釋和闡釋實(shí)現(xiàn)了每一個子菜單的命令。 (3)幫助菜單,介紹了游戲的版本等。 當(dāng)用戶點(diǎn)擊游戲場景中的圖像塊時就會響應(yīng)鼠標(biāo)的 OnLButtonDown 事件,然后進(jìn)行相應(yīng)的邏輯判斷。 ? 對用戶輸入的 信息 ,系統(tǒng)進(jìn)行嚴(yán)格的 信息 檢驗,盡可能排除人為的錯誤。本系統(tǒng)主要實(shí)現(xiàn)如下功能: ? 系統(tǒng)采用圖片連連看的 方式,界面美觀友好, 用戶使用 靈活、方 7 便、快捷、準(zhǔn)確,數(shù)據(jù)存儲安全可靠。 ? 內(nèi)存: 256MB 以上。 5 本章小結(jié) 這一章介紹了連連看應(yīng)該具備的功能模塊,在這一章中,我們可以了解什么是連連看,當(dāng)前連連看系統(tǒng)的系統(tǒng),還有一個連連看系統(tǒng)應(yīng)該的開發(fā)目標(biāo)。有一個玩家將所有的牌都全部消掉 。 隨著 Flash 應(yīng)用的流行,網(wǎng)上出現(xiàn)了多種在線 Flash 版本“連連看”。 ( 3) 再來一局 功能 該 功能 有一個“再來一局”的按鈕,當(dāng)按下“再來一局”按鈕后,圖片將會重新排列,重新開始游戲。 課程設(shè)計 內(nèi)容 游戲規(guī)則是模仿網(wǎng)絡(luò)上普通的連連看游戲,主要是鼠標(biāo)兩次點(diǎn)擊的圖片能否消去的問題。并于 2020年,取得了國家版權(quán)局的計算機(jī)軟件著作權(quán)登記證書。第 四 章則對游戲的各功能模塊及實(shí)現(xiàn)算法等詳細(xì)設(shè)計進(jìn)行了介紹。主要應(yīng)用到 Swing組件, Java 小程序,事件及接口等 。當(dāng)前,前提是點(diǎn)擊兩張相同的圖片,若點(diǎn)擊的是同一張圖片或者兩張不同的圖片,則不予處理。圖片全部消完為游戲成功。 本文闡述了實(shí)例“連連看”的設(shè)計思想和實(shí)現(xiàn)。s society, Casual games get more and more popular among people, I did graduate design example, Design and Implementation Lianliankan game is very popular in recent years the work of a twodimensional casual games. Its less demanding puter configuration, Entertaining, Easy to fly. The language used in graduate design language for the Java, Development environment for the JCreator . Mainly applied to the Microsoft Swing framework provides more documentation procedures and events functions to interface. The game interface offers convenient conditions for production, The main features of this system is to use events framework and interface technology to interface mapping, mouse operations, and display functions standings. The design and development by Lianliankan Swing framework will understand the technology and the events application of technology in the games played very helpful, Java programming for both master and twodimensional recreation of the general method of game design and lay a solid foundation. In this paper, examples of Lianliankan The design and implementation. Paper is divided into five chapters. Chapter I of the project background and project a brief description of the function. The second chapter describes the development of this system uses Java language, Swing framework of the technology and Event interface technology. The third chapter describes the system requirements analysis. The fourth chapter of the game39。 2020 年,隨著社交網(wǎng)絡(luò)的普及和開放平臺的興起,“連連看”被引入了社交網(wǎng)絡(luò)。 2 該游戲 由 30 張不同的圖片組成,游戲開始將會出現(xiàn) 30 張隨機(jī)組合的圖片,在規(guī)則下點(diǎn)擊兩張相同的圖片后圖片將會消失。 任務(wù)分工 2 章 連連看游戲界面 連連看游戲 概述 當(dāng)今社會 ,休閑型游戲越來越得到人們的喜愛, 我 們 所做的設(shè)計實(shí)例 “連連看游戲的設(shè)計與實(shí)現(xiàn) ”是近幾年來網(wǎng)絡(luò)上非常流行的一種二維休閑游戲,它對電腦配置要求不高,娛樂性強(qiáng),易于上手。 操作 : 第一次使用鼠標(biāo)點(diǎn)擊棋盤中的棋子,該棋子此時為 “被選中 ”,以特殊方式顯示;再次以鼠標(biāo)點(diǎn)擊其他棋子,若該棋子與被選中的棋子圖案相同,且把第一個棋子到第二個棋子連起來, 中間的直線不超過 3 根,則消掉這一對棋子,否則第一顆棋子恢復(fù)成未被選中狀態(tài),而第二顆棋子變成被選中狀態(tài) 。繼而開發(fā)出一個完整的連連看電腦游戲。 ( 2)游戲中將有“退出”功能, 選擇退出命令后程序?qū)⒔K止執(zhí)行,關(guān)閉窗口。 ? 開發(fā)工具包: JDK 。 ? 計分 自動完成,提高工作效率。 連連看 系統(tǒng)總體結(jié)構(gòu) 連連看是基于 java 基本知識設(shè)置的一個小游戲,剛開始的時候有一個用戶登陸界面,要是沒有賬號 的可以先申請一個。其中用到的 API 函數(shù)主要是是BitBlt,他的主要功能是 將某一內(nèi)存塊的數(shù)據(jù)傳送到另一 內(nèi)存塊 , 前一內(nèi)存塊被稱為 源 ,后一內(nèi)存塊被稱為 目標(biāo) 圖象程序開發(fā)者使用 Blit 的函數(shù)在內(nèi)存中將某頁面上的一幅位圖經(jīng)過一定的變換轉(zhuǎn)移到另一個頁面上 。這些顯示信息會隨著游戲的進(jìn)行而動態(tài)改變