【正文】
務(wù)是設(shè)計打磚塊游戲的算法,并使用 JAVA 語言編寫程序,最終完成游戲編程,并使之能夠正確運行。 本文第一章闡述了選題目的及 Java 游戲目前的發(fā)展現(xiàn)狀。第三章詳細介紹了 打磚塊游戲,包括游戲的規(guī)則和期待的效果等。第五章對游戲進行運行和測試,以期檢測游戲中的各種問題。 關(guān)鍵字: java,游戲設(shè)計,測試,打磚塊,算法 基于 Java 的打磚塊游戲開發(fā) II Arkanoid javabased development Abstract Arkanoid is a small classic games on handheld game consoles and many mobile phones can be found on this little game. The basic content of the game by controlling a player can move around the baffle, the rebound is in motion pinball , making changes in the direction of movement , eliminating the bricks with a small ball inside the game window , then reach the next level , the obstacles process is eliminated , the shutter may be some change in the state of pellets or articles such as : the paddle length , shorter, and so enhance the power of the ball . This system is a Javabased platform Arkanoid game. The main task is to design algorithms Arkanoid game and using JAVA programming language , the final pletion of game programming , and enable it to run correctly. The main collision detection algorithm and the trajectory of the ball , the ball collision portion may be regarded as a rectangle, the coordinates of the boundary rectangle when bricks , baffles , such as a wall , the collision can be judged , and exercise Just after the collision trajectory X axis or Y axis inverted it. The first chapter describes the purpose of the topic and the current status of the development of Java games , the second chapter introduces the Java based voice features and related technologies Java game development , the third leg detailing Arkanoid games, including games rules and expectations effects, Chapter IV specific design and implementation of Arkanoid games, including interface design , class design , algorithm design, etc., the fifth chapter of the game running and testing in order to detect game various problems . Expected by the game master instance small Java game development and Java programming based knowledge and skills , so that they have the basic ability to develop Java games . Keywords : Java, Game Design, Game Testing , Arkanoid, The Algorithm 基于 Java 的打磚塊游戲開發(fā) III 目 錄 摘 要 ........................................................................................................................... I Abstract ..........................................................................................................................II 第一章 緒論 .................................................................................................................. 1 選題的目的和意義 ......................................................................................... 1 游戲產(chǎn)業(yè)的發(fā)展現(xiàn)狀 ...................................................................................... 1 第二章 游戲開發(fā)的環(huán)境及相關(guān)技術(shù) .......................................................................... 3 開發(fā)環(huán)境 ......................................................................................................... 3 Java 語言特點 ................................................................................................ 3 GUI 介紹 .......................................................................................................... 4 第三章 打磚塊游戲介紹 .............................................................................................. 5 打磚塊游戲的規(guī)則 ......................................................................................... 5 打磚塊游戲預(yù)期的效果 ................................................................................. 5 第四章 打磚塊游戲的設(shè)計與 實現(xiàn) .............................................................................. 7 游戲模塊設(shè)計 ................................................................................................. 7 游戲界面繪制模塊 .............................................................................. 7 游戲操作模塊 ...................................................................................... 8 類的設(shè)計 ......................................................................................................... 8 代碼實現(xiàn) ........................................................................................................ 10 GameFrame 類 ..................................................................................... 10 GamePanel 類 ..................................................................................... 11 Pad 類 ................................................................................................. 16 Block 類 ............................................................................................. 17 Bullet 類 ........................................................................................... 20 Ball 類 ............................................................................................... 22 SoundPlayer 類 ................................................................................. 26 第五章 游戲的運行與測試 ........................................................................................ 27 測試的目的和原則 ....................................................................................... 27 游戲界面顯示測試 ....................................................................................... 27 擋板移動控制 ............................................................................................... 29 小球運動檢測 ............................................................................................... 30 寶物功能測試 ............................................................................................... 30 游戲聲音測試 ........................