initial commit

This commit is contained in:
2026-04-15 19:50:15 -05:00
commit b00f8d7d87
59 changed files with 1100 additions and 0 deletions

30
Collidable.java Normal file
View File

@@ -0,0 +1,30 @@
import java.awt.Rectangle;
import javax.swing.ImageIcon;
import java.awt.Graphics;
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;
}
}