This commit is contained in:
h4570
2022-07-30 14:48:59 +02:00
parent 52a19f11a5
commit b7b32fb35a
25 changed files with 792 additions and 21 deletions
+46
View File
@@ -0,0 +1,46 @@
/*
# ______ ____ ___
# | \/ ____| |___|
# | | | \ | |
#-----------------------------------------------------------------------
# Copyright 2022, tyra - https://github.com/h4570/tyra
# Licenced under Apache License 2.0
# Sandro Sobczyński <sandro.sobczynski@gmail.com>
*/
#include "states/intro/intro_state.hpp"
#include "file/file_utils.hpp"
#include "debug/debug.hpp"
#include "states/intro/states/intro_ps2dev_state.hpp"
#include "states/intro/states/intro_tyra_state.hpp"
#include "states/intro/states/intro_war_info_state.hpp"
using Tyra::FileUtils;
namespace Demo {
IntroState::IntroState(Engine* t_engine)
: State(t_engine), stateManager(STATE_PS2DEV) {
state = STATE_INTRO;
_wantFinish = false;
}
IntroState::~IntroState() {}
void IntroState::onStart() {
engine->audio.loadSong(FileUtils::fromCwd("intro/intro.wav"));
engine->audio.setSongLoop(false);
engine->audio.setSongVolume(80);
engine->audio.playSong();
stateManager.add(new IntroPs2DevState(engine));
stateManager.add(new IntroTyraState(engine));
stateManager.add(new IntroWarInfoState(engine));
}
void IntroState::update() { stateManager.update(); }
GlobalStateType IntroState::onFinish() { return STATE_EXIT; }
} // namespace Demo