Pacman
1.0
Pacman game
|
The Renderer class. Plus de détails...
#include <Renderer.h>
Fonctions membres publiques | |
Renderer () | |
Construct a new Renderer object. Plus de détails... | |
~Renderer () | |
void | render (const Maze &maze, std::shared_ptr< Pacman > pacman, std::vector< std::shared_ptr< Ghosts >> ghosts, int score, int state, int lives) |
This function renders the game. Plus de détails... | |
void | updateScreen () |
This function updates the screen. Plus de détails... | |
Fonctions membres privées | |
void | createWindow () |
void | createRenderer () |
void | loadResources () |
void | loadMusic () |
void | drawScore (int score) |
void | drawLives (int lives) |
void | animateDeath (std::shared_ptr< Pacman > pacman) |
Attributs privés | |
SDL_Window * | window = nullptr |
SDL_Renderer * | renderer = nullptr |
SDL_Surface * | surface_bmp = nullptr |
SDL_Texture * | texture_bmp = nullptr |
Mix_Music * | music_start = nullptr |
Mix_Music * | music_death = nullptr |
Mix_Music * | music_chomp = nullptr |
int | screenWidth |
int | screenHeight |
int | frame = 0 |
The Renderer class.
This class is responsible for rendering the game. It contains all the functions related to rendering the game and the game elements. It also contains the functions related to loading the resources.
Renderer::Renderer | ( | ) |
Construct a new Renderer object.
This constructor initializes the renderer by creating the window and the renderer. It also loads the resources, and initializes the SDL, SDL_ttf and SDL_mixer libraries.
Renderer::~Renderer | ( | ) |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
void Renderer::render | ( | const Maze & | maze, |
std::shared_ptr< Pacman > | pacman, | ||
std::vector< std::shared_ptr< Ghosts >> | ghosts, | ||
int | score, | ||
int | state, | ||
int | lives | ||
) |
This function renders the game.
This function renders the game by rendering the maze, the pacman, the ghosts, the score and the lives.
maze | |
pacman | |
ghosts | |
score | |
state | |
lives |
void Renderer::updateScreen | ( | ) |
This function updates the screen.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |