C++ Project 2016-2017: Arkanoid
|
The SFML element that represents the arkanoid::Block in the game. More...
#include <block_sfml.h>
Public Member Functions | |
BlockSFML (double x, double y, sf::RenderWindow &window, const string &textureFile="data/sprites/blocks/blue_block.png") | |
~BlockSFML () | |
void | update () |
void | draw () const |
![]() | |
Block () | |
Block (double x, double y, pair< double, double > size=make_pair(1, 2)) | |
~Block () | |
void | update () |
void | draw () const |
![]() | |
Wall () | |
Wall (double x, double y, pair< double, double > size=make_pair(1, 1)) | |
~Wall () | |
void | update () |
void | draw () const |
![]() | |
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 |
Protected Attributes | |
sf::RenderWindow & | windowSFML |
sf::Sprite | sprite |
The sprite of the BlockSFML. | |
sf::Texture | texture |
Transformation * | transformation |
![]() | |
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. | |
The SFML element that represents the arkanoid::Block in the game.
Definition at line 19 of file block_sfml.h.
arkanoidSFML::BlockSFML::BlockSFML | ( | double | x, |
double | y, | ||
sf::RenderWindow & | window, | ||
const string & | textureFile = "data/sprites/blocks/blue_block.png" |
||
) |
Constructor.
Creates a BlockSFML sprite in the World at a specific position in the game window. Also applies the texture to this BlockSFML.
x | The x (on screen) position of the arkanoid::Block. |
y | The y (on screen) position of the arkanoid::Block. |
window | The SFML window. |
textureFile | (optional) The file that contains the texture of the BlockSFML. |
Definition at line 12 of file block_sfml.cpp.
arkanoidSFML::BlockSFML::~BlockSFML | ( | ) |
Destructor.
Definition at line 30 of file block_sfml.cpp.
|
virtual |
Draws the BlockSFML in the game window.
Implements arkanoid::Entity.
Reimplemented in arkanoidSFML::BallSpeedBlockSFML, arkanoidSFML::PlayerSpeedBlockSFML, and arkanoidSFML::InvisBlockSFML.
Definition at line 34 of file block_sfml.cpp.
|
virtual |
Do nothing...
Implements arkanoid::Entity.
Reimplemented in arkanoidSFML::BallSpeedBlockSFML, arkanoidSFML::PlayerSpeedBlockSFML, and arkanoidSFML::InvisBlockSFML.
Definition at line 32 of file block_sfml.cpp.