C++ Project 2016-2017: Arkanoid
|
A "special" Block: when hit with a Ball, speed up or slow down the Player. More...
#include <player_speed_block.h>
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. | |
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.
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.
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.
x | The x position (in the grid) of the PlayerSpeedBlock. |
y | The 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.
arkanoid::PlayerSpeedBlock::~PlayerSpeedBlock | ( | ) |
Destructor.
Definition at line 15 of file player_speed_block.cpp.
|
virtual |
Do nothing...
Reimplemented from arkanoid::Block.
Definition at line 21 of file player_speed_block.cpp.
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.
player | The Player that will be effected. |
Definition at line 25 of file player_speed_block.cpp.
|
virtual |
Do nothing...
Reimplemented from arkanoid::Block.
Definition at line 17 of file player_speed_block.cpp.