From 5c86d9b97e39260575edf9cf5946088556b890f1 Mon Sep 17 00:00:00 2001 From: gregchan550 <86044792+gregchan550@users.noreply.github.com> Date: Tue, 17 Oct 2023 10:39:22 +1000 Subject: [PATCH] set normal speed for bosses and general mobs so slow and stun works properly --- .../com/csse3200/game/components/tasks/MobTask/MobTask.java | 3 ++- .../csse3200/game/components/tasks/bosstask/IceBabyTask.java | 1 + .../csse3200/game/components/tasks/bosstask/PatrickTask.java | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/source/core/src/main/com/csse3200/game/components/tasks/MobTask/MobTask.java b/source/core/src/main/com/csse3200/game/components/tasks/MobTask/MobTask.java index 2cc103bd8..9eebbf1d4 100644 --- a/source/core/src/main/com/csse3200/game/components/tasks/MobTask/MobTask.java +++ b/source/core/src/main/com/csse3200/game/components/tasks/MobTask/MobTask.java @@ -89,7 +89,6 @@ public void start() { super.start(); mob = owner.getEntity(); animation = mob.getComponent(AnimationRenderComponent.class); - mob.getComponent(PhysicsMovementComponent.class).setSpeed(MELEE_MOB_SPEED); melee = mobType.isMelee(); movementTask = new MovementTask(new Vector2(0f, mob.getPosition().y)); @@ -102,8 +101,10 @@ public void start() { if (melee) { mob.getComponent(PhysicsMovementComponent.class).setSpeed(MELEE_MOB_SPEED); + mob.getComponent(PhysicsMovementComponent.class).setNormalSpeed(MELEE_MOB_SPEED); } else { mob.getComponent(PhysicsMovementComponent.class).setSpeed(MELEE_RANGE_SPEED); + mob.getComponent(PhysicsMovementComponent.class).setNormalSpeed(MELEE_RANGE_SPEED); } } diff --git a/source/core/src/main/com/csse3200/game/components/tasks/bosstask/IceBabyTask.java b/source/core/src/main/com/csse3200/game/components/tasks/bosstask/IceBabyTask.java index 4b298c059..7cfea58df 100644 --- a/source/core/src/main/com/csse3200/game/components/tasks/bosstask/IceBabyTask.java +++ b/source/core/src/main/com/csse3200/game/components/tasks/bosstask/IceBabyTask.java @@ -71,6 +71,7 @@ public void start() { animation = iceBaby.getComponent(AnimationRenderComponent.class); currentPos = iceBaby.getPosition(); iceBaby.getComponent(PhysicsMovementComponent.class).setSpeed(ICEBABY_SPEED); + iceBaby.getComponent(PhysicsMovementComponent.class).setNormalSpeed(ICEBABY_SPEED); Timer.schedule(new Timer.Task() { @Override public void run() { diff --git a/source/core/src/main/com/csse3200/game/components/tasks/bosstask/PatrickTask.java b/source/core/src/main/com/csse3200/game/components/tasks/bosstask/PatrickTask.java index bf5e6c30c..cb3f27b8f 100644 --- a/source/core/src/main/com/csse3200/game/components/tasks/bosstask/PatrickTask.java +++ b/source/core/src/main/com/csse3200/game/components/tasks/bosstask/PatrickTask.java @@ -64,6 +64,7 @@ public void start() { patrick = owner.getEntity(); animation = owner.getEntity().getComponent(AnimationRenderComponent.class); // get animation patrick.getComponent(PhysicsMovementComponent.class).setSpeed(PATRICK_SPEED); // set speed + patrick.getComponent(PhysicsMovementComponent.class).setNormalSpeed(PATRICK_SPEED); // give game time to load Timer.schedule(new Timer.Task() {