《基于51单片机模拟射击类游戏》由会员分享,可在线阅读,更多相关《基于51单片机模拟射击类游戏(36页珍藏版)》请在金锄头文库上搜索。
1、重庆1基于 51 单片机模拟射击类游戏上海大学 王凯 (抄袭必纠)摘要摘要电子游戏机,又俗称电玩,电动,不同于电脑。自从问世以来,在全球范围内吸引了无数人的热潮,在每个国家都能找到众多的游戏发烧友,它无疑是当今社会上炙手可热的产品,基于这个广大的应用前景,本文着手研究电子模拟射击训练游戏。本文主要通过使用51单片机来模拟简单的射击游戏。在像素为160*128的 LCD 显示屏上显示模拟的手枪,并且可以用按键控制手枪的上下移动以及射出子弹,判断子弹是否击中移动的目标,最后统计得分显示结果。当目标被击中时,蜂鸣器就会发出声音,并且设置有重新开始按键,即得分清零,子弹恢复初始值。本设计通过K1、K2
2、、K3、K4四个按键对游戏进行控制,分别为“向上”键, “向下”键, “发射”键, “子弹复位”键。通过控制上下键使射击器与射击目标保持同一水平线上,然后开始射击,此时蜂鸣器发出发射音效,如射中即可获得一分得分,否则得分不变。当子弹弹数为0时,按“子弹复位”键使游戏中的子弹数目恢复,就重新开始新的游戏。本课题是基于单片机应用技术和 LCD 液晶显示屏的广泛应用而提出的,本课题所做的设计是以 AT89S52单片机结合 JM160128A 显示器,通过 proteus 画图软件和keil 的 C 语言编程软件,达到实现模拟射击游戏的目的。通过将 AT89S52单片机与 JM160128A LCD
3、结合应用,在仿真软件和硬件上都能很好地模拟常见的简单射击游戏,实现预期目标。在游戏运行过程中,能够通过上下键移动枪支,射击目标,并能够实现上弹复位的目的。这对于更深层次的单片机开发应用有着重要的意义。关键词:关键词:AT89S52单片机,LCD 液晶显示屏,C 语言,射击游戏重庆2AbstractElectronic games, also known as electric toys (video games, electric), separated from the home computer. Since the advent of a sensation around the wor
4、ld, we can find a group of ingenious enthusiasts on every foot in the Earths. It is undoubtedly one of todays most computer products of the customers, based on the vast number of potential applications, the paper started studying electronic analog shooting training game.This paper is mainly using co
5、mbination design which includes MCU AT89S52 and 160*128LCD to simulate simple shooting training game ,displaying the simulate pistols graphics in pixels for 160*128LCD and through pressing the button to control pistol and to move up and down and then decide whether it has hit the target ,then statis
6、tic scores and display it .every time when hitting the target ,buzzer will issue hit sound ,otherwise restart key works .By this design, there are K1, K2, K3, K4 four control buttons on the game, namely “up“ key, “down“ key, the “transmit“ button, “bullet Reset“ button. By controlling the up and dow
7、n keys to keep shooting target and pistol on the same level, then start shooting target, at the same time , the buzzer sounds emitted, the score will add one if you shot, otherwise the score unchanged. When the bullet shells is zero, press the “bullet Reset“ key to restore the number of bullets in t
8、he game, the game can start again, a new round of challenges begin. This paper proposed is based on the wide range of applications of single-chip technology and JM160128A.In order to simulate shooting training game, AT89S52 single-chip is served as the core , combined JM160128A display, then togethe
9、r with ISIS_7_Professional and Micro-controller Development kit,also named KEIL ,to achieve the goal of simulating shooting training game.By combining AT89S52 MCU with JM160128A LCD applications,we can achieve the desired objectives and can can well simulate common simple shooting game both in softw
10、are and hardware. In the course of the game running,we can shoot target by moving guns with up and down keys and have the ability to achieve the purpose of the missile 重庆3reset. This has very real implications for the development of SCM deeper applications.Keywords: AT89S52MCU, LCD, C language ,shooting game目录目录第一章 绪论.51.1 系统设计背景及意义.51.2 国内外研究现状.51.3 系统设计任务.61.4 本章小结.6第二章 射击训练游戏系统方案设计.72.1 系统工作原理.72.2 系统组成框图.8重庆42.3 硬件的选型.82.3.1.单片机概述.82.3.2.单片机最小系统.82.3.3.单片机选型.92.3.4.LCD 的选型 .102.4 本章小结.10第三章 射击训练游戏器件介绍.113.1 AT89S52 单片机.113.2 PG160128A.