【正文】
} if (keyCode == 22) {// 右 action = 22。 } if (keyCode == 20) {// 下 action = 0。 } public void toGameView() {// 初始游戲界面 (gameView)。 getWindow().setFlags(, )。// 初始化進(jìn)度條并切換到進(jìn)度條View (processView)。 (false)。 gameView = new GameView()。 (false)。// GameView的引用 WeleView weleView。//引入相關(guān)類import 。參考文獻(xiàn)[1] 王正軍 著,《Java程序設(shè)計(jì)》,北京:人民郵電出版社,2006年。雖然,這個(gè)軟件目前運(yùn)行良好,但是我認(rèn)為代碼的健壯行還很差,在整個(gè)工程的構(gòu)思方面也不足,用戶操作界面還不夠靈活,這些問題還需要今后逐一解決。爆炸換幀線程Explode,該類是為爆炸效果類服務(wù)的,當(dāng)爆炸存在時(shí)定時(shí)為每個(gè)爆炸效果換幀。 } } try { (sleepSpan)。// 移動(dòng)云彩 if ( 1000) { = 1000。// 循環(huán)標(biāo)志位 GameView gameView。勝利界面WinView,該類為玩家順利過關(guān)后的恭喜過關(guān)界面。 countFine = (countFine + 1) % fineN。amp。 } else { KEY_A = false。 } else { KEY_UP = false。// 向下鍵是否被按下 private boolean KEY_LEFT = false。// 飛機(jī)移動(dòng)的計(jì)數(shù)器 int countFine = 0。 在界面初始化的同時(shí),還需要啟動(dòng)MoveThread線程、GameViewBackGroundThread線程、KeyThread線程以及ExplodeThread線程。當(dāng)玩家單擊“幫助”時(shí)將初始化幫助界面HelpView并將其顯示出來。接著再去,下載,Android 。這種方式只能畫靜態(tài)或者極為簡(jiǎn)單的2D圖畫,對(duì)于實(shí)時(shí)性很強(qiáng)的動(dòng)畫,高品質(zhì)的游戲都是沒法實(shí)現(xiàn)的。 Android的Activity組件Activity,一般代表手機(jī)屏幕的一屏,相當(dāng)于瀏覽器的一個(gè)頁面。單從面向?qū)ο蟮奶匦詠砜?,Java類似于SmallTalk,但其它特性、尤其是適用于分布式計(jì)算環(huán)境的特性遠(yuǎn)遠(yuǎn)超越了SmallTalk。另外,Java中的類有一個(gè)運(yùn)行時(shí)刻的表示,能進(jìn)行運(yùn)行時(shí)刻的類型檢查。通常有兩種方法來創(chuàng)建線程:其一,使用型構(gòu)為Thread(Runnable) 的構(gòu)造子將一個(gè)實(shí)現(xiàn)了Runnable接口的對(duì)象包裝成一個(gè)線程,其二,從Thread類派生出子類并重寫run方法,使用該子類創(chuàng)建的對(duì)象即為線程。 Java語言是解釋型的。Java通常被用在網(wǎng)絡(luò)環(huán)境中,為此,Java提供了一個(gè)安全機(jī)制以防惡意代碼的攻擊。 Java語言是分布式的。二、相關(guān)研究綜述 關(guān)于java語言Java編程特點(diǎn) Java語言是簡(jiǎn)單的。其他操作系統(tǒng)的表現(xiàn)則要平穩(wěn)很多。并有關(guān)卡BOSS等著與你死戰(zhàn)。 Android platform目 錄一、 緒論…………………………………………………………………5二、 相關(guān)研究綜述…………………………………………………………6(一)關(guān)于java語言………………………………………………6 (二) 關(guān)于Android……………………………………………………8三、系統(tǒng)開發(fā)環(huán)境及相關(guān)技術(shù)……………………………………………10四、游戲所需類的分析與實(shí)現(xiàn)……………………………………………11(一)游戲的框架簡(jiǎn)介…………………………………………………11(二)游戲界面的框架簡(jiǎn)介……………………………………………12(三)各個(gè)類的簡(jiǎn)要介紹…………………………………………………13五、游戲界面展示…………………………………………………………22總結(jié)……………………………………………………………………27致謝………………………………………………………………………28參考文獻(xiàn)…………………………………………………………………29前 言隨著3G移動(dòng)網(wǎng)絡(luò)應(yīng)用的推廣,手機(jī)游戲的規(guī)模、復(fù)雜程度日益增強(qiáng);其技術(shù)手段、設(shè)計(jì)思想、系統(tǒng)體系結(jié)構(gòu)都發(fā)生了深刻的變化。 當(dāng)今網(wǎng)絡(luò)發(fā)展迅速,益智類游戲被廣泛運(yùn)用到網(wǎng)絡(luò)各大平臺(tái)上。 關(guān)鍵詞:滾屏游戲;飛機(jī)大戰(zhàn);手機(jī)游戲 ;Android平臺(tái)Abstract: the World War II aircraft rolling screen action game one, incorporating many action games unique technology, and smooth picture, sound network is developing rapidly, a puzzle game is widely applied to the network the platform. From the network the platform game, through the Eclipse Android SDK Java language prepared by the World War II aircraft.This paper elaborated on the platform of Android, objectoriented software development thought to the World War II aircraft game system analysis, design and implementation process. In the practice of the project process, the main use of the following techniques: the layout of the main mobile phone using XML design, procedures and sub module life cycle management used in the Activity process control, the game screen is updated using the mobile phone 2D graphics programming. In this paper, the front half part of brief introduction of system related industry information and basic technical knowledge, the second part of the each module of the system used in the realization of the key technology for a prehensive introduction.Key words: scrolling game。機(jī)戰(zhàn)類游戲一直以來都很多。1.3研究現(xiàn)狀和發(fā)展趨勢(shì)據(jù)Gartner最新數(shù)據(jù)顯示,2010年第二、三季度全球智能手機(jī)銷售繼續(xù)大幅增長(zhǎng),%,僅次于塞班,成為第二大智能手機(jī)系統(tǒng)。安卓操作系統(tǒng)發(fā)展迅猛主要得益于免費(fèi)、開源和良好產(chǎn)業(yè)運(yùn)作策略,這三點(diǎn)為安卓在智能手機(jī)市場(chǎng)贏得更多的發(fā)展機(jī)遇。Java語言提供類、接口和繼承等原語,為了簡(jiǎn)單起見,只支持類之間的單繼承,但支持接口之間的多繼承,并支持類與接口之間的實(shí)現(xiàn)機(jī)制(關(guān)鍵字為implements)。對(duì)指針的丟棄是Java的明智選擇。 Java語言是可移植的。事實(shí)上,Java的運(yùn)行速度隨著JIT(JustInTime)編譯器技術(shù)的發(fā)展越來越接近于C++。Java語言的設(shè)計(jì)目標(biāo)之一是適應(yīng)于動(dòng)態(tài)變化的環(huán)境。2 面向?qū)ο罂梢哉f是Java最重要的特性。根據(jù)Android的軟件框圖,其軟件層