Ghost movement working - first rev
This commit is contained in:
@ -1,7 +1,12 @@
|
||||
package se.urmo.game.map;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.awt.image.BufferedImage;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
public class MapTile {
|
||||
private final int value;
|
||||
private BufferedImage image;
|
||||
@ -11,14 +16,10 @@ public class MapTile {
|
||||
public MapTile(BufferedImage image, int value) {
|
||||
this.value = value;
|
||||
this.image = image;
|
||||
this.solid = value != 0;
|
||||
this.solid = value != 0 && value != 99;
|
||||
this.collisionMask = value != 0 ? createCollisionMask(image) : null;
|
||||
}
|
||||
|
||||
public boolean[][] getCollisionMask() {
|
||||
return collisionMask;
|
||||
}
|
||||
|
||||
private boolean[][] createCollisionMask(BufferedImage img) {
|
||||
if(img == null) return null;
|
||||
int w = img.getWidth();
|
||||
@ -33,19 +34,4 @@ public class MapTile {
|
||||
return mask;
|
||||
}
|
||||
|
||||
public BufferedImage getImage() {
|
||||
return this.image;
|
||||
}
|
||||
|
||||
public boolean isSolid() {
|
||||
return this.solid;
|
||||
}
|
||||
|
||||
public void setImage(BufferedImage img) {
|
||||
this.image = img;
|
||||
}
|
||||
|
||||
public int getValue() {
|
||||
return this.value;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user