Files
american-identity-project/American-Identity-Project/Powerup.java
CoolGuy27 05de9e8914 Organize game files into their project directory and ensure proper build configuration
Moves all game source files and assets into the 'American-Identity-Project' directory and updates the manifest to point to the 'Display' class as the main entry point.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: f6819c21-e85d-45ac-acde-604db2cfa4fe
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Event-Id: a9500e48-7f68-408f-a5c6-28df9f59fe00
Replit-Helium-Checkpoint-Created: true
2026-04-20 20:48:12 +00:00

25 lines
492 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;
}
}