class Entity:
    def __init__(self, asset, x, y, action, direction, speed, engine):
        self.asset = asset
        
        self.x = x
        self.y = y
        self.action = action
        self.direction = direction
        self.speed = speed
        self.frame = 0
        self.graphics = engine.graphics
        self.engine = engine

    def update(self):
        x, y = self.graphics.iso_transform(self.x, self.y)
        occlusion = self.graphics.get_distance((self.x, self.y), self.engine.cursor_pos) / 4
        if occlusion >= 0.8:
            return
        
        self.frame = self.graphics.render_sprite(f"{self.asset}_{self.action}_dir{self.direction}", x,y, self.frame, occlusion)

        