freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

射擊類手機游戲的研究與設計畢業(yè)論文(參考版)

2024-08-30 14:48本頁面
  

【正文】 while (()) { int scoreTableNum = (1)。 }//查詢欲插入的數(shù)據(jù)是否在數(shù)據(jù)庫中已經(jīng)存在了 public int scoreTableNum() { db = getReadableDatabase()。 return scoreNum。 while (()) { int scoreNum = (1)。 }//查詢最小的分數(shù) public int scoreNum(int score) { db = getReadableDatabase()。 return minscore。 while (()) { int minscore = (1)。 }//查詢數(shù)據(jù)庫分數(shù)中的最大分 public int selectMinScore() { db = getReadableDatabase()。 return maxscore。 while (()) { int maxscore = (1)。 }//關閉數(shù)據(jù)庫連接 public int selectMaxScore() { db = getReadableDatabase()。 } return li。 while(()){ int score = ((score))。 Cursor cursor = (select * from score order by score desc, null)。 return cursor。//插入兩條初始的數(shù)據(jù) } public Cursor selectPlane() { db = getReadableDatabase()。139。139。139。039。039。139。139。 (CREATE TABLE score(score INT))。 public DButil(Context context) { super(context, plane_zjj, null, 1)。//沒有碰撞到就返回 false } 安卓數(shù)據(jù)庫的實現(xiàn) 設計方法 安卓使用的是手機自帶的數(shù)據(jù)庫 SQLite,此數(shù)據(jù)庫可針對創(chuàng)建時和更新時分別創(chuàng)建 sql 語句,通過繼承 SQLiteOpenHelper 類來實現(xiàn), 數(shù)據(jù)庫總共要實現(xiàn)兩總功能,一種為排行榜的數(shù)據(jù),另一種為飛機的具體參數(shù),如 :飛機的等級,聲音的狀態(tài),金錢數(shù),超級子彈的數(shù)量,子彈的等級,當前的最大關卡數(shù)等。 y2 = y3) { return true。 x2 = x3 amp。 y1 = y4 amp。如下圖所示: 圖 41 碰撞檢測示意圖 實現(xiàn)代碼 具體的實現(xiàn)代碼如下: public static boolean ifRam(int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4) { if (x1 = x4 amp。 //把飛機移動到想的位置 } 南京工程學院畢業(yè)設計說明書(論文) 43 實體碰撞判斷 設計方法 兩個在界面中顯示的圖像其實歸根結底可以把他們看做是兩個矩形,當兩個矩形的圖像有相接觸的部分時,即認定兩個物體相碰撞到了。amp。amp。amp。//保存兩者之前的橫向間距 my = (int) () 。amp。amp。amp。移動手指時,計算手指的坐標減去之前所保存的橫豎間距,即為現(xiàn)在 飛機所應在的位置,且不可讓飛機超出屏幕范圍。//重置背景 2 } } 我方飛機的移動方法 設計方法 只有當手指按在屏幕上且發(fā)生移動時,飛機才會做出相應的移動,并且飛機的圖片不能超出屏幕的移動范圍。 if (dy1 = ) { dy1 = 。 //初始化圖像 2 的位置 (bitmap, src, dst1, null)。//第二章圖片往下的速率為每次 4 像素 (0, dy1, , + dy1)。 實現(xiàn)代碼 實現(xiàn)的方法是將 2 個 dy 自加,超過屏幕高度后重置,核心代碼如下: public void drawBackGround(Canvas canvas) { dy1 += 4。 } 南京工程學院畢業(yè)設計說明書(論文) 41 } ...... 第四章 詳細設計 游戲背景的滾動 設計方法 游戲是一個 2d 的豎屏滾動游戲,背景圖其實就是兩張圖片不停的循環(huán),當下方圖片的左上角的 y 軸的坐標大于屏幕的高度則重置這張圖片,讓其 y 軸的坐標成為負的屏幕高度。 try { (100)。 } } } Override public void surfaceCreated(SurfaceHolder arg0) { new Thread(this).start()。 } } catch (Exception e) { ()。 for (Integer integer : li) { (第 + (++i) + 名 : + integer, 220, 250 + i * 100, paint)。 ListInteger li = ()。 } private void drawView() { try { if (sh != null) { c = ()。 sh = ()。 ()。 dst = new Rect(0, 0, displayWidth, displayHeight)。 displayHeight =().getResources().getDisplayMetrics().heightPixels。//背景圖片 bi = ((), )。 db = new DButil(context)。//聲音開始播放 } } 兩種狀態(tài)的圖片顯示如下 : 圖 312 開啟聲音和關閉聲音 南京工程學院畢業(yè)設計說明書(論文) 39 排行榜按鈕 設計方法和代碼 游戲排行榜是一個完全依賴于數(shù)據(jù)庫的界面,顯示了你有郵寄的最高分,最多顯示 8 個,從大到小排列,且沒有重復項。 (0)。 //更換圖片 (btnpressed_soundid, 1, 1, 0, 0, 1)。//將數(shù)據(jù)庫中表示聲音的鍵置為 1 ()。 = false。 y = 800 + ()) { i++。 y = 800 amp。 x = + () amp。 } } 游戲成功和失敗界面如下: 南京工程學院畢業(yè)設計說明書(論文) 37 圖 311 成功和失敗界面 開啟和關閉聲音 設計方法和代碼 聲音按鈕的實現(xiàn)方式較為簡單:主要代碼在 IndexActivity 中實現(xiàn)了,代碼如下: if (x = amp。 (, , , 0, 0, )。 () = (() + superBulletButton .getHeight()) / 2) { if ( 0) {//符合條件并且剩余的子彈數(shù)大于 0 。 () = (() superBulletButton .getHeight()) / 2 amp。 () = () amp。 () = 0 amp。 () == 1 amp。 == amp。 !choiceLoss amp。 !choiceSuccess amp。 } // 超級子彈 if (isRunning amp。amp。amp。amp。 my = (int) () 。amp。amp。amp。//如果按了返回鍵 則暫停線程 } return (keyCode, event)。 ()。//如果游戲是開啟聲音的狀態(tài)則開啟背景音樂 } } Override public void surfaceDestroyed(SurfaceHolder holder) { isRunning = false。//開啟線程 isRunning = true。 bossExplodeManage = new BossExplodeManage(this)。 bossmanage = new BossManage(this)。 superBulletManage = new SuperBulletManage(this)。 enemyBulletManage = new EnemyBulletManage(this)。 myBulletManage = new MyBulletManage(this)。 enemyManage = new EnemyManage(this)。//把畫布解鎖運用此種方式可增加畫面的運行效率 } } } Override public void surfaceCreated(SurfaceHolder holder) {//界面創(chuàng)建時運行 myPlaneManage = new MyPlaneManage(this)。 } } } catch (Exception e) { ()。 (loss, ( ()) / 2, ( ()) / 2, null)。 ()。 ()。 isRunning = false。 ( / 10)。 ( * 10 + , / 2, 758, scorePaint)。 ( + , / 2, 642, scorePaint)。 ( success, ( ()) / 2, ( ()) / 2, null)。 ()。 (allScore, 20, 70, textPaint)。 (superBulletButton, 0, (() ()) / 2, null)。 (c)。 } (c)。 (c)。 (c)。 } } 南京工程學院畢業(yè)設計說明書(論文) 33 (c)。 bosswaringTime = false。 if (bosswaringTime) { ()。 (, lifePaint)。 .set(0, 0, (int) ( * ((float) / )), 15)。 } if ( = bossTime) { (c)。 (lifeYellow, lifeYellowPaint)。 (c)。 allScore = 總得分 : + 。 } } } private void drawView() { try { if (sh != null) { c = ()。 try { (30)。 (this)。// (true)。 (true)。 successsound = (context, )。 bossbgm = (context, )。 superBulletButton = ((), )。 success = ((), )。 ()。 (50)。//設置畫筆為空心 ()。//設置畫筆大小 南京工程學院畢業(yè)設計說明書(論文) 31 ()。 scorePaint = new Paint()。 lifePaint = new Paint()。//實例化矩形 textPaint = new Paint()。 lifeYellow = new Rect(0, 15, , 2)。 } public GameView1(Context context) { super(context)。 } public EnemyBulletManage getEnemyBulletManage() { return enemyBulletManage。
點擊復制文檔內(nèi)容
高考資料相關推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1