Add a new platformer game with various levels and enemies

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
This commit is contained in:
CoolGuy27
2026-04-20 21:19:57 +00:00
parent d27949385e
commit a97e122e58
92 changed files with 159 additions and 0 deletions

View File

@@ -0,0 +1,30 @@
import java.awt.Graphics;
import java.awt.Rectangle;
import javax.swing.ImageIcon;
public class Collidable extends Sprite {
int x, y, width, height;
Rectangle rect;
public Collidable(int x1, int y1, int w, int h, ImageIcon icon) {
super(icon);
x = x1;
y = y1;
width = w;
height = h;
rect = new Rectangle(x1, y1, w, h);
}
public void draw(Graphics g) {
sprite = icon.getImage();
g.drawImage(sprite, x, y, width, height, null);
}
public boolean collidesWith(Collidable other) {
return this.rect.intersects(other.rect);
}
public void onCollide(Collidable other) {
return;
}
}