Arkanoid Remake  1.0
Public Member Functions | Protected Attributes | List of all members
Ball Class Reference

Game ball definition. More...

#include <Ball.h>

Inheritance diagram for Ball:
DynObj BoxObj

Public Member Functions

 Ball (float default_speed=0.0f)
 Constructor.
 
float DefaultSpeed ()
 Get the default speed.
 
void SetDefaultSpeed (float default_speed)
 Set a default speed.
 
void Hold ()
 Mark this ball as held.
 
void Release ()
 Mark this ball as not held.
 
bool Held ()
 Check if this ball was marked as held.
 
- Public Member Functions inherited from DynObj
 DynObj ()
 Default constructor.
 
 DynObj (const DynObj &obj)
 Copy contructor.
 
void SetVel (double x, double y)
 Set the velocity along the axes.
 
void SetVelX (double x)
 Set the velocity along the X axis.
 
void SetVelY (double y)
 Set the velocity along the Y axis.
 
const VecXyVel () const
 Get the velocity vector.
 
const double VelX () const
 Get the velocity component along the X axis.
 
const double VelY () const
 Get the velocity component along the Y axis.
 
void InvertVelX ()
 Invert the velocity component along the X axis.
 
void InvertVelY ()
 Invert the velocity component along the Y axis.
 
const double Speed () const
 Get the speed (recalculate it if needed)
 
const double SquareSpeed () const
 Get the square speed (recalculate it if needed)
 
void Move (double delta_time)
 Move according to the velocity.
 
void Stop ()
 Stop: reset the velocity.
 
const VecXyPrevPos () const
 
VecXyPrevPos ()
 
- Public Member Functions inherited from BoxObj
 BoxObj (double x=0.0, double y=0.0)
 Default constructor with optional intialization list.
 
 BoxObj (const BoxObj &obj)
 
VecXyPos ()
 Position.
 
const VecXyPos () const
 Position (read only)
 
VecXyOrigin ()
 Origin (min x,y corner)
 
const VecXyOrigin () const
 Origin (min x,y corner, read-only)
 
VecXySize ()
 Size.
 
const VecXySize () const
 Size (read only)
 
const double MinX () const
 Lower X value.
 
const double MinY () const
 Lower Y value.
 
const double MaxX () const
 Upper X value.
 
const double MaxY () const
 Upper X value.
 
const VecXy HSize () const
 Half size.
 
const double HSizeX () const
 Half size along X axis.
 
const double HSizeY () const
 Half size along Y axis.
 

Protected Attributes

float mDefaultSpeed
 Default speed, used by the ship to launch the ball.
 
bool mHeld
 Flag that save the condition of the ball as "held".
 
- Protected Attributes inherited from DynObj
VecXy mVel
 
VecXy mPrevPos
 
- Protected Attributes inherited from BoxObj
VecXy mPos
 
VecXy mSize
 
VecXy mOrigin
 

Additional Inherited Members

- Protected Member Functions inherited from DynObj
void UpdateSpeed () const
 Update the scala speed values based on the velocity.
 

Detailed Description

Game ball definition.

The Ball class implements the specific behaviour of a specialized dynamic object, thus it is derived from the DynObj class.


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