31 lines
1.1 KiB
Java
31 lines
1.1 KiB
Java
package de.miaurizius.jgame2d.entity.objects;
|
|
|
|
import de.miaurizius.jgame2d.core.GamePanel;
|
|
|
|
import java.awt.*;
|
|
import java.awt.image.BufferedImage;
|
|
|
|
@Deprecated
|
|
public class SuperObject {
|
|
|
|
public BufferedImage image, image2, image3;
|
|
public String name;
|
|
public boolean collision = false;
|
|
public int worldX, worldY;
|
|
public Rectangle solidArea = new Rectangle(0, 0, 48, 48);
|
|
public int solidAreaDefaultX = 0;
|
|
public int solidAreaDefaultY = 0;
|
|
|
|
public void draw(Graphics2D graphics2D, GamePanel panel) {
|
|
int screenX = worldX - panel.player.worldX + panel.player.screenX;
|
|
int screenY = worldY - panel.player.worldY + panel.player.screenY;
|
|
|
|
if(worldX + panel.tileSize > panel.player.worldX - panel.player.screenX &&
|
|
worldX - panel.tileSize < panel.player.worldX + panel.player.screenX &&
|
|
worldY + panel.tileSize > panel.player.worldY - panel.player.screenY &&
|
|
worldY - panel.tileSize < panel.player.worldY + panel.player.screenY
|
|
) graphics2D.drawImage(image, screenX, screenY, panel.tileSize, panel.tileSize, null);
|
|
}
|
|
|
|
}
|