Updated the project configuration to use Java 21 and run the game from the correct directory, resolving previous Java version conflicts and ensuring proper execution. Replit-Commit-Author: Agent Replit-Commit-Session-Id: f6819c21-e85d-45ac-acde-604db2cfa4fe Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Event-Id: ed832e25-fc86-4753-8cfc-80cfabc64a02 Replit-Helium-Checkpoint-Created: true
17 lines
390 B
Java
17 lines
390 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 == 1) ? "1" : "2") + ".png"));
|
|
xVelo = 10 * direction;
|
|
}
|
|
|
|
public void move() {
|
|
this.x += xVelo;
|
|
this.rect.x = this.x;
|
|
}
|
|
}
|