bool MenuState::onEnter() { StateParser stateParser; stateParser.parseState("values.xml", s_menuID, &m_gameObjects, &m_textureIDList); m_callbacks.push_back(0); //pushback 0 callbackID start from 1 m_callbacks.push_back(s_menuToPlay); m_callbacks.push_back(s_exitFromMenu); // set the callbacks for menu items setCallbacks(m_callbacks); /*if (!TextureManager::Instance()->load("buttonexit.bmp", "exit", Game::Instance()->getRenderer())) { return false; } if (!TextureManager::Instance()->load("buttonstart.bmp", "start", Game::Instance()->getRenderer())) { return false; } GameObject *bStart = TheGameObjectFactory->CreateGameObject("MenuButton"); bStart = new MenuButton(new LoaderParams(200, 200, 201, 72, 3, "start"), s_menuToPlay); m_gameObjects.push_back(bStart); GameObject *bExit = TheGameObjectFactory->CreateGameObject("MenuButton"); bExit = new MenuButton(new LoaderParams(200, 300, 201, 72, 3, "exit"), s_exitFromMenu); m_gameObjects.push_back(bExit); */ return true; }
bool PlayState::onEnter() { StateParser stateParser; stateParser.parseState("text.xml", s_playID, &m_gameObjects, &m_textureIDList); std::cout << "entering PlayState\n"; return true; }
bool GameOverState::onEnter() { StateParser stateParser; stateParser.parseState("values.xml", s_pauseID, &m_gameObjects, &m_textureIDList); m_callbacks.push_back(0); //pushback 0 callbackID start from 1 m_callbacks.push_back(s_resumePlay); m_callbacks.push_back(s_overToMain); // set the callbacks for menu items setCallbacks(m_callbacks); SoundManager::Instance()->playMusic("over_music", 0); return true; }
bool PlayState::onEnter() { LevelParser levelParser; pLevel = levelParser.parseLevel("assets/space_tilemap.tmx"); // Parse the states file StateParser stateParser; stateParser.parseState("assets/states-config.xml", s_playID, &m_gameObjects, &m_textureIDList); std::cout << "Entering PlayState" << std::endl; return true; }
bool PauseState::onEnter() { StateParser stateParser; stateParser.parseState("test.xml", s_pauseID, &m_gameObjects, &m_textureIDList); m_callbacks.push_back(0); m_callbacks.push_back(s_pauseToMain); m_callbacks.push_back(s_resumePlay); setCallbacks(m_callbacks); return true; }
bool MainMenuState::onEnter() { cout << "MenuState onEnter" << '\n'; StateParser stateParser; stateParser.parseState("assets/attack.xml",s_menuID,&m_gameObjects,&m_textureIDList); m_callbacks.push_back(0); m_callbacks.push_back(s_menuToPlay); m_callbacks.push_back(s_exitFromMenu); setCallbacks(m_callbacks); return true; }
bool MainMeneState::onEnter() { StateParser stateParser; stateParser.parseState("text.xml", s_menuID, &m_gameObjects, &m_textureIDList); m_callbacks.push_back(0); m_callbacks.push_back(s_menuToPlay); m_callbacks.push_back(s_exitFromMenu); setCallbacks(m_callbacks); std::cout << "entering MenuState\n"; return true; }
bool AboutState::onEnter() { StateParser stateParser; stateParser.parseState("resources/data.json", s_aboutID, &m_gameObjects, &m_textureIDList, &m_fontIDList); if (!MenuState::onEnter()) { return false; } initCallbacks(); std::cout << "entering AboutState\n"; return true; }
bool PauseState::onEnter() { // Parse the states file StateParser stateParser; stateParser.parseState("assets/states-config.xml", s_pauseID, &m_gameObjects, &m_textureIDList); m_callbacks.push_back(NULL); m_callbacks.push_back(s_pauseToMain); m_callbacks.push_back(s_resumePlay); setCallbacks(m_callbacks); std::cout << "Entering PauseState" << std::endl; return true; }
bool GameOverState::onEnter() { StateParser stateParser; stateParser.parseState("./Data/Tiny.xml", s_gameOverID, &m_gameObjects, &m_TextureIDList); m_callbacks.push_back(0); m_callbacks.push_back(s_menuTOMain); setCallbacks(m_callbacksID); std::cout << "Entrada al menuState\n"; return true; }
bool PauseState::onEnter() { StateParser stateParser; stateParser.parseState(DATA_PREFIX "attack.xml", s_pauseID, &m_gameObjects, &m_textureIDList); m_callbacks.push_back(0); m_callbacks.push_back(s_pauseToMain); m_callbacks.push_back(s_resumePlay); setCallbacks(m_callbacks); m_loadingComplete = true; std::cout << "entering PauseState\n"; return true; }
bool MainMenuState::onEnter() { // parse the state StateParser stateParser; stateParser.parseState(DATA_PREFIX "conan.xml", s_menuID, &m_gameObjects, &m_textureIDList); m_callbacks.push_back(0); m_callbacks.push_back(s_menuToPlay); m_callbacks.push_back(s_exitFromMenu); // set the callbacks for menu items setCallbacks(m_callbacks); m_loadingComplete = true; std::cout << "entering MenuState\n"; return true; }
bool MenuState::onEnter(){ StateParser stateParser; stateParser.parseState("tiny.xml", s_menuID, &m_gameObjects, &m_textureIDList); m_callbacks.push_back(0); m_callbacks.push_back(s_menuToPlay); m_callbacks.push_back(s_exitFromMenu); setCallbacks(m_callbacks); return true; }
bool MenuState::onEnter() { SoundManager::Instance()->playMusic("SongMenu", -1); SDL_Renderer* render; render = Game::Instance()->getRender(); SDL_SetRenderDrawColor(render, 255, 229, 204, 255); Game::Instance()->setRender(render); // parse the state StateParser stateParser; stateParser.parseState("assets/images.xml", s_menuID, &m_gameObjectsMenuState, &m_textureIDList); m_callbacksMenu.push_back(0); //pushback 0 callbackID start from 1 m_callbacksMenu.push_back(s_menuToPlay); m_callbacksMenu.push_back(s_exitFromMenu); // set the callbacks for menu items setCallbacks(m_callbacksMenu); return true; }
bool MenuState::onEnter() { if (!TextureManager::Instance()->load("play.bmp", "play", Game::Instance()->getRender())) { return false; } if (!TextureManager::Instance()->load("exit.bmp", "exit", Game::Instance()->getRender())) { return false; } StateParser stateParser; stateParser.parseState("XMLFile.xml", s_menuID, &m_gameObjects, &m_textureIDList); m_callbacks.push_back(0); //El primero vacío m_callbacks.push_back(s_menuToPlay); m_callbacks.push_back(s_exitFromMenu); setCallbacks(m_callbacks); return true; }
bool PlayState::onEnter() { StateParser stateParser; stateParser.parseState("./Data/Tiny.xml", s_playID, &m_gObjects, &m_TextureIDList); LevelParser levelParser; pLevel = levelParser.parseLevel("./Data/mapaObjetos.tmx"); //layerParser.parseTileLayer("./Data/mapa1.tmx"); m_callbacks.push_back(0); setCallbacks(); SoundManager::Instance()->playMusic("play", -1); /*player = new Player(); zep = new Zep(); gordo = new Gordo(); TextureManager::Instance()->load("Kirby.bmp", "player", Game::Instance()->getRender()); TextureManager::Instance()->load("ZepS.bmp", "zep", Game::Instance()->getRender()); TextureManager::Instance()->load("GordoS.bmp", "gordo", Game::Instance()->getRender()); load = new LoaderParams(100, 100, 35, 32,10, "player",0); load2 = new LoaderParams(200, 200, 89, 78,4, "zep",0); load3 = new LoaderParams(400, 300, 50, 70,4, "gordo", 0); player->load(load); m_gObjects.push_back(player); zep->load(load2); m_gObjects.push_back(zep); gordo->load(load3); m_gObjects.push_back(gordo);*/ return true; }