Example #1
0
    // Update is called once per frame
    void Update()
    {
        float step = speed * Time.deltaTime;

        hammerLoc = target.transform.position;

        if (flip == false)
        {
            move_down_side(hammerLoc, ground.transform.position, ogSpot, step, smash);
        }
        else
        {
            go_up(ogSpot, step);
        }

        if (GlobalControl.GetButtonDownX(num) && cooldown >= 300)
        {
            smash = true;
        }
        if (smash == true)
        {
            cooldown = 0;
        }
        if (smash == false)
        {
            cooldown += 1;

            if (cooldown > 300)
            {
                cooldown = 300;
            }
        }

        if (BossHealth.isBossTwoThirdsHealth == true)
        {
            canMove = true;
        }
        else
        {
            canMove = false;
        }

        if (canMove == false)
        {
            cooldown = 300;
            smash    = false;
        }

        CDBAR.value = cooldowntimer();
    }