TheCOSCGameProject  1.0
Functions
menu.cpp File Reference

Implementation of the Valeris game menu system. More...

#include "../lib/toolkit.h"
#include "../lib/dependencies.h"
#include "../lib/dungeon.h"
#include "../lib/menu.h"
#include "../lib/valerisgame.h"
#include <iomanip>
Include dependency graph for menu.cpp:

Functions

void displayIntro (int delayTime, const std::string &color)
 Display the game introduction. More...
 
void Displayj ()
 Display the Valeris game main menu. More...
 
void StartGame (const std::string &color)
 Start a new game of Valeris. More...
 
void LoadSavedGame ()
 Load a saved game. More...
 
void DisplayInstructionsText ()
 Display the game instructions. More...
 
std::string getColor (int colorChoice, const std::string &color)
 Get color from user for menu. More...
 
void Accessiblity (int &delayTime, std::string &color)
 Configure accessibility options. More...
 

Detailed Description

Implementation of the Valeris game menu system.

This file contains functions for displaying the game menu, handling user input, and configuring accessibility options.

Function Documentation

◆ Accessiblity()

void Accessiblity ( int &  delayTime,
std::string &  color 
)

Configure accessibility options.

Manages accessibility options.

Parameters
delayTimeReference to the delay time between printing each character.
colorReference to the color code for the text.

This function allows the player to adjust text speed and color for better accessibility. Changes are applied immediately, and the player can return to the main menu at any time.

◆ DisplayInstructionsText()

void DisplayInstructionsText ( )

Display the game instructions.

Displays the game instructions.

This function prints the instructions for playing the Valeris game and waits for the user to press Enter before clearing the screen.

◆ displayIntro()

void displayIntro ( int  delayTime,
const std::string &  color 
)

Display the game introduction.

Displays the introductory text for the game.

Parameters
delayTimeThe delay time between printing each character.
colorThe color code for the text.

The introduction is read from a file and printed with a delay and color for dramatic effect.

◆ Displayj()

void Displayj ( )

Display the Valeris game main menu.

Displays the game menu.

This function displays the main menu with options for starting a new game, loading a saved game, viewing instructions, adjusting accessibility settings, or exiting the game.

◆ getColor()

std::string getColor ( int  colorChoice,
const std::string &  color 
)

Get color from user for menu.

Parameters
colorChoicethe color choice the user chose.
colorReference to the old color code for the text.

This function allows the player to select and change the color of the text

◆ LoadSavedGame()

void LoadSavedGame ( )

Load a saved game.

Loads a saved game.

This function simulates loading a saved game. The actual loading functionality is not implemented.

◆ StartGame()

void StartGame ( const std::string &  color)

Start a new game of Valeris.

Starts a new game.

This function creates an instance of the ValerisGame class and begins the game.