Crouching!
#2 in the player movement chronicles!
Surprisingly, I also managed to create a whole new 5 animations! slide, crouch idle, crouch walk, and the sledge versions (not slide cause ya can’t sprint with sledge). I implemented all but the slide, which’ll take a long time, so I’m going to keep it off a bit. This was really straight forward to add, and for the first time in a long time, i had like only 1 problem
. I really just had a piece of code that asks, “did ya click the crouch button?” and if so, it toggles crouch. IF (and only if!) the crouch is on (or “true”) the idle and walk animations are switched to their respective crouch variants, and the normal player hitbox is replaced by a shorter-er-est one.
To bar the player from un-crouching in the midst of a tunnel, I added 2 new raycasts to the front and back of the players head facing up, these casts detect if there is a block above the player, and if either one of them detects anything, the player is unable to un-crouch until they are unshielded. Another quick thing I had to fix a bit was the raycasts detecting the player, which broke EVERYTHING
so I just turned good ’ol collision mask/layer 20 into the super-cool (ALL-NEW
!!) “player raycast collision!!!” which just only lets them interact with the floor and boxes, so yippee
NEXT STEPeths!:
-slide ):
-enemy lunge
-other player attacks (only hard attack right now which is bad)
but I got a lot done, mostly just some serious drawing. I finished some tiles for the first and second levels, and some tiles for the next three.
(very bad) Theres was already a variable to detect if the player was being hit that was used for testing, so I just implemented that to play the injury animations. i also detected if the players health was zero or below after being hit, and if so it would make the player play the death animation instead of the injury. I have currently unimplemented animations for a before-death injured player, so after they are hit for the last time they will stand for a bit before collapsing.


the codes really just the same as the player attacking the enemies. Theres a hurtbox in the player that gets hit by an area in the enemy that makes them take damage.
: