#pragma once #include #include #include "AnimatedSprite.hpp" #include "IEntity.hpp" #include "Renderer.hpp" #include "Collider.hpp" #include "Voice.hpp" #include "Endthing.hpp" using namespace sf; #define HOPS 10 class Player: public AnimatedSprite, public IEntity { public: Player(); virtual ~Player(); void update(float dt) override; void announce(float dist) { static bool trig_fuck = false; static float scare = 0.f; //Log(DEBUG, ) if (!trig_fuck && dist < 300.f) { m_voice.addLine("data/nem/what3.wav", 0.f); m_voice.addSubtitle(0.f, 1.f, "What was that?"); trig_fuck = true; } if (dist < 300.f) { scare += 300.f - dist; } if (scare > 12000.f && m_voice.isFree()) { m_voice.addLine("data/nem/aaa" + std::to_string(rand() % 7 + 1) + ".wav", 0.5f, true); m_voice.addSubtitle(0.5f, 0.5f, "!?"); scare = 0.f; } } void cheat() { m_cheat = true; } sf::Vector2f getSpawnerPosition() { return m_end.getPosition(); } private: Collider m_collider; Voice m_voice; float m_ms; sf::Clock m_intro_clock; AnimatedSprite m_notnem; Endthing m_end; sf::Sound m_brown; bool m_cheat{ false }; };