你好,欢迎来到经管之家 [登录] [注册]

设为首页 | 经管之家首页 | 收藏本站

基于Java语言设计的“俄罗斯方块”游戏_计算机专业论文

发布时间:2015-01-16 来源:人大经济论坛
计算机专业论文范文 摘要 俄罗斯方块是一款非常经典游戏,风靡全球,经久不衰,是学习面向对象的编程思想的理想实例。现在面向对象的计算机编程语言很多,都可以编程来实现。 本毕业设计论文介绍用Java语言设计一个“俄罗斯方块”游戏的过程,整个游戏系统是一个应用程序(Java Application),不再是嵌入到网页里的那种小应用程序(Applet);并使用了最新的Java 2标准Swing组件,使得界面更具有专业效果。游戏设计过程中涉及到游戏框架、游戏界面的编写、菜单处理、变量的定义、算法设计以及预览功能的实现。同时,还为游戏添加了其他功能,如设计About对话框,实现游戏分数的存档,为游戏添加状态栏。 通过本次毕业设计可以学到如何定义类和类成员及其方法,如何使用JBuilder来创建工程,如何创建一个对话框,并将对话框和主应用程序联系起来。 关键词:俄罗斯方块,应用程序,Swing组件,Java ABSTRACT Tetris is a classic and durable game, and it has been popular all over the world. And it’s an ideal sample for leaning object-oriented programming. It can be implemented by different object-oriented programming languages that exist nowadays. This thesis describes the implementing process of this game in java language, which is implemented in application form instead of applet that embedded in the web pages. The use of swing component makes the interface look more professional. The game designs in the process to involve to the game frame, the compilation of game contact surface, menu processing, the definition of variable, the design of algorithm as well as the realization of the function of preview are involved in the process of designing this game. Meanwhile, some other functions are also added to the game, such as designing “About dialog”, achieving the archive of the game scores, adding status bar to the game. Through this thesis we can learn how to define classes, class members and the methods, how to use JBuilder to create works, how to create a dialog, and how to link the dialog box and the main application. Keywords: The Russian Block, the application procedure, the Swing module, Java 目录 摘要I ABSTRACTII 第1章 绪论1 1.1 研究背景1 1.1.1 游戏的历史1 1.1.2 游戏的意思与涵义2 1.2 研究内容3 第2章 开发工具的选择4 第3章 可行性研究6 3.1 设计目的6 3.2 可行性研究前提6 3.3 可行性分析6 3.3.1 管理可行性6 3.3.2 经济可行性7 3.3.3 技术可行性7 3.3.4 社会可行性7 3.4 本章小结7 第4章 需求分析8 4.1 引言8 4.2 游戏的需求8 4.3 方案论证9 4.3.1 C++的优点9 4.3.2 Java的优点9 4.3.3 方案的选择10 4.4 本章小结11 第5章 概要设计12 5.1 游戏设计分析12 5.1.1 方块类型数据12 5.1.2 程序运算逻辑12 5.1.3 绘图12 5.1.4 显示平台12 5.2 注意事项13 5.3 游戏流程图13 5.4 本章小结14 第6章 系统详细设计15 6.1 设计游戏框架15 6.1.1 编写游戏框架15 6.1.2 为游戏编写菜单项15 6.1.3 为菜单增加事件处理16 6.2 设计游戏界面17 6.2.1 在Panel中加入几个必要的常量和变量17 6.2.2 在Panel上面画出游戏界面18 6.2.3 将Panel加到框架中去19 6.3 游戏内容的设计20 6.3.1 描述方块20 6.3.2 描述游戏状态21 6.3.3 初始化游戏状态21 6.3.4 编写新的方块组的算法21 6.3.5 编写方块组移动的算法23 6.3.6 编写消去一行的算法24 6.3.7 游戏里实现一个线程26 6.3.8 控制游戏开始26 6.3.9 让游戏暂停28 6.3.10 让游戏结束29 6.3.11 判断游戏是否结束30 6.3.12 让玩家控制游戏30 6.3.13 重新编写画图的功能代码32 6.3.14 类的同步方法33 6.3.15 计算游戏得分和当前游戏级别34 6.4 添加游戏的其他功能34 6.4.1 设计“关于”对话框34 6.4.2 设计设定游戏等级的对话框35 6.4.3 添加状态栏36 6.5 封装得分情况37 6.5.1 定义Score类和类成员38 6.5.2 定义方法writeToFile()38 6.5.3 定义方法readFromFile()38 6.5.4 定义方法sortScore()38 6.5.5 定义方法isScoreTop(int nScore)39 6.5.6 定义方法insertNameScore(String sName,int nScore)39 6.5.7 定义方法getScore()和getName()39 6.6 让玩家输入名字39 6.6.1 输入玩家名字的对话框39 6.6.2 查看排行榜的对话框40 6.7 系统完成后的主要界面效果41 6.8 本章小结41 第7章 系统测试42 7.1 发现问题42 7.2 解决问题42 7.3 本章小结44 第8章 游戏打包发布45 8.1 打包的好处45 8.2 如何打包45 8.3 本章小结46 第9章 结论47 致谢48 参考文献49
经管之家“学道会”小程序
  • 扫码加入“考研学习笔记群”
推荐阅读
经济学相关文章
标签云
经管之家精彩文章推荐