Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Boss fight Code Simple

[SerializeField] float Speed;

[SerializeField] int MaxHealth;

int CurrentHealth;

Animator anim;

int RandomMove;

float RandomWait;

void private void Start() {

    anim = gameObject.GetComponent<Animator>();

    Randomize();

}

void private void Update()

{

    if(CurrentHealth<=0)

    {

        anim.SetBool(dieAnim,true)

        Destroy(gameObject,1f)

    }

}

public void Randomize() {

    RandomMove=Random.Range(0,100)

    if(RandomMove=<50)

    {

        //Walk

    }else if(70>=RandomMove>50)

    {

        //BasicAttack

        BossAttack1();

    }else if(85>=RandomMove>70)

    {

        //MiddleAttack

        BossAttack2();

    }else if(RandomMove>85)

    {

        BossAttackSpecial();

    }

}

public void BossAttack1() {

}

public void BossAttack2() {

}

public void BossAttackSpecial() {

}

IEnumarator NextStep()

{

    RandomWait=Random.Range(1f,3f)

    yield return new WaitForSeconds(RandomWait);

    Randomize()

}

Support this post

Did you like this post? Tell us

Leave a comment

Log in with your itch.io account to leave a comment.