package com.zhcpt.day02.game;
import java.awt.Image;
import java.util.Random;
import javax.swing.ImageIcon;
public class Snow {
int x,y;
int speed;
int size;
Image img;
public Snow() {
size = 30;
Random random = new Random();
x = random.nextInt(800-size);
y = random.nextInt(30)+15;
speed = random.nextInt(5)+1;
img = new ImageIcon("image/snow.png").getImage();
}
@Override
public String toString() {
return "Snow [x=" + x + ", y=" + y + ", speed=" + speed + ", size="
+ size + ", img=" + img + "]";
}
public void down() {
y+=speed;
}
}
最近下载更多
Cold_sangs LV3
2022年6月6日
543666826 LV34
2022年3月12日
qsyqa0 LV6
2021年9月4日
1234567zz LV7
2020年8月13日
new_docker LV15
2020年7月27日
最代码官方 LV168
2020年7月19日
最近浏览更多
刘孟飞 LV22
1月15日
Aliiiiiiiiii23 LV2
2024年7月25日
11111444
2022年12月3日
暂无贡献等级
微信网友_6191697646571520 LV6
2022年11月23日
微信网友_6122422462320640
2022年9月7日
暂无贡献等级
sqee121 LV1
2022年9月4日
lcy111 LV5
2022年9月1日
Cold_sangs LV3
2022年6月6日
liys1234 LV9
2022年4月22日
3188681084 LV1
2022年3月24日

