From d254452e80dd91fcd085a875b8a54fb026f9137e Mon Sep 17 00:00:00 2001 From: sigonasr2 Date: Mon, 27 Jun 2022 16:43:52 -0500 Subject: [PATCH] Remove spacebar released again after debugging jump counts and correcting them Co-authored-by: r3cp3ct <45179536+r3cp3ct@users.noreply.github.com> Co-authored-by: sigonasr2 --- backgrounds/water-overlay.gif | Bin 5845 -> 1075 bytes src/sig/objects/LevelRenderer.java | 7 ++++--- src/sig/objects/Player.java | 17 +++++++---------- src/sig/objects/actor/PhysicsObject.java | 2 +- src/sig/objects/enemies/BlueBun.java | 1 + src/sig/objects/enemies/GreenBun.java | 1 + src/sig/objects/enemies/RedBun.java | 1 + src/sig/objects/enemies/YellowBun.java | 1 + 8 files changed, 16 insertions(+), 14 deletions(-) diff --git a/backgrounds/water-overlay.gif b/backgrounds/water-overlay.gif index 0b6b980cd25271ebd2670b26a0a1fe1b01fb286b..321094a291b43373c7d70f112f83db65612e4424 100644 GIT binary patch literal 1075 zcmZ?wbhEHbWMG`Yu#}S_dRb}q$(+@9Q~tc~{lBB~RZ`L!r?|x$5vAf`mYnX15`pce zq02(!PZk${S~v6m;ZN`SPhZK~+-}z*FQDaR5L6w~u&j0d&Ali7|Np=4(f{7<|8pCD zwWPjj_B~RoyTDJP=0C%KpgFWdia%KxxftvjbQnMY=qCoYe+PQpR%lA~pIB0KGRJEE zg%u@UYopfRSXD6lW!3%%8!CMCW}kntrRr?n?)x8p7#wE2`u>|u-TL>R|JOA(G&i-j zw6}G3ba(ak^!H8dh;^PcZNiM{vu4hjJ#X%U`Ase*3d@$SSh;HTnzifJZ`inL^OmjK zw(r=vt#nD{uKfoN9y)yF=&?;QOG=NQIeYH>g^TO~PppZdqdCDQT!)`4b@n+LV0ZdiD@T%qb^ zwa3Oq8(W2Sv+i`PPH^i}aQ?@vzG=zHFggEKF`b1=PfyZ}KXvCu(K6pI!~9n+5yi{@ zoo}$L=h}L`ctv2jW51Sec*)A(4x#y8wd@6}LUTOVXW3pWS$(})aJA$g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Mnf?u|aRuy#;+;*E5!U(DZsar>(C1<@{-Rv(lH%yLB^jMSYW( z*8IiuqB8ndam~tF{qLDC*XrU4=T6OExoy+;taW!zo_bxd_1~-6>kskm&ffUrVV6$D zLA_|{jpyvDbGB^Xb#GO}kzfW6g%d<&gdAnvWJgwLIWN-A^ zj#;O)bN74`QqSABd+q7>$?yJ2&)m;sELL!^Pq3#TkzN1H!!3OCcjq5jrs=b>Q#jsc z)={bFR|}4-Iq_^tk?()A@q`-loWfHQi_UC1sJ)*@^0?7siQ==p7kiAW%-`3{J#EJx zR&?R3hQ+U_(N?i5dYttj= zrM?~!$%J@O6g_iQk~ zYtJB1VUVjG`}1C%cU^^n{*~U?2XoK!?tGZWyKnQ&w%@s|PZl2copxWpWS`Z8iOdP* z(F_^$zQ5V{n>U8D^0-~~gG5pNX&+C>udn%Z=6lMIS9>q7t#G$8wcGXOZ2JB`-)@zk zxBb4wT<*JX$kCL4KVK|g|L@nE?f)-1d`MUM|L4o~{QrM{JlDVI#>j}7Y1>C@w$Yl6 yo;Ar}vum`{8m+WOE3H9YX<36?n4`pK2#kinXb6mkz-S1JhQMeDjD`RiApiiEZqBR# diff --git a/src/sig/objects/LevelRenderer.java b/src/sig/objects/LevelRenderer.java index dcb08fc..3777e16 100644 --- a/src/sig/objects/LevelRenderer.java +++ b/src/sig/objects/LevelRenderer.java @@ -174,9 +174,10 @@ public class LevelRenderer extends Object{ for (int x=0;x0&&a==Action.JUMP&&state!=State.ATTACK2&&state!=State.ATTACK3) { + if (jumpCount>0&&a==Action.JUMP&&state!=State.ATTACK2&&state!=State.ATTACK3) { state = State.JUMP; jumpCount--; y_velocity = jump_velocity; spacebarPressed = RabiClone.TIME; - spacebarReleased=false; - System.out.println("Jump"); + //System.out.println("Jump"); } } if (state != State.SLIDE&&state!=State.BELLYSLIDE) { diff --git a/src/sig/objects/actor/PhysicsObject.java b/src/sig/objects/actor/PhysicsObject.java index 508e348..67db56b 100644 --- a/src/sig/objects/actor/PhysicsObject.java +++ b/src/sig/objects/actor/PhysicsObject.java @@ -50,8 +50,8 @@ public abstract class PhysicsObject extends AnimatedObject implements PhysicsObj protected double gravity = GRAVITY; protected double x_acceleration,y_acceleration; protected boolean groundCollision; - protected byte jumpCount=0; protected byte maxJumpCount=2; + protected byte jumpCount=maxJumpCount; protected double x_velocity_limit,y_velocity_limit; protected double x_acceleration_limit,y_acceleration_limit; protected double jump_velocity; diff --git a/src/sig/objects/enemies/BlueBun.java b/src/sig/objects/enemies/BlueBun.java index 6b99827..e89bd25 100644 --- a/src/sig/objects/enemies/BlueBun.java +++ b/src/sig/objects/enemies/BlueBun.java @@ -19,6 +19,7 @@ public class BlueBun extends BunnyGirls{ setSlidingVelocity_UseDefaultStrategy(); setSlidingAcceleration_UseDefaultStrategy(); setJumpVelocity_UseDefaultStrategy(); + setMaxJumpCount_UseDefaultStrategy(); setGravity_UseHalfStrategy(950); } diff --git a/src/sig/objects/enemies/GreenBun.java b/src/sig/objects/enemies/GreenBun.java index 5256a9d..46d6959 100644 --- a/src/sig/objects/enemies/GreenBun.java +++ b/src/sig/objects/enemies/GreenBun.java @@ -19,6 +19,7 @@ public class GreenBun extends BunnyGirls{ setSlidingVelocity_UseDefaultStrategy(); setSlidingAcceleration_UseDefaultStrategy(); setJumpVelocity_UseDefaultStrategy(); + setMaxJumpCount_UseDefaultStrategy(); setGravity_UseHalfStrategy(1550); } diff --git a/src/sig/objects/enemies/RedBun.java b/src/sig/objects/enemies/RedBun.java index 1609aff..137a98d 100644 --- a/src/sig/objects/enemies/RedBun.java +++ b/src/sig/objects/enemies/RedBun.java @@ -19,6 +19,7 @@ public class RedBun extends BunnyGirls{ setSlidingVelocity_UseDefaultStrategy(); setSlidingAcceleration_UseDefaultStrategy(); setJumpVelocity_UseDefaultStrategy(); + setMaxJumpCount_UseDefaultStrategy(); setGravity_UseHalfStrategy(750); } diff --git a/src/sig/objects/enemies/YellowBun.java b/src/sig/objects/enemies/YellowBun.java index d056d78..7528720 100644 --- a/src/sig/objects/enemies/YellowBun.java +++ b/src/sig/objects/enemies/YellowBun.java @@ -19,6 +19,7 @@ public class YellowBun extends BunnyGirls{ setSlidingVelocity_UseDefaultStrategy(); setSlidingAcceleration_UseDefaultStrategy(); setJumpVelocity_UseDefaultStrategy(); + setMaxJumpCount_UseDefaultStrategy(); setGravity_UseHalfStrategy(150); }