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

Belong to the homing missile power up. The cannons will shoot homing missiles that go after Schmitty Doop. More...

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

Classes

struct  CannonFireInfo
 Data class used to provide information about a cannon. More...
 

Public Member Functions

void Awake ()
 Initialize references the cannons need. More...
 
void Init ()
 Initialize the values the cannons need. More...
 
CannonFireInfo GetNextFireInfo ()
 
void DespawnCannons (System.Action animationFinishedDelegate)
 The cannons should trigger their despawn animations. More...
 
bool IsReadyToFire ()
 
void FinishedSpawnAnimation ()
 Callback from the Unity Animator that says the cannons have been spawned and are ready to be used. More...
 
void FinishDespawnAnimation ()
 Callback from the Unity Animator that says the cannons have been despawned. More...
 
void FixedUpdate ()
 Make sure the scale is as expected and check to make sure the walls are not overlapping with either cannon. More...
 

Public Attributes

Transform topCannonFirePosition
 
BoxCollider2D topCannonCollider
 
Transform bottomCannonFirePosition
 
BoxCollider2D bottomCannonCollider
 
LayerMask wallLayer
 
Vector2 desiredScale
 

Detailed Description

Belong to the homing missile power up. The cannons will shoot homing missiles that go after Schmitty Doop.

The cannons consist of two cannons, one on top and the other on bottom of the player. The cannons take turns firing a homing missle.

Member Function Documentation

◆ Awake()

void CoopCannons.Awake ( )

Initialize references the cannons need.

◆ DespawnCannons()

void CoopCannons.DespawnCannons ( System.Action  animationFinishedDelegate)

The cannons should trigger their despawn animations.

Parameters
animationFinishedDelegateFunction that should be called once the despawn animation is finished.

◆ FinishDespawnAnimation()

void CoopCannons.FinishDespawnAnimation ( )

Callback from the Unity Animator that says the cannons have been despawned.

◆ FinishedSpawnAnimation()

void CoopCannons.FinishedSpawnAnimation ( )

Callback from the Unity Animator that says the cannons have been spawned and are ready to be used.

◆ FixedUpdate()

void CoopCannons.FixedUpdate ( )

Make sure the scale is as expected and check to make sure the walls are not overlapping with either cannon.

◆ GetNextFireInfo()

CannonFireInfo CoopCannons.GetNextFireInfo ( )
Returns
The information of the cannon that should fire the next bullet.

◆ Init()

void CoopCannons.Init ( )

Initialize the values the cannons need.

◆ IsReadyToFire()

bool CoopCannons.IsReadyToFire ( )
Returns
True once the cannons have fully spawned.

Member Data Documentation

◆ bottomCannonCollider

BoxCollider2D CoopCannons.bottomCannonCollider

The collider of the cannon on the bottom of the player.

◆ bottomCannonFirePosition

Transform CoopCannons.bottomCannonFirePosition

The firing position of the cannon on the bottom of the player.

◆ desiredScale

Vector2 CoopCannons.desiredScale

The expectes scale of the cannons. The scale is needed because the cannons were designed before all power ups were placed as children of the player. So it was easier to force the scale once childed.

◆ topCannonCollider

BoxCollider2D CoopCannons.topCannonCollider

The collider of the cannon on top of the player.

◆ topCannonFirePosition

Transform CoopCannons.topCannonFirePosition

The firing position of the cannon on top of the player.

◆ wallLayer

LayerMask CoopCannons.wallLayer

The Unity Layer of the wall, used so that if a cannon spawns inside a wall, it can ignore the wall collider so the player can move away from the wall.


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