From 02eacc0516eb0b024470cacacfba304d3011a07c Mon Sep 17 00:00:00 2001 From: freshc0w <121275444+freshc0w@users.noreply.github.com> Date: Wed, 11 Oct 2023 13:51:20 +1000 Subject: [PATCH] Fix split moblings spawning out of bounds bug --- .../main/com/csse3200/game/components/npc/SplitMoblings.java | 2 +- .../test/com/csse3200/game/components/SplitMoblingsTest.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/source/core/src/main/com/csse3200/game/components/npc/SplitMoblings.java b/source/core/src/main/com/csse3200/game/components/npc/SplitMoblings.java index 11fda5ceb..95afb3a80 100644 --- a/source/core/src/main/com/csse3200/game/components/npc/SplitMoblings.java +++ b/source/core/src/main/com/csse3200/game/components/npc/SplitMoblings.java @@ -24,7 +24,7 @@ public class SplitMoblings extends Component { public static final float MIN_X_BOUNDS = 1; public static final float MAX_X_BOUNDS = (float) 18.5; public static final float MIN_Y_BOUNDS = 0; - public static final float MAX_Y_BOUNDS = 8; + public static final float MAX_Y_BOUNDS = 6; public static final String DIE_START_EVENT = "splitDeath"; /** diff --git a/source/core/src/test/com/csse3200/game/components/SplitMoblingsTest.java b/source/core/src/test/com/csse3200/game/components/SplitMoblingsTest.java index 71dbdf757..c82d9f497 100644 --- a/source/core/src/test/com/csse3200/game/components/SplitMoblingsTest.java +++ b/source/core/src/test/com/csse3200/game/components/SplitMoblingsTest.java @@ -226,7 +226,7 @@ public void shouldSpawnWithinRangeMultipleAmount() { for (Entity entity : initialEntities) { entity.setPosition( - SplitMoblings.MIN_X_BOUNDS + 5, SplitMoblings.MIN_Y_BOUNDS + 5); + SplitMoblings.MIN_X_BOUNDS + 5, SplitMoblings.MIN_Y_BOUNDS + 3); } projectile.getComponent(TouchAttackComponent.class)