The agent has updated the game's core logic, including player movement, enemy AI, collision detection, and level loading. New sprites and sound effects have been integrated, along with the addition of a Chess game. The replit.nix file has been configured to include jdk21 and neovim. Replit-Commit-Author: Agent Replit-Commit-Session-Id: f6819c21-e85d-45ac-acde-604db2cfa4fe Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Event-Id: 32bc3e83-133e-4485-96b6-ff3d548bcbfd Replit-Helium-Checkpoint-Created: true
25 lines
492 B
Java
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;
|
|
}
|
|
}
|