Pacman class.
Plus de détails...
#include <Pacman.h>
Pacman class.
this class is used to store the pacman entity. It is a subclass of Entity.
◆ Pacman()
Pacman::Pacman |
( |
float |
x, |
|
|
float |
y, |
|
|
int |
direction, |
|
|
std::shared_ptr< Intersection > |
destination |
|
) |
| |
◆ ~Pacman()
◆ getEating()
bool Pacman::getEating |
( |
| ) |
const |
◆ getSprite()
SDL_Rect Pacman::getSprite |
( |
int |
frame, |
|
|
int |
direction |
|
) |
| |
|
privatevirtual |
◆ getX()
int Pacman::getX |
( |
| ) |
const |
◆ getY()
int Pacman::getY |
( |
| ) |
const |
◆ makeTurn()
return the next intersection
this method is used to return the next intersection. It also updates the coordinates of the pacman.
- Renvoie
- std::shared_ptr<Intersection>
◆ move()
move the pacman
this method is used to move the pacman. It calls the makeTurn method when the pacman is at an intersection.
◆ render()
void Pacman::render |
( |
int |
frame, |
|
|
SDL_Renderer * |
renderer, |
|
|
SDL_Texture * |
texture |
|
) |
| |
|
virtual |
render the pacman
this method is used to render the pacman. It calls the getSprite method to get the correct sprite for the pacman.
- Paramètres
-
Implémente Entity.
◆ setEating()
void Pacman::setEating |
( |
bool |
e | ) |
|
◆ setPlayerDirection()
void Pacman::setPlayerDirection |
( |
int |
d | ) |
|
◆ dest
◆ isEating
bool Pacman::isEating = false |
|
private |
◆ lastSprite
SDL_Rect Pacman::lastSprite = {489, 1, 13, 13} |
|
private |
◆ playerDirection
int Pacman::playerDirection = RIGHT |
|
private |
◆ sprites
std::vector<SDL_Rect> Pacman::sprites |
|
private |
La documentation de cette classe a été générée à partir du fichier suivant :