-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMissile.java
More file actions
33 lines (26 loc) · 711 Bytes
/
Copy pathMissile.java
File metadata and controls
33 lines (26 loc) · 711 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
public class Missile extends Sprite{
private int BOARD_HEIGHT;
private final int MISSILE_SPEED = 15;
public Boolean isSuperAttack = false;
public Missile(int x, int y, String pathname){
super(x, y);
if(pathname == "img/kiblast.png"){
isSuperAttack = true;
}
initMissile(pathname);
this.BOARD_HEIGHT = 0 - this.width;
}
private void initMissile(String pathname){
loadImage(pathname);
getImageDimensions();
}
public boolean isSuperAttack(){
return isSuperAttack;
}
public void move(){
y -= MISSILE_SPEED;
if(y < BOARD_HEIGHT){
visible = false;
}
}
}