Skip to content

Commit

Permalink
Merge pull request #42 from Adrian400811/Jimmy
Browse files Browse the repository at this point in the history
Revert change to jump
  • Loading branch information
349928465 authored Jun 13, 2024
2 parents 14dec2a + 46a055e commit 6717bb5
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 6717bb5

Please sign in to comment.