diff --git a/src/sig/objects/LevelRenderer.java b/src/sig/objects/LevelRenderer.java index 7e653d7..67ab078 100644 --- a/src/sig/objects/LevelRenderer.java +++ b/src/sig/objects/LevelRenderer.java @@ -76,7 +76,7 @@ public class LevelRenderer extends Object{ } if (RabiClone.player!=null) { Draw_Animated_Object(RabiClone.player,RabiClone.player.facing_direction?Transform.HORIZONTAL:Transform.NONE); - Draw_Text(4,4,new String(RabiClone.player.x_velocity),Font.PROFONT_12); + Draw_Text(4,4,new String(RabiClone.player.y_velocity),Font.PROFONT_12); Draw_Text(4,4+Font.PROFONT_12.getGlyphHeight(),new String(RabiClone.player.slide_time3),Font.PROFONT_12); } //RenderCollisionGrid(p); diff --git a/src/sig/objects/Player.java b/src/sig/objects/Player.java index 487e0c8..9426c5e 100644 --- a/src/sig/objects/Player.java +++ b/src/sig/objects/Player.java @@ -400,37 +400,39 @@ public class Player extends AnimatedObject implements CollisionEntity { groundCollision=true; jumpCount=maxJumpCount; } - } - double startingY=getY(); - if (displacement_y>0) { - for (int y=(int)getY();y0) { + for (int y=(int)getY();ystartingY+displacement_y;y--) { + if (y==getY()) { + continue; } - break; - } - } - }/* else { - for (int x=(int)getX();x>startingX+displacement_x;x--) { - if (x==getX()) { - continue; + if (checkCollision(getX()-RabiClone.level_renderer.getX(),y-RabiClone.level_renderer.getY()+getCollisionBox().getY()-getSprite().getHeight()/2)) { + setY(y+1); + y_acceleration = 0; + y_velocity = 0; + break; + } } - if (checkCollision((x-RabiClone.level_renderer.getX()+getCollisionBox().getX()-getSprite().getWidth()/2),getY()-RabiClone.level_renderer.getY()-getSprite().getHeight()/2+getCollisionBounds().getY2())) { - x_acceleration = 0; - x_velocity = Math.signum(x_velocity)*0.000001; - sideCollision=true; - setX(x+1); - } } - }*/ + } if (!groundCollision){ this.setY(this.getY()+displacement_y); y_acceleration = GRAVITY;