|
DoopelPonger
|
Parent level class to control how a ball/bullet moves in the game scene. More...


Public Member Functions | |
| void | Awake () |
| Initialize references needed by the ball movement object. More... | |
| void | Init (CoopBall ball) |
| Initialize values needed by the ball movement object. More... | |
| void | ReturnObject () |
| Put this object back in the object pooler for later use. This method should be called when the ball is destroyed. More... | |
| Vector2 | GetVelocity (float previousAliveTimer, float currentAliveTimer, Vector2 currentDirection) |
| Get the new velocity given information about a ball's current velocity. More... | |
Protected Member Functions | |
| abstract Vector2 | GetDirectionAndSpeed (float previousAliveTimer, float currentAliveTimer, Vector2 currentDirection) |
| Get the new velocity given information about a ball's current velocity. More... | |
| abstract void | ChildInit (CoopBall ball) |
| Initialize values needed by the ball movement object. More... | |
Parent level class to control how a ball/bullet moves in the game scene.
| void CoopBallMovement.Awake | ( | ) |
Initialize references needed by the ball movement object.
|
protectedpure virtual |
Initialize values needed by the ball movement object.
| ball | The ball that needs to have the speed/direction initialized. |
Implemented in CoopSineWaveMovement, CoopSquareWaveMovement, CoopTriangleWaveMovement, CoopWhirlyMovement, CoopDecreaseSpeed, CoopIncreaseSpeed, CoopStartStopMovement, and CoopConstantSpeed.
|
protectedpure virtual |
Get the new velocity given information about a ball's current velocity.
| previousAliveTimer | The time the ball was alive the previous tick of the game. |
| currentAliveTimer | The time the ball has been alive for the current tick of the game. |
| currentDirection | The normalized direction the ball is moving. |
Implemented in CoopSineWaveMovement, CoopTriangleWaveMovement, CoopSquareWaveMovement, CoopWhirlyMovement, CoopDecreaseSpeed, CoopIncreaseSpeed, CoopStartStopMovement, and CoopConstantSpeed.
| Vector2 CoopBallMovement.GetVelocity | ( | float | previousAliveTimer, |
| float | currentAliveTimer, | ||
| Vector2 | currentDirection | ||
| ) |
Get the new velocity given information about a ball's current velocity.
| previousAliveTimer | The time the ball was alive the previous tick of the game. |
| currentAliveTimer | The time the ball has been alive for the current tick of the game. |
| currentDirection | The normalized direction the ball is moving. |
| void CoopBallMovement.Init | ( | CoopBall | ball | ) |
Initialize values needed by the ball movement object.
| ball | The ball that needs to have the speed/direction initialized. |
| void CoopBallMovement.ReturnObject | ( | ) |
Put this object back in the object pooler for later use. This method should be called when the ball is destroyed.
1.8.14