EchoesOfFate
A game for our COMP315 Project
 
Loading...
Searching...
No Matches
SceneClass.h
Go to the documentation of this file.
1#pragma once
2
3#include <SFML/Graphics.hpp>
4#include <string>
5#include <fstream>
6#include <SFML/Audio.hpp>
7
8using namespace sf;
9
11typedef struct
12{
13 std::string background;
14 std::string character;
15 std::string displayText;
16 std::string music;
18
20{
21 private:
22 float maxWindowWidth = 800.f;
23 float maxWindowHeight = 600.f;
24 Texture texture1;
25 Texture texture2;
26 Sprite background;
27 Sprite sprite;
28 Text text;
29 Font font;
30 std::string fullText;
31 std::string displayedText;
32 Clock typewriterClock;
33 float typingSpeed;
34 Music m;
35 std::string music;
36 bool sceneDone = false;
37 bool mainBoss = false;
38 std::vector<SceneParameters*> scenes;
39 std::vector<std::string> converstations;
40 int sceneTracker = 0;
41
42 public:
43 SceneClass(float speed = 0.05f);
44 SceneClass(std::string imageFile, std::string musicFile);
45 void update();
46 void handleInput(Event event);
47 void draw(RenderWindow& window);
48 void draw(RenderWindow& window, bool bg);
49 void playMusic();
50 void stopMusic();
51 bool isSceneDone();
52 std::string formatText(std::string currentText);
53 void updateBackground(std::string newBackground);
54 void updateChracter(std::string newCharacter);
55 void updateDisplayText(std::string newText);
56 void updateMusic(std::string newMusic);
57 std::vector<SceneParameters*> getScenes();
58 void textFileReader(std::string fileName);
59 std::vector<std::string> split(std::string line, char delimiter);
60 int getCurrentScene();
61 void updateSceneTracker();
62};
int getCurrentScene()
splits string with a delimiter
Definition SceneClass.cpp:309
void playMusic()
Definition SceneClass.cpp:118
void updateMusic(std::string newMusic)
Definition SceneClass.cpp:157
void handleInput(Event event)
Definition SceneClass.cpp:47
std::string formatText(std::string currentText)
Definition SceneClass.cpp:169
void updateSceneTracker()
gets the current scene from textfile vector
Definition SceneClass.cpp:313
void textFileReader(std::string fileName)
Takes in a file name of a file in the assets folder(file extention not needed in file name)(HELPER)
Definition SceneClass.cpp:261
bool isSceneDone()
Definition SceneClass.cpp:165
std::vector< std::string > split(std::string line, char delimiter)
reads text files and stores it in a scenes vector
Definition SceneClass.cpp:236
void updateDisplayText(std::string newText)
Definition SceneClass.cpp:151
SceneClass(float speed=0.05f)
tracks what scene is being displayed from the textfile vector
Definition SceneClass.cpp:18
void updateChracter(std::string newCharacter)
Definition SceneClass.cpp:134
void stopMusic()
Definition SceneClass.cpp:124
void update()
Definition SceneClass.cpp:30
std::vector< SceneParameters * > getScenes()
Definition SceneClass.cpp:64
void updateBackground(std::string newBackground)
Definition SceneClass.cpp:129
void draw(RenderWindow &window)
Definition SceneClass.cpp:69
Constuctor parameters to read from textfile.
Definition SceneClass.h:12
std::string character
Definition SceneClass.h:14
std::string background
Definition SceneClass.h:13
std::string music
Definition SceneClass.h:16
std::string displayText
Definition SceneClass.h:15