Skip to content

Commit

Permalink
Removed extra print statements for testing and moved position of mobball
Browse files Browse the repository at this point in the history
  • Loading branch information
meganroxburgh committed Sep 9, 2023
1 parent 92d3c99 commit 0aa993a
Showing 1 changed file with 3 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
public class MobAttackTask extends DefaultTask implements PriorityTask {
private static final int INTERVAL = 1; // time interval to scan for towers in
private static final short TARGET = PhysicsLayer.HUMANS; // mobs detecting for towers
// ^ fix this

// private static final String STOW = "stowStart";
// private static final String DEPLOY = "deployStart";
Expand Down Expand Up @@ -101,13 +100,10 @@ public void updateMobState() {

case IDLE -> {
if (isTargetVisible()) {
System.out.println("IDLE: target visible for " + owner.getEntity().getId());
// targets detected in idle mode - start deployment
//owner.getEntity().getEvents().trigger(DEPLOY);
mobState = STATE.FIRING;
}
else {
System.out.println("IDLE: target not visible for " + owner.getEntity().getId());
owner.getEntity().getEvents().trigger(FIRING);
}
}

Expand All @@ -128,14 +124,11 @@ public void updateMobState() {
if (!isTargetVisible()) {
//owner.getEntity().getEvents().trigger(STOW);
mobState = STATE.IDLE;
System.out.println("FIRING: target not visible for " + owner.getEntity().getId());
} else {
owner.getEntity().getEvents().trigger(FIRING);
Entity newProjectile = ProjectileFactory.createMobBall(PhysicsLayer.HUMANS, new Vector2(0, owner.getEntity().getPosition().y), new Vector2(2f,2f));
newProjectile.setPosition((float) (owner.getEntity().getPosition().x), (float) (owner.getEntity().getPosition().y));
Entity newProjectile = ProjectileFactory.createMobBall(TARGET, new Vector2(0, owner.getEntity().getPosition().y), new Vector2(2f,2f));
newProjectile.setPosition((float) (owner.getEntity().getPosition().x - 1), (float) (owner.getEntity().getPosition().y));
ServiceLocator.getEntityService().register(newProjectile);
// mobState = STATE.IDLE;
System.out.println("FIRING: target visible for " + owner.getEntity().getId());
owner.getEntity().getEvents().trigger(FIRING);
}
}
Expand Down

0 comments on commit 0aa993a

Please sign in to comment.