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

正文內(nèi)容

基于android平臺的游戲設(shè)計—_—太空保衛(wèi)戰(zhàn)畢業(yè)論文(編輯修改稿)

2024-08-16 11:43 本頁面
 

【文章內(nèi)容簡介】 lane 類讀取主戰(zhàn)飛機的信息進(jìn)行繪制。 當(dāng)主戰(zhàn)飛機發(fā)射子彈時,會創(chuàng)建 Buller 對象并添加到指定容器中,此時MoveThread 同樣需要定時改變子彈對象的位置。 在以上過程中,全部需要 PlaneActivity 的管理與 ConstantUtil 的參與。 (四 )游戲總流程圖 ( 五 )游戲?qū)嶓w相關(guān)類的實現(xiàn) 飛機 Plane 類的實現(xiàn),其代碼如下: package 。 import 。 import 。 import 。 12 import 。 import 。 public class Plane { private int x。//飛機的坐標(biāo) private int y。 int life。//生命 private int dir。//飛機的方向 ,0 靜止, 1 上 ,2 右上, 3右, 4右下, 5下,6 左下, 7左, 8 左上 private int type。//飛機的類型 Bitmap bitmap1。//當(dāng)前向下飛機的圖片 Bitmap bitmap2。//當(dāng)前向上飛機的圖片 Bitmap bitmap3。//當(dāng)前飛機的圖片 GameView gameView。//GameView 的引用 private int span = 10。//飛機走一步的像素 int bulletType = 1。 public Plane(int x, int y, int type, int dir,int life, GameView gameView){ = gameView。 = x。 = y。 = type。 = dir。 = life。 initBitmap()。 } public void initBitmap(){ if(type == 1){//當(dāng)類型為 1時 bitmap1 = ((), 13 )。 bitmap2 = ((), )。 bitmap3 = ((), )。 } } public void draw(Canvas canvas){ if(dir == ){//向上 (bitmap2, x, y,new Paint())。 } else if(dir == ){//向下 (bitmap1, x, y,new Paint())。 } else{//其他情況使用的圖片 (bitmap3, x, y,new Paint())。 } } public void fire(){//打子彈的方法 if(bulletType == 1){ Bullet b = new Bullet(+75, +8, 1, ,gameView)。 (b)。 } else if(bulletType == 2){ Bullet b = new Bullet(+75, +4, 3, ,gameView)。 14 (b)。 } else { Bullet b = new Bullet(+75, +4, 3, ,gameView)。 (b)。 Bullet b2 = new Bullet(+55, , 4, ,gameView)。 (b2)。 Bullet b3 = new Bullet(+55, +12, 5, ,gameView)。 (b3)。 } if(){ (1,0)。//播放音樂 } } public boolean contain(Bullet b){ if(isContain(, , (), ())){//檢測成功 。//自己的生命減 1 if(0){//當(dāng)生命小于 0 時 = 2。 if(()){ ()。 } if(){ (3,0)。 } 15 Message msg1 = (1)。 (msg1)。// 向主activity 發(fā)送 Handler 消息 } return true。 } return false。 } public boolean contain(ChangeBullet cb){ if(isContain(, , (), ())){//檢測成功 += 1。 return true。 } return false。 } public boolean contain(EnemyPlane ep){ if(isContain(, , (), ())){//檢測成功 。//自己的生命減 1 if(0){//當(dāng)生命小于 0 時 = 2。 if(()){ ()。 } if(){ (3,0)。 } 16 (1)。// 向主activity 發(fā)送 Handler 消息 } return true。 } return false。 } public boolean contain(Life l){//檢測玩家飛機是否撞血塊 if(isContain(, , (), ())){//檢測成功 if(){ ++。//生命加一 } return true。 } return false。 } private boolean isContain(int otherX, int otherY, int otherWidth, int otherHeight){//判斷兩個矩形是否碰撞 int xd = 0。//大的 x int yd = 0。//大大 y int xx = 0。//小的 x int yx = 0。//小的 y int width = 0。 int height = 0。 boolean xFlag = true。//玩家飛機 x是否在前 boolean yFlag = true。//玩家飛機 y是否在前 if( = otherX){ xd = 。 17 xx = otherX。 xFlag = false。 }else{ xd = otherX。 xx = 。 xFlag = true。 } if( = otherY){ yd = 。 yx = o
點擊復(fù)制文檔內(nèi)容
研究報告相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖片鄂ICP備17016276號-1