基于Python的贪吃蛇游戏的设计与实现摘要在现代文明高度发达的今天,人们在日常生活中来源于各个方面的压力也越来越大。在所剩无几的闲暇时间里,人们更希望通过某种娱乐方式来放松疲惫不己的身心。游戏,我相信这是很大一部分人的选择!说到游戏,可能每个人有不同的答案,但是有一款游戏是每个人都熟悉并且玩过的,那就是贪吃蛇。贪吃蛇以其无网络运行、硬件要求低,操作简单等优势在非智能手机时代大放光彩。本次毕业设计的主题就是小游戏贪吃蛇的设计与实现,此次选择的程序设计语言为Python。Python运用地越来越广泛,甚至有着“黄金语言”的美称,它拥有相当丰富的标准库以及第三方模块库。为了节省开发的时间成本,本文运用的就是其中的PyGame模块来实现游戏的开发工作。关键词:游戏:贪吃蛇:Python:PyGameDesign and development of the greedy snake small gamebased on pythonAbstractIn the modern civilization highly developed today,people in daily life from allaspects of the pressure is also growing.In the few spare time left,people prefer to relaxtheir exhausted body and mind through some kind of entertainment.Game,I believethat this is the choice of a large number of people!When it comes to games,everyonemay have different answers,but there is a game that everyone is familiar with and hasplayed,that is,greedy snake.Greedy snake,with its advantages of no networkoperation,low hardware requirements,simple operation,etc.,shines in the era of nonsmart phones.This graduation project is the design and implementation of greedy snakeand the programming language chosen this time is Python.Python is used very widelynow,and even has the reputation of "golden language".It has a rich standard libraryand a third-party module library.In order to save development time and cost,this paperuses the PyGame module to realize the development of the game.Key words:Game;Snake;Python;PyGame目录摘要Abstract .............II一、绪论1(一)研究现状与背景(二)行性分析..2二、需求分析..……2(一)功能性需求..........2(二)非功能性需求.........3三、游戏及开发工具简介...2(一)游戏简介.....(二)Python简介.......3l.Python的运行原理.32.Python的特点3.PyGame简介...5(三)PyCharm简介...·5四、概要设计6(一)功能介绍....6(二)程序流程设计...........61.程序流程图...62.界面设计...73.功能设计.........8(三)游戏过程.....9五、系统实现..8(一)功能概览...·9(二)构建开始界面..。....9(三)蛇与食物的绘制.10(四)蛇的移动........111
暂无评论内容