?? streamball.java
字號:
package role;
import java.awt.Image;
/**
* 本類為汽球類
* @author Administrator
*
*/
public class StreamBall extends SportRole {
/**汽球圖像*/
public static Image streamBallImage;
/**是否移動*/
private boolean isMove = true;
/**移動計數器*/
private int count;
/**
* 構造方法
*
*/
public StreamBall() {
super(480, -260, 150, 245, 0);
this.img = streamBallImage;
}
@Override
/**
* 移動計數器
*/
public void move() {
// TODO 自動生成方法存根
if(isMove){//如果能夠移動
count++;
if(count>1){//40毫秒移動一次
this.y+=1;
count=0;
}
if(this.y>300){//Y坐標大于300,則停止
this.y = 300;
this.isMove = false;
}
}
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -