void Scene_Title::CreateCommandWindow() { // Create Options Window std::vector<std::string> options; options.push_back(Data::terms.new_game); options.push_back(Data::terms.load_game); options.push_back(Data::terms.exit_game); command_window.reset(new Window_Command(options)); if (!Player::hide_title_flag) { command_window->SetX(SCREEN_TARGET_WIDTH / 2 - command_window->GetWidth() / 2); command_window->SetY(SCREEN_TARGET_HEIGHT * 53 / 60 - command_window->GetHeight()); } else { command_window->SetX(SCREEN_TARGET_WIDTH / 2 - command_window->GetWidth() / 2); command_window->SetY(SCREEN_TARGET_HEIGHT / 2 - command_window->GetHeight() / 2); } // Enable load game if available continue_enabled = CheckContinue(); if (continue_enabled) { command_window->SetIndex(1); } else { command_window->DisableItem(1); } // Set the number of frames for the opening animation to last if (!Player::hide_title_flag) { command_window->SetOpenAnimation(8); } command_window->SetVisible(false); }
// Loop based on user input void Game::GameLoop() { char key = NULL; do { instance->player->ReadyPlayerForGame(instance->diceFactory); // Run Game instance->PlayAGame(); // Draw Result DrawScreen(); } while (CheckContinue()); }
void Scene_Title::CreateCommandWindow() { // Create Options Window std::vector<std::string> options; options.push_back(Data::terms.new_game); options.push_back(Data::terms.load_game); options.push_back(Data::terms.exit_game); command_window.reset(new Window_Command(options)); command_window->SetX(160 - command_window->GetWidth() / 2); command_window->SetY(224 - command_window->GetHeight()); // Enable load game if available continue_enabled = CheckContinue(); if (continue_enabled) { command_window->SetIndex(1); } else { command_window->DisableItem(1); } // Set the number of frames for the opening animation to last command_window->SetOpenAnimation(32); command_window->SetVisible(false); }