Game Development Reference
In-Depth Information
switch (selectedOption)
{
case PlayerOptions::GoEast:
{
directionToMove = Room::JoiningDirections::East;
}
break;
case PlayerOptions::GoSouth:
{
directionToMove = Room::JoiningDirections::South;
}
break;
case PlayerOptions::GoWest:
{
directionToMove = Room::JoiningDirections::West;
}
break;
}
const Room* pPlayerCurrentRoom = m_player.GetCurrentRoom();
const Room* pNewRoom = pPlayerCurrentRoom->GetRoom(directionToMove);
if (pNewRoom != nullptr)
{
m_player.SetCurrentRoom(pNewRoom);
}
else
{
const char* strDirection = "North";
switch (selectedOption)
{
case PlayerOptions::GoEast:
{
strDirection = "East";
}
break;
case PlayerOptions::GoSouth:
{
strDirection = "South";
}
break;
case PlayerOptions::GoWest:
{
strDirection = "West";
}
break;
}
Search WWH ::




Custom Search