From 4edcc62e9991fe05f4a19892cb45eead856bd813 Mon Sep 17 00:00:00 2001 From: unknown <45179536+r3cp3ct@users.noreply.github.com> Date: Sat, 11 Jun 2022 10:01:36 +0300 Subject: [PATCH] Slopes now kind of work but not really Co-authored-by: r3cp3ct <45179536+r3cp3ct@users.noreply.github.com> Co-authored-by: sigonasr2 --- bin/sig/map/Tile.class | Bin 3127 -> 3145 bytes bin/sig/objects/Player$1.class | Bin 1465 -> 1465 bytes bin/sig/objects/Player.class | Bin 9650 -> 10232 bytes maps/world1.map | Bin 295488 -> 295488 bytes src/sig/map/Tile.java | 12 +++++------ src/sig/objects/Player.java | 38 +++++++++++++++++++++++++++------ 6 files changed, 37 insertions(+), 13 deletions(-) diff --git a/bin/sig/map/Tile.class b/bin/sig/map/Tile.class index b252eeb6426575b86f85c66594fc03e3971d2c4e..6732950d91fb0b324b91eaa344708e9617f5d9af 100644 GIT binary patch delta 1023 zcmZva%WKq77{yO=lj)sw#8?rh)YjV8iYX|fRtAlVWuSwDBPd7(5m&zItG;z=)M|a! zSA6w*`&St-5t?&OneF3lulT+4L z(U-;n9LwN1c4{#96-#^b673S565SHL5^F68oXy}IMk+tWFWo(lL1?%@gpP}7#ihjg za_oGC^{cV-HD5Hj-gS(SP$r>^d+=D(a6V$)Jl4PGNy8}Dl&T4&u?06GzphlPML2WV zI1f?p*Wlr1=x^s9bTFL{$h`~EUX8tiwOhCydb>D}9`tqEW{{f-&CI6Ml`zps=NRsU z{y5uB#s~(xi}5;i-wa%TyG*qP6IRKqN$zEj0qo~m_7BOe+NeJ%yO-RfN5_3tJECeo zWQVu#=4NEjkE-hdTRp_12HA?WxoczRXnKr^x@;V~m>hc>!?|=miO^nr?oyJygWji& z*`*|V7uf^!Ka1FLbUumB)A}3}2Dh^RJH0&iAqGh*P=C>oR7jF`)9N=4SxAQ5Lv+cu zg6khN<{ue`!4>ewtb@zq7ggdVUa53{ta0z?EDl$Y{R}bGa>8yhjA>M*HYJ_3r5Q;b zN*cD)sYqI-q*Jyf%-V}RN;+*f8i=!tu(*0PUgHfl9dG{w DP^pbF delta 898 zcmZvaOHUJF7==$e)6O?Ti6aJRQ>a`NLpO$mOB!rQBuyX?yKzHeVptgORxVzOLh%C1 zUHO1NfeW!1j3&C)KjDU-;2J&i4NiwiH#75|bKYm(@A5N#5Vw9Eefc&3~sBU$o0Aw0*d<1p9Ex08>g_mTO)j}R)+CRTGO@##d{IAWOZ zXgc{BnLRISDfKKOXkl_5FOKtmbW`@Dmv;wjW9lVdIaxU%8WYZ6UDA1yI>;QvRX&Td zAo@cya#ysUe$7l63(6Z;-fxj=t#tMvhF-X-MUvm(t>UN52Hyr`s4ZdHamYKds?p%8 zE^(GDlPfNXdH<^N!3`T=bhRpa6!{?gGTDP{SgXp;1=%@9*Il;!Yx*~Ah@fG*8^_DN zXf@<2hd4s#UDcT|931HiNqO6Ht|z;Sa@o3Z;!X*?$EI@hn#Iz!16(g7{ten#-A&uj z^-pl6q>^sgBH~FYCEd2os3)~5>5gq_k^hb7lyujw(LL$H7u+i&U755OwLAtLXQUbH OI^`a=#Fn}m+y4Ol_kOzo diff --git a/bin/sig/objects/Player$1.class b/bin/sig/objects/Player$1.class index d178b867f9d964ece844fa1023d13903058248f0..05044e1f5fe88c783f102148c3ab507fb5d5f4bf 100644 GIT binary patch delta 17 YcmdnVy_0)`Gb<}UgDbd7XSbN delta 17 YcmdnVy_0)`Gb<|}gDb=9$sVkQ056XP6#xJL diff --git a/bin/sig/objects/Player.class b/bin/sig/objects/Player.class index 1caf0a04181d17971512644e29f790a29817a125..86301b46afa201c472b89dbcad833ff619083ca9 100644 GIT binary patch delta 4029 zcmb7H33OED75=_AZ}yi-LNdt=Sx7>VWY_~l5)uhQSi>TV8cP02Qq%k1Fd>SE+BwO4_x}IA_rLf1 z?|=XM+Gl<<$MxEG$4&qk!{-jWK6eIVnW}LB(+JDTHI0O~WO@18@)6Z5N6cMaUDr6j zadl;R?RXb6IMB{aje~d@5%(i9guUL-sHqbpSz#+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h;&>zE=|;LSgiQRFurt(!McueN2FGTXm!gwRQt{1*vjr#Finq87A4(}(*(L?PQo6p? zTqyn5M(MmdxSp}7^jLA;M^WY*yr1ui=o@ZQhVTKY+|9~NZc%RKR%Ia{mg;>>spB@K zk=vEEd|Y{%Pe`%uP%cncRsLMHbEoR&lWH1wsXp#jbGS$C%WY~Q+tm>Fse}298s@X= zICiL0ctD-Q=hTAv>{M$RQ(O4Fx`8jL8+l0G!I#y2e8s$0=S*>C2&5*tf~1TP@- zBCOwHyKwUVH8ka0SjkJ!)x^{V^cRhba1<2;rA?9sHBt1^SlFcOfwn$-&_{M8{{*M& z9~Cy2b;#r}X^_BUa=LaSm&Y-HCnV1&F_xz=ov&gRUz2>lF8%mvH1kcY;9GJIt?3_% z#`t{C0s--($d|@8O8+KfiX27YuY{9kvPbQh^l~zbwXd?V<~W2;(R6M~F!}K)H>Y!Jf|IvXn1>BUP9u|fG{Kab%r;@- zeEbzzJkdXTjJA?zu#oRz4bPbQ&V;hS#>UGMirh4*#2XJXvbur5L(-(getX()%Tile.TILE_WIDTH)+(int)(getY()+getAnimatedSpr().getHeight()/2)/Tile.TILE_HEIGHT*Tile.TILE_HEIGHT+(getAnimatedSpr().getHeight()/2-4))) + { + setY(-(getX()%Tile.TILE_WIDTH)+(int)(getY()+getAnimatedSpr().getHeight()/2)/Tile.TILE_HEIGHT*Tile.TILE_HEIGHT+(getAnimatedSpr().getHeight()/2-4)); + collisionOccured = groundCollision(check_distance_y); + System.out.println(checked_tile_bottom_center); + break; + } //System.out.println((int)getX()/Tile.TILE_WIDTH); if(checked_tile_bottom_right.getCollision()==CollisionType.BLOCK||checked_tile_bottom_left.getCollision()==CollisionType.BLOCK){ - setY((getY()-check_distance_y)); - y_acceleration = 0; - y_velocity = 0; - groundCollision=true; - collisionOccured=true; - state = State.IDLE; + collisionOccured = groundCollision(check_distance_y); break; } } @@ -432,6 +444,18 @@ public class Player extends AnimatedObject{ } + private boolean groundCollision(double check_distance_y) { + boolean collisionOccured; + setY((getY()-check_distance_y)); + y_acceleration = 0; + y_velocity = 0; + groundCollision=true; + collisionOccured=true; + state = State.IDLE; + return collisionOccured; + } + + private void handleKeyboardMovement(double updateMult, int movement, double friction, double drag) { if (movement!=0&&Math.abs(x_velocity)