Dots and eating works

This commit is contained in:
Urban Modig
2025-08-16 10:36:54 +02:00
parent 7bcc46122c
commit f15a01837d
5 changed files with 34 additions and 15 deletions

View File

@ -4,17 +4,15 @@ import java.awt.image.BufferedImage;
public class MapTile {
private final int value;
private final BufferedImage image;
private BufferedImage image;
private final boolean solid;
private final boolean[][] collisionMask;
public MapTile(BufferedImage image, int value) {
this.value = value;
this.image = image;
// this.image = value != 0 ? MiscUtil.createOutlinedBox(16, 16, Color.blue, 2) : null;
this.solid = value != 0;
this.collisionMask = createCollisionMask(image);
this.collisionMask = value != 0 ? createCollisionMask(image) : null;
}
public boolean[][] getCollisionMask() {
@ -42,4 +40,12 @@ public class MapTile {
public boolean isPassable() {
return ! this.solid;
}
public void setImage(BufferedImage img) {
this.image = img;
}
public int getValue() {
return this.value;
}
}