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

/**
 * Write a description of class Asprin here.
 * 
 * @author Florian Keck 
 * @version (a version number or a date)
 */
public class Asprin extends Element
{

    public Asprin(){
        GreenfootImage img = new GreenfootImage("Skins/Waffe/Asprin.png");
        img.scale(30,30);
        setImage(img);
    }

    /**
     * Act - do whatever the Asprin wants to do. This method is called whenever
     * the 'Act' or 'Run' button gets pressed in the environment.
     */
    public void act() 
    {
        if(isTouching(Linch.class)){
            Welt.linch.addHeart();
            if(!Welt.firstAsprinFound){
                String[] msg = {"Glückwunsch!", "Du hast die Schmerztablette Asprin gefunden", "Sie gibt dir ein Leben mehr", "Sammle weitere ein!"};
                Background.msg(msg);
                Welt.firstAsprinFound = true;
                Greenfoot.playSound("Dialog_3.mp3");
            }

            getWorld().removeObject(this);
        }
    }    
}
