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

A type of good ball that should charge a player's power up if it hits a player and should damage Schmitty Doop when hit. More...

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

Public Member Functions

void Awake ()
 Initialize the references needed by the MiniBall. More...
 
void Init ()
 Initialize the values needed by the MiniBall. More...
 
void OnCollisionEnter2D (Collision2D collision)
 Checks the collision object and do specific things based on the object that collided with the ball. More...
 
void IgnoreShield (Collider2D shieldCollider)
 When the ball hits the shield, in some situations it can hit the shield twitce and bounce back in the original direction it was traveling. We want to ignore the second collision. More...
 

Public Attributes

float chargeAmountMultiplier
 The amount of charge to give the player if the ball hits the player. More...
 
float velocity
 How fast the mini ball should move. More...
 
float verticalRatio
 The speed.y/speed.x ratio to apply the vertical fix amount to make sure the ball is not bouncing up and down. More...
 
float verticalFix
 The amount of speed to add to the x axis to correct the velocity if it is moving too much in the y axis. More...
 
CoopBallHitParticle hitParticleSystem
 The particle system to play when the ball is destroyed. More...
 
int numberOfBounces
 The number of times the mini ball has been bounced off a shield. More...
 
float radius
 The size of the ball. More...
 

Detailed Description

A type of good ball that should charge a player's power up if it hits a player and should damage Schmitty Doop when hit.

The mini ball can also bounce off of player shields. Each time the ball bounces it increases the amount of damage it will do to Schmitty Doop as well as increase the amount of charge to give to the player being hit.

Member Function Documentation

◆ Awake()

void CoopMiniBall.Awake ( )

Initialize the references needed by the MiniBall.

◆ IgnoreShield()

void CoopMiniBall.IgnoreShield ( Collider2D  shieldCollider)

When the ball hits the shield, in some situations it can hit the shield twitce and bounce back in the original direction it was traveling. We want to ignore the second collision.

Parameters
shieldColliderThe shield that the ball hit.

◆ Init()

void CoopMiniBall.Init ( )

Initialize the values needed by the MiniBall.

◆ OnCollisionEnter2D()

void CoopMiniBall.OnCollisionEnter2D ( Collision2D  collision)

Checks the collision object and do specific things based on the object that collided with the ball.

If the ball collides with Schmitty Doop, damage it. If the ball collides with a player, the player should have the power up charge increased. If the ball hits a shield it will bounce back in the opposite direction.

Parameters
collisionThe object that has been collided with the ball.

Member Data Documentation

◆ chargeAmountMultiplier

float CoopMiniBall.chargeAmountMultiplier

The amount of charge to give the player if the ball hits the player.

◆ hitParticleSystem

CoopBallHitParticle CoopMiniBall.hitParticleSystem

The particle system to play when the ball is destroyed.

◆ numberOfBounces

int CoopMiniBall.numberOfBounces

The number of times the mini ball has been bounced off a shield.

◆ radius

float CoopMiniBall.radius

The size of the ball.

◆ velocity

float CoopMiniBall.velocity

How fast the mini ball should move.

◆ verticalFix

float CoopMiniBall.verticalFix

The amount of speed to add to the x axis to correct the velocity if it is moving too much in the y axis.

◆ verticalRatio

float CoopMiniBall.verticalRatio

The speed.y/speed.x ratio to apply the vertical fix amount to make sure the ball is not bouncing up and down.


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