Files
american-identity-project/Powerup.java

23 lines
539 B
Java

import javax.swing.ImageIcon;
public class Powerup extends Collectable{
int yVelo, xVelo, id;
boolean onGround;
public Powerup(int x, int y, int w, int h, int id){
super(x,y,w,h,new ImageIcon("Sprites/Powerup" + id + ".png"));
xVelo = 0; yVelo = -7;
onGround = false;
this.id = id;
}
public void moveX(int moveX){
this.x += moveX;
this.rect.x = this.x;
}
public void moveY(int moveY){
this.y += moveY;
this.rect.y = this.y;
}
}