36 const std::string
IMAGEPATH =
"images/Arkanoid_Img/";
55 void PlayArkanoid( RenderWindow& window, Sprite& s_Background, Sprite& s_Ball, Sprite& s_Paddle, Sprite* block, Sprite* lives, Texture& texture1 );
60 void CheckCollisions(
float& xAxis,
float& xPos,
float& yAxis,
float& yPos, Sprite* block,
const bool isVertical );
65 void SetBoundaries(
float& xAxis,
float& xPos,
float& yAxis,
float& yPos, Sprite* lives );
int blocksRemain
Remaining titls.
virtual int CalculateScore()
Pure virtual function inherited from GameGenerics.h Each game calculate scores differently and theref...
const std::string IMAGEPATH
Define path where image are located.
Arkanoid()
Default Constructor. Calls the InitializeVars() function.
const int WIDTH
Define the Width of the window.
int n
The number of tiles in the block. Currently, it has 100 tiles.
void SetBoundaries(float &xAxis, float &xPos, float &yAxis, float &yPos, Sprite *lives)
Set the boundaries so ball will remian inside the window. Also, whenever the ball hits outside the pa...
void InitializeVars()
Create Sprites. Load the Images and set the Sprites. Creates a block of titles with 100 tiles....
bool isGameOver
Set true when user lost all the chances. This indicate time to display game over screen.
int remainingLives
Player has 3 hearts and once it ran out game will be over. Remaining lives are multiple of 2....
const int LENGTH
Define the length of the window. If you want to change this you might need to change the background i...
void SetControls(Sprite &s_Paddle)
Set the paddle to move right and left by pressing right and left arrow keys.
void PlayArkanoid(RenderWindow &window, Sprite &s_Background, Sprite &s_Ball, Sprite &s_Paddle, Sprite *block, Sprite *lives, Texture &texture1)
Start the game and call other helper functions.
void CheckCollisions(float &xAxis, float &xPos, float &yAxis, float &yPos, Sprite *block, const bool isVertical)
This will check collisions with the tiles and the ball. Everytime the ball hit a tile,...
void SetLives(Sprite *lives)
Remove a heart whenever user miss the ball and it hit outside the paddle.