基于51单片机模拟射击类游戏

合集下载
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

基于51单片机模拟射击类游戏

大学王凯

(抄袭必纠)

摘要

电子游戏机,又俗称电玩,电动,不同于电脑。自从问世以来,在全球围吸引了无数人的热潮,在每个国家都能找到众多的游戏发烧友,它无疑是当今社会上炙手可热的产品,基于这个广大的应用前景,本文着手研究电子模拟射击训练游戏。

本文主要通过使用51单片机来模拟简单的射击游戏。在像素为160*128的LCD显示屏上显示模拟的手枪,并且可以用按键控制手枪的上下移动以及射出子弹,判断子弹是否击中移动的目标,最后统计得分显示结果。当目标被击中时,蜂鸣器就会发出声音,并且设置有重新开始按键,即得分清零,子弹恢复初始值。本设计通过K1、K2、K3、K4四个按键对游戏进行控制,分别为“向上”键,“向下”键,“发射”键,“子弹复位”键。通过控制上下键使射击器与射击目标保持同一水平线上,然后开始射击,此时蜂鸣器发出发射音效,如射中即可获得一分得分,否则得分不变。当子弹弹数为0时,按“子弹复位”键使游戏中的子弹数目恢复,就重新开始新的游戏。本课题是基于单片机应用技术和LCD液晶显示屏的广泛应用而提出的,本课题所做的设计是以AT89S52单片机结合JM160128A显示器,通过proteus画图软件和keil的C语言编程软件,达到实现模拟射击游戏的目的。

通过将AT89S52单片机与JM160128A LCD结合应用,在仿真软件和硬件上都能很好地模拟常见的简单射击游戏,实现预期目标。在游戏运行过程中,能够通过上下键移动枪支,射击目标,并能够实现上弹复位的目的。这对于更深层次的单片机开发应用有着重要的意义。

关键词:AT89S52单片机,LCD液晶显示屏,C语言,射击游戏

Abstract

Electronic games, also known as electric toys (video games, electric), separated from the home computer. Since the advent of a sensation around the world, we can find a group of ingenious enthusiasts on every foot in the Earth's. It is

undoubtedly one of today's 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 combination design which includes MCU AT89S52 and 160*128LCD to simulate simple shooting training game ,displaying the simulate pistol’s 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 statistic 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 down 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 the 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 together 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 software 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 reset. This has very real implications for the development of SCM deeper applications.

Keywords:AT89S52MCU, LCD,C language ,shooting game

相关文档
最新文档