C++ Project 2016-2017: Arkanoid
Public Member Functions | List of all members
arkanoid::Block Class Reference

The Block in the Arkanoid game, can be hit and destroyed by the Player. More...

#include <block.h>

Inheritance diagram for arkanoid::Block:
arkanoid::Wall arkanoid::Entity arkanoid::BallSpeedBlock arkanoid::InvisBlock arkanoid::PlayerSpeedBlock arkanoidSFML::BlockSFML arkanoidSFML::BallSpeedBlockSFML arkanoidSFML::InvisBlockSFML arkanoidSFML::PlayerSpeedBlockSFML arkanoidSFML::BallSpeedBlockSFML arkanoidSFML::InvisBlockSFML arkanoidSFML::PlayerSpeedBlockSFML

Public Member Functions

 Block ()
 
 Block (double x, double y, pair< double, double > size=make_pair(1, 2))
 
 ~Block ()
 
void update ()
 
void draw () const
 
- Public Member Functions inherited from arkanoid::Wall
 Wall ()
 
 Wall (double x, double y, pair< double, double > size=make_pair(1, 1))
 
 ~Wall ()
 
void update ()
 
void draw () const
 
- Public Member Functions inherited from arkanoid::Entity
 Entity ()
 
 Entity (double x, double y, pair< double, double > newSize=make_pair(1.0, 1.0))
 
virtual ~Entity ()
 
Vector2D getPosition () const
 
void setPosition (double x, double y)
 
void setPosition (const Vector2D &vector)
 
void setSize (pair< double, double > newSize)
 
pair< double, double > getSize () const
 
bool collidesWith (const Entity &other) const
 

Additional Inherited Members

- Protected Attributes inherited from arkanoid::Entity
Vector2D position
 The current position of the Entity (in the 9x7 grid).
 
pair< double, double > size
 The size (width and height respectively) of the Entity.
 

Detailed Description

The Block in the Arkanoid game, can be hit and destroyed by the Player.

Definition at line 18 of file block.h.

Constructor & Destructor Documentation

◆ Block() [1/2]

arkanoid::Block::Block ( )

Default Constructor.

Initialise the Block at origin ([0, 0]) in the World.

Definition at line 12 of file block.cpp.

◆ Block() [2/2]

arkanoid::Block::Block ( double  x,
double  y,
pair< double, double >  size = make_pair(1, 2) 
)

Constructor.

Initialise the Block at a specific position in the World.

Parameters
xThe x position (in the grid) of the Block.
yThe y position (in the grid) of the Block.
size(optional) The size (width and height respectively) of the Block.

Definition at line 14 of file block.cpp.

◆ ~Block()

arkanoid::Block::~Block ( )

Destructor.

Definition at line 16 of file block.cpp.

Member Function Documentation

◆ draw()

void arkanoid::Block::draw ( ) const
virtual

Do nothing...

Implements arkanoid::Entity.

Reimplemented in arkanoid::BallSpeedBlock, arkanoid::PlayerSpeedBlock, and arkanoid::InvisBlock.

Definition at line 20 of file block.cpp.

◆ update()

void arkanoid::Block::update ( )
virtual

Do nothing...

Implements arkanoid::Entity.

Reimplemented in arkanoid::BallSpeedBlock, arkanoid::PlayerSpeedBlock, and arkanoid::InvisBlock.

Definition at line 18 of file block.cpp.


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