switched from SuperObject to Entity for objects

This commit is contained in:
2025-11-28 23:04:36 +01:00
parent 44b74ddcbf
commit b2b65dd290
15 changed files with 88 additions and 144 deletions

View File

@@ -18,7 +18,7 @@ public class Entity {
public int worldX, worldY;
public int speed;
public BufferedImage up1, up2, down1, down2, left1, left2, right1, right2;
public Direction direction;
public Direction direction = Direction.DOWN;
public int spriteCounter = 0;
public int spriteNum = 1;
public Rectangle solidArea = new Rectangle(0, 0, 48, 48);
@@ -27,6 +27,9 @@ public class Entity {
public int actionLock = 0;
String[] dialogue = new String[20];
int dialogueIndex = 0;
public BufferedImage image, image2, image3;
public String name;
public boolean collision = false;
// CHARACTER STATUS
public int maxLife;
@@ -98,7 +101,7 @@ public class Entity {
};
}
BufferedImage initEntitySprites(String name) {
public BufferedImage initEntitySprites(String name) {
try {
return Utility.scaleImage(ImageIO.read(new FileInputStream("assets/" + name + ".png")), panel.tileSize, panel.tileSize);
} catch (IOException e) {