DoopelPonger
Public Member Functions | Public Attributes | List of all members
CoopPlayerScaleAnimatorDelegate Class Reference

Animation delegate used to change the size of the player. More...

Inheritance diagram for CoopPlayerScaleAnimatorDelegate:
Inheritance graph
[legend]
Collaboration diagram for CoopPlayerScaleAnimatorDelegate:
Collaboration graph
[legend]

Public Member Functions

override void Init (Animator playerAnimator)
 Initialize the animator. More...
 
override void PlayerBadBallHit ()
 The player has been hit with a bad ball. More...
 
override void PlayerGoodBallHit ()
 The player has been hit with a good ball. More...
 
override void PowerUpActivated ()
 The player has activated a power up. More...
 
override void PowerUpChargeChange (float percentCharge, bool prematureActivation)
 The amount of charge the player has has changed. More...
 
override void PowerUpDeactivated ()
 The player has had their power up run out. More...
 
void FixedUpdate ()
 Grows, shrinks, or makes the player stay the same size based on the state of the stateMachine. More...
 

Public Attributes

Range chargeRange
 
float hitOffset
 
float superFastMultiplier
 
float fastChangeRate
 
float slowChangeRate
 

Detailed Description

Animation delegate used to change the size of the player.

The player's size increases as their charge inscreases, so the more power up charge they have the harder it is to dodge. The player's scale also increase to the full if the player is hit by a good ball and then shrinks back to the expected size over a short period of time. And as one could guess, getting hit by a bad ball shrinks the player to the smallest size and then has the scale grow back over a short period of time. Unity's Blend Tree is also used to control the scale of the player with the max and min size defined in the Animations and the Blen Tree lerps between the sizes.

Member Function Documentation

◆ FixedUpdate()

void CoopPlayerScaleAnimatorDelegate.FixedUpdate ( )

Grows, shrinks, or makes the player stay the same size based on the state of the stateMachine.

◆ Init()

override void CoopPlayerScaleAnimatorDelegate.Init ( Animator  playerAnimator)
virtual

Initialize the animator.

Parameters
playerAnimatorThe Unity animator component on the CoopPlayer gameObject.

Implements CoopPlayerAnimatorDelegate.

◆ PlayerBadBallHit()

override void CoopPlayerScaleAnimatorDelegate.PlayerBadBallHit ( )
virtual

The player has been hit with a bad ball.

Implements CoopPlayerAnimatorDelegate.

◆ PlayerGoodBallHit()

override void CoopPlayerScaleAnimatorDelegate.PlayerGoodBallHit ( )
virtual

The player has been hit with a good ball.

Implements CoopPlayerAnimatorDelegate.

◆ PowerUpActivated()

override void CoopPlayerScaleAnimatorDelegate.PowerUpActivated ( )
virtual

The player has activated a power up.

Implements CoopPlayerAnimatorDelegate.

◆ PowerUpChargeChange()

override void CoopPlayerScaleAnimatorDelegate.PowerUpChargeChange ( float  percentCharge,
bool  prematureActivation 
)
virtual

The amount of charge the player has has changed.

Parameters
chargePercentThe amount of charge the player has from 0 to 1
prematureActivationMeans that the player tried to use their power up before actually having a full charge.

Implements CoopPlayerAnimatorDelegate.

◆ PowerUpDeactivated()

override void CoopPlayerScaleAnimatorDelegate.PowerUpDeactivated ( )
virtual

The player has had their power up run out.

Implements CoopPlayerAnimatorDelegate.

Member Data Documentation

◆ chargeRange

Range CoopPlayerScaleAnimatorDelegate.chargeRange

The minimum and maximum value the animator goes for setting the scale.

◆ fastChangeRate

float CoopPlayerScaleAnimatorDelegate.fastChangeRate

How fast the player's size should change when needing to change quickly. Currently this rate is used when hit by a good/bad ball.

◆ hitOffset

float CoopPlayerScaleAnimatorDelegate.hitOffset

The +/- of the current scale when the player is hit by a good/bad ball.

◆ slowChangeRate

float CoopPlayerScaleAnimatorDelegate.slowChangeRate

How slow the player's size should change when needing to change slowly. Currently this rate is used when the player gains power up charge.

◆ superFastMultiplier

float CoopPlayerScaleAnimatorDelegate.superFastMultiplier

Multiplier for when the scale needs to change quickly. Currently, this multiplier is only used when a power up is over and the player needs to shink to the smallest size.


The documentation for this class was generated from the following file: