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

A "special" Block: when hit with a Ball, speed up or slow down the Player. More...

#include <player_speed_block.h>

Inheritance diagram for arkanoid::PlayerSpeedBlock:
arkanoid::Block arkanoid::Wall arkanoid::Entity arkanoidSFML::PlayerSpeedBlockSFML

Public Member Functions

 PlayerSpeedBlock ()
 
 PlayerSpeedBlock (double x, double y, double speedF=1.5, pair< double, double > size=make_pair(1, 2))
 
 ~PlayerSpeedBlock ()
 
void update ()
 
void draw () const
 
void effectPlayer (unique_ptr< Player > &player) const
 
- Public Member Functions inherited from arkanoid::Block
 Block ()
 
 Block (double x, double y, pair< double, double > size=make_pair(1, 2))
 
 ~Block ()
 
- 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

A "special" Block: when hit with a Ball, speed up or slow down the Player.

Definition at line 16 of file player_speed_block.h.

Constructor & Destructor Documentation

◆ PlayerSpeedBlock() [1/2]

arkanoid::PlayerSpeedBlock::PlayerSpeedBlock ( )

Default Constructor.

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

Definition at line 11 of file player_speed_block.cpp.

◆ PlayerSpeedBlock() [2/2]

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

Constructor.

Initialise the PlayerSpeedBlock at a specific position in the World.

Parameters
xThe x position (in the grid) of the PlayerSpeedBlock.
yThe y position (in the grid) of the PlayerSpeedBlock.
speedF(optional) The factor of the speed up/down for the Ball.
size(optional) The size (width and height respectively) of the PlayerSpeedBlock.

Definition at line 13 of file player_speed_block.cpp.

◆ ~PlayerSpeedBlock()

arkanoid::PlayerSpeedBlock::~PlayerSpeedBlock ( )

Destructor.

Definition at line 15 of file player_speed_block.cpp.

Member Function Documentation

◆ draw()

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

Do nothing...

Reimplemented from arkanoid::Block.

Definition at line 21 of file player_speed_block.cpp.

◆ effectPlayer()

void arkanoid::PlayerSpeedBlock::effectPlayer ( unique_ptr< Player > &  player) const

Activate this PlayerSpeedBlock 'speciality': speed up or slow down the Player, depending on the speed factor.

Parameters
playerThe Player that will be effected.

Definition at line 25 of file player_speed_block.cpp.

◆ update()

void arkanoid::PlayerSpeedBlock::update ( )
virtual

Do nothing...

Reimplemented from arkanoid::Block.

Definition at line 17 of file player_speed_block.cpp.


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