123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- #pragma once
- #include <SFML/Graphics.hpp>
- #include <SFML/Audio.hpp>
- #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 };
- };
|