Skip to content

Commit

Permalink
Revert change to jump
Browse files Browse the repository at this point in the history
  • Loading branch information
349928465 committed Jun 13, 2024
1 parent 116cc3e commit 46a055e
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions Player.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,9 @@ private void movement() {
}

private void jump() {
if (Greenfoot.isKeyDown("Space") && getOneObjectAtOffset((getImage().getHeight() / 2), (getImage().getHeight() / 2) + 1, Brick.class) != null) {
if (Greenfoot.isKeyDown("Space") && getOneObjectAtOffset(0, (getImage().getHeight() / 2) + 1, Brick.class) != null) {
jumpActs = 30;
} else if (Greenfoot.isKeyDown("Space") && getOneObjectAtOffset(-(getImage().getHeight() / 2), (getImage().getHeight() / 2) + 1, Brick.class) != null) {
jumpActs = 30;
}
}
if (jumpActs > 15) {
setLocation(getX(), getY() - 8);
}
Expand Down

0 comments on commit 46a055e

Please sign in to comment.