File size: 434 Bytes
30f5826 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | package game;
import java.awt.image.BufferedImage;
public class Ground {
int x;
int y;
int w;
int h;
BufferedImage img;
Ground ground;
public Ground(){//构造方法
img = Tools.getImg("../img/land.png");
h = img.getHeight();
w = img.getWidth();
x = 0;//初始化x
y = 512 - h;//初始化y
}
public void move(){
if(x <= -(w - 288)) {//地面有限,地面重复出现,保证地面
x = 0;
}
x --;
}
}
|