package com.tarrena.shoot;
import java.util.Random;
public class Bullet extends FlyingObject{
private int xSpeed=1;
private int ySpeed=4;
private int xaSpeed=3;
private int yaSpeed=3;
private static int n1=1;
Random rand=new Random();
int n=rand.nextInt(3);
//构造方法子弹x,y坐标随英雄机的坐标而变动;
public Bullet(int x,int y){
image=ShootGame.bullet;
width=image.getWidth();
height=image.getHeight();
this.x=x;
this.y=y;
// n1++;
}
public void step() {
if(n%3==1)
x-=xSpeed;
else if(n%3==2)
x+=xSpeed;
else
x=x;
y-=ySpeed;
n1++;
}
public void astep() {
y+=yaSpeed;
}
}
最近下载更多
最近浏览更多
枝与蔓 LV1
6月3日
微信网友_7123494434885632
2024年8月14日
暂无贡献等级
12345678ajkdakjd LV1
2024年6月26日
以沫煊
2024年6月22日
暂无贡献等级
鬼屋报道 LV3
2024年6月1日
2656362504
2023年12月12日
暂无贡献等级
jkjfdgbkl LV2
2023年11月1日
tyiyiyuiyuihui LV3
2023年10月11日
2017143155 LV12
2023年6月26日
1111123ah
2023年6月6日
暂无贡献等级

