【正文】
例以及結(jié)果分析。于 2021 年 8 月被美國科技企業(yè) Google 收購。 Linux 內(nèi)核也是作為硬件與軟件棧的抽象層。使用 ADT 之前,必須確認已經(jīng)安裝了 Eclipse 以及同 Eclipse IDE 兼容版本的 Android SDK。 如下圖 所示: 電子科技大學中山學院畢業(yè)設(shè)計(論文) 第 4 章 游戲設(shè)計 12 圖 游戲主界面 游戲 邏輯實現(xiàn) 1) 游戲 布局 本游戲的設(shè)計用到了線性布局、相對布局、表格布局等等。 4) 數(shù)字合并 滑動方向不同時 , 執(zhí)行不同的遍歷順序 。 8) 撤 銷功能 撤銷操作,獲取操作記錄棧中最后的記錄,并重繪界面 。測試初級階段主要由游戲主要編程員進行測試,以便能 夠全面的進行一次錯誤排查。 if(x==3 amp。amp。 //獲取空白格的 view,并將 其背景置成當前格的背景 View nextView = (nextIdx)。 (nextIdx)。y++){ for(int x=2。y++){ int thisIdx = 4*y +x。 } } /** * 根據(jù)參數(shù)重繪界面 * param spaceList 空白格列表 * param numberList 數(shù)字格列表 * param score 當前分數(shù) 電子科技大學中山學院畢業(yè)設(shè)計(論文) 附錄 32 */ public void drawViews(ListInteger spaceList, NumberList numberList, int score){ (score+)。從最初的運行于掌上游戲機的“貪吃蛇”和“俄羅斯方塊”到如今風靡全世界的網(wǎng)游無不體現(xiàn)了游戲的魅力。特別是 iPhone 智能手機和 Android 智能手機的面世,為掌上休閑游戲與應用提供了 更完善的的開發(fā)環(huán)境。 for(int i=0。 電子科技大學中山學院畢業(yè)設(shè)計(論文) 附錄 31 } } break。x){ int thisIdx = 4*y +x。 } } /** * 該方法,為每個符合條件的格子執(zhí)行變動的操作,如置換,升級等 * param thisIdx 當前格子的坐標 * param direction 滑動方向 */ public void Change(int thisIdx,int direction){ if((thisIdx)){ int nextIdx = getLast(thisIdx, direction)。 電子科技大學中山學院畢業(yè)設(shè)計(論文) 附錄 27 (icons[(thisIdx)])。 if(x==3 amp。 direction==RIGHT) return 1。 測試 內(nèi)容 為了更好的測試游戲的可用性現(xiàn)用安卓模擬器進行測試,首先打開 Eclipse 軟件,通過 import 將源代碼導入工作區(qū),然后點擊工具欄的開始按鈕打開模擬器進行運行,當游戲進入游戲主界面時按照以下步驟進行測試。 將當前的界面記錄在棧中彈出 。再調(diào)用置換方法實現(xiàn)。表格布局用來顯示 4 乘 4 的方格。有 SE、 EE、ME 三個版本。 Android 版本 Android 操作系統(tǒng)是一個由 Google 和開放手持設(shè)備聯(lián)盟共同開發(fā)發(fā)展的 移動設(shè)備操作系統(tǒng),其最早的一個版本 Android beta 發(fā)布于 2021 年 11 月 5 日,至今已經(jīng)發(fā)布了多個更新。 2021 年末數(shù)據(jù)顯示,僅正式推出兩年的 Android 操作系統(tǒng)在市場占有率上已經(jīng)超越稱霸逾十年的諾基亞 Symbian 系統(tǒng),成 為全球第一大智能手機操作系統(tǒng)。但是,由于一些非技術(shù)上的原因, Oak 語言并沒有得到迅速的推廣。 由于近幾年來, Android 智能 手機游戲的快速發(fā)展,游戲的分類也變得越來越豐富,目前手機游戲按內(nèi)容可分為:角色扮演類( RPG)、冒險類( AVG)、格斗類( FTG)、棋牌類、電影改版類、益智類、體育競技類、模擬類。 《 2048》這款小游戲是一款流行的 數(shù)字游戲 。在市場上成名的手機游戲基本上都是國外游戲公司開發(fā)的,而且很容易辨認。終于,在 1995 年, Java 這個被定位于網(wǎng)絡(luò)應用的程序設(shè)計語言被正式推出。 圖 Android 系統(tǒng)架構(gòu) ( 1)應用程序?qū)? 該層提供一些核心應用程序包,例如電子郵件、短信、日歷、地圖、瀏覽器和聯(lián)系人管理等。 開發(fā)平臺介紹 2048 Android 游戲開發(fā)平臺為 + + ,模擬測試平臺為 Android SDK 模擬器,真機測試平臺為 ZTEU930HD。 ADT 插件提供了一系列圖形用戶界面組件進行界面編程,所以在技術(shù)上可行。相應的數(shù)字對四取余得到該數(shù)字的橫坐標,除以四得到該數(shù)字的縱坐標。 然后在空白格列表中加入當前格子 , 在數(shù)字列中刪掉第一個格子 , 將數(shù)字列表對應的內(nèi)容升級 。 9) 重置功能 清空界面, 清空數(shù)字,使得分為零, 重新初始化 。 ( 3) 向下滑動,如圖所示: 圖 向下滑動 結(jié)果:正常 。 direction==LEFT) return 1。 if(y==3 amp。 //在數(shù)字格列表中,當前格的坐標置換成目標格的坐標 (thisIdx, nextIdx)。 }else{ if((thisIdx) == (nextIdx)){ //可以合并 levelup(thisIdx, nextIdx)。 case LEFT: for(int y=0。x++){ for(int y=2。 ImageView image = (ImageView) ()。然后介紹了 Android 平臺開發(fā)環(huán)境及環(huán)境搭建,最后講述了基于 Android 飛機大戰(zhàn)游戲功能的實現(xiàn)。 同時,非常感謝我的 室友 李朗 和劉雨坤 ,在論文編寫和畢業(yè)設(shè)計的制作過程中,給予我 鼓勵和關(guān)懷,提出了許多寶貴意見和建議,再次深表感謝。 (歷史軌跡壓入棧中 )。x4。 ()。 //在空白格列表中加入當前格 (thisIdx)。 //獲取當前格子的 view,并將其置成空白格 View thisView = (thisIdx)。 } /** * 用于獲取移動方向上前一個格子的位置 * param index 當前格子的位置 * param direction 滑動方向 * return 如果在邊界在返回 1 */ public int getBefore(int index,int direction){ 電子科技大學中山學院畢業(yè)設(shè)計(論文) 附錄 26 int y = index/4。成功的大門永遠為那些追逐目標而奮發(fā)圖強的人而開。 ( 4) 深度測試。 7) 游戲計分 每當有相同的數(shù)字合并時 , 合并所得的所有新生成數(shù)字相加即為該此移動的有效得分 。 特殊情況: 1. 由于人的手指在滑動方向會有偏差,一般不會精準的向四個方向滑動,肯定會有偏差,所以要判斷手指滑過方向的是水平方向還是垂直方向的 意圖,當水平方向的偏移量大于垂直方向的偏移量時,表明用戶是水平滑動意圖,當垂直方向的偏移量大于水平方向的偏移量,表明用戶是垂直方向滑動的意圖。同時保存游戲最高分 到本地,下次啟動應用時顯示歷史最高分 。 ADT 是 Eclipse 中構(gòu)建 Android 應用程序 IDE 插件, ADT 擴展了 Eclipse 的功能,讓開發(fā)人員快速建立新的 Android 項目、創(chuàng)建應用程序的用戶界面。 Android 運行時包括核心庫和 Dalvik 虛擬機,前者既兼容了大多數(shù) Java 語言所需要調(diào)用的功能函數(shù),又包括了 Android 的核心庫,比如 、 、 等等。 Android 已發(fā)布的最新版本為Android (Lollipop)。 第 3 章:可行性分析,對 Android 2048 游戲進行 可行性分析。 【 關(guān)鍵詞 】 游戲; 益智; 數(shù)字電子科技大學中山學院畢業(yè)設(shè)計(論文) Abstract II Based on the Android platform 2048 game 【 Abstract】 In the accelerated pace of life in the modern society, easy puzzle game to ease the pressure of , adjust the mood has important meaning 2048 this small game is a popular digital game. The first 2048 small game was released by Cirulli GitHub on Gabriele for the first time. 2048 was based on 1024 and small three Legend of the two gameplay and the development of a new type of digital games and game design original intention is a puzzle game, its characteristics is easy and simple, therefore, to achieve the function to plete, easy to operate, Yi Xueyi use. Now developed a version of the ordinary version, hexagonal version, Dynasty version, 3D version, the palace version, etc. The Java language to develop the 2048 small game, 2048, the basic operation is realized through the Android platform, the purpose of simple and easy operation principle and alleviate the pressure of life, reduce the original intention of the rhythm of life, the game without different button, also need not particularly plex operations, only need to move a finger, you can maneuverability. Game through the processing of the graphical interface to display different colors with different numbers, and have the highest score records, undo the last step, reset the function of the game. The logic of the game to achieve part of the test, the test results are normal, there is no abnormal. But the game interface may be a little simple, in the future can be used to beautify the interface to get a better gaming experience. 【 Key Words】 game; puzzle; numbel電子科技大學中山學院畢業(yè)設(shè)計(論文) 目 錄 III 目 錄 第 1 章 緒論 ............................................................. 1 游戲開發(fā)背景 .................................................... 1 國內(nèi)外研究現(xiàn) 狀 .................................................. 1 游戲開發(fā)意義 .................................................... 2 論文結(jié)構(gòu) ........................................................ 2 第 2 章 相關(guān)技術(shù)和理論基礎(chǔ) .......................................