?? sunken.java
字號:
/*
* Created on 2005-9-11
*
* TODO To change the template for this generated file go to
* Window - Preferences - Java - Code Style - Code Templates
*/
package shipwar;
import javax.microedition.lcdui.game.Sprite;
import javax.microedition.lcdui.*;
import java.util.*;
/**
* @author wanggang
*
* TODO To change the template for this generated type comment go to
* Window - Preferences - Java - Code Style - Code Templates
*/
public class sunken extends Sprite {
int drawX=0,drawY=0;
int screenWidth;
private Image image;
public sunken(Image image,int x){
super(image,60,40);
this.image=image;
this.screenWidth=x;
}
public void setDrawX(int x){
this.drawX=x;
}
public int getDrawX(){
return drawX;
}
public void move(){
if(drawX+image.getWidth()>0)
drawX=drawX-2;
else
drawX=screenWidth;
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -