Week 4: Pounded!


Ground Pound

To get ground pound working meant reworking the entire ground check system. Instead of using the dot product to check if the player is grounded, a series of three raycasts shot downward from different location on the player is now used instead. When the player collides with the something the IsBelow function is called which performs those raycasts, if the player is colliding with something below them, we then check if the collision object is the ground and if the player is in the act of ground pounding. If they are we then call the functions Smash and Start Smoke, reset their bools for IsGrounded and IsDown, and reset their mass and jumps available. If the player is not ground pounding the functions are not called. The Smash function creates an array storing colliders tagged as player that are with the area of effect, using a for loop the TakeDamage and damage Flash functions are called and knockback is applied to all players that are not the initiating player. The StartSmoke function calls the Smoke script to enable the sprite renderer on the smoke effect and play the animation, it then disables the sprite renderer. StartSmoke also calls the StartShake function, which is part of the CameraShake script, in this script the Shaking coroutine is started which moves the main camera's position based on an animation curve to create the screen shake effect.

Fig 1 - Player using groundpound

Fig 1 - Player using groundpound

Mass Powerup

The mass boost power up works the same way as the other powerups mentioned in the other previous devlog. The only difference that it also effects the player's jumpForce as well so the player can still jump normally while their mass is increased.

Fig 2 - Player using the mass powerup

Fig 2 - Player using the mass powerup

Warp Zone Fade

When a player interacts with a warp point, the FadeOut coroutine starts which fades the players opacity down to zero via a for loop before moving them to the new warp point where the FadeIn coroutine starts which just does the opposite of FadeOut and brings their opacity back up to one.

Fig 3 - Demonstration of the warp point fade effect

Fig 3 - Demonstration of the warp point fade effect

Powerup Sprites and Indicator

Feedback from last week brought up that the powerups were not clear on what they would do for the player. So, I made custom sprites for each of them to make them more obvious. An addition was also made to the player UI at the top of the screen to indicate if a player has a powerup active. This uses a new function on the UIContainer script called UpdatePowerup, which sets a UI image to that of the powerup that is active, this function is called when a powerup is enabled and then disables when the powerup timer expires.

Fig 4 - New powerup sprites and indicator system
Fig 4 - New powerup sprites and indicator system

Leave a comment

Log in with itch.io to leave a comment.