Skip to content

Mob Boss Factory

cindyle1 edited this page Oct 19, 2023 · 13 revisions

Introduction

The mob boss entity is created to ensure that each level has its corresponding final boss. This is to create a diversity between levels and planets to make the game more enjoyable.

MobBoss

Base Mob Boss function createBaseBoss()

The function createBaseBoss() is responsible for assigning the base components for all mob bosses within the game. The components added for the base boss are PhysicsCollider(), ColliderComponent(), PhysicsMovementComponent(), HitboxComponent() and TouchAttackComponent().

Entity boss = new Entity()
                .addComponent(new PhysicsComponent())
                .addComponent(new ColliderComponent())
                .addComponent(new PhysicsMovementComponent())
                .addComponent(new HitboxComponent().setLayer(PhysicsLayer.NPC))
                .addComponent(new TouchAttackComponent(PhysicsLayer.HUMANS, 1.5f));

Creating a Demon Boss createDemonBoss()

This function will build upon the createBaseBoss() function and adds the specific AITaskComponent, DemonBossTask. Demon boss is able to shoot burn projectiles and do AOE damage. Demon boss is also able to regenerate health once it hits half health.

AITaskComponent aiTaskComponent = new AITaskComponent()
                .addTask(new DemonBossTask());

It also adds the animations to that entity.

demon
                .addComponent(animator)
                .addComponent(new DemonAnimationController())

Additionally, it also adds CombatStatsComponent() to ensure the demon has health and attack.

Image for Demon:

01_d_idle

Creating a Patrick Boss createPatrickBoss()

This function will build upon the createBaseBoss() function and adds the specific AITaskComponent, PatrickBossTask. Patrick is able to teleport to the closest entity and do damage as well as shoot projectiles and melee attack. Once Patrick hits half health, it will shoot 5 projectiles of random effect.

AITaskComponent aiTaskComponent = new AITaskComponent()
                .addTask(new PatrickBossTask());

It also adds the animations to that entity.

demon
                .addComponent(animator)
                .addComponent(new PatrickAnimationController())

Additionally, it also adds CombatStatsComponent() to ensure the Patrick has health and attack.

Image for Patrick:

Bringer-of-Death_Idle_1

Creating a Ice Baby Boss createIceBoss()

This function will build upon the createBaseBoss() function and adds the specific AITaskComponent, IceBabyBossTask. The Ice Baby is able to spawn water mobs and do AOE damage.

AITaskComponent aiTaskComponent = new AITaskComponent()
                .addTask(new IceBabyBossTask());

It also adds the animations to that entity.

demon
                .addComponent(animator)
                .addComponent(new IceBabyAnimationController())

Additionally, it also adds CombatStatsComponent() to ensure the Ice Baby has health and attack.

Image for Ice Baby:

2_atk

Sequence diagram for Ice Baby

Screen Shot 2023-10-19 at 6 59 31 pm
Clone this wiki locally