Skip to content

Commit

Permalink
Fixed bounds checking
Browse files Browse the repository at this point in the history
  • Loading branch information
basimkhajwal committed May 19, 2016
1 parent d6c99c7 commit 46be682
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/src/net/net63/codearcade/LSD/systems/PlayerSystem.java
Original file line number Diff line number Diff line change
Expand Up @@ -123,11 +123,11 @@ public void processEntity(Entity entity, float deltaTime) {
state.set(PlayerComponent.STATE_FALLING);
}

//Check if player remains within bounds, appy death otherwise
//Check if player remains within bounds, apply death otherwise
if (playerComponent.isFlying && !playerComponent.isDead) {
Rectangle bounds = levelDescriptor.getWorldBounds();

if ((!bounds.contains(position)) && (bounds.y + bounds.height) > position.y) {
if (bounds.x > position.x || bounds.x + bounds.width < position.x || bounds.y > position.y ) {
applyDeath = true;
}
}
Expand Down

0 comments on commit 46be682

Please sign in to comment.