登录

  • 登录
  • 忘记密码?点击找回

注册

  • 获取手机验证码 60
  • 注册

找回密码

  • 获取手机验证码60
  • 找回
毕业论文网 > 毕业论文 > 电子信息类 > 电子信息工程 > 正文

基于C语言的俄罗斯方块游戏设计与实现毕业论文

 2022-03-25 07:03  

论文总字数:46674字

摘 要

随着人民物质文化水平的不断提高,游戏正逐渐成为越来越多的人们休闲娱乐的主要方式之一。俄罗斯方块作为一款经典的方块消除类游戏,在全世界有着广泛的知名度与大批的拥趸者,同时也为大量同类型游戏提供了灵感。

本次设计将实现经典俄罗斯方块的全部功能,包括随机生成当前方块和下一块方块的预览,方块的移动和旋转,游戏的消行与计分,方块下落速度的设定和递增等等,并加入了当前方块下落位置预览的功能,以提高游戏体验。本次设计采用Windows10系统下的VC6.0平台开发,使用C语言为编程语言。游戏功能均由自定义函数配合C语言标准库中的函数实现,游戏的可视化界面由Windows应用程序接口(API)函数实现,并最终通过编译,得到可执行文件。对于程序编译过程和运行过程中出现的bug,不断修改和优化程序,并最终达到理想效果。程序最终运行表明,本次设计实现了预设的功能,程序稳定性良好,游戏可玩性较高。

关键词:C语言 俄罗斯方块 API

Design and program of Tetris based on the C Programming Language

Abstract

With the continuous improvement of people's material and cultural level, game is becoming the main way to kill time and have fun among more and more people. As a classic block elimination game, Tetris is very popular around the world and have a large number of fans, and also provides a lot of similar games with inspiration.

This program will achieve all of the functions the classic Tetris, including the randomly generation of the current block and preview of the next block, move and rotation of the block, elimination of the block and estimate of scores, setting and increasing the falling speed of the block and so on. In order to improve the gaming experience, the program also has the function to preview the falling position of current block. This program is designed on the VC6.0 platform under Windows 10 system, and it is base on the C Programming Language. All the functions of the game are supported by the C language standard library and custom functions, and the visual interface of the game is supported by Windows application program interface (API). Finally the program passes the compiling, and gets the executable file. About the bugs showed during the process of compiling and running, I continually modify and optimize the program, and finally achieve the ideal program. The program eventually turns out to be successful, the presupposed function and stability of the program work very well, and the playability of the game is also very good.

Key Words: C Programming Language; Tetris; API

目 录

摘 要 I

Abstract II

第一章 绪论 1

1.1 课题研究背景 1

1.2 论文所做工作 2

第二章 软件设计概述 3

2.1 软件设计内容和要求 3

2.2 程序原理流程图 3

第三章 数据的定义 6

3.1 图形的定义 6

3.1.1 图形变量的定义 6

3.1.2 图形变量的存储 6

3.2 分数和等级的设置 7

3.3 游戏区域的定义 8

3.3.1 逻辑游戏区域的定义 8

3.3.2 窗口大小的定义 9

3.4 游戏状态参数的定义 10

第四章 函数的设计 11

4.1 内部功能函数 16

4.2 显示部分函数 17

4.3 外部输入函数 21

4.4 窗口生成函数 24

第五章 软件的使用 25

5.1 软件调试 25

5.2 软件使用说明 31

结束语 32

参考文献 33

致谢 35

附录 软件程序 36

第一章 绪论

1.1 课题研究背景

游戏产业隶属于文化产业当中,属于我国新兴的高新技术产业之一。游戏产业本身属于互动数字内容产业和休闲娱乐产业,同时又是一个包含计算机、互联网、软件、电子等诸多领域的大型综合领域。游戏产业具有极大的渗透力,影响着非常多的相关产业。

游戏市场随着游戏技术的发展不断的变化。但是,新游戏的兴起,并不一定意味着旧的游戏被取代或者消亡,许多经典的游戏仍然具有很强的活力和市场。总的来说,游戏市场目前呈现的是创意与经典并存,互为补充的格局。

C语言在很大程度上是计算机程序语言的基础,一款非常实用的程序设计工具,学好C语言对今后学习JAVA、C 、VB等可以打下良好的基础,因为它们大都是由C语言扩充或衍生而来的。此外,C语言对于开发较为底层的软件,例如驱动、通信协议等等,和在Linux环境下编写程序以及嵌入式系统开发等领域也是不可或缺的。

俄罗斯方块最初是由苏联的数学家帕基特诺夫为了测试计算机的性能而在业余时间编写的一个游戏程序,他从拼图游戏里得到灵感,并最终设计出了这款风靡全球游戏。这款游戏看似简单但却变化无穷,令人上瘾。据统计,俄罗斯方块拥有超过5O种语言的版本,受到世界各地玩家的喜爱。运行在几十种游戏平台上,从个人电脑、掌机、街机,到手机和PAD。

请支付后下载全文,论文总字数:46674字

您需要先支付 80元 才能查看全部内容!立即支付

企业微信

Copyright © 2010-2022 毕业论文网 站点地图