Skip to content

Commit

Permalink
set normal speed for bosses and general mobs so slow and stun works p…
Browse files Browse the repository at this point in the history
…roperly
  • Loading branch information
gregchan550 committed Oct 17, 2023
1 parent aa34129 commit 5c86d9b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand All @@ -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);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit 5c86d9b

Please sign in to comment.