public void act() 
    {   
        if (timer == 0)
        {

            if(foundAvatar())
            {
                timer++;
                delta = getFun();
            }
        }

        if (timer > 0)
            timer++;

        if (timer == 30)
        {
            if (delta == 10)
            {
                setImage(plus10);
            }
            else
            {
                setImage(plus20);

            }
            counter.add(delta);

        }

        if (timer == 45)
        {
            setImage(close);
        }

        if (timer == 65)
        {
            timer = 0;
            setLocation(Greenfoot.getRandomNumber(800), Greenfoot.getRandomNumber(600));
        }
    }