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

Power up that, as you would guess by the name, fires out of the player and then returns before any more charge can be collected. More...

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

Public Member Functions

void Awake ()
 Initialize references needed by the boomerang. More...
 
void Init ()
 Initialize all variables of the boomerang before being used. More...
 
void ThrowBoomerang ()
 Launch the boomerang! (Player activated the power up). More...
 
void Despawn (System.Action despawnFinishedAction)
 For the boomerang to be destroy. An example of this use case is the boomerang is flying and then the player decides to go back to the main menu. More...
 
void FixedUpdate ()
 Move the boomerang and apply damage/charge if the boomerang hits an object. More...
 
void SchmittyDoopTriggerEnter (CoopSchmittyDoop schmittyDoop)
 The boomerang has hit Schmitty Doop and should start applying damage. More...
 
void SchmittyDoopTriggerExit ()
 The boomerang is no longer hitting Schmitty Doop and should not apply damage. More...
 
void PlayerTriggerEnter (CoopPlayer player)
 The boomerang has hit the player. If the player is the player that threw the boomerang, then trigger the returning function. Else give charge to the player and return the boomerang back to sender. More...
 

Public Attributes

Vector2 targetPosition
 
float timeToTargetPosition
 
float rotationalVelocity
 
float timeToMaxReturnSpeed
 
float chargeAmountMultiplier
 
float damageMultiplier
 
float waitBeforeTriggerIsActive
 
float delayBetweenHits
 
CoopBoomerangController controller
 
Transform returnTransform
 
int playerNumber
 
CoopBoomerangAnimator animator
 

Detailed Description

Power up that, as you would guess by the name, fires out of the player and then returns before any more charge can be collected.

Member Function Documentation

◆ Awake()

void CoopBoomerang.Awake ( )

Initialize references needed by the boomerang.

◆ Despawn()

void CoopBoomerang.Despawn ( System.Action  despawnFinishedAction)

For the boomerang to be destroy. An example of this use case is the boomerang is flying and then the player decides to go back to the main menu.

◆ FixedUpdate()

void CoopBoomerang.FixedUpdate ( )

Move the boomerang and apply damage/charge if the boomerang hits an object.

◆ Init()

void CoopBoomerang.Init ( )

Initialize all variables of the boomerang before being used.

◆ PlayerTriggerEnter()

void CoopBoomerang.PlayerTriggerEnter ( CoopPlayer  player)

The boomerang has hit the player. If the player is the player that threw the boomerang, then trigger the returning function. Else give charge to the player and return the boomerang back to sender.

◆ SchmittyDoopTriggerEnter()

void CoopBoomerang.SchmittyDoopTriggerEnter ( CoopSchmittyDoop  schmittyDoop)

The boomerang has hit Schmitty Doop and should start applying damage.

◆ SchmittyDoopTriggerExit()

void CoopBoomerang.SchmittyDoopTriggerExit ( )

The boomerang is no longer hitting Schmitty Doop and should not apply damage.

◆ ThrowBoomerang()

void CoopBoomerang.ThrowBoomerang ( )

Launch the boomerang! (Player activated the power up).

Member Data Documentation

◆ animator

CoopBoomerangAnimator CoopBoomerang.animator

◆ chargeAmountMultiplier

float CoopBoomerang.chargeAmountMultiplier

The amount of charge to give to the other player if the boomerang hits a player.

◆ controller

CoopBoomerangController CoopBoomerang.controller

The controller that spawned the boomerang.

◆ damageMultiplier

float CoopBoomerang.damageMultiplier

How much hurt should be brought down on Schmitty Doop when hit by the boomerang.

◆ delayBetweenHits

float CoopBoomerang.delayBetweenHits

The wait time before Schmitty Doop can take damage again from the boomerang.

◆ playerNumber

int CoopBoomerang.playerNumber

The player number that launched the boomerang.

◆ returnTransform

Transform CoopBoomerang.returnTransform

The transform to return to after a player was hit or the target position was reached. (It is the player that launched the boomerang)

◆ rotationalVelocity

float CoopBoomerang.rotationalVelocity

How fast the boomerang should spin when traveling.

◆ targetPosition

Vector2 CoopBoomerang.targetPosition

The position the boomerang should fly to.

◆ timeToMaxReturnSpeed

float CoopBoomerang.timeToMaxReturnSpeed

Once the boomerang has reaced the targetPosition, it needs to return to the player. When it returns the speed goes from 0 to the max speed. This is the amount of time it takes to get to the max speed when returning.

◆ timeToTargetPosition

float CoopBoomerang.timeToTargetPosition

How long it should take to reach the target position.

◆ waitBeforeTriggerIsActive

float CoopBoomerang.waitBeforeTriggerIsActive

As a jank solution, I add a very small delay when the player fires the boomerang so that the player firing the boomerang isn't detected as a collision in the first few frames after the throw.


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