Pacman Torben Petré
Loading...
Searching...
No Matches
logic::Difficulty Class Reference

#include <Difficulty.h>

Public Member Functions

 Difficulty (Difficulty &other)=delete
void operator= (const Difficulty &)=delete
int getFruitSpriteOffset () const
 Retrieves the sprite sheet offset for the fruit associated with the current difficulty level.
int getFruitPoints () const
 The point value differs per difficulty level. As per the original game. https://pacman.fandom.com/wiki/Point_Configurations.
float getPacmanSpeed () const
 The speed of Pacman is different on some levels.
float getGhostSpeed () const
 The speed of the Ghosts is different on some levels.
float getFrighenedGhostSpeed () const
 The speed decrease of the ghosts varies on some levels.
float getFrightenedTime () const
 This duration differs on every level and goes up and down.
int getFlashesh () const
 Flashes determine how many warnings the player gets before frightened ghosts turn normal again.
void increaseDifficulty ()
 Increases the difficulty for as long as it doesn't out~index the difficulty map. Reuses the final difficulty for anything beyond.
void reset ()
 Resets the difficulty back to 0.

Static Public Member Functions

static DifficultygetInstance ()
 Returns an instance of the Difficulty class.

Constructor & Destructor Documentation

◆ Difficulty()

logic::Difficulty::Difficulty ( Difficulty & other)
delete

Singletons should not be cloneable or assignable.

Member Function Documentation

◆ getFlashesh()

int Difficulty::getFlashesh ( ) const
nodiscard

Flashes determine how many warnings the player gets before frightened ghosts turn normal again.

Just like the frigthenedTime, this goes up and down between levels to catch the player of guard.

Returns
Amount of flashes

◆ getFrighenedGhostSpeed()

float Difficulty::getFrighenedGhostSpeed ( ) const
nodiscard

The speed decrease of the ghosts varies on some levels.

Returns
Frightened Ghost Speed negative multiplier.

◆ getFrightenedTime()

float Difficulty::getFrightenedTime ( ) const
nodiscard

This duration differs on every level and goes up and down.

By going up and down the player is slightly thrown of guard which makes timing things more difficult for the player.

Returns
How long ghosts are frightened

◆ getFruitPoints()

int Difficulty::getFruitPoints ( ) const
nodiscard

The point value differs per difficulty level. As per the original game. https://pacman.fandom.com/wiki/Point_Configurations.

Returns
Point value for fruit.

◆ getFruitSpriteOffset()

int Difficulty::getFruitSpriteOffset ( ) const
nodiscard

Retrieves the sprite sheet offset for the fruit associated with the current difficulty level.

Returns
Integer offset for the fruit sprite.

◆ getGhostSpeed()

float Difficulty::getGhostSpeed ( ) const
nodiscard

The speed of the Ghosts is different on some levels.

Returns
Ghost Speed

◆ getInstance()

Difficulty & Difficulty::getInstance ( )
staticnodiscard

Returns an instance of the Difficulty class.

Returns
Difficulty instance

◆ getPacmanSpeed()

float Difficulty::getPacmanSpeed ( ) const
nodiscard

The speed of Pacman is different on some levels.

Returns
Pacman speed

◆ increaseDifficulty()

void Difficulty::increaseDifficulty ( )

Increases the difficulty for as long as it doesn't out~index the difficulty map. Reuses the final difficulty for anything beyond.

◆ operator=()

void logic::Difficulty::operator= ( const Difficulty & )
delete

◆ reset()

void Difficulty::reset ( )

Resets the difficulty back to 0.


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