-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBullet.java
More file actions
35 lines (32 loc) · 885 Bytes
/
Copy pathBullet.java
File metadata and controls
35 lines (32 loc) · 885 Bytes
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
27
28
29
30
31
32
33
34
35
public class Bullet {
public static final float Dy = 40;
public static int SpeedBullet = 500;
public static final int Width = 32;
public static final int Hieght = 32;
public boolean remove = false;
float x , y;
IsToched toched;
private static Texture texture;
public Bullet(float x){
this.x = x;
this.y = Dy;
SpeedBullet = 500;
this.toched = new IsToched(x , y , Width , Hieght);
if (texture == null){
texture = new Texture("bullet_red_alt.png");
}
}
public void update(float deltatime){
y+=SpeedBullet*deltatime;
if (y> MyGame2.HEIGHT){
remove = true;
}
toched.move(x , y);
}
public void render (SpriteBatch batch){
batch.draw(texture , x , y);
}
public IsToched getToched (){
return toched;
}
}