Breakout
PlayerScore.h
Go to the documentation of this file.
1 #ifndef PLAYERSCORE
2 #define PLAYERSCORE
3 #include <SDL2/SDL.h>
4 #include <SDL2/SDL_ttf.h>
5 #include "Vec2.h"
6 #include <string>
10 class PlayerScore {
11 public:
19  PlayerScore(Vec2 position, SDL_Renderer* ren, TTF_Font* font);
23  ~PlayerScore();
27  void Draw();
32  void SetScore(int score);
37  void SetText(const char* text);
41  void SetHeart();
45  void SetStar();
50  void setFlag(int language);
51 private:
55  SDL_Renderer* renderer;
59  SDL_Surface* spriteSheet;
63  TTF_Font* font;
67  SDL_Surface* surface{};
71  SDL_Texture* texture{};
75  SDL_Rect rect{};
76 
77 };
78 #endif
Represents various score displayed in the game.
Definition: PlayerScore.h:10
void Draw()
The method to draw or render the score on the screen.
Definition: PlayerScore.cpp:29
void SetStar()
This method will load and set star icon to indicate the points scored by the player.
Definition: PlayerScore.cpp:88
~PlayerScore()
The destructor for playerScore.
Definition: PlayerScore.cpp:23
void SetHeart()
The method will load and set heart icon to indidcate lives left.
Definition: PlayerScore.cpp:48
void setFlag(int language)
This method will upload and set the flag icon for the language being used.
Definition: PlayerScore.cpp:65
PlayerScore(Vec2 position, SDL_Renderer *ren, TTF_Font *font)
The constructor for PlayerScore that takkes in Position, Renderer and font as an argument.
Definition: PlayerScore.cpp:8
void SetText(const char *text)
The method to set and update text.
Definition: PlayerScore.cpp:105
void SetScore(int score)
The method to set and update score.
Definition: PlayerScore.cpp:34
Vec2 will abstract X&Y position for ball and paddle.
Definition: Vec2.h:6
GLuint texture
Definition: glad.h:2396