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

The data necessary to have a bullet move along a triangle wave. More...

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

Public Attributes

float speed
 
float amplitude
 
float wavelengthMultiplier
 

Protected Member Functions

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...
 

Additional Inherited Members

- Public Member Functions inherited from CoopBallMovement
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...
 

Detailed Description

The data necessary to have a bullet move along a triangle wave.

Member Function Documentation

◆ ChildInit()

override void CoopTriangleWaveMovement.ChildInit ( CoopBall  ball)
protectedvirtual

Initialize values needed by the ball movement object.

Parameters
ballThe ball that needs to have the speed/direction initialized.

Implements CoopBallMovement.

◆ GetDirectionAndSpeed()

override Vector2 CoopTriangleWaveMovement.GetDirectionAndSpeed ( float  previousAliveTimer,
float  currentAliveTimer,
Vector2  currentDirection 
)
protectedvirtual

Get the new velocity given information about a ball's current velocity.

Parameters
previousAliveTimerThe time the ball was alive the previous tick of the game.
currentAliveTimerThe time the ball has been alive for the current tick of the game.
currentDirectionThe normalized direction the ball is moving.
Returns
The new speed and direction of the ball should move.

Implements CoopBallMovement.

Member Data Documentation

◆ amplitude

float CoopTriangleWaveMovement.amplitude

The distance between the peaks on the y axis.

◆ speed

float CoopTriangleWaveMovement.speed

The speed the bullet moves along the triangle wave.

◆ wavelengthMultiplier

float CoopTriangleWaveMovement.wavelengthMultiplier

The distance between the peaks on the x axis.


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