diff --git a/maps/world1.map b/maps/world1.map index b86a24d..bbcd34b 100644 Binary files a/maps/world1.map and b/maps/world1.map differ diff --git a/src/sig/objects/Player.java b/src/sig/objects/Player.java index cbf05d5..4c3ceb4 100644 --- a/src/sig/objects/Player.java +++ b/src/sig/objects/Player.java @@ -16,6 +16,7 @@ import java.awt.event.KeyEvent; public class Player extends AnimatedObject{ final double GRAVITY = 1300; final double NORMAL_FRICTION = 6400; + final double NORMAL_JUMP_VELOCITY = -300; final boolean LEFT = false; final boolean RIGHT = true; final int jump_fall_AnimationWaitTime = 200; @@ -29,14 +30,15 @@ public class Player extends AnimatedObject{ double x_velocity = 0; double x_velocity_limit = 164; double y_velocity = 5; - double y_velocity_limit = 400; + double y_velocity_limit = 500; + double sliding_velocity = 164; double horizontal_drag = 2000; double horizontal_friction = NORMAL_FRICTION; double horizontal_air_drag = 800; double horizontal_air_friction = 180; - double jump_velocity = -300; + double jump_velocity = NORMAL_JUMP_VELOCITY; int maxJumpCount=2; int jumpCount=maxJumpCount; @@ -85,6 +87,7 @@ public class Player extends AnimatedObject{ } break; case IDLE: + jump_velocity = NORMAL_JUMP_VELOCITY; horizontal_friction = NORMAL_FRICTION; jump_slide_fall_StartAnimationTimer=-1; @@ -106,6 +109,9 @@ public class Player extends AnimatedObject{ } break; case JUMP: + if(prvState==State.SLIDE){ + //jump_velocity=-500; + } if(jump_slide_fall_StartAnimationTimer==-1){ jump_slide_fall_StartAnimationTimer = System.currentTimeMillis(); setAnimatedSpr(Sprite.ERINA_JUMP_RISE1); @@ -124,6 +130,12 @@ public class Player extends AnimatedObject{ setAnimatedSpr(Sprite.ERINA_SLIDE); } if(System.currentTimeMillis()-slide_time>slide_duration){ + if(KeyHeld(KeyEvent.VK_A)||KeyHeld(KeyEvent.VK_LEFT)){ + facing_direction=LEFT; + } + if(KeyHeld(KeyEvent.VK_D)||KeyHeld(KeyEvent.VK_RIGHT)){ + facing_direction=RIGHT; + } state=State.IDLE; } break; @@ -139,7 +151,7 @@ public class Player extends AnimatedObject{ if ((KeyHeld(KeyEvent.VK_SPACE)||KeyHeld(KeyEvent.VK_W))&&System.currentTimeMillis()-spacebarPressedx_velocity_limit ?Math.signum(x_velocity+x_acceleration*updateMult)*x_velocity_limit