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

正文內(nèi)容

畢業(yè)論文-基于android的祖瑪游戲開發(fā)與設(shè)計(編輯修改稿)

2025-02-08 11:16 本頁面
 

【文章內(nèi)容簡介】 nt i=0。imCurrentCount。i++) { if(data[i]==nums) return i。 } return 1。 } public int getLast() //獲得最后一個數(shù)據(jù) { if(mCurrentCount1=0) return data[mCurrentCount1]。 return 1。 } public int getFirst() { return data[0]。 } public int getAhead(int index) //獲得前一個數(shù)據(jù) { if(index==0) return 1。 else return data[index1]。 } public int getBehind(int index) //獲取后一個數(shù)據(jù) { if(index=mCurrentCount1) return 1。 else return data[index+1]。 } public void ClearList() //清空列表 { for(int i=0。i。i++) { data[i]=1。 } mCurrentCount=0。 } public void Insert(int pos,int nums,boolean bfirst)//插入列表 { if(bfirst) { for(int i=mCurrentCount1。i=pos。i) { data[i+1]=data[i]。 } data[pos]=nums。 mCurrentCount+=1。 }else { for(int i=mCurrentCount1。ipos。i) { data[i+1]=data[i]。 } data[pos+1]=nums。 mCurrentCount+=1。 } } public void MoveEByIndex(int index) //通過索引刪除數(shù)據(jù) { if(index!=1) { for(int i=index。imCurrentCount。i++) { data[i]=data[i+1]。 } data[mCurrentCount]=1。 mCurrentCount=1。 } } public void MoveE(int nums) //刪除列表中的數(shù)據(jù)值 { int index=getIndex(nums)。 if(index!=1) { for(int i=index+1。imCurrentCount。i++) { data[i1]=data[i]。 } data[mCurrentCount]=1。 mCurrentCount=1。 } } } 以上代碼實現(xiàn)了所有隊列,后面只要通過繼承就可以實現(xiàn)隊列的應(yīng)用,在后面我們用到了一下三個隊列: ( 1) 正在滾動球的集合: public List mMoveList=new List()。 ( 2) 發(fā)射中的子彈的集合: public List mBulletList=new List()。 ( 3) 爆炸小球的集合: public List ExplodeList=new List()。 這三個都是繼承了 List對象的。 四、小球的行為 小球的行為包括:開火、撞擊、插入、爆炸這四種行為 ,下面我們分別詳細(xì)說說實現(xiàn)每種行為的 方法 ( 1)開火:就是發(fā)射器將小球射向小球串中,用戶看到是小球飛過去,其實是通過圖片不斷的刷新來實現(xiàn)的,主要通過下面的代碼: private void Fire(float x,float y) { int free=()。 (free)。 mAcBall[free].bulletindex=0。 mAcBall[free].mPosx=。 mAcBall[free].mPosy=。 mAcBall[free].mMoveIndex=0。 mAcBall[free].mBallColor=[1]。 [1]=1。 mAcBall[free].mMoveAnimationType=6。 } 以上代碼通過設(shè)置小球移動的坐標(biāo)即 X和 Y的坐標(biāo)來實現(xiàn)小球的移動,移動過程就像動畫片那樣,通過圖片不斷的刷新來實現(xiàn)。 ( 2) 撞擊:就是當(dāng)小球遇到正在運動中的小球串時發(fā)生的情況,下面我們通過代碼來說明 : public void CulStricke() { int buletcount=()。//發(fā)射中子彈的數(shù)量 if(buletcount=0) return。 int rollcount=()。//滾動的數(shù)量 for(int i=0。ibuletcount。i++) { Ball bullet=mAcBall[(i)]。 float srx=。 float sry=。 for(int j=0。jrollcount。j++) { Ball roll=mAcBall[(j)]。 float desx=()。 float desy=()。 float dis= BulletDistance(srx,sry,desx,desy)。 if(dis=32) { float firstx=(+16)。 float firsty=(+16)。 float lastx=()。 float lasty=()。 float firstdis=BulletDistance(srx,sry,firstx,firsty)。 float lastdis=BulletDistance(srx,sry,lastx,lasty)。 if(firstdislastdis) { InsertBullet((i),j,true)。 }else { InsertBullet((i),j,false)。 } (i)。 return。 } } } } ( 3)插入:就是小球碰到球串時應(yīng)該進(jìn)行的動作,就是將小球插入到兩個小球的之間,代碼如下: private void InsertBullet(int nums,int index,boolean firstpos) { Try { Ball roll=mAcBall[nums]。 Ball indexBall=mAcBall[(index)]。 int moveindex=。 =。 if(firstpos) { RollInsertPos=index。 int aheadnums=(index)。 if(index==0) { =mAcBall[(0)].mMoveIndex+16。 (index, nums,firstpos)。 return。 } Ball firstball=mAcBall[aheadnums]。 if(moveindex+17) { =moveindex+16。 }else { =moveindex+16。 for(int i=index1。i=0。i) { Ball temball=mAcBall[(i)]。 int temindex=。 if(temindexmoveindex=(indexi)*16) +=16。 else break。 } } (index, nums,firstpos)。 }else { RollInsertPos=index+1。 int behindnums=(index)。 if(behindnums==1) { =mAcBall[()].mMoveIndex16。 (index, nums,firstpos)。 return。 } Ball behindball=mAcBall[behindnums]。 if(moveindex17) { =moveindex16。 }else { =moveindex。 for(int i=index。i=0。i) { Ball temball=mAcBall[(i)]。 int temindex=。 if(temindex=moveindex+(1+indexi)*16) +=16。 else break。 } } (index, nums,firstpos)。 } }catch(Exception e) { String mess=()。 ()。 } } 每當(dāng)小球碰到小球串時,上述代碼就會執(zhí)行一邊,將球插入到相應(yīng)的位置。 ( 4)爆炸:這個行為則是游戲的規(guī)則,即遇到三個或三個以上顏色相同時就會產(chǎn)生爆炸行為,這里也用到上面所提到的隊列,爆炸的小球串是一個隊列。 public void checkBomb(int insert) { List TemList=new List()。 Ball SertBall=mAcBall[(insert)]。 int searchc=。 int searchType=。 int searchIndex=。 ((insert))。 for(int i=insert+1。i()。i++) { int checkcolor=mAcBall[(i)].mBallColor。 int type=mAcBall[(i)].mMoveAnimationType。 int moveindex=mAcBall[(i)].mMoveIndex。 if(searchIndexmoveindex=(iinsert)*16amp。amp。searchc==checkcoloramp。amp。type==searchType) { ((i))。 } else { break。 } } for(int i=insert1。i=0。i) { int checkcolor=mAcBall[(i)].mBallColor。 int type=mAcBLL[(i)].mMoveAnimationType。 int moveindex=mAcBall[(i)].mMoveIndex。 if(moveindexsearchIndex=(inserti)*16amp。amp。searchc==checkcoloramp。amp。searchType==type) { ((i))。 } else { break。 } } if(()3) { ()。 }else { mBombIndex=0。 for(int i=0。i()。i++) { int num=(i)。 (num)。 mAcBall[num].mMoveAnimationType=3。 // } for(int i=0。i()。i++) { Ball tb=mAcBall[(i)]。 if(!=3) { =0。 }else break。 } } 五、發(fā)射器 發(fā)射器 主要由兩部分組成,一個是獲取閑置小球,另一個就是更新發(fā)射球的位置。 ( 1)獲取閑置小球:發(fā)射器上都固定有兩個小球,當(dāng)發(fā)射出去一個后,就需要更新發(fā)射器上的小球,讓發(fā)射器上的小球還保持有兩個,代碼如下:
點擊復(fù)制文檔內(nèi)容
電大資料相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖片鄂ICP備17016276號-1