【正文】
ange to run in the same Linux process, sharing the same VM. ComponentsA central feature of Android is that one application can make use of elements of other applications (provided those applications permit it). For example, if your application needs to display a scrolling list of images and another application has developed a suitable scroller and made it available to others, you can call upon that scroller to do the work, rather than develop your own. Your application doesn39。s window by the () method. The content view is the View object at the root of the hierarchy. (See the separate User Interface document for more information on views and the hierarchy.)2)ServicesA service doesn39。t block ot。s possible to connect to (bind to) an ongoing service (and start the service if it39。t have a single entry point for everything in the application (no main()function, for example). Rather, they have essential ponents that the system can instantiate and run as needed. There are four types of ponents:1)ActivitiesAn activity presents a visual user interface for one focused endeavor the user can undertake. For example, an activity might present a list of menu items users can choose from or it might display photographs along with their captions. A text messaging application might have one activity that shows a list of contacts to send messages to, a second activity to write the message to the chosen contact, and other activities to review old messages or change settings. Though they work together to form a cohesive user interface, each activity is independent of the others. Each one is implemented as a subclass of the Activity base class.An application might consist of just one activity or, like the text messaging application just mentioned, it may contain several. What the activities are, and how many there are depends, of course, on the application and its design. Typically, one of the activities is marked as the first one that should be presented to the user when the application is launched. Moving from one activity to another is acplished by having the current activity start the next one.Each activity is given a default window to draw in. Typically, the window fills the screen, but it might be smaller than the screen and float on top of other windows. An activity can also make use of additional windows — for example, a popup dialog that calls for a user response in the midst of the activity, or a window that presents users with vital information when they select a particular item onscreen.The visual content of the window is provided by a hierarchy of views — objects derived from the base view class. Each view controls a particular rectangular space within the window. Parent views contain and organize the layout of their children. Leaf views (those at the bottom of the hierarchy) draw in the rectangles they control and respond to user actions directed at that space. Thus, views are where the activity39。s files are visible only to that user and only to the application itself — although there are ways to export them to other applications as well.It39。 it39。在老師的帶領(lǐng)下我接受了全新的思想觀念,樹立了宏偉的學(xué)術(shù)目標(biāo),領(lǐng)會了基本的思考方式。再次感謝全體老師對我的栽培,是他們帶領(lǐng)我走向計(jì)算機(jī)知識的大門,也促使我對計(jì)算機(jī)產(chǎn)生了濃厚的興趣。這些正是我今后努力的方向。本系統(tǒng)的功能雖然還不完善,但是幾乎涵蓋了Android的所有開發(fā)技術(shù)以及手機(jī)游戲的基本功能,達(dá)到了綜合應(yīng)用所學(xué)知識的目的。另外,該系統(tǒng)的設(shè)計(jì)也體現(xiàn)了Eclipse用來開發(fā)手機(jī)游戲的優(yōu)點(diǎn),從系統(tǒng)設(shè)計(jì)到系統(tǒng)實(shí)現(xiàn)完全遵循了手機(jī)游戲的思想,思路清晰,結(jié)構(gòu)合理。(4) 關(guān)于界面本游戲關(guān)于界面主要是開發(fā)者,以及開發(fā)者的聯(lián)系方式,關(guān)于界面如下:圖59 關(guān)于測試圖第 6 章 結(jié)束語不知不覺,畢業(yè)設(shè)計(jì)已接近尾聲了。道具等級越高,加成效果越好。為了測試方便,我首先將人物等級玩到11級,然后分別進(jìn)行了繼續(xù)游戲和開始新游戲測試,然后分別顯示等級,測試結(jié)果如下圖52 開始游戲測試圖 開始游戲后,選擇關(guān)卡,等級不足,會進(jìn)行提示,測試結(jié)果如下圖53 關(guān)卡選擇等級不足測試圖 選擇等級足夠的城市以后,就可以進(jìn)行怪物洞府選擇。你同時也要對某個模塊或者集成模塊進(jìn)行非功能性的抽樣測試。(2)概要分析概要設(shè)計(jì)期間,測試的主要工作為:審核概要設(shè)計(jì)報(bào)告,概要設(shè)計(jì)是否符合全部需求,概要設(shè)計(jì)是否存在問題。為了盡可能多地找出程序中的錯誤,生產(chǎn)出高質(zhì)量的軟件產(chǎn)品,加強(qiáng)對測試工作的組織和管理就顯得尤為重要。第 5 章 系統(tǒng)測試軟件系統(tǒng)的測試時在系統(tǒng)正式使用之前,對系統(tǒng)的需求分析、設(shè)計(jì)規(guī)格說明和編碼的最終復(fù)審,是保證系統(tǒng)質(zhì)量的關(guān)鍵步驟。 private static final String DBNAME = 。import 。表410角色的數(shù)據(jù)表字段名稱數(shù)據(jù)類型說明NameChar(10)名稱GradeEmppiricalAttackDefenseLifeintintintintint等級經(jīng)驗(yàn)值攻擊力防御力生命值(2)地圖表(article)角色可以選擇地圖如表411所示。為一個給定的邏輯數(shù)據(jù)模型選取一個最合適應(yīng)用要求的物理結(jié)構(gòu)的過程,就是數(shù)據(jù)庫的物理模型設(shè)計(jì)。(2)一個1:1聯(lián)系可以轉(zhuǎn)化為一個獨(dú)立的關(guān)系模式,也可以與任意一端對應(yīng)的關(guān)系模式合并。圖45 系統(tǒng)全局ER圖 邏輯模型設(shè)計(jì)概念模型是獨(dú)立于任何一種數(shù)據(jù)模型的信息結(jié)構(gòu)。(4)保存關(guān)卡信息,包括城鎮(zhèn),洞府 由于手機(jī)游戲面向手機(jī)所有者單人操作,所以本游戲的面向用戶也就只有玩家自己,本系統(tǒng)采用了如下數(shù)據(jù)項(xiàng)和數(shù)據(jù)結(jié)構(gòu):(1) actor表,保存玩家等級,經(jīng)驗(yàn)值等等(2) body表,保存的是與怪物相關(guān)的信息(3) prop表,保存的是與怪物有關(guān)的信息等(4) map表,保存的是地圖信息。要設(shè)計(jì)出這樣的表,需要根據(jù)系統(tǒng)充分了解用戶各個方面的需求,包括現(xiàn)有的以及將來可能增加的需求。有一定的機(jī)率獲得40級裝備。有一定機(jī)率獲得20級裝備。有一定機(jī)率獲得10級裝備。但是這妖道李易實(shí)力相當(dāng)高,雖然這一次他逃離了小漁村,但他以后一定會再出現(xiàn),想要看看后面他還會使出什么高招來,那就等待他的出現(xiàn)吧。在小漁村中,若是你成功闖關(guān),就可以開啟下一個城鎮(zhèn)大門繼續(xù)修仙。你的起步將從小漁村開始,這里你會找到你的師父,他會教導(dǎo)你基本武功。 } else { setGrade(getGrade1) }else if(getGrade=7) { if (success()) { setGrade(getGrade()+1)。在本游戲中關(guān)于強(qiáng)化的設(shè)置如下:1)本游戲中武器、護(hù)甲、護(hù)符都可以強(qiáng)化,強(qiáng)化裝備成功等級加1級,強(qiáng)化失敗時會根據(jù)強(qiáng)化時等級有不同的結(jié)果(注:強(qiáng)化等級為9的也就是滿級的裝備不可以再強(qiáng)化,強(qiáng)化等級最低為0) 2)在游戲中,裝備的等級越高,強(qiáng)化成功的機(jī)率越低。本游戲中的套裝有:新手套裝,青龍?zhí)籽b,白虎套裝,朱雀套裝,玄武套裝。護(hù)符選擇界面類似與武器選擇界面。護(hù)甲選擇界面類似于武器選擇界面(3) 護(hù)符在本游戲中,護(hù)符的主要作用是生命值加成。它們的基礎(chǔ)加成依次是,新手刀加成10%,青龍刀基礎(chǔ)加成為20%,白虎劍基礎(chǔ)加成為30%,朱雀弓基礎(chǔ)加成為40%,玄武棍基礎(chǔ)加成為50%。1. 基礎(chǔ)道具詳細(xì)設(shè)置本游戲中,基本道具分為三類:武器,護(hù)甲,護(hù)符。以各種裝備的效果擴(kuò)大人物的唯美度。life40) { if(((int)(() * 5))%5==0) { life4=life4harmToBogy*2。 } } if(!shanbi()) { life1=life1harmToActor。 if (score) { while(life10amp。life20) { if(baoji()) { life2=life2harmToBogy*2。闖關(guān)成功有會獲得經(jīng)驗(yàn)和道具,并且有一定機(jī)率幸運(yùn)獲得額外經(jīng)驗(yàn)。然后怪物一、二、三若沒有死亡,則依次攻擊玩家。 1)類圖(如圖42所示):圖42 游戲關(guān)卡選擇類圖2)類描述(如表42)所示:表42游戲關(guān)卡選擇類表類名描述關(guān)卡選擇Activity類關(guān)卡選擇SurfaceView類,用于顯示關(guān)卡。點(diǎn)擊城市的圖片就可以完成城市選擇了。 if(canvas != null) { //draw方法在此不斷更新畫布 draw(canvas)。 2)類圖(如圖41所示):圖41菜單類圖 3)類邏輯(如表41所示):表41菜單類表類名描述主菜單Activity類主菜單SurfaceView類,用于顯示菜單。進(jìn)入以后可以從上次進(jìn)度繼續(xù)游戲。進(jìn)一步分析了此系統(tǒng)的數(shù)據(jù)庫結(jié)構(gòu)。在實(shí)際調(diào)研和需求分析的基礎(chǔ)上,對該系統(tǒng)設(shè)計(jì)數(shù)據(jù)庫。3)模型構(gòu)件部分本游戲?yàn)榱嗽O(shè)計(jì)方便,為角色、道具、怪物等創(chuàng)建了模型,封裝了所需核心數(shù)據(jù),邏輯以及計(jì)算關(guān)系。關(guān)于模塊主要是開發(fā)者的聯(lián)方式以及生命。其主要功能模塊有四大塊:游戲模塊、設(shè)置模塊、幫助模塊、關(guān)于模塊。該游戲應(yīng)易于修改、易于擴(kuò)充、易于維護(hù),能夠適應(yīng)業(yè)務(wù)不斷發(fā)展變化的需要。能連續(xù)準(zhǔn)確的進(jìn)行游戲,有較強(qiáng)的容錯能力。程序在設(shè)計(jì)時不僅考慮到基本功能——手機(jī)游戲功能的實(shí)現(xiàn),同時作為一個手機(jī)游戲程序,還集成了幫助、關(guān)于等模塊,完善了本游戲的功能。首先開始游戲,然后選擇關(guān)卡,進(jìn)行道具設(shè)置,然后闖關(guān)。慘淡設(shè)置邏輯流程如圖21所示:圖21 菜單設(shè)置流程邏輯2) 關(guān)卡選擇邏輯流程分析