From 5ebcfc08e1afa5c72fe9af663d6ebc3319e65ac4 Mon Sep 17 00:00:00 2001 From: freshc0w <121275444+freshc0w@users.noreply.github.com> Date: Tue, 10 Oct 2023 16:02:54 +1000 Subject: [PATCH] Change scaled collider so dragon knight is able to get hit --- .../csse3200/game/entities/factories/NPCFactory.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/source/core/src/main/com/csse3200/game/entities/factories/NPCFactory.java b/source/core/src/main/com/csse3200/game/entities/factories/NPCFactory.java index 4cdec4518..94663d076 100644 --- a/source/core/src/main/com/csse3200/game/entities/factories/NPCFactory.java +++ b/source/core/src/main/com/csse3200/game/entities/factories/NPCFactory.java @@ -486,12 +486,15 @@ public static Entity createSplittingWaterSlime(int health) { * @return */ public static Entity createDodgingDragonKnight(int health) { - Entity fireWorm = createDragonKnight(health); + Entity dodgeKnight = createDragonKnight(health); - fireWorm.addComponent(new DodgingComponent(PhysicsLayer.PROJECTILE, 0.25f)); - fireWorm.getComponent(AITaskComponent.class).addTask(new MobDodgeTask(new Vector2(2f, 2f), 2f, 5)); + dodgeKnight.addComponent(new DodgingComponent(PhysicsLayer.PROJECTILE, 0.25f)); + dodgeKnight.getComponent(AITaskComponent.class).addTask(new MobDodgeTask(new Vector2(2f, 2f), 2f, 5)); + + PhysicsUtils.setScaledCollider(dodgeKnight, 0.3f, 0.7f); + dodgeKnight.setScale(0.3f, 0.7f); - return fireWorm; + return dodgeKnight; } // public static Entity createDeflectXenoGrunt(int health) {