|
|
|
@ -40,6 +40,7 @@ public class Player extends PhysicsObject{ |
|
|
|
|
final double viewBoundaryX = RabiClone.BASE_WIDTH / 3; |
|
|
|
|
final double viewBoundaryY = RabiClone.BASE_HEIGHT / 3; |
|
|
|
|
View lastCameraView = View.FIXED; |
|
|
|
|
boolean spacebarReleased = true; |
|
|
|
|
boolean facing_direction = RIGHT; |
|
|
|
|
boolean landedBellySlide=false; |
|
|
|
|
|
|
|
|
@ -211,7 +212,7 @@ public class Player extends PhysicsObject{ |
|
|
|
|
&& state!=State.ATTACK2&&state!=State.ATTACK3&&state!=State.BELLYSLIDE) { |
|
|
|
|
y_velocity = jump_velocity; |
|
|
|
|
} |
|
|
|
|
// System.out.println(state);
|
|
|
|
|
System.out.println(spacebarReleased); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void handleEventCollisions() { |
|
|
|
@ -255,6 +256,7 @@ public class Player extends PhysicsObject{ |
|
|
|
|
public void KeyReleased(Action a) { |
|
|
|
|
if (a == Action.JUMP) { |
|
|
|
|
spacebarPressed = 0; |
|
|
|
|
spacebarReleased=true; |
|
|
|
|
} |
|
|
|
|
if (state != State.SLIDE&&state!=State.BELLYSLIDE) { |
|
|
|
|
if ((a == Action.MOVE_LEFT) && (KeyHeld(Action.MOVE_RIGHT))) { |
|
|
|
@ -329,12 +331,13 @@ public class Player extends PhysicsObject{ |
|
|
|
|
weaponSwingTime=RabiClone.TIME; |
|
|
|
|
} |
|
|
|
|
if (groundCollision||isUnderwater()) { |
|
|
|
|
if (a==Action.JUMP&&state!=State.ATTACK2&&state!=State.ATTACK3) { |
|
|
|
|
if (spacebarReleased&&jumpCount>0&&a==Action.JUMP&&state!=State.ATTACK2&&state!=State.ATTACK3) { |
|
|
|
|
state = State.JUMP; |
|
|
|
|
jumpCount--; |
|
|
|
|
y_velocity = jump_velocity; |
|
|
|
|
spacebarPressed = RabiClone.TIME; |
|
|
|
|
// System.out.println("Jump");
|
|
|
|
|
spacebarReleased=false; |
|
|
|
|
System.out.println("Jump"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (state != State.SLIDE&&state!=State.BELLYSLIDE) { |
|
|
|
|