public void act() 
    {
        if (!dead)
        {
            getLocation();
            animation();
            damageDetection();
            if (moveUp && y < groundHeight && !abilityR && !abilityH && !hurt)
            {
                y += 3;
            }
        }
        else
        {
            if (maxDieFrame > dieFrame)
            {
                dieFrame++;
                mage = new GreenfootImage ("Mage//mageDie//mageDie" + ((dieFrame/6) + 1) + ".png");
                if (!movementDirection)
                {
                    mage.mirrorHorizontally();
                }
                setImage(mage);
            }
            else if (maxDieFrame == dieFrame)
            {
                setImage(new GreenfootImage ("ballsI.png"));
                getWorld().removeObject(shadow);
                dieFrame++;
            }
        }
    }