Data configuration to move the bullets along a sine wave.
More...
|
override void | ChildInit (CoopBall ball) |
| Initialize values needed by the ball movement object. More...
|
|
override Vector2 | GetDirectionAndSpeed (float previousAliveTimer, float currentAliveTimer, Vector2 currentDirection) |
| Get the new velocity given information about a ball's current velocity. More...
|
|
|
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...
|
|
Data configuration to move the bullets along a sine wave.
◆ ChildInit()
override void CoopSineWaveMovement.ChildInit |
( |
CoopBall |
ball | ) |
|
|
protectedvirtual |
Initialize values needed by the ball movement object.
- Parameters
-
ball | The ball that needs to have the speed/direction initialized. |
Implements CoopBallMovement.
◆ GetDirectionAndSpeed()
override Vector2 CoopSineWaveMovement.GetDirectionAndSpeed |
( |
float |
previousAliveTimer, |
|
|
float |
currentAliveTimer, |
|
|
Vector2 |
currentDirection |
|
) |
| |
|
protectedvirtual |
Get the new velocity given information about a ball's current velocity.
- Parameters
-
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. |
- Returns
- The new speed and direction of the ball should move.
Implements CoopBallMovement.
◆ amplitude
float CoopSineWaveMovement.amplitude |
The amplitude (height) of the wave to travel.
◆ speed
float CoopSineWaveMovement.speed |
The speed the bullet moves along the wave.
◆ wavelengthMultiplier
float CoopSineWaveMovement.wavelengthMultiplier |
The wavelength of the sine wave path.
The documentation for this class was generated from the following file: