-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathlevel_state.hpp
66 lines (54 loc) · 1.29 KB
/
level_state.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#pragma once
#include "state.hpp"
#include "bitmap_text.hpp"
#include "infiltrator.hpp"
#include "orb.hpp"
#include "lever.hpp"
#include "beat_block.hpp"
#include <SFML/Graphics.hpp>
#include <SFML/Audio.hpp>
#include <vector>
class LevelState : public State {
public:
LevelState(int level, bool skipIntro = false);
~LevelState();
void init();
void gotEvent(sf::Event event);
void update(sf::Time elapsed);
void render(sf::RenderWindow &window);
bool checkCollision(sf::Vector2f position, int width, int height);
bool isMetal(sf::Vector2f position);
private:
void setupLevel();
void calculateVolume();
void setVolume(float volume);
void setSection(int section);
int level = 0;
int section = 1;
float volume = 0;
float alert = 0;
int gameState = 0;
float gameTimer = 2;
int bpm = 130;
float beatCounter = 0;
int beat = 0;
sf::Sprite elevator;
BitmapText floorDisplay;
sf::Sprite levelSprite;
sf::Image levelMask;
Infiltrator player;
Orb orb;
std::vector<Lever*> levers;
std::vector<BeatBlock*> blocks;
sf::Sprite hud;
sf::Sprite ambientBar;
sf::Sprite personalBar;
sf::Sprite alertOverlay;
BitmapText pauseOverlay;
sf::Sound elevatorSound;
sf::Sound doorSound;
sf::Sound alertSound;
sf::Sound completeSound;
std::vector<sf::Music*> music;
sf::Music staticMusic;
};