-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFallingThings.java
More file actions
36 lines (33 loc) · 984 Bytes
/
Copy pathFallingThings.java
File metadata and controls
36 lines (33 loc) · 984 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
36
public class FallingThings {
public static final float width = 16;
public static final float height = 16;
public static final int Width = 32;
public static final int Hieght = 32;
public static int SpeedFallingThings = 250;
public boolean remove = false;
float x , y;
IsToched toched;
private static Texture texture;
public FallingThings(float x){
this.x = x;
SpeedFallingThings = 250;
this.toched = new IsToched(x , y , Width , Hieght);
this.y = MyGame2.HEIGHT;
if (texture == null){
texture = new Texture("asteroid22.png");
}
}
public void update(float deltatime){
y-=SpeedFallingThings*deltatime;
if (y< -height){
remove = true;
}
toched.move(x, y);
}
public void render (SpriteBatch batch){
batch.draw(texture , x , y , width , height);
}
public IsToched getToched (){
return toched;
}
}