Skip to content

Commit

Permalink
Fixed timer tick rate, removed some obnoxious logger messages.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jantoom committed Nov 4, 2021
1 parent 3dffcf3 commit d875c81
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public void update() {
}

public void scheduleEntityForRemoval(Entity entity) {
logger.info("Scheduling entity {} for removal", entity);
logger.debug("Scheduling entity {} for removal", entity);
entitiesScheduledForRemoval.add(entity);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ private void walkThroughDoor() {
GridPoint2 targetPos = ServiceLocator.getHome().getFloor().getMumTargetPos();
dest = ServiceLocator.getHome().getFloor().getTerrain().tileToWorldPosition(targetPos);
movementComponent.setTarget(dest);
movementComponent.setMaxSpeed(new Vector2(3f, 3f));
movementComponent.setMoving(true);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public void onInteraction(Entity target) {
logger.debug("PLAYER interacted with Book");
startTime = ServiceLocator.getTimeSource().getTime();
hasInteracted = true;
entity.getEvents().trigger(UPDATE_ANIMATION, "dust1");
//entity.getEvents().trigger(UPDATE_ANIMATION, "dust1");
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public void onInteraction(Entity target) {
logger.debug("PLAYER interacted with Trash");
startTime = ServiceLocator.getTimeSource().getTime();
hasInteracted = true;
entity.getEvents().trigger(UPDATE_ANIMATION, "dust1");
//entity.getEvents().trigger(UPDATE_ANIMATION, "dust1");
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
*/
public class PhysicsMovementComponent extends Component implements MovementController {
private static final Logger logger = LoggerFactory.getLogger(PhysicsMovementComponent.class);
private static final Vector2 maxSpeed = new Vector2(3f, 3f);
private Vector2 maxSpeed = new Vector2(1f, 1f);

private PhysicsComponent physicsComponent;
private Vector2 targetPosition;
Expand Down Expand Up @@ -45,6 +45,10 @@ public void update() {
}
}

public void setMaxSpeed(Vector2 maxSpeed) {
this.maxSpeed = maxSpeed;
}

/**
* Enable/disable movement for the controller. Disabling will immediately set velocity to 0.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public class TimerWidget extends RetroactiveWidget {
private static final String TIMER_BACKGROUND = "images/ui/elements/Textbox_256.png";
private static final int TIMER_START = 2300;
private static final int TIMER_END = 200;
private static final long TIMER_TICK_RATE = 30L;
private static final long TIMER_TICK_RATE = 500L;
private long lastTime = 0L;
private Label timerLabel;
private TimerStatus timerStatus = TimerStatus.NORMAL;
Expand Down

0 comments on commit d875c81

Please sign in to comment.