|
DoopelPonger
|
The core logic for anything related to the player. This class ended up being a bit too large, so chances are it does basically anything related to the player. More...


Public Member Functions | |
| void | Awake () |
| Initialize all references, event callbacks, input management, and positioning of the player. More... | |
| void | OnDestroy () |
| Remove all function pointers being held on to by the input manager or event manager when the player dies. More... | |
| void | FixedUpdate () |
| Move the player if input is pressed, change the state of animations, and update the invulnerability state. More... | |
| void | IgnoreRegisterAllInputRequests () |
| Used during the tutorial so that the player cannot be controlled at any point in time. More... | |
| void | RegisterNewControls (InputManager.InputTriggerOption newTriggerPowerUpOption, InputManager.InputTriggerOption newPlayerMovementOption, InputManager.InputTriggerOption shieldTriggerOption) |
| Used when the single player dies and the new player on the right should be spawned with the same input controls as the player on the left. More... | |
| void | RegisterShield () |
| Tell the player shield to register the callbacks in the InputManager. More... | |
| void | RegisterMovement () |
| Register the movement options with the InputManager. More... | |
| void | RegisterPowerUpControls () |
| Register the power up option with the InputManager. More... | |
| void | DeregisterAllControls () |
| Remove all function pointers away from the InputManager. More... | |
| void | RegisterAllControls () |
| Register all input options with the InputManager. More... | |
| bool | GoodBallHit (float chargeAmount) |
| A CoopGoodBall hit the player. More... | |
| bool | BadBallHit () |
| A CoopBadBall hit the player. More... | |
| void | HitAnimationDone () |
| Unity animation callback for when the hit animation has finished playing. More... | |
| InputManager.InputTriggerOption | GetShieldTriggerOption () |
Public Attributes | |
| InputManager.InputTriggerOption | triggerPowerUpOption |
| InputManager.InputTriggerOption | playerMovementOption |
| Rigidbody2D | rigidbody2d |
| float | playerPercentPosition |
| float | speed |
| int | playerNumber |
| float | hitInvulnerableTimer |
| float | explosionForce |
| CoopPowerUpController | powerUpController |
| float | blendRate |
Static Public Attributes | |
| static readonly float | MAX_BLEND = 2 |
| static readonly float | MIN_BLEND = 0 |
| static readonly float | MID_BLEND = (MAX_BLEND + MIN_BLEND) / 2 |
The core logic for anything related to the player. This class ended up being a bit too large, so chances are it does basically anything related to the player.
| void CoopPlayer.Awake | ( | ) |
Initialize all references, event callbacks, input management, and positioning of the player.
| bool CoopPlayer.BadBallHit | ( | ) |
A CoopBadBall hit the player.
| void CoopPlayer.DeregisterAllControls | ( | ) |
Remove all function pointers away from the InputManager.
| void CoopPlayer.FixedUpdate | ( | ) |
Move the player if input is pressed, change the state of animations, and update the invulnerability state.
| InputManager.InputTriggerOption CoopPlayer.GetShieldTriggerOption | ( | ) |
| bool CoopPlayer.GoodBallHit | ( | float | chargeAmount | ) |
A CoopGoodBall hit the player.
| chargeAmount | The amount of charge that should be added to the player. |
| void CoopPlayer.HitAnimationDone | ( | ) |
Unity animation callback for when the hit animation has finished playing.
| void CoopPlayer.IgnoreRegisterAllInputRequests | ( | ) |
Used during the tutorial so that the player cannot be controlled at any point in time.
| void CoopPlayer.OnDestroy | ( | ) |
Remove all function pointers being held on to by the input manager or event manager when the player dies.
| void CoopPlayer.RegisterAllControls | ( | ) |
Register all input options with the InputManager.
| void CoopPlayer.RegisterMovement | ( | ) |
Register the movement options with the InputManager.
| void CoopPlayer.RegisterNewControls | ( | InputManager.InputTriggerOption | newTriggerPowerUpOption, |
| InputManager.InputTriggerOption | newPlayerMovementOption, | ||
| InputManager.InputTriggerOption | shieldTriggerOption | ||
| ) |
Used when the single player dies and the new player on the right should be spawned with the same input controls as the player on the left.
| newTriggerPowerUpOption | The new button used to trigger the power up. |
| newPlayerMovementOption | The new buttons used to move the player up and down. |
| shieldTriggerOption | The new button to trigger the player's shield. |
| void CoopPlayer.RegisterPowerUpControls | ( | ) |
Register the power up option with the InputManager.
| void CoopPlayer.RegisterShield | ( | ) |
Tell the player shield to register the callbacks in the InputManager.
| float CoopPlayer.blendRate |
How fast the player sprite changes animation state when getting hit/increasing size when dodging balls.
| float CoopPlayer.explosionForce |
When the player dies, they explode into several pieces. This force pushes all the pieces aware from the center of mass.
| float CoopPlayer.hitInvulnerableTimer |
The amount of time the player should be invulnerable after getting hit before they can get hit again.
|
static |
|
static |
| InputManager.InputTriggerOption CoopPlayer.playerMovementOption |
The InputTriggerOption used to move the player up and down.
| int CoopPlayer.playerNumber |
Number of the player, used to identify the different players.
| float CoopPlayer.playerPercentPosition |
The percent of x axis that the player should spawn at.
| CoopPowerUpController CoopPlayer.powerUpController |
Reference to the code that manages the power the player has, the amount of power up charge, etc.
| Rigidbody2D CoopPlayer.rigidbody2d |
The rigidbody that should be used to change the velocity of when movement is necessary.
| float CoopPlayer.speed |
How fast the player should move.
| InputManager.InputTriggerOption CoopPlayer.triggerPowerUpOption |
The InputTriggerOption used to trigger the power up.
1.8.14