【正文】
元件組成的單片機可以工作的系統(tǒng)。 硬件的選型 單片機是一種集成芯片,一個小而完善的微型計算機系統(tǒng)。軟件部分的主要內(nèi)容是通過 keil 軟件進行編寫游戲程序以及在 Proteus 中調(diào)試來實現(xiàn)射擊移動目標的功能。游戲進行時的界面如下: 圖 正在游戲的界面 重慶 8 系統(tǒng)組成框圖 本系統(tǒng)硬件主要由 51單片機與蜂鳴器、按鍵中斷、 JM160128ALCD液晶顯示模塊、單片機晶振和復(fù)位電路連接組成。隨后打開定時器 T0,定時器T1和外部中斷 INT0。重慶 7 第二章 射擊訓(xùn)練游戲系統(tǒng)方案設(shè)計 系統(tǒng)工作原理 整個硬件 電路由 AT98S52 單片機及 單片機最小系統(tǒng)的 晶振電路和復(fù)位 電路外接JM128*160LCD 液晶屏、 4個獨立 按鍵以及 蜂鳴器 和 一個 雙 4輸入與非門 74LS20 和一個 74HC04 非門 組 成。 本章小結(jié) 本章主要 介紹了本課題的研究背景,即游戲機的發(fā)展歷程,以及國內(nèi)外對于本課題的研究現(xiàn)狀,國內(nèi)外游戲機的發(fā)展,主要說明了本設(shè)計的任務(wù),利用 51 單片機來模擬射擊游戲,通過按鍵控制手槍的移動和射擊,擊中加一分。通過控制上下鍵使射擊器與射擊目標保持同一水平線上, 然后開始射擊,此時蜂鳴器發(fā)出發(fā)射音效,如射中即可獲得一分得分,否則得分不變。程序啟動時在像素為 160*128 的液晶屏幕上顯示游戲封面,然后顯示游戲區(qū),默認彈藥為 20 發(fā), K1, K2鍵用于向上或向下移動槍支,跟蹤目標, K3 鍵用于發(fā)射并模擬槍聲,在每次發(fā)射時,如果擊中則加 1分,在擊中后若目標物體尚未移動就發(fā)射并擊中,程序不重復(fù)加分,彈藥用完可按下 K4 鍵重新開始,也可按鍵更改默認彈藥數(shù)。由此可見,世界游戲機發(fā)展前景一片大好,我們應(yīng)該加大力度開發(fā)游戲。 游戲在將來很有可能成為網(wǎng)絡(luò)競爭中的主角,而且其產(chǎn)生的商業(yè)價值與利益無法估量。次年,美國雅利達公司出售 ATARI LYNK 彩電液晶 8位機,運用 顯現(xiàn)板。電競重慶 6 也像足球那樣有自己的俱樂部,有自己的戰(zhàn)隊,玩家們還可以代表國家參加國際大賽,我國的戰(zhàn)隊游戲水平更是在世界巔峰,就在最近英雄聯(lián)盟季中賽上,中國戰(zhàn)隊 Edward Gaming 打敗了統(tǒng)治多年的韓國隊,為國爭光。隨著互聯(lián)網(wǎng)的興起,巨大 的市場需求量使中國的游戲市場在短短幾年內(nèi),從無到有,從陌生到熟悉,從掌握到運用。 國內(nèi)外研究現(xiàn)狀 目前國內(nèi)的游戲公司已經(jīng)發(fā)展到了幾百家的規(guī)模,市場上運營的游戲亦達到了250多款,但是與歐美、韓國等科技強國的游戲發(fā)展程度還存在一定的差距。如果我們編寫的游戲程序能夠如預(yù)期一樣的穩(wěn)定運行,我們將對單片機有著更深的理解,對編寫游戲的復(fù)雜程度有更切身的體會。因此我們對于游戲機的研究具有很重要的意義,這也是我們對于本課題研究的背景和意義。隨著我們 對終端設(shè)備的開發(fā),使得娛樂終端的游戲機同時也獲得了很大程度的發(fā)展。然而,游戲機狂潮為什么能夠席卷全世界呢 ?從游戲機的發(fā)展歷史我們不難看出,科學(xué)技術(shù)的快速進步在游戲機發(fā)展過程中起到了至關(guān)重要的作用。在世界范圍內(nèi),無論是大城市還是小村莊,無論是在國內(nèi)還是在國外,每時每刻都在進行著這樣的“奮斗”。s most puter 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 bination 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 singlechip technology and order to simulate shooting training game, AT89S52 singlechip is served as the core , bined JM160128A display, then together with ISIS_7_Professional and Microcontroller Development kit,also named KEIL ,to achieve the goal of simulating shooting training game. By bining AT89S52 MCU with JM160128A LCD applications,we can achieve the desired objectives and can can well simulate mon 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 重慶 3 目錄 第一章 緒論 ......................................................................................................................... 5 系統(tǒng)設(shè)計背景及意義 .................................................................................................... 5 國內(nèi)外研究現(xiàn)狀 ............................................................................................................ 5 系統(tǒng)設(shè)計任務(wù) ................................................................................................................ 6 本章小結(jié) ........................................................................................................................ 6 第二章 射擊訓(xùn)練游戲系統(tǒng)方案設(shè)計 ................................................................................. 7 系統(tǒng)工作原理 ................................................................................................................ 7 系統(tǒng)組成框圖 ........................................................................................................ 8 硬件的選型 ............................................................................................................. 8 ............................................................................................................... 8 .......................................................................................................... 8 ............................................................................................................... 9 的選型 .............................................................................................................. 10 本章小結(jié) ............................................................................................................... 10 第三章 射擊訓(xùn)練游戲器件介紹 ....................................................................................... 11 AT89S52 單片機 ................................................................................................... 11 PG160128A ........................................................................................................ 13 74LS20 與非門 ..................................................................................................... 15 74HC04 .................................................................................................................. 16 第四章 射擊訓(xùn)練游戲硬件電路設(shè)計 ............................................................................... 17 晶振和復(fù)位電路 .........................................