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

Pong ball that moves without gravity across the screen. More...

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

Public Member Functions

void Awake ()
 Initialize references and set the movement direction. More...
 
void OnEnable ()
 Make sure the ball is moving when the menu gets enabled. More...
 
void FixedUpdate ()
 Save the velocity of the ball so it can continue moving after * leaving and coming back to the menu. More...
 
void OnCollisionEnter2D (Collision2D collision)
 Play pong sounds when the ball hits objects. More...
 

Public Attributes

Vector2 moveDirection
 

Detailed Description

Pong ball that moves without gravity across the screen.

Member Function Documentation

◆ Awake()

void AIBall.Awake ( )

Initialize references and set the movement direction.

◆ FixedUpdate()

void AIBall.FixedUpdate ( )

Save the velocity of the ball so it can continue moving after * leaving and coming back to the menu.

◆ OnCollisionEnter2D()

void AIBall.OnCollisionEnter2D ( Collision2D  collision)

Play pong sounds when the ball hits objects.

Parameters
collisionObject the ball hit.

◆ OnEnable()

void AIBall.OnEnable ( )

Make sure the ball is moving when the menu gets enabled.

Member Data Documentation

◆ moveDirection

Vector2 AIBall.moveDirection

The direction the ball should initially move.


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