Question: In the following code what does the line bool gotKey = m_controller->getLastKey(value); do? Is it setting the value of m_controller to the last key the
In the following code what does the line bool gotKey = m_controller->getLastKey(value); do? Is it setting the value of m_controller to the last key the user entered or something else?
#include "GameWorld.h"
#include "GameController.h"
#include
#include
using namespace std;
bool GameWorld::getKey(int& value)
{
bool gotKey = m_controller->getLastKey(value);
if (gotKey)
{
if (value == 'q' || value == '\x03') // CTRL-C
m_controller->quitGame();
}
return gotKey;
}
void GameWorld::playSound(int soundID)
{
m_controller->playSound(soundID);
}
void GameWorld::setGameStatText(string text)
{
m_controller->setGameStatText(text);
}
void GameWorld::setMsPerTick(int ms_per_tick)
{
m_controller->setMsPerTick(ms_per_tick);
}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
