1 / 29
文档名称:

贪吃蛇游戏毕业设计.docx

格式:docx   大小:62KB   页数:29页
下载后只包含 1 个 DOCX 格式的文档,没有任何的图纸或源代码,查看文件列表

如果您已付费下载过本站文档,您可以点这里二次下载

分享

预览

贪吃蛇游戏毕业设计.docx

上传人:2072510724 2021/8/3 文件大小:62 KB

下载得到文件列表

贪吃蛇游戏毕业设计.docx

文档介绍

文档介绍:唐山老浣
毕业设计
设计题目:
贪吃蛇游戏
系 别: 信息工程二系
班 级:04计算机与信息管理(3)班
班 级:翟丽丽
指导教师: 姜方正
2006年6月9日
贪吃蛇游戏
摘要
贪吃蛇游戏是一个深受人们喜爱的游戏,它能够让你在忙碌的工作中轻松一 下自己,游戏贪吃蛇确实是在屏幕上画出蛇,同时随机地给出食物。游戏者通过 键盘操作操纵贪吃蛇的移动,去吃食物,吃到后食物消失,然后再随机给出食物 同时蛇的躯体增加。撞到墙壁或躯体交又蛇头撞到自己的躯体,那么游戏终止。
那个程序关键点是表示蛇的图形和蛇的移动。用一个小矩形块表示蛇的一节 躯体,躯体每长一节,增加一个矩形块,蛇头用两节表示。移动时必需从蛇头开 始,因此蛇不能向相反的方向移动,也确实是蛇尾不能改作蛇头。若是不按任何 键,蛇自行在当前方向上前移,当游戏者按了有效的方向键后,蛇头朝着指定的 方向移动,一步移动一节躯体,因此当按了有效的方向键后,先确信蛇头的位置, 然后蛇躯体随着蛇头移动,图形的实现是从蛇头的新位置开始画出蛇,这时,由 于没有清屏的缘故,原先蛇的位置差一个单位,因此看起来蛇会多一节躯体,因 此将蛇的最后一节用背景色覆盖。食物的显现和消失也是画矩形块和覆盖矩形块。
本程序实现的要紧技术在二维数组的应用上。编写此游戏把握了用C语言知识 的了解,通过这次毕业设计,提高了咱们的编程的水平。
关键词:食物和蛇
Tanchishe game
Abstract
Tanchishe game is a very popular game is that it can allow you to relax at work in a busy themselves in the game Tanchiyi screen is painted snake while random to give food. Tanchiyi operational control of the game through keyboard movement, eat food. after eating food disappeared, and then randomly given food and snake physical growth. Hit the walls or physical cross-snake hit their physical the game ended.
The key point is that the procedures of the snake and the snake mobile graphics. Using a small rectangle pieces that snake section body, the body of each long section, add a rectangle pieces, with two sections that snakeheads. Movement must start from the snake, the snake can not be contrary to the direction of movement that is capable not for snakeheads. If we do not by any keys, snakes themselves in the current direction of everything, when those games by an effective direction keys, snake head towards the designated direction movements, step movement section of the body, so when the effective direction keys, to identify the snake's position, and then snake body with snakeheads movement graphic realization from the snakeheads new location beginning painted snake? then, In the absence of the Qing Ping reasons, the original location of poor snakes in a flat, it appears more than one section wi