import greenfoot.*;  // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)

/**
 * Write a description of class Heart here.
 * 
 * @author Jonathan Lutz
 * @version (a version number or a date)
 */
public class Heart extends Actor
{
    public static int sizex = 24;
    public static int sizey = 29;
    public static int abstand = 5;
    public static String image = "Skins/HUD/heart.png";
    public Heart()
    {
        GreenfootImage img = new GreenfootImage("Skins/HUD/heart.png");
        img.scale(sizex, sizey);
        setImage(img);
    }
    
    /**
     * Act - do whatever the Heart wants to do. This method is called whenever
     * the 'Act' or 'Run' button gets pressed in the environment.
     */
    public void act() 
    {
        // Add your action code here.
    } 
    
    public void setVisibility (boolean visible)
    {
        if (visible == true )
        {
            GreenfootImage img = new GreenfootImage(image);
            img.scale(sizex, sizey);
            img.setTransparency(255);
            setImage(img);
        }
        else if (visible == false )
        {
            GreenfootImage img = new GreenfootImage(image);
            img.scale(sizex, sizey);
            img.setTransparency(120);
            setImage(img);
        }
    }
}
