版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
PAGEPAGE32石家莊科技信息職業(yè)學(xué)院畢業(yè)論文題目:基于J2ME的小球快跑游戲?qū)I(yè)班級(jí):軟件技術(shù)(游戲方向)09-24班
基于J2ME的小球快跑游戲摘要:手機(jī)是人們?nèi)粘I钪兴玫姆浅nl繁的通信工具。隨著JAVA技術(shù)的不斷更新提高,J2ME技術(shù)的出現(xiàn),使得手機(jī)游戲越來(lái)越成為我們關(guān)注的焦點(diǎn)。J2ME技術(shù)目前最流行的就是在制作手機(jī)游戲方面,JAVA手機(jī)的出現(xiàn)使得這一技術(shù)更有它的用武之地,發(fā)揮著他靈活、輕便、快捷的作用。J2ME平臺(tái)被是最杰出的手機(jī)游戲手機(jī)游戲平臺(tái),它一些非常重要的特征對(duì)開(kāi)發(fā)者都有很大益處。因?yàn)镴2ME應(yīng)用在不同設(shè)備上都是便攜式的,他們常??梢栽诰W(wǎng)絡(luò)上下載和執(zhí)行。本設(shè)計(jì)通過(guò)DriftBall和GameView等類進(jìn)行小球快跑游戲設(shè)計(jì),最后編程實(shí)現(xiàn)了全過(guò)程。關(guān)鍵詞:J2MEDriftBallGameView目錄設(shè)計(jì)內(nèi)容及過(guò)程……………4(1)游戲策劃………………… 4(2)設(shè)計(jì)背景………………..4(3)游戲框架設(shè)計(jì)…………… 5游戲主菜單的開(kāi)發(fā)…………5(1)WelcomeView類的代碼框架………… 5(2)WelcomeView類的主要成員方法.………6(3)WelcomeThread類的開(kāi)發(fā)…………8(4)菜單界面的用戶交互事件處理……….……9游戲界面模塊的開(kāi)發(fā)…………………… 11(1)GameView的成員變量11(2)GameThread類的代碼框架13(3)GameMenuThread類的開(kāi)發(fā)13游戲中各個(gè)圖層的開(kāi)發(fā)……………………..15(1)地圖圖層的開(kāi)發(fā)…………………. 15(2)其他圖層的開(kāi)發(fā)與實(shí)現(xiàn)………………… 18游戲后臺(tái)邏輯的開(kāi)發(fā)…………………....21(1)小球的運(yùn)動(dòng)控制21(2)小球的碰撞檢測(cè)25傳感器計(jì)算模塊的開(kāi)發(fā)27(1)BallListener類的開(kāi)發(fā)27(2)RotateUtil類的開(kāi)發(fā)28設(shè)計(jì)總結(jié)參考文獻(xiàn)…………31設(shè)計(jì)內(nèi)容及過(guò)程本設(shè)計(jì)針對(duì)小球快跑實(shí)現(xiàn)了新游戲、選關(guān)、恭喜過(guò)關(guān),繼續(xù)或沖完等過(guò)程??梢郧宄难菔靖鱾€(gè)畫面的切換和一些游戲開(kāi)發(fā)的類庫(kù)。游戲策劃本游戲從類型上看屬于動(dòng)作類通關(guān)游戲,因此在游戲開(kāi)發(fā)前進(jìn)行的策劃中需要考慮到諸如劇情規(guī)劃、關(guān)卡設(shè)計(jì)等內(nèi)容劇情規(guī)劃:由于本游戲主要是以玩法取勝,而不是靠游戲情節(jié)來(lái)吸引玩家,所以游戲的劇情的規(guī)劃可以盡量簡(jiǎn)單或者干脆沒(méi)有關(guān)卡設(shè)計(jì):關(guān)卡設(shè)計(jì)是本游戲的一個(gè)重點(diǎn),在關(guān)卡設(shè)計(jì)的時(shí)候,如何保證難易程度的循環(huán)漸進(jìn)和關(guān)卡之間的互異性以及關(guān)卡的可玩性是需要重視的問(wèn)題。目標(biāo)受眾:本游戲的操作方式十分簡(jiǎn)單,各個(gè)年齡階段的玩家都可以快速掌握。目標(biāo)平臺(tái):本游戲的目標(biāo)平臺(tái)為MTK。呈現(xiàn)技術(shù):本游戲的游戲畫面采用了圖元技術(shù),所以地圖的設(shè)計(jì)也是一個(gè)重點(diǎn),同時(shí)增強(qiáng)了游戲的空間感。(2)設(shè)計(jì)背景游戲中,首先必須要有個(gè)主應(yīng)用程序類,其次,為了把程序的畫面呈現(xiàn)出來(lái),就是要有畫布;為了比較容易管理地圖、增加或修改地圖比較方便,應(yīng)該把地圖和畫布分開(kāi)。這其中需要先了解游戲中應(yīng)用到的類。WelcomeView類繼承自SurfaceView類,其主要負(fù)責(zé)播放歡迎動(dòng)畫和顯示游戲主菜單。GameView類繼承自SurfaceView,其主要負(fù)責(zé)游戲主畫面的渲染。GameMenuThread負(fù)責(zé)實(shí)現(xiàn)游戲中菜單的逐行的效果。GameMap類負(fù)責(zé)負(fù)責(zé)提供游戲中的地圖信息,GameMap中存儲(chǔ)了所有關(guān)卡的信息,并對(duì)外提供了方法用于獲得指定關(guān)卡的地圖信息。DriftBall類繼承自Activity,其主要負(fù)責(zé)在不同的View之間進(jìn)行切換,同時(shí)也負(fù)責(zé)處理用戶單擊屏幕事件。BaiiListener類繼承自SensorListener類,氣質(zhì)要負(fù)責(zé)監(jiān)聽(tīng)手機(jī)姿態(tài)的變化并將捕獲到的數(shù)據(jù)傳遞給RotateUtil進(jìn)行分析計(jì)算。RotateUtil類主要負(fù)責(zé)接收手機(jī)姿態(tài)的變化數(shù)據(jù),并根據(jù)一系列算法計(jì)算出在這種姿態(tài)下的小球的運(yùn)動(dòng)方向。(3)游戲框架設(shè)計(jì)游戲基本框架圖:圖1小球快跑游戲基本框架游戲主菜單的開(kāi)發(fā)WelcomeView類的代碼框架代碼如下:packagewyf.wpf; //聲明包語(yǔ)句importandroid.content.Context; //引入相關(guān)類importandroid.content.res.Resources; //引入相關(guān)類importandroid.graphics.Bitmap; //引入相關(guān)類importandroid.graphics.BitmapFactory; //引入相關(guān)類importandroid.graphics.Canvas; //引入相關(guān)類importandroid.graphics.Color; //引入相關(guān)類importandroid.graphics.Matrix; //引入相關(guān)類importandroid.graphics.Paint; //引入相關(guān)類importandroid.view.SurfaceHolder; //引入相關(guān)類importandroid.view.SurfaceView; //引入相關(guān)類/**該類繼承自View,負(fù)責(zé)歡迎界面的繪制*/publicclassWelcomeViewextendsSurfaceViewimplementsSurfaceHolder.Callback{ DriftBallfather; WelcomeThreadwt; WelcomeDrawThreadwdt; Bitmap[]bmpBackScreen; //后臺(tái)背景的動(dòng)畫幀 Bitmap[]bmpStartOrQuit; //開(kāi)始和退出的兩個(gè)大球圖片 Bitmap[]bmpSoundOption; //聲音選項(xiàng)的兩個(gè)大球圖片 intstatus=-1; //狀態(tài)值,為0表示待命,1表示開(kāi)始或退出按鈕按下,2為顯示加載中 intselectedIndex=-1; //被選中的命令,只能是開(kāi)始或退出 intbackIndex; //后臺(tái)幀動(dòng)畫的索引 Matrixm; //Matrix對(duì)象,負(fù)責(zé) int[][]planetCoordinate={ //三個(gè)球的位置數(shù)組 {60,120}, {120,300}, {180,220} }; //構(gòu)造器,初始化成員變量 publicWelcomeView(DriftBallfather){ super(father); wt=newWelcomeThread(this); getHolder().addCallback(this); wdt=newWelcomeDrawThread(this,getHolder()); initBitmap(father); //初始化圖片 this.father=father; status=0; m=newMatrix(); }WelcomeView類主要成員方法代碼如下:packagewyf.wpf; //聲明包語(yǔ)句importorg.openintents.sensorsimulator.hardware.SensorManagerSimulator;//引入相關(guān)類importandroid.app.Activity; //引入相關(guān)類importandroid.graphics.Rect; //引入相關(guān)類importandroid.hardware.SensorManager; //引入相關(guān)類importandroid.media.MediaPlayer; //引入相關(guān)類importandroid.os.Bundle; //引入相關(guān)類importandroid.os.Handler; //引入相關(guān)類importandroid.os.Message; //引入相關(guān)類importandroid.view.KeyEvent; //引入相關(guān)類importandroid.view.MotionEvent; //引入相關(guān)類importandroid.view.View; //引入相關(guān)類importandroid.view.Window; //引入相關(guān)類importandroid.view.WindowManager; //引入相關(guān)類/**該類為游戲的主類,所有的View對(duì)象在這里有所引用,主要的功能是實(shí)現(xiàn)游戲*的流程控制,提供游戲需要的常量,在視圖之間進(jìn)行切換。*/publicclassDriftBallextendsActivity{ publicstaticfinalintSTATUS_PLAY=0; //游戲進(jìn)行中 publicstaticfinalintSTATUS_PAUSE=1; //游戲暫停 publicstaticfinalintSTATUS_WIN=2; //通過(guò)一關(guān) publicstaticfinalintSTATUS_LOSE=3; //丟掉一條命 publicstaticfinalintSTATUS_OVER=4; //送完命了,游戲結(jié)束 publicstaticfinalintSTATUS_PASS=5; //通全關(guān) publicstaticfinalintMAX_LIFE=5; //最大生命數(shù) publicstaticfinalintMAX_LEVEL=5; //最大關(guān)卡數(shù) intlevel=1; //初始狀態(tài)等級(jí)為1 intlife=MAX_LIFE; //初始狀態(tài)生命數(shù)最大 RectrectStart; //開(kāi)始圓球按鈕的矩形框 RectrectSoundOption; //聲音選項(xiàng)圓球按鈕的矩形框 RectrectQuit; //推出圓形按鈕的矩形框 RectrectContinue; //繼續(xù)游戲菜單項(xiàng)的矩形框 RectrectSoundAlter; //聲音選項(xiàng)菜單項(xiàng)的矩形框 RectrectHelp; //幫助菜單項(xiàng)的矩形框 RectrectBackToMain; //回到主菜單菜單項(xiàng)的矩形框 RectrectGameMsgBox; //屏幕中間提示消息的矩形框 MediaPlayermpGameMusic; //游戲背景音樂(lè) MediaPlayermpPlusLife; //加命的音樂(lè) MediaPlayermpMissileHit; //導(dǎo)彈打中的音樂(lè) MediaPlayermpGameWin; //通過(guò)了一關(guān)的音樂(lè) MediaPlayermpGameLose; //損失一條命的音樂(lè) MediaPlayermpBreakOut; //顯示菜單和掉入陷阱以及被吃掉的音樂(lè) booleanwantSound=true; //標(biāo)志位,記錄是否播放音樂(lè) ViewcurrView; //記錄當(dāng)前顯示的View GameViewgv; //游戲視圖的引用 WelcomeViewwv; //歡迎視圖的引用 BallListenerbl; //繼承自SensorListener的監(jiān)聽(tīng)器 HelpViewhv; //幫助視圖 //@1======對(duì)源代碼進(jìn)行如下修改以連接SensorSimulator// SensorManagermySensorManager; SensorManagerSimulatormySensorManager; HandlermyHandler=newHandler(){ publicvoidhandleMessage(Messagemsg){ //重寫handleMessage方法 switch(msg.what){ case0: //0為收到來(lái)自WelcomeView的開(kāi)始游戲命令 gv=newGameView(DriftBall.this); setContentView(gv); //設(shè)置當(dāng)前View currView=gv; //記錄當(dāng)前View startSensor(); //開(kāi)啟傳感器 圖2游戲開(kāi)始界面WelcomeThread的開(kāi)發(fā)代碼如下:packagewyf.wpf; //聲明包語(yǔ)句/**該類繼承自Thread,為歡迎界面的后臺(tái)線程,*負(fù)責(zé)修改相關(guān)數(shù)據(jù),達(dá)到動(dòng)畫效果*/publicclassWelcomeThreadextendsThread{ WelcomeViewfather; //WelcomeView引用 intsleepSpan=100; //休眠時(shí)間 booleanflag=false; //構(gòu)造器,接收WelcomeView對(duì)象引用 publicWelcomeThread(WelcomeViewfather){ this.father=father; this.flag=true; } }菜單界面的用戶交互事件處理代碼如下: //重寫的方法,用于接收和處理用戶點(diǎn)擊屏幕事件 @Override publicbooleanonTouchEvent(MotionEventevent){ if(event.getAction()==MotionEvent.ACTION_UP){ intx=(int)event.getX(); inty=(int)event.getY();if(currView==wv){ //當(dāng)前為歡迎界面 if(rectStart.contains(x,y)){ //點(diǎn)下開(kāi)始的圓球 wv.status=1; //設(shè)置狀態(tài)為1,有按鈕按下 wv.selectedIndex=0; //設(shè)置被選中的按鈕為開(kāi)始按鈕 } elseif(rectSoundOption.contains(x,y)){ //點(diǎn)下切換聲音的圓球 wantSound=!wantSound; //切換標(biāo)志位 if(!wantSound){ //如果當(dāng)前在播放聲音,停 if(mpGameMusic.isPlaying()){ try{ mpGameMusic.pause(); //暫停游戲背景音樂(lè) }catch(Exceptione){} } } elseif(wantSound){ //如果當(dāng)前沒(méi)有播放聲音,播放 if(!mpGameMusic.isPlaying()){ try{ mpGameMusic.start(); //播放游戲背景音樂(lè) }catch(Exceptione){} } } } elseif(rectQuit.contains(x,y)){ //點(diǎn)下退出的圓球 wv.status=1; //設(shè)置狀態(tài)為1,有按鈕按下 wv.selectedIndex=1; //設(shè)置被選中的按鈕為退出按鈕 } } elseif(currView==gv){ //當(dāng)前為游戲界面在顯示 if(gv.status==STATUS_PAUSE){ if(rectContinue.contains(x,y)){ //點(diǎn)下繼續(xù)游戲菜單 gv.gmt.isOut=true; //菜單開(kāi)始退出屏幕 } elseif(rectSoundAlter.contains(x,y)){ //點(diǎn)下切換聲音菜單 wantSound=!wantSound; if(!wantSound){ //判斷記錄值的真假 if(mpGameMusic.isPlaying()){ try{ mpGameMusic.pause(); //暫停聲音 }catch(Exceptione){} } } elseif(wantSound){ if(!mpGameMusic.isPlaying()){ try{ mpGameMusic.start(); //播放聲音 }catch(Exceptione){} } } gv.gmt.isOut=true; } elseif(rectHelp.contains(x,y)){ //點(diǎn)下幫助菜單 gv.gmt.isOut=true; //淡出菜單 gv.pauseGame(); //暫停游戲 hv=newHelpView(this); //創(chuàng)建HelpView對(duì)象 setContentView(hv); //切屏 currView=hv; } elseif(rectBackToMain.contains(x,y)){ //點(diǎn)下回主菜單 gv.gmt.isOut=true; //淡出菜單 wv=newWelcomeView(this); //創(chuàng)建歡迎界面 setContentView(wv); //切屏 currView=wv; //記錄當(dāng)前View pauseSensor(); //暫停Sensor gv.shutAll(); //關(guān)閉gv的附屬線程 gv=null; } } elseif(gv.status==STATUS_WIN){ //闖過(guò)一關(guān) if(rectGameMsgBox.contains(x,y)){ gv.initGame(); gv.resumeGame(); //開(kāi)始下一關(guān)的游戲 } } elseif(gv.status==STATUS_PASS||gv.status==STATUS_OVER){ //當(dāng)前狀態(tài)為通全關(guān)或死完了 if(rectGameMsgBox.contains(x,y)){ //判斷點(diǎn)擊的位置 wv=newWelcomeView(this); //創(chuàng)建歡迎界面 setContentView(wv); //切屏 currView=wv; //記錄View pauseSensor(); //暫停監(jiān)聽(tīng)器 gv.shutAll(); //關(guān)閉gv附屬線程 gv=null; } } } } returntrue; } 游戲界面模塊的開(kāi)發(fā)GameView的成員變量代碼如下:packagewyf.wpf; //聲明包語(yǔ)句importjava.util.ArrayList; //引入相關(guān)類importandroid.content.res.Resources; //引入相關(guān)類importandroid.graphics.Bitmap; //引入相關(guān)類importandroid.graphics.BitmapFactory; //引入相關(guān)類importandroid.graphics.Canvas; //引入相關(guān)類importandroid.view.SurfaceHolder; //引入相關(guān)類importandroid.view.SurfaceView; //引入相關(guān)類importandroid.view.SurfaceHolder.Callback; //引入相關(guān)類importstaticwyf.wpf.DriftBall.*; //引入相關(guān)類/**該類繼承自SurfaceView,主要功能是繪制游戲屏幕,對(duì)后臺(tái)的繪制或其他線程*進(jìn)行控制。*/publicclassGameViewextendsSurfaceViewimplementsCallback{ intscreenWidth=320; //屏幕寬度 intscreenHeight=480; //屏幕高度 intbackY; //x坐標(biāo)總是為零 intnebulaX; //星云的x坐標(biāo) intnebulaY; //星云的y坐標(biāo) intballX; //小球的橫坐標(biāo) intballY; //小球的縱坐標(biāo) inttileSize=20; //圖元的大小 intdirection=-1; //小球運(yùn)動(dòng)方向,上為0,順時(shí)針依次為1~7 intvelocity=4; //小球運(yùn)動(dòng)速度 inteatIndex; //吃人動(dòng)畫幀索引 intstatus; //游戲狀態(tài) inttrapIndex; //陷阱動(dòng)畫索引 booleanshowMenu; //是否顯示菜單 DriftBallfather; //DriftBall引用 DrawThreaddt; //繪制線程 GameThreadgt; //后臺(tái)數(shù)據(jù)的修改線程 CannonThreadct; //大炮線程 GameMenuThreadgmt; //游戲菜單線程 Meteorolite[]meteoArray; //隕石數(shù)組 ArrayList<Missile>alMissile=newArrayList<Missile>(); //存放導(dǎo)彈集合 ArrayList<Cannon>alCannon=newArrayList<Cannon>(); //存放大炮集合 BitmapbmpStar; //星空?qǐng)D片 BitmapbmpNebula; //星云圖片 BitmapbmpBall; //小球圖片 BitmapbmpTile; //地圖圖元,即路的圖片 Bitmap[]bmpMeteo; //隕石圖片 Bitmap[]bmpEat; //吃人圖片 BitmapbmpHome; //家的圖片 Bitmap[]bmpTrap; //陷阱圖片 BitmapbmpCannon; //大炮圖片 BitmapbmpMissile; //導(dǎo)彈圖片 BitmapbmpPlusLife; //加命圖片 BitmapbmpMultiply; //乘號(hào)圖片,用以顯示命數(shù) Bitmap[]bmpNumber; //數(shù)字圖片 Bitmap[]bmpMenuItem; //菜單項(xiàng)圖片數(shù)組 BitmapbmpGameWin; //游戲勝利圖片 BitmapbmpGameOver; //游戲結(jié)束圖片 BitmapbmpGamePass; //游戲通關(guān)圖片 (2)GameThread類的代碼框架代碼如下:packagewyf.wpf; //聲明包語(yǔ)句/**這個(gè)類主要負(fù)責(zé)繪制元素的數(shù)據(jù)變化,如控制隕石和星云的幀何時(shí)切換*同時(shí)還負(fù)責(zé),移動(dòng)小球。不同的元素的不同的換幀間隔是通過(guò)幀控制計(jì)數(shù)器*來(lái)實(shí)現(xiàn)的。移動(dòng)小球的同時(shí)還會(huì)相應(yīng)地進(jìn)行碰撞檢測(cè)*/importstaticwyf.wpf.DriftBall.*; //引入DriftBall類的靜態(tài)常量publicclassGameThreadextendsThread{ GameViewfather; //GameView對(duì)象引用 intsleepSpan=25; //休眠時(shí)間 intbackCounter; //背景幀控制計(jì)數(shù)器 intnebulaCounter; //星云幀控制計(jì)數(shù)器 inteatCounter; //吃掉小球的幀控制計(jì)數(shù)器 inttrapCounter; //陷阱幀控制計(jì)數(shù)器 intmeteoCounter; //隕石幀控制計(jì)數(shù)器 booleanflag=false; //外層循環(huán) booleanisGameOn=false; //游戲是否在進(jìn)行 //構(gòu)造器 publicGameThread(GameViewfather){ this.father=father; this.flag=true; }GameMenuThraed類的開(kāi)發(fā)代碼如下:packagewyf.wpf; //聲明包語(yǔ)句/**該類繼承自Thread類,主要負(fù)責(zé)將菜單及菜單項(xiàng)在屏幕上的位置*進(jìn)行改變以達(dá)到動(dòng)畫效果*/publicclassGameMenuThreadextendsThread{ DriftBallfather; //主類引用 booleanflag; //循環(huán)控制變量 booleanisIn; //是否是淡入菜單 booleanisOut; //是否是淡出菜單 intsleepSpan=20; //睡眠時(shí)間 int[][]menuCoordinate={ //菜單在沒(méi)進(jìn)來(lái)之前的位置,分別是菜單背景和4個(gè)菜單項(xiàng) {350,0}, {400,30}, {450,80}, {500,130}, {550,180} }; //構(gòu)造器 publicGameMenuThread(DriftBallfather){ this.father=father; father.gv.menuCoordinate=this.menuCoordinate; flag=true; isIn=true; } //線程執(zhí)行方法 publicvoidrun(){ intinIndex=0; //淡入的索引順序 intoutIndex=4; //淡出時(shí)的索引順序 while(flag){ if(isIn){ //菜單進(jìn)屏幕 for(inti=inIndex;i<father.gv.menuCoordinate.length;i++){ father.gv.menuCoordinate[i][0]-=25; //向屏幕內(nèi)移動(dòng)菜單項(xiàng) if(father.gv.menuCoordinate[i][0]==150){ //判斷菜單項(xiàng)是否已到位 inIndex=i+1; //將開(kāi)始索引下移,即不再改變到位的菜單項(xiàng)坐標(biāo) } } if(inIndex==5){ //如果所有菜單項(xiàng)都移動(dòng)到位 isIn=false; //設(shè)置isIn標(biāo)志位為false } } elseif(isOut){ //菜單出屏幕 father.gv.menuCoordinate[outIndex][0]+=10; //向屏幕外移動(dòng)菜單項(xiàng) if(father.gv.menuCoordinate[outIndex][0]>=320){ //判斷是否將菜單項(xiàng)移出屏幕 outIndex--; //改移動(dòng)前一個(gè)菜單項(xiàng) if(outIndex<0){ //判斷是否所有的菜單項(xiàng)都移出屏幕 if(father.currView==father.gv){ //如果當(dāng)前View是GameView father.gv.resumeGame(); //調(diào)用resumeGame方法恢復(fù)游戲 } flag=false; //停止線程的執(zhí)行 } } } try{ //線程休眠 Thread.sleep(sleepSpan); } catch(Exceptione){ e.printStackTrace(); } } }}五.游戲中各個(gè)圖層的開(kāi)發(fā)地圖圖層的開(kāi)發(fā)代碼如下:packagewyf.wpf; //聲明包語(yǔ)句/**該類主要存儲(chǔ)一個(gè)靜態(tài)成員,3為數(shù)組,里面存放所有地圖,每個(gè)地圖*都是一個(gè)二維數(shù)組。同時(shí)還提供了一個(gè)靜態(tài)方法,調(diào)用之后返回一個(gè)*地圖的二維數(shù)組*/publicclassGameMap{ staticbyte[][][]map={//地圖,為0則空,為1則路,2為家,3是加命的,4是吃小球的,5是陷阱,6是大炮 { //第一關(guān) {1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, {0,1,1,1,1,5,1,1,1,1,0,0,0,0,0,0}, {0,0,0,1,0,0,0,0,0,1,1,1,1,0,0,0}, {0,0,0,1,1,1,1,1,1,1,0,0,1,0,0,0}, {0,0,0,0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,0,1,0,0}, {0,1,1,1,1,1,1,3,0,0,0,0,0,1,1,0}, {0,0,0,4,0,0,0,0,0,0,0,0,0,0,1,2} }, { //第五關(guān) {1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0}, {0,0,1,0,0,0,4,0,0,0,0,0,0,0,0,0}, {0,0,1,1,1,1,1,1,1,1,0,0,0,0,0,0}, {0,0,1,0,0,0,0,0,0,1,1,5,1,1,0,0}, {0,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0}, {0,4,1,1,1,1,1,5,1,1,1,1,1,1,1,0}, {0,1,1,0,1,0,0,0,0,0,1,0,0,0,1,0}, {0,1,0,0,1,0,0,0,0,1,1,0,0,0,1,0}, {0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0}, {0,1,0,0,1,0,0,0,0,3,1,1,1,1,1,0}, {0,1,0,0,1,0,0,6,0,0,0,0,0,0,1,0}, {0,1,1,1,1,3,0,0,0,0,0,0,4,3,1,0}, {0,0,0,0,0,1,1,3,0,0,0,0,0,0,1,0}, {0,0,0,0,0,1,0,1,0,0,0,0,0,0,1,4}, {0,1,1,5,1,1,0,1,1,1,1,1,0,0,1,0}, {0,1,0,0,0,0,0,0,0,0,0,1,1,1,1,0}, {0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0}, {0,1,1,1,1,1,1,1,1,1,1,3,1,1,0,0}, {0,0,0,0,0,3,0,0,0,1,0,0,0,1,0,0}, {0,0,0,0,0,4,0,0,0,1,0,0,0,1,0,0}, {0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0}, {0,0,0,0,0,1,1,1,1,1,0,0,0,1,0,0}, {0,1,1,1,1,1,0,0,0,1,1,1,1,3,0,0}, {2,1,0,0,4,0,0,0,0,0,0,0,0,0,0,6} } }; //方法,返回指定關(guān)卡的地圖數(shù)組 publicstaticbyte[][]getMap(intlevel){ returnmap[level-1]; }}(2)其他圖層的開(kāi)發(fā)與實(shí)現(xiàn)代碼如下:packagewyf.wpf; //聲明包語(yǔ)句/**該類代表隕石對(duì)象,將隕石的坐標(biāo),當(dāng)前幀號(hào)封裝起來(lái)*有一個(gè)成員方法負(fù)責(zé)初始化隕石的信息*/publicclassMeteorolite{ intx; //隕石x坐標(biāo) inty; //隕石y坐標(biāo) booleanup; //為true則在地圖圖層上,為false則在地圖圖層下 intindex; //旋轉(zhuǎn)角度 publicMeteorolite(){ //構(gòu)造器,調(diào)用init方法進(jìn)行初始化 init(); } publicvoidinit(){//方法:初始化成員變量 x=(int)(Math.random()*290); //隨機(jī)產(chǎn)生X坐標(biāo) y=-(int)(Math.random()*250); //隨機(jī)產(chǎn)生Y坐標(biāo) up=(Math.random()>0.5?true:false); //隨機(jī)設(shè)置是否在上層的標(biāo)志位 index=(int)(Math.random()*8); //隨機(jī)產(chǎn)生隕石動(dòng)畫的幀索引 }}packagewyf.wpf; //聲明包語(yǔ)句importjava.util.ArrayList; //引入相關(guān)類importandroid.content.res.Resources; //引入相關(guān)類importandroid.graphics.Bitmap; //引入相關(guān)類importandroid.graphics.BitmapFactory; //引入相關(guān)類importandroid.graphics.Canvas; //引入相關(guān)類importandroid.view.SurfaceHolder; //引入相關(guān)類importandroid.view.SurfaceView; //引入相關(guān)類importandroid.view.SurfaceHolder.Callback; //引入相關(guān)類importstaticwyf.wpf.DriftBall.*; //引入相關(guān)類/**該類繼承自SurfaceView,主要功能是繪制游戲屏幕,對(duì)后臺(tái)的繪制或其他線程*進(jìn)行控制。*/publicclassGameViewextendsSurfaceViewimplementsCallback{ intscreenWidth=320; //屏幕寬度 intscreenHeight=480; //屏幕高度 intbackY; //x坐標(biāo)總是為零 intnebulaX; //星云的x坐標(biāo) intnebulaY; //星云的y坐標(biāo) intballX; //小球的橫坐標(biāo) intballY; //小球的縱坐標(biāo) inttileSize=20; //圖元的大小 intdirection=-1; //小球運(yùn)動(dòng)方向,上為0,順時(shí)針依次為1~7 intvelocity=4; //小球運(yùn)動(dòng)速度 inteatIndex; //吃人動(dòng)畫幀索引 intstatus; //游戲狀態(tài) inttrapIndex; //陷阱動(dòng)畫索引 booleanshowMenu; //是否顯示菜單 DriftBallfather; //DriftBall引用 DrawThreaddt; //繪制線程 GameThreadgt; //后臺(tái)數(shù)據(jù)的修改線程 CannonThreadct; //大炮線程 GameMenuThreadgmt; //游戲菜單線程 Meteorolite[]meteoArray; //隕石數(shù)組 ArrayList<Missile>alMissile=newArrayList<Missile>(); //存放導(dǎo)彈集合 ArrayList<Cannon>alCannon=newArrayList<Cannon>(); //存放大炮集合 BitmapbmpStar; //星空?qǐng)D片 BitmapbmpNebula; //星云圖片 BitmapbmpBall; //小球圖片 BitmapbmpTile; //地圖圖元,即路的圖片 Bitmap[]bmpMeteo; //隕石圖片 Bitmap[]bmpEat; //吃人圖片 BitmapbmpHome; //家的圖片 Bitmap[]bmpTrap; //陷阱圖片 BitmapbmpCannon; //大炮圖片 BitmapbmpMissile; //導(dǎo)彈圖片 BitmapbmpPlusLife; //加命圖片 BitmapbmpMultiply; //乘號(hào)圖片,用以顯示命數(shù) Bitmap[]bmpNumber; //數(shù)字圖片 Bitmap[]bmpMenuItem; //菜單項(xiàng)圖片數(shù)組 BitmapbmpGameWin; //游戲勝利圖片 BitmapbmpGameOver; //游戲結(jié)束圖片 BitmapbmpGamePass; //游戲通關(guān)圖片 圖3游戲運(yùn)行界面五.游戲后臺(tái)邏輯的開(kāi)發(fā)(1)小球的運(yùn)動(dòng)控制代碼如下packagewyf.wpf; //聲明包語(yǔ)句/**這個(gè)類主要負(fù)責(zé)繪制元素的數(shù)據(jù)變化,如控制隕石和星云的幀何時(shí)切換*同時(shí)還負(fù)責(zé),移動(dòng)小球。不同的元素的不同的換幀間隔是通過(guò)幀控制計(jì)數(shù)器*來(lái)實(shí)現(xiàn)的。移動(dòng)小球的同時(shí)還會(huì)相應(yīng)地進(jìn)行碰撞檢測(cè)*/importstaticwyf.wpf.DriftBall.*; //引入DriftBall類的靜態(tài)常量publicclassGameThreadextendsThread{ GameViewfather; //GameView對(duì)象引用 intsleepSpan=25; //休眠時(shí)間 intbackCounter; //背景幀控制計(jì)數(shù)器 intnebulaCounter; //星云幀控制計(jì)數(shù)器 inteatCounter; //吃掉小球的幀控制計(jì)數(shù)器 inttrapCounter; //陷阱幀控制計(jì)數(shù)器 intmeteoCounter; //隕石幀控制計(jì)數(shù)器 booleanflag=false; //外層循環(huán) booleanisGameOn=false; //游戲是否在進(jìn)行 //構(gòu)造器 publicGameThread(GameViewfather){ this.father=father; this.flag=true; } //線程執(zhí)行方法 publicvoidrun(){ while(flag){ while(isGameOn){ //星空的運(yùn)動(dòng) backCounter++; if(backCounter==50/sleepSpan){ //星空是500ms移動(dòng)一下 father.backY-=1; backCounter=0; if(father.backY==-600){ father.backY=0; } } //星云的運(yùn)動(dòng) nebulaCounter++; if(nebulaCounter==40/sleepSpan){ father.nebulaY+=1; nebulaCounter=0; if(father.nebulaY>=480){ father.nebulaY=-150; father.nebulaX=(int)(Math.random()*250); } } //隕石的運(yùn)動(dòng) meteoCounter++; for(Meteorolitem:father.meteoArray){ m.y+=2; if(m.y>=father.screenHeight){ //超出屏幕邊界則重新初始化 m.init(); } } if(meteoCounter==150/sleepSpan){ for(Meteorolitem:father.meteoArray){ m.index=(m.index+1)%8; } meteoCounter=0; } //吃人動(dòng)畫 eatCounter++; if(eatCounter==200/sleepSpan){ father.eatIndex=(father.eatIndex+1)%father.bmpEat.length; eatCounter=0; } //陷阱動(dòng)畫 trapCounter++; if(trapCounter==300/sleepSpan){ father.trapIndex=(father.trapIndex+1)%father.bmpTrap.length; trapCounter=0; } //移動(dòng)炮彈 try{ if(father.alMissile.size()!=0){ for(Missilem:father.alMissile){ m.moveAndCheck(); } } } catch(Exceptione){ } //移動(dòng)小球 checkAndMoveBall(); try{ Thread.sleep(sleepSpan); } catch(Exceptione){ e.printStackTrace(); } } try{ Thread.sleep(800); } catch(Exceptione){ e.printStackTrace(); } } } //檢查移動(dòng)小球 publicvoidcheckAndMoveBall(){ switch(father.direction){ case0: //方向向上 father.ballY-=father.velocity; //Y方向上的移動(dòng) if(checkCollision()){ //檢測(cè)是否發(fā)生碰撞 father.ballY+=father.velocity; //若發(fā)生碰撞就撤銷移動(dòng) } break; case1: //方向右上 father.ballY-=father.velocity; //Y方向上的移動(dòng) if(checkCollision()){ //檢測(cè)是否發(fā)生碰撞 father.ballY+=father.velocity; //若發(fā)生碰撞就撤銷移動(dòng) } father.ballX+=father.velocity; //X方向上的移動(dòng) if(checkCollision()){ //檢測(cè)是否發(fā)生碰撞 father.ballX-=father.velocity; //若發(fā)生碰撞就撤銷移動(dòng) } break; case2: //方向向右 father.ballX+=father.velocity; //X方向上的移動(dòng) if(checkCollision()){ //檢測(cè)是否發(fā)生碰撞 father.ballX-=father.velocity; //若發(fā)生碰撞就撤銷移動(dòng) } break; case3: //方向右下 father.ballX+=father.velocity; //X方向上的移動(dòng) if(checkCollision()){ //檢測(cè)是否發(fā)生碰撞 father.ballX-=father.velocity; //若發(fā)生碰撞就撤銷移動(dòng) } father.ballY+=father.velocity; //Y方向上的移動(dòng) if(checkCollision()){ //檢測(cè)是否發(fā)生碰撞 father.ballY-=father.velocity; //若發(fā)生碰撞就撤銷移動(dòng) } break; case4: //方向向下 father.ballY+=father.velocity; //Y方向上的移動(dòng) if(checkCollision()){ //檢測(cè)是否發(fā)生碰撞 father.ballY-=father.velocity; //若發(fā)生碰撞就撤銷移動(dòng) } break; case5: //方向左下 father.ballX-=father.velocity; //X方向上的移動(dòng) if(checkCollision()){ //檢測(cè)是否發(fā)生碰撞 father.ballX+=father.velocity; //若發(fā)生碰撞就撤銷移動(dòng) } father.ballY+=father.velocity; //Y方向上的移動(dòng) if(checkCollision()){ //若發(fā)生碰撞就撤銷移動(dòng) father.ballY-=father.velocity; //若發(fā)生碰撞就撤銷移動(dòng) } break; case6: //方向向左 father.ballX-=father.velocity; //X方向上的移動(dòng) if(checkCollision()){ //若發(fā)生碰撞就撤銷移動(dòng) father.ballX+=father.velocity; //若發(fā)生碰撞就撤銷移動(dòng) } break; case7: //方向左上 father.ballX-=father.velocity; //X方向上的移動(dòng) if(checkCollision()){ //若發(fā)生碰撞就撤銷移動(dòng) father.ballX+=father.velocity; //若發(fā)生碰撞就撤銷移動(dòng) } father.ballY-=father.velocity; //Y方向上的移動(dòng) if(checkCollision()){ //若發(fā)生碰撞就撤銷移動(dòng) father.ballY+=father.velocity; //若發(fā)生碰撞就撤銷移動(dòng) } break; } } 小球的碰撞檢測(cè)代碼如下: publicbooleancheckCollision(){ intsize=father.tileSize; //獲取地圖圖元大小 byte[][]map=father.currMap; //獲取地圖矩陣 introw=0; intcol=0; //檢查左上角 col=father.ballX/size; //求出左上角在地圖中所占的列數(shù) row=father.ballY/size; //求出左上角在地圖中所占的行數(shù) if(col>=0&&col<map[0].length&&row>=0&&row<map.length&&map[row][col]==0){ returntrue; } //檢查右上角 col=(father.ballX+size-1)/size;//求出右上角在地圖中所占的列數(shù) row=father.ballY/size; //求出右上角在地圖中所占的行數(shù) if(col>=0&&col<map[0].length&&row>=0&&row<map.length&&map[row][col]==0){ returntrue; } //檢查右下角 col=(father.ballX+size-1)/size;//求出右下角在地圖中所占的列數(shù) row=(father.ballY+size-1)/size;//求出右下角在地圖中所占的行數(shù) if(col>=0&&col<map[0].length&&row>=0&&row<map.length&&map[row][col]==0){ returntrue; } //檢查左下角 col=father.ballX/size; //求出左下角在地圖中所占的列數(shù) row=(father.ballY+size-1)/size; //求出左下角在地圖中所占的行數(shù) if(col>=0&&col<map[0].length&&row>=0&&row<map.length&&map[row][col]==0){ returntrue; } //檢查左邊界 if(father.ballX<0){ returntrue; } //檢查上邊界 if(father.ballY<0){ returntrue; } //檢查右邊界 if(father.ballX+size>father.currMap[0].length*size){ //前面的size指的是小球的尺寸,后面的是指圖元尺寸 returntrue; } //檢查下邊界 if(father.ballY+size>father.currMap.length*size){ returntrue; } //檢查是否遇到其他情況 col=father.ballX/size; row=father.ballY/size; if(col==(father.ballX+size-1)/size&&row==(father.ballY+size-1)/size){ //判斷小球是否正好在某個(gè)格子里 switch(father.currMap[row][col]){ case2: //到家了 father.status=STATUS_WIN; //設(shè)置游戲狀態(tài)為STATUS_WIN if(father.father.wantSound){ //如有需要播放聲音 try{ father.father.mpGameWin.start(); }catch(Exceptione){} } isGameOn=false; //暫停GameThread的執(zhí)行 if(father.father.level==MAX_LEVEL){ //檢查是否是最后一關(guān) father.status=STATUS_PASS; //設(shè)置游戲狀態(tài)為STATUS_PASS } else{ father.father.level+=1; //如果不是最后一關(guān),就將關(guān)卡加1 } break; case3: //吃到加命的 if(father.father.wantSound){ //如有需要播放聲音 try{ father.father.mpPlusLife.start(); } catch(Exceptione){} } father.ballX=col*size; //修正小球的X坐標(biāo) father.ballY=row*size; //修正小球的Y坐標(biāo) father.currMap[row][col]=1; //將地圖矩陣中該位置改為道路 father.father.life+=1; //小球的生命數(shù)加1 break; case4: //被吃了 father.status=STATUS_LOSE; //設(shè)置游戲狀態(tài)為STATUS_LOSE if(father.father.wantSound){ //如有需要播放聲音 try{ father.father.mpBreakOut.start(); }catch(Exceptione){} } father.father.life-=1; //小球的生命數(shù)減1 if(father.father.life<=0){ father.status=STATUS_OVER; //如果小球生命耗盡,設(shè)置狀態(tài)位為STATUS_OVER } else{ father.ballX=0; //復(fù)位小球坐標(biāo) father.ballY=0; } break; }傳感器計(jì)算模塊的開(kāi)發(fā)BallListener類的開(kāi)發(fā)代碼如下:packagewyf.wpf; //聲明包語(yǔ)句importandroid.hardware.SensorListener;//引入相關(guān)類importandroid.hardware.SensorManager;//引入相關(guān)類/**該類繼承自SensorListener,主要功能是感應(yīng)傳感器的姿態(tài)數(shù)據(jù)*通過(guò)onSensorChanged方法讀取數(shù)據(jù),并調(diào)用RoatatUtil中的靜態(tài)*方法來(lái)確定小球應(yīng)該移動(dòng)的方向。*/publicclassBallListenerimplementsSensorListener{ DriftBallfather; //DriftBall引用 inttimeSpan=500; //500MS檢查一次 longstartTime; //記錄開(kāi)始的時(shí)間 publicBallListener(DriftBallfather){ //構(gòu)造器,初始化成員變量 this.father=father; startTime=System.currentTimeMillis(); //記錄系統(tǒng)時(shí)間作為當(dāng)前時(shí)間 } @Override publicvoidonAccur
溫馨提示
- 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 廣東外語(yǔ)外貿(mào)大學(xué)《營(yíng)養(yǎng)生理學(xué)》2023-2024學(xué)年第一學(xué)期期末試卷
- 廣東司法警官職業(yè)學(xué)院《別墅建筑設(shè)計(jì)》2023-2024學(xué)年第一學(xué)期期末試卷
- 廣東生態(tài)工程職業(yè)學(xué)院《西方經(jīng)濟(jì)學(xué)(下)》2023-2024學(xué)年第一學(xué)期期末試卷
- 七年級(jí)上冊(cè)《6.2.1直線、射線、線段》課件與作業(yè)
- 廣東南華工商職業(yè)學(xué)院《色彩靜物及人物頭像》2023-2024學(xué)年第一學(xué)期期末試卷
- 廣東梅州職業(yè)技術(shù)學(xué)院《計(jì)算機(jī)創(chuàng)客訓(xùn)練》2023-2024學(xué)年第一學(xué)期期末試卷
- 廣東茂名健康職業(yè)學(xué)院《半導(dǎo)體器件原理》2023-2024學(xué)年第一學(xué)期期末試卷
- 一年級(jí)數(shù)學(xué)計(jì)算題專項(xiàng)練習(xí)1000題匯編
- 2024八年級(jí)地理上冊(cè)第三章自然資源-我們生存和發(fā)展的物質(zhì)基礎(chǔ)學(xué)情評(píng)估晉教版
- 【2021屆備考】2020全國(guó)名校物理試題分類解析匯編(11月第二期)A4-豎直上拋運(yùn)動(dòng)
- Unit 1 You and Me Section A 1a~Pronunciation說(shuō)課稿-2024-2025學(xué)年人教版英語(yǔ)七年級(jí)上冊(cè)
- 2024年托管裝修責(zé)任協(xié)議
- 補(bǔ)牙講課課件
- 電動(dòng)車著火應(yīng)急預(yù)案
- 國(guó)家自然科學(xué)基金申請(qǐng)書模板三篇
- 系統(tǒng)運(yùn)行維護(hù)方案
- 外貿(mào)企業(yè)海外市場(chǎng)開(kāi)拓計(jì)劃書
- (醫(yī)學(xué)課件)護(hù)理人文關(guān)懷
- 數(shù)據(jù)采集服務(wù)委托合同
- DB11T 1833-2021 建筑工程施工安全操作規(guī)程
- 河長(zhǎng)制工作總結(jié)報(bào)告5篇河長(zhǎng)制年度工作總結(jié)
評(píng)論
0/150
提交評(píng)論