16 lines
360 B
Java
16 lines
360 B
Java
import javax.swing.ImageIcon;
|
|
|
|
public class Projectile extends Collidable {
|
|
int xVelo;
|
|
|
|
public Projectile(int x, int y, int w, int h, int curLevel, int direction) {
|
|
super(x, y, w, h, new ImageIcon("Sprites/Projectiles/" + curLevel + ".png"));
|
|
xVelo = 10 * direction;
|
|
}
|
|
|
|
public void move() {
|
|
this.x += xVelo;
|
|
this.rect.x = this.x;
|
|
}
|
|
}
|