Breakout
Public Member Functions | List of all members
PlayerScore Class Reference

Represents various score displayed in the game. More...

#include <PlayerScore.h>

Public Member Functions

 PlayerScore (Vec2 position, SDL_Renderer *ren, TTF_Font *font)
 The constructor for PlayerScore that takkes in Position, Renderer and font as an argument. More...
 
 ~PlayerScore ()
 The destructor for playerScore. More...
 
void Draw ()
 The method to draw or render the score on the screen. More...
 
void SetScore (int score)
 The method to set and update score. More...
 
void SetText (const char *text)
 The method to set and update text. More...
 
void SetHeart ()
 The method will load and set heart icon to indidcate lives left. More...
 
void SetStar ()
 This method will load and set star icon to indicate the points scored by the player. More...
 
void setFlag (int language)
 This method will upload and set the flag icon for the language being used. More...
 

Detailed Description

Represents various score displayed in the game.

Constructor & Destructor Documentation

◆ PlayerScore()

PlayerScore::PlayerScore ( Vec2  position,
SDL_Renderer *  ren,
TTF_Font *  font 
)

The constructor for PlayerScore that takkes in Position, Renderer and font as an argument.

Parameters
positionThe x and y coordinates where the score would be rendered
renThe pointer to the SDL_Renderer for playerscore to be rendered
fontThe type of font to load into when rendering

◆ ~PlayerScore()

PlayerScore::~PlayerScore ( )

The destructor for playerScore.

Member Function Documentation

◆ Draw()

void PlayerScore::Draw ( )

The method to draw or render the score on the screen.

◆ setFlag()

void PlayerScore::setFlag ( int  language)

This method will upload and set the flag icon for the language being used.

Parameters
languagethe code for the language. As of now 0 stands for french and 1 stands for english

◆ SetHeart()

void PlayerScore::SetHeart ( )

The method will load and set heart icon to indidcate lives left.

◆ SetScore()

void PlayerScore::SetScore ( int  score)

The method to set and update score.

Parameters
scorethe score to be set or updated

◆ SetStar()

void PlayerScore::SetStar ( )

This method will load and set star icon to indicate the points scored by the player.

◆ SetText()

void PlayerScore::SetText ( const char *  text)

The method to set and update text.

Parameters
textthe text to be set or updated

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