Java版贪吃蛇毕业论文完整版(附带源码地址) 下载本文

内容发布更新时间 : 2024/10/25 1:28:43星期一 下面是文章的全部内容请认真阅读。

摘 要

近年来,Java作为一种新的编程语言,以其简单性、可移植性和平台无关性等优点,得到了广泛地应用,特别是Java与万维网的完美结合,使其成为网络编程和嵌入式编程领域的首选编程语言。eclipse是IBM公司用于快速开发Java应用的一款优秀的集成开发环境,它以其友好的开发界面、强大的组件支持以及开源等优点,得到广大程序员的接受和认可。

“贪吃蛇”游戏是一个经典的游戏,它因操作简单、娱乐性强而广受欢迎。本文基于Java技术和eclipse开发环境,开发了一个操作简单、界面美观、功能较齐全的“贪吃蛇”游戏。整个游戏程序分为二个功能模块,八个类模块,实现了游戏的开始、暂停、结束。通过本游戏的开发,达到学习Java技术和熟悉软件开发流程的目的。

本文在介绍Java相关技术和国内外发展现状的基础上,对“贪吃蛇”游戏的整个生命周期的各个开发阶段进行了详细地介绍。首先,分析了开发本游戏软件的可行性,重点分析本设计所采用的技术的可行性。其次,从游戏主界面等几方面,分析了本游戏的功能需求;从可使用性和安全性方面分析了属性需求。然后,进行了游戏的概要设计和详细设计,这也是本文的重点。概要设计给出二个功能模块的主框架以及八个类模块的函数调用关系;详细设计介绍了Java2标准运行环境的配置,重点给出各个类模块的程序列表,介绍了各个类包含的变量、使用的方法,展示了游戏的界面。为了保证程序代码的正确性和功能实现的可靠性,本文还介绍了游戏软件的程序调试过程和功能测试结果。

关键词:Java;eclipse;贪吃蛇;开发流程

Snake game design and development

Abstract

In recent years, Java, as a new programming language, with its simplicity, portability and platform independence and other advantages, had been used widely, especially Java and the perfect combination of the world wide web, to make it a network programming and embedded programming field preferred programming language. Eclipse is IBM used for fast development Java application of a good integrated development environment, with its friendly development interface, powerful components support and open source etc, and receive the accepted and approved by the programmer.

\game is a classic game, it was simple operation, strong and popular entertainment. This paper, based on the Java technology and eclipse development

I

environment, develop a simple operation, interface aesthetics, the function is more complete \, eight class module, realize the games to begin, pause, over. Through the development of the game, to learn Java technology and familiar with the purpose of the software development process.

Based on the introduction of Java related technology and the domestic and foreign development present situation, on the basis of \development phases are introduced in detail. First of all, analyzes the feasibility of this game software development, this paper analyzes the design of the feasibility of the technology. Second, from the game in such aspects as the interface, and analyzes the function requirements of this game; Can use sex and safety from analyzes the attribute demand. Then, the summary of game design and detailed design, this also is the focus of this paper. General design gives two function module's main frame and eight class module function call relationship; The detailed design Java2 standard operation environment is introduced the configuration, each module of the key given a list of programs, in each kind of variable contains, and use of the method, show the game interface. In order to guarantee the correctness of the program code and function of the realization of the reliability, this paper also introduces the game software program debugging process and function test results.

Key Words:Java;Eclipse;Snake;Development process

II

目 录

摘要 ................................................................... I Abstract ............................................................... I 引 言 ............................................................... 1 第一章 系统开发环境 .................................................... 2

1.1 开发工具 ..................................................................................................................... 2 1.2 应用环境 ..................................................................................................................... 2 第二章 系统需求分析 .................................................... 2

2.1 需求分析 ..................................................................................................................... 2 2.2 可行性分析 ................................................................................................................. 3 第三章 系统概要设计 .................................................... 3

3.1 设计目标 ..................................................................................................................... 3 3.2 系统功能模块 ............................................................................................................. 3 3.3 系统数据结构设计 ..................................................................................................... 4

3.3.1 蛇、石头、食物的表示 ................................................................................ 4 3.3.2 蛇的移动 .......................................................................................................... 5 3.3.3 存储蛇身的数据结构 ...................................................................................... 5 3.3.4 蛇的移动方向 .................................................................................................. 5 3.3.5 如何显示蛇身 .................................................................................................. 6 3.3.6 蛇身的移动方向 .............................................................................................. 6 3.3.7 吃到食物判定 .................................................................................................. 6

第四章 系统详细设计 .................................................... 6

4.1 程序设计 ..................................................................................................................... 6

4.1.1 主类MainFrame .............................................................................................. 6 4.1.2 类MainFrame .................................................................................................. 7 4.1.3 类Snake ........................................................................................................... 7 4.1.4 类Food ............................................................................................................. 8 4.1.5 类Controller .................................................................................................... 8 4.1.6 类Ground ......................................................................................................... 9 4.1.7 类GameListener .............................................................................................. 9 4.1.8 类SnakeListener .............................................................................................. 9

III