j2me设计论文-推箱子内容摘要:

se{ =true。 } break。 case : if(==true){ stop()。 }else{ cancel=false。 } =true。 break。 } } }} private void setBackground(){ (0x6A4055)。 (0,0, getWidth(),getHeight())。 (0xF89433)。 (0,20,getWidth(),20)。 ( 你 正 在 攻 克 第 +(index+1)+ 关 ,getWidth()/2,18, |)。 (0, 0, getWidth()2, getHeight()3)。 (1,1, getWidth()3, getHeight()4)。 } public void run(){ while(runningFlag){ if(()){ (g)。 本科课程设计论文 12 }else{ if(cancel==false){ setBackground()。 ()。 }else{ (g)。 } } flushGraphics()。 try{ (100)。 }catch(InterruptedException e){ ()。 }} ()。 ()。 }} /* * */ package gamepackage。 import .*。 public class GameChoose extends Canvas{ private GameMidlet midlet=null。 private boolean ok。 private boolean select。 private boolean ok2。 private int select2。 private int index。 private int w,h。 private GameMain game=null。 public GameChoose(GameMidlet midlet) { =midlet。 init()。 } public void init(){ reset()。 } public void reset(){ 本科课程设计论文 13 ok=true。 select=false。 ok2=false。 select2=0。 index=1。 } public void show(){ (this)。 } public void paint(Graphics g){ h=getHeight()。 w=getWidth()。 (0xffffff)。 (0,0, w,h)。 ((, ))。 (0xFCA204)。 (0, 0, w,18)。 (0x000000)。 (0,18,w,18)。 (推箱子 ,w/2,16, |)。 (8↑ 2↓ 4← 6→ , w/2, 50, |)。 (右上按钮 退出 , w/2, 70, |)。 (1 上 一 关 节 3 下 一 关 , w/2, 90, |)。 (0x046DFB)。 (0, h22, w,22)。 (0x000000)。 (0, h22, w,h22)。 (3,h11,11,h15,11,h7)。 (w3,h11,w11,h15,w11,h7)。 if(ok){ (0x0452BC)。 (14, h22, w/214, 22)。 (0xffffff)。 本科课程设计论文 14 (新游戏 ,w/4+7,h3, |)。 (0x000000)。 (选关 ,3*w/47,h3,|)。 }else{ (0x0452BC)。 (w/2, h22, w/214, 22)。 (0x000000)。 (新游戏 ,w/4+7,h3, |)。 (0xffffff)。 (选关 ,3*w/47,h3,|)。 } if(select==true){ (0xffffff)。 (25,40, 130, 100)。 (0x046DFB)。 (27, 118,126, 20)。 (0xFFA800)。 (25,40,130,100)。 (0xFFA800)。 (27,42,126,96)。 (0x000000)。 (30,128, 36, 125, 36, 131)。 (150, 128, 146, 125, 146, 131)。 (0x000000)。 (选关 ,60, 80 ,|)。 ((1~40), 60, 100,|)。 ((,|,ZE_LARGE))。 ([ ], 115, 90,| )。 ((, ))。 if(index==1amp。 amp。 select2==0){ ((, 115, 87,| )。 本科课程设计论文 15 }else if(index!=1){ (+index, 115, 87,| )。 } if(select2==1){ (0x0452BC)。 (40, 118, 50, 20)。 (0xffffff)。 (确定 , 65, 136, |)。 (0x000000)。 (取消 , 115, 136, |)。 } else if(select2==2){ (0x0452BC)。 (90, 118, 50, 20)。 (0x000000)。 (确定 , 65, 136, |)。 (0xffffff)。 (取消 , 115, 136, |)。 }else if(select2==0){ (0x000000)。 (确定 , 65, 136, |)。 (取消 , 115, 136, |)。 } } } public void keyPressed(int keyCode){ if(select==false){ switch(getGameAction(keyCode)){ case : case : if(ok==true){ ok=false。 }else{ ok=true。 } break。 case : if(ok==true){ game=new GameMain(this)。 ()。 本科课程设计论文 16 (game)。 } else{ select=true。 ok2=true。 } break。 } }else{ if(select2==0){ if(keyCode58amp。 amp。 keyCode47){ keyCode=48。 if(index==1){ index=keyCode。 }else if(index10){ index=index*10+keyCode。 } }else{ switch(getGameAction(keyCode)){ case : select2=2。 break。 case : select2++。 break。 default: if(keyCode==7){ if(index9){ index/=10。
阅读剩余 0%
本站所有文章资讯、展示的图片素材等内容均为注册用户上传(部分报媒/平媒内容转载自网络合作媒体),仅供学习参考。 用户通过本站上传、发布的任何内容的知识产权归属用户或原始著作权人所有。如有侵犯您的版权,请联系我们反馈本站将在三个工作日内改正。