#include <IntroState.h>
Public Member Functions | |
| IntroState (sf::RenderWindow &window) | |
| Constructors/Destructors. | |
| ~IntroState () | |
| void | update (sf::RenderWindow &window, StateManager &stateManager) override |
| Handles animations in current state, look at chapterOne state. | |
| void | render (sf::RenderWindow &window) override |
| Renders current state. | |
Public Member Functions inherited from State | |
| virtual | ~State () |
| IntroState::IntroState | ( | sf::RenderWindow & | window | ) |
Constructors/Destructors.
Create an instance of SceneClass with the paths to the image files and the text Note that I want to have a text file reader that reads a text file and each line of the text file has all 3 parameters on one line and it takes whats written in the text file (first 3 words) and uses that as the input for the parameters The text file reader would move line by line everytime we hit enter and that will update the scene everytime we hit enter that means we would need a function in our class that lets us update each parameter which we will implement later.
Constructor/Destructor Use the constructor as you would in Main.cpp
initalize scene class
when the state is created read from text file
initalizes the starting scene
Add textures to texture vector
push blank textture
push path to texture
load texture
don't change this, i need Slot at the back of the vector
push blank sprites because player inventory isnt created yet, so dk what each sprite will be yet
points to null
| IntroState::~IntroState | ( | ) |
clears scene pointers from memory
|
overridevirtual |
Renders current state.
Call our update function
Clear the window
Draw the scene
Display the updated window contents
Implements State.
|
overridevirtual |
Handles animations in current state, look at chapterOne state.
Mandotory code to make sure the pause menu accessable
Stop any playing music
point to next state
point to textures vector
point to sprites vector
point to filepaths vector
push pointer to next state
Check if you can go to the next scene
if the scene is not done you are able to display the text instantly else go to the next scene(if both are done go to the next state)
Checks if user click enter to skip the text animation
gets the next scene(because the first scene auto displays at the start)
go to next state
Stop music
point to next state
point to textures vector
point to sprites vector
point to filepaths vector
push pointer to next state
Implements State.