Commit 541cb824 authored by Konrad McClure's avatar Konrad McClure

Fixes on the main menu

parent 51a81155
......@@ -85,7 +85,7 @@ void C2048GameState::Update(CGameEngine* game)
game2048->Shift(input);
if (!game2048->addNumber()) {
game->Quit();
game->PopState();
}
}
......
......@@ -26,8 +26,10 @@ void CMainMenuState::Init()
menuOptions.push_back("Snake");
menuOptions.push_back("Quit");
// Set name for debugging
stateName = "MainMenuState";
// Set first input and draw the menu
input = ' ';
Draw(nullptr);
}
......@@ -119,6 +121,8 @@ void CMainMenuState::Draw(CGameEngine* game)
}
}
cout << "\n\n\n" << "Press w and s to move up and down, d to select" << endl;
system("stty raw");
}
......@@ -8,39 +8,39 @@ CSnakeState CSnakeState::m_SnakeState;
void CSnakeState::Init()
{
cout << " SnakeState Init" << endl;
stateName = "SnakeState";
// cout << " SnakeState Init" << endl;
// stateName = "SnakeState";
}
void CSnakeState::Pause()
{
cout << " SnakeState Pause" << endl;
// cout << " SnakeState Pause" << endl;
}
void CSnakeState::Resume()
{
cout << " SnakeState Resume" << endl;
// cout << " SnakeState Resume" << endl;
}
void CSnakeState::Cleanup()
{
cout << " SnakeState Cleanup" << endl;
// cout << " SnakeState Cleanup" << endl;
}
void CSnakeState::HandleEvents(CGameEngine* game)
{
cout << " SnakeState Handle Events" << endl;
// cout << " SnakeState Handle Events" << endl;
}
void CSnakeState::Update(CGameEngine* game)
{
cout << " SnakeState Update" << endl;
game->ChangeState(C2048GameState::Instance());
// cout << " SnakeState Update" << endl;
while (game->input != 'd') {}
game->PopState();
}
void CSnakeState::Draw(CGameEngine* game)
{
cout << " SnakeState Draw" << endl;
// cout << " SnakeState Draw" << endl;
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment