From 0fc9aee91979a6c959bcfcf213725008778e7eaf Mon Sep 17 00:00:00 2001 From: unknown <45179536+r3cp3ct@users.noreply.github.com> Date: Sat, 11 Jun 2022 10:17:47 +0300 Subject: [PATCH] SLope but it works Co-authored-by: r3cp3ct <45179536+r3cp3ct@users.noreply.github.com> Co-authored-by: sigonasr2 --- bin/sig/objects/Player.class | Bin 10232 -> 10321 bytes maps/world1.map | Bin 295488 -> 295488 bytes src/sig/objects/Player.java | 6 ++++++ 3 files changed, 6 insertions(+) diff --git a/bin/sig/objects/Player.class b/bin/sig/objects/Player.class index 86301b46afa201c472b89dbcad833ff619083ca9..9631b2cc1a4139e6f7eff4b907df0345cf906e82 100644 GIT binary patch delta 536 zcmYL@TS(Jk0L9Pw{$JDCE*PWuBk7#B!9vOxAFG!@v6vA?AU;?Y}hpaLN3K*MxuEO>kHeUn_-C7#{7}o2i++H=6{-7^a z?{HIdqDFO;)%zRS#@*b{!#v0?wlhgTN9WTxJNTJLI5mI!JCE`gkBJI)iY6Wx0d|RQ z21S@BM1&_roZVuOr^FObi*Gz5rg>KUW=PDiM>8<2+1RVq@Vs`2ecAx~wKxZ~PrM+P z@Zx4!!iaP+D&4#+*YJw0=2cnC9=U?1J6AD+MI1#jU&6&PRPq&8a~!pN4G-U-k#Et$ckuE9cJZUy X>-2C!J#h9KC(*z!Xyc@6bp`(biH4j~ delta 485 zcmXAfZ)nVM9DqO1_xJVZ=IojlJJUJGc6CMD3wtGANR+L+x=4*uyl}1QEOnz}VQs|u z)7Q97vxVCsf6i_?vv-hv2`P1!{?`Gs)4iv3 ze^W+0y3W>KLh_H8QTKz2a6%UNtc9L|*v4-fizH-(2PM`II{($w1>)OE$y@Z5b zN|$zXQ&(|I`?#ZPxvST4PjBSDt|z5~4C)=Eb%-Gy;h~Q5NXN+PIFHGQ$Zc6>zO35f zm=R;mqi&WO_p~fF+pBtS+M9NeIaR delta 38 qcmX@mB6OfdXam2@WI+j;$?`cu&9*Y_wla)B%ml>D+ihi7n9~63a0-tA diff --git a/src/sig/objects/Player.java b/src/sig/objects/Player.java index 1e62b48..e30ae26 100644 --- a/src/sig/objects/Player.java +++ b/src/sig/objects/Player.java @@ -370,8 +370,13 @@ public class Player extends AnimatedObject{ Tile checked_tile_top_right = RabiClone.CURRENT_MAP.getTile((int)(getX()+getAnimatedSpr().getWidth()/2-4+check_distance_x)/Tile.TILE_WIDTH, (int)(getY()+getAnimatedSpr().getHeight()/2)/Tile.TILE_HEIGHT); Tile checked_tile_top_left = RabiClone.CURRENT_MAP.getTile((int)(getX()-getAnimatedSpr().getWidth()/2+4+check_distance_x)/Tile.TILE_WIDTH, (int)(getY()+getAnimatedSpr().getHeight()/2)/Tile.TILE_HEIGHT); + Tile checked_tile_bottom_center = RabiClone.CURRENT_MAP.getTile((int)(getX())/Tile.TILE_WIDTH, (int)(getY()+getAnimatedSpr().getHeight()/2)/Tile.TILE_HEIGHT); + if(checked_tile_top_right.getCollision()==CollisionType.BLOCK||checked_tile_top_left.getCollision()==CollisionType.BLOCK){ //System.out.println(checked_tile_top_right.getCollision()+"//"+checked_tile_top_left.getCollision()); + if(checked_tile_bottom_center.getCollision()==CollisionType.SLOPE){ + }else{ + if (checked_tile_top_right.getCollision()==CollisionType.BLOCK) { setX(((int)(getX()-getAnimatedSpr().getWidth()/2)/Tile.TILE_WIDTH)*Tile.TILE_WIDTH+Tile.TILE_WIDTH/2+3+check_distance_x); } else { @@ -380,6 +385,7 @@ public class Player extends AnimatedObject{ x_acceleration = 0; x_velocity = Math.signum(x_velocity)*0.000001; sideCollision=true; + } } } if (y_velocity==0) {