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

正文內(nèi)容

基于j2me的推箱子游戲畢業(yè)設(shè)計(jì)論文任務(wù)書-文庫(kù)吧

2025-06-03 14:50 本頁面


【正文】 rtSound = (this, )。 (true)。 initAndToWeleView()。} public void initAndToWeleView(){ weleView = new WeleView(this)。 if(isSound){ ()。 } (weleView)。 weleViewGoThread = new WeleViewGoThread(this)。 ()。} public void initAndToMenuView(){ menuView = new MenuView(this)。 (menuView)。 menuViewGoThread = new MenuViewGoThread(this)。 ()。} public void initAndToGameView(){ map1 = new int[[selectMap].length][[selectMap][0].length]。 for(int i=0。 i[selectMap].length。 i++){ for(int j=0。 j[selectMap][i].length。 j++){ map1[i][j] = [selectMap][i][j]。//初始化第一層 } } map2 = new int[[selectMap].length][[selectMap][0].length]。 for(int i=0。 i[selectMap].length。 i++){ for(int j=0。 j[selectMap][i].length。 j++){ map2[i][j] = [selectMap][i][j]。//初始化第二層 } } gameView = new GameView(this)。 mySprite = new MySprite(this)。 kt = new KeyThread(this)。//添加鍵盤監(jiān)聽 ()。 if(isSound){ ()。//播放聲音 } (gameView)。 } public boolean onKeyUp(int keyCode, KeyEvent event) {//鍵盤抬起 if(keyCode == 19){//上 action = action amp。 0x37。 } if(keyCode == 20){//下 action = action amp。 0x3B。 } if(keyCode == 21){//左 action = action amp。 0x3D。 } if(keyCode == 22){//右 action = action amp。 0x3E。 } return false。 } public boolean onKeyDown(int keyCode, KeyEvent event){//鍵盤按下監(jiān)聽 if(keyCode == 19){//上 action = action | 0x08。 } if(keyCode == 20){//下 action = action | 0x04。 } if(keyCode == 21){//左 action = action | 0x02。 } if(keyCode == 22){//右 action = action | 0x01。 } return false。 } }(2) 歡迎界面WeleView類的實(shí)現(xiàn)代碼如下:package 。import 。import 。import 。import 。import 。import 。import 。import 。import 。public class WeleView extends SurfaceView implements , OnClickListener{ PushBoxActivity pushBoxActivity。 WeleViewDrawThread weleViewDrawThread = null。 Bitmap bitmap。 Bitmap wallLeft。//左面的墻 Bitmap wallRight。//右面的墻 Bitmap iron。//鐵門 Bitmap woodLeft。//左面的木門 Bitmap woodRight。//右面的木門 Bitmap background。 Bitmap mountain。//背景的山 int wallLeftX = 15。//墻的坐標(biāo) int wallLeftY = 10。 int wallRightX = 150。 int wallRightY = 10。 int ironX = 15。//鐵門的坐標(biāo) int ironY = 10。 int woodLeftX = 15。//木門的坐標(biāo) int woodLeftY = 10。 int woodRightX = 150。 int woodRightY = 10。 public WeleView(PushBoxActivity pushBoxActivity) {//構(gòu)造器 super(pushBoxActivity)。 = pushBoxActivity。 getHolder().addCallback(this)。 weleViewDrawThread = new WeleViewDrawThread(this,getHolder())。 wallRight = (getResources(), )。 wallLeft = (getResources(), )。 bitmap = (getResources(), )。 iron = (getResources(), )。 woodLeft = (getResources(), )。 woodRight = (getResources(), )。 background = (getResources(), )。//背景的水 mountain = (getResources(), )。 } protected void onDraw(Canvas canvas) { ()。//背景白色 (background, 0, 0, new Paint())。//繪制背景 (mountain, 0, 0, new Paint())。//后面的山圖片 (wallLeft, wallLeftX, wallLeftY,new Paint())。//墻的左面 (wallRight, wallRightX, wallRightY,new Paint())。//墻的右面 (iron, ironX, ironY,new Paint())。//鐵門 (woodLeft, woodLeftX, woodLeftY,new Paint())。//木頭門左面 (woodRight, woodRightX, woodRightY,new Paint())。//木頭門右面 (bitmap, 0, 0, new Paint())。 (this)。 } public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) { } public void surfaceCreated(SurfaceHolder holder) { (true)。 ()。//啟動(dòng)刷幀線程 } public void surfaceDestroyed(SurfaceHolder holder) { boolean retry = true。 (false)。//停止刷幀線程 while (retry) { try { ()。//等待刷幀線程結(jié)束 retry = false。 } catch (InterruptedException e) {//不斷地循環(huán),直到等待的線程結(jié)束 } } } public void onClick(View v) { (1)。 } }(3) 刷幀線程WeleViewDrawThread的實(shí)現(xiàn)代碼如下:package 。public class WeleViewGoThread extends Thread{ int sleepSpan = 200。//睡眠的毫秒數(shù) private boolean flag = true。 int status = 0。 PushBoxActivity pushBoxActivity。//activity的引用 public WeleViewGoThread(PushBoxActivity pushBoxActivity){ = pushBoxActivity。 } public void setFlag(boolean flag){ = flag。 } public void run() {//重寫的run方法 while(flag){ switch(status){ case 0://木門運(yùn)動(dòng) = 2。 += 2。 if(90){ status = 1。 } break。 case 1://鐵門運(yùn)動(dòng) = 8。 if(380){ status = 2。 } break。 case 2: = 3。 += 3。 if(90){ status = 3。 } break。 case 3: = false。 (1)。//向主activity發(fā)送Handler消息 break。 } try{ (sleepSpan)。//睡眠 } catch(Exception e){ ()。 } } }}(4) 動(dòng)畫線程WeleViewGoThread的實(shí)現(xiàn)代碼如下:package 。public class MenuViewGoThread extends Thread{ boolean flag = true。//循環(huán)標(biāo)記位 int sleepSpan = 300。//睡眠的毫秒數(shù) PushBoxActivity pushBoxActivity。 public MenuViewGoThread(PushBoxActivity pushBoxActivity){ = pushBoxA
點(diǎn)擊復(fù)制文檔內(nèi)容
試題試卷相關(guān)推薦
文庫(kù)吧 www.dybbs8.com
備案圖鄂ICP備17016276號(hào)-1