diff --git a/source/core/src/main/com/csse3200/game/services/GameEndService.java b/source/core/src/main/com/csse3200/game/services/GameEndService.java index 32d4c2091..2ac4bddbb 100644 --- a/source/core/src/main/com/csse3200/game/services/GameEndService.java +++ b/source/core/src/main/com/csse3200/game/services/GameEndService.java @@ -16,7 +16,7 @@ public class GameEndService { * Constructor for the Game End Service */ public GameEndService() { - this.remainingEngineerCount = 10; + this.remainingEngineerCount = 5; this.display = new EngineerCountDisplay(); } diff --git a/source/core/src/test/com/csse3200/game/components/player/HumanAnimationControllerTest.java b/source/core/src/test/com/csse3200/game/components/player/HumanAnimationControllerTest.java index 1f8f063d6..1647cd9ef 100644 --- a/source/core/src/test/com/csse3200/game/components/player/HumanAnimationControllerTest.java +++ b/source/core/src/test/com/csse3200/game/components/player/HumanAnimationControllerTest.java @@ -112,4 +112,40 @@ void shouldAnimateDeath() { assertEquals("death", engineer.getComponent(AnimationRenderComponent.class).getCurrentAnimation(), "'deathStart' event should trigger 'death' animation'"); } + + @Test + void notSelectedOnStart() { + assertFalse(engineer.getComponent(HumanAnimationController.class).isClicked(), + "Engineer should not be selected when initialised"); + } + + @Test + void shouldSelectEngineer() { + engineer.getComponent(HumanAnimationController.class).setClicked(true); + AnimationRenderComponent animator = engineer.getComponent(AnimationRenderComponent.class); + + engineer.getEvents().trigger("idleRight"); + assertEquals("idle_right_outline", animator.getCurrentAnimation(), + "After selection, outlined animation should be playing - idle right"); + + engineer.getEvents().trigger("walkLeftStart"); + assertEquals("walk_left_outline", animator.getCurrentAnimation(), + "After selection, outlined animation should be playing - walk left"); + + engineer.getEvents().trigger("walkRightStart"); + assertEquals("walk_right_outline", animator.getCurrentAnimation(), + "After selection, outlined animation should be playing - walk right"); + + engineer.getEvents().trigger("firingSingleStart"); + assertEquals("firing_single_outline", animator.getCurrentAnimation(), + "After selection, outlined animation should be playing - firing single"); + + engineer.getEvents().trigger("hitStart"); + assertEquals("hit_outline", animator.getCurrentAnimation(), + "After selection, outlined animation should be playing - hit"); + + engineer.getEvents().trigger("deathStart"); + assertEquals("death_outline", animator.getCurrentAnimation(), + "After selection, outlined animation should be playing - death"); + } } \ No newline at end of file