【正文】
石家莊科技信息職業(yè)學院 畢 業(yè) 論 文 題目: 基于 J2SE 的坦克大戰(zhàn) 學 號: 090124017 姓 名: 李世陽 專業(yè)班級: 軟件技術(shù)(游戲方向) 0924 班 指導教師: 劉永偉 完成日期: 20xx1218 基于 Java 的網(wǎng)絡版坦克大戰(zhàn)游戲設計 摘 要: 本設計采用面向?qū)ο蟮脑O計模式,對游戲中的 所有物體賦予對象的概念和屬性。運行程序后允許用戶選擇執(zhí)行選項菜單。在開始游戲后,啟動服務器和客戶端,對背景的所有物體進行繪圖。在主程序運行的線程中,畫面刷新將以一定的頻率采用雙緩沖技術(shù)對屏幕重繪,實時反映整個游戲的進行狀態(tài)。用戶控制的坦克運行在主線程中,隨屏幕刷新的頻率而移動。坦克將在游戲開始時進行初始化,然后將坦克繪制在地圖的上層。本設計主要實現(xiàn)的功能是讓坦克移動并能夠智能的打出炮彈,躲避子彈,炸毀對方坦克。能夠支持網(wǎng)絡對戰(zhàn)和單機對戰(zhàn)兩種模式。 關(guān)鍵詞: 面向?qū)ο?;坦克大?zhàn);網(wǎng)絡游戲; Java; Socket 類 Javabased Web version of Battle City Game Design 【 Abstract】 The design of objectoriented design patterns, all the objects on in the game to give the concept of objects and attributes. After running the program allows the user to select the implementation of the Options menu. At the beginning of the game, start the server and client, all objects on the background graphics. Thread running in the main program, the screen refresh frequency will be some double buffer technology to redraw the screen in real time to reflect the state of the game. Usercontrolled tanks to run in the main thread, with the screen refresh frequency of the movement. Tank will start to initialize the game, and then draw the map of the upper tank. Designed to achieve the main function is to allow tanks to move and be able to play smart bombs, dodge bullets, to blow up other tanks. To support online play and single play against two modes. Key words: Objectoriented。 Battle City。 online games。 Java。 Socket class 摘要 .................................................. 1 第 1 章 前言 .......................................... 4 游戲設計的需求分析 ............................... 4 本系統(tǒng)的現(xiàn)實意義 ............................. 4 本系統(tǒng)和其他開發(fā)游戲區(qū)別 ...................... 4 開發(fā)技術(shù)概述 ..................................... 5 JAVA、 C 語言、 C++三種主流編程技術(shù)比較 ........... 5 本章小結(jié) ........................................ 5 第 2 章 相關(guān)技術(shù)理論 ................................... 5 系統(tǒng)運行環(huán)境 ..................................... 5 系統(tǒng)運行的軟件環(huán)境 ............................ 5 系統(tǒng)運行的硬件環(huán)境 ............................ 6 相關(guān)理論 ........................................ 6 關(guān)于 ECLIPSE 的介紹 ............................. 6 J2SE 框架 .................................... 6 聯(lián)機通信機制 ................................. 7 JAVA 圖形編程 .................................. 8 本章小結(jié) ........................................ 9 第 3 章 系統(tǒng)設計 ....................................... 9 系統(tǒng)功能設計 ..................................... 9 坦克大戰(zhàn)總體功能設計 ......................... 93 TANKCLIENT 類基本功能分析 ...................... 10 TANK 類基本功能分析 ........................... 11 MISSILE 類基本功能分析 ......................... 12 EXPLODE 類基本功能分析 ......................... 13 服務器類基本功能分析 ......................... 13 信息傳送類基本功能分析 ....................... 14 ........................................ 14 第 4 章 系統(tǒng)實現(xiàn) ...................................... 14 游戲主窗體實現(xiàn) .................................. 14 單機游戲的實現(xiàn) .................................. 16 聯(lián)機功能實現(xiàn) .................................... 17 本章小結(jié) ....................................... 22 第 5 章 總結(jié)與展望 .................................... 22 總結(jié) ........................................... 22 設計中的不足之處 ................................ 23 展望 ........................................