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

正文內(nèi)容

j2me手機拼圖游戲畢業(yè)論文(編輯修改稿)

2025-07-16 08:59 本頁面
 

【文章內(nèi)容簡介】 選擇鍵,實例化MyCanvas類的對象mc(傳參dis,temp,3,3),并實現(xiàn)對象mc的方法,轉(zhuǎn)到畫布界面,在畫布界面添加“返回”和“暫停計時”軟鍵按鍵(界面如圖3_3);選擇“4*4記時記步 拼圖”后按選擇鍵,實例化MyCanvas類的對象mc(傳參dis,temp,4,4),并實現(xiàn)對象mc的方法,轉(zhuǎn)到畫布界面,在畫布界面添加“返回”和“暫停計時”軟鍵按鍵(界面如圖3_4)。 圖3_1列表框界面圖 圖3_2 普通拼圖界面圖 圖3_3 3*3記時記步拼圖界面圖 圖3_4 4*4記時記步拼圖界面圖 MyImage類定義了MyImage類來表示分割后的小圖塊,其主要代碼如下:package PinTu。import 。public class MyImage { private Image image=null。 private int old_x=0。 private int old_y=0。 private int x=0。 private int y=0。 public MyImage(Image image, int old_x, int old_y) { super()。 = image。 = old_x。 = old_y。 =old_x。 =old_y。 } public int getX() { return x。 } public void setX(int x) { = x。 } public int getY() { return y。 } public void setY(int y) { = y。 } public Image getImage() { return image。 } public int getOld_x() { return old_x。 } public int getOld_y() { return old_y。 } public boolean check(){ if(old_x==xamp。amp。old_y==y){ return true。 } return false。 }}該類3個參數(shù),image用來表示小圖塊,old_x與ole_y表示小圖塊起始坐標。同時用2個變量x和y來改變小圖塊的坐標,初始值分別等于old_x與ole_y。包含的方法分別實現(xiàn):得到x; 修改x; 得到y(tǒng); 修改y; 得到表示小方塊的參數(shù);得到該小方塊的初始坐標old_x。 得到該小方塊的初始坐標old_y。 最后的check()方法是判斷小圖塊改變后的坐標x與y是否與初始坐標old_x與ole_y相等,是的話返回true,不是返回false。 MyCanvas類MyCanvas類繼承自Canvas,實現(xiàn)CommandListener與Runnable接口。主要代碼如下:package PinTu。import 。import 。import 。import 。import 。import 。import 。import 。import 。import 。import 。import 。import 。public class MyCanvas extends Canvas implements CommandListener , Runnable{ private Image image=null。 private int xuanz_x。 private int xuanz_y。 private MyImage is[][]。 private MyImage Nimage=null。 public int null_x。 public int null_y。 private boolean game_key=false。 private boolean game_miji。 private Display d=null。 private List l=null。 private String miji=。 private String miji_temp=。 private int jishu。 private int jishi。 private int shuz。 public boolean bRUN。 //構(gòu)造函數(shù) public MyCanvas(Display d, List l, int xuanz_x, int xuanz_y) { super()。 game_miji=true。 = d。 = l。 =xuanz_x。 =xuanz_y。 null_x=xuanz_x1。 null_y=xuanz_y1。 is=new MyImage[xuanz_x][xuanz_y]。 jishu=0。 jishi=0。 (this)。 bRUN=true。 Thread th=new Thread(this)。 ()。} //畫布函數(shù) protected void paint(Graphics arg0) { (255, 255, 255)。 (0, 0, (), ())。 for(int i=0。ixuanz_x。i++) { for(int j=0。jxuanz_y。j++) {if(is[i][j]!=null) (is[i][j].getImage(), is[i][j].getX(), is[i][j].getY(), 0)。 else {if(xuanz_x==3amp。amp。xuanz_y==4) (null_x*80, null_y*80, 75, 75)。 if(xuanz_x==3amp。amp。xuanz_y==3) (null_x*80, null_y*80, 75, 75)。 if(xuanz_x==4amp。amp。xuanz_y==4) (null_x*60, null_y*60, 55, 55)。} } } if(game_key) {if(xuanz_x==3amp。amp。xuanz_y==4) (image, 0, 0, 0)。 if((xuanz_x==3amp。amp。xuanz_y==3)||(xuanz_x==4amp。amp。xuanz_y==4)) (image, 0,()240, 240, 240, , 0, 0,|)。 } if((xuanz_x==3amp。amp。xuanz_y==3)||(xuanz_x==4amp。amp。xuanz_y==4)) {(0, 0, 0)。 Font font = (,|,)。 (font)。 (時間+:+ +(jishi)+(秒)+ + 移動次數(shù)+ +:+ +(jishu), ()20, ()10, |)。 if(jishu==9999||jishi==9999) {Form fom=new Form(別浪費時間了)。 (fom)。 //所用時間太長 移動次數(shù)太多 自動跳轉(zhuǎn) (this)。 (new Command(返回, , 1))。} } } //加入圖片 public void addImage(String p_name){ try { image=(p_name+.gif)。 } catch (IOException e) {()。} } //分割圖片 public void allimages(){ for(int i=0。ixuanz_x。i++){ for(int j=0。jxuanz_y。j++){ if(xuanz_x==3amp。amp。xuanz_y==4) is[i][j]=new MyImage((image, i*80, j*80, 79, 79, ), i*80, j*80)。 if(xuanz_x==3amp。amp。xuanz_y==3) is[i][j]=new MyImage((image, i*80, ()240+j*80, 79, 79, ),i*80, j*80)。 if(xuanz_x==4amp。amp。xuanz_y==4) is[i][j]=new MyImage((image, i*60, ()240+j*60, 59, 59, ), i*60, j*60)。 } } Nimage=is[null_x][null_y]。 is[null_x][null_y]=null。 } //打亂圖片 public void Fenge(){ MyImage is
點擊復制文檔內(nèi)容
黨政相關相關推薦
文庫吧 www.dybbs8.com
備案圖片鄂ICP備17016276號-1