Building Game Engines
Public Member Functions | Public Attributes | List of all members
GameManager Class Reference

#include <GameManager.hpp>

Collaboration diagram for GameManager:
Collaboration graph

Public Member Functions

void Start (GameObject *player, TileMap *tileMap, std::vector< GameObject *> Fruits, std::vector< GameObject *> Ai, SDL_Renderer *m_renderer)
 
void Start (GameObject *player, TileMap *tileMap, SDL_Renderer *m_renderer)
 
void Update ()
 
void Render ()
 
void Stop ()
 
void SaveCollectibles (const char *filename)
 
void SaveEnemies (const char *filename)
 
void AddEnemy (GameObject *enemy)
 
int NumCollectibles ()
 
int NumEnemies ()
 
void AddCollectible (GameObject *collectible)
 
 GameManager ()
 
 ~GameManager ()
 

Public Attributes

std::vector< GameObject * > Fruits
 
std::vector< GameObject * > Ai
 

Constructor & Destructor Documentation

◆ GameManager()

GameManager::GameManager ( )
inline

Constructor

◆ ~GameManager()

GameManager::~GameManager ( )
inline

Deconstructor

Member Function Documentation

◆ AddCollectible()

void GameManager::AddCollectible ( GameObject collectible)

Adds Collectible to GameManager.

◆ AddEnemy()

void GameManager::AddEnemy ( GameObject enemy)

Adds Enemy to GameManager.

◆ NumCollectibles()

int GameManager::NumCollectibles ( )

Gets the number of collectibles in the scene.

◆ NumEnemies()

int GameManager::NumEnemies ( )

Gets the number of enemies in the scene.

◆ Render()

void GameManager::Render ( )

Renders the text for the score

◆ SaveCollectibles()

void GameManager::SaveCollectibles ( const char *  filename)

Saves the types and positions of all collectibles in the level to a file.

Here is the call graph for this function:

◆ SaveEnemies()

void GameManager::SaveEnemies ( const char *  filename)

Saves the types and positions of all enemies in the level to a file.

Here is the call graph for this function:

◆ Start() [1/2]

void GameManager::Start ( GameObject player,
TileMap tileMap,
std::vector< GameObject *>  Fruits,
std::vector< GameObject *>  Ai,
SDL_Renderer *  m_renderer 
)

Is the actuily constructor for Game Manager player: The playble chacters Game object tilemap: The tilemap component for the world fruits: A vector list of all the Fruits game object Ai: A vector of all the Eniemies in the world m_renderer: The game renderers

◆ Start() [2/2]

void GameManager::Start ( GameObject player,
TileMap tileMap,
SDL_Renderer *  m_renderer 
)

◆ Stop()

void GameManager::Stop ( )

Makes sure that ttf is correctly removed.

◆ Update()

void GameManager::Update ( )

Checks to see if there is collisions bewteen player and Fruits and player and Ai Also increaments score based off collisions with fruits and removes wall segments based of score

Here is the call graph for this function:

Member Data Documentation

◆ Ai

std::vector<GameObject*> GameManager::Ai

Vector of all the Ais in the current Level

◆ Fruits

std::vector<GameObject*> GameManager::Fruits

Vector of all the Fruits gameobjects in the level


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