I基于单片机的贪吃蛇游戏设计学生姓名:学生学号:院(系):电气信息工程学院年级专业:指导教师:二〇一五年五月II摘要在21世纪的今天,人们的生活开始变得更加丰富多彩。在繁忙的工作之余,娱乐成为人们生活不可或缺的一份子,而游戏作为近年来逐渐兴起的一种娱乐方式,已经越来越受到人们的青睐。在工作学习之余,通过玩游戏来放松、调节紧张的学习工作压力是不错的选择;然而大型的网络游戏玩起来比较耗费时间,且不能随时随地的玩。那么如果这时候拥有一款简单易携带,并且能够缓解压力的小游戏将是个不错的选择,所以,我就设计了这样一款简单易携带的经典小游戏——贪吃蛇。具体实现上,硬件系统平台采用STC89C52R单片机,搭载LCD12864显示屏,构成一个轻巧简单的游戏机系统。软件系统采用C语言编程,Protues软件设计电路并仿真,KEIL软件进行程序的调试。最终实现贪吃蛇游戏系统。本次设计的贪吃蛇游戏,实现了传统意义上的贪吃蛇游戏的特点:蛇吃掉豆子后,得分增加并且蛇身变长;分数到达一定数目进行升级以后,蛇运动速度加快。而玩家只需利用方向按钮“上↑、下↓、左←、右→”来改变蛇的运行方向,就能达到娱乐的目的,操作非常简单。关键词:贪吃蛇游戏,STC89C52R单片机,LCD12864,C语言ABSTRACTInthe21stcenturytoday,people'slifebecomemorecolorful,Intheoutsideofbusywork,entertainmentbecomeanintegralpartofpeople'slife,Andthegameasemerginginrecentyears,akindofentertainment,alreadymoreandmoregetthepopularofpeople,Intheoutsideofworkandstudy,throughtheplaygamestorelax,adjustthepressureoflearningisagoodchoice;HoweverlargenetworkgameplayIIImoretime-consuming,Andcan'tplayanywhere,anytime.Soifthistimehasasimpleiseasytocarry,andcaneasethepressureofsmallgamewillbeagoodchoice.So,Iwoulddesignsuchasimpleandeasytocarrysmallclassicgame–thesnakegame.Ontheconcreteimplementation,withSTC89C52RCSinglechipmicrocomputersystemplatform,withaLCDdisplay,constitutealightweightsimplegamesystem.SoftwareuseClanguageprogramming,useProtuessoftwareCircuitdesignandsimulation,KEILSoftwareprogramdebugging,Finallyrealizesthesnakegamesystem.Thedesignofthesnakegame,Achievedinthetraditionalsenseofthesnakegamefeatures:afterthesnaketoeatbeans,scoresandsnake-bodyvariablelength;Scoretoreachacertainnumberaftertheupgrade,thesnake'smovementspeed.Playersneedtousethedirectionkey"↑,up,down,left,right,tochangetherunningdirectionofsnake,andcanachievethepurposeofentertainment,theoperationisverysimple.Keywords:GreedySnakeGame,STC89C52RCSinglechipmicrocomputer,LCD12864,Clanguage目录摘要.............................................................................................................................IIABSTRACT..................................................................................................................11绪论............................................................................................................................21.1本课题研究的背景及意义................................................................................................21.2国内外研究现状、水平...................................................................................................21.3本课题的发展趋势...........................................................................................................11.4本课题的研究内容和达到的要求....................................................................................12方案分析与选择........................................................................................................22.1系统方案设计...............................