-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLevel.hpp
60 lines (49 loc) · 1.08 KB
/
Level.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
//
// Created by iMer on 22.08.2015.
//
#ifndef LD33_LEVEL_HPP
#define LD33_LEVEL_HPP
#include <Engine/Scene.hpp>
#include <SFML/Audio/Sound.hpp>
class Level: public engine::Scene {
public:
struct Object {
float chance;
std::string script;
};
void GameOver();
void PowerUp(uint8_t type);
protected:
std::vector<Object> m_objects;
float m_spawnTimer;
uint32_t m_score;
bool m_over;
engine::Node* m_objectNode;
float m_rainbowTime;
bool m_speed;
float m_speedTime;
float m_healthTime;
float m_doubleTime;
bool m_paused;
sf::Sound* m_backgroundMusic;
sf::Sound *m_powerUpSound;
sf::Sound *m_gameoverSound;
engine::util::EventHandler<const sf::Event::KeyEvent&>* m_keyDown;
float m_scoreAdd;
float m_zigzagTime;
bool m_zig;
engine::Node *m_mouse;
public:
Level(engine::Game * game);
~Level();
virtual bool initialize(Json::Value& root);
void AddScore(uint32_t score);
virtual void update(sf::Time interval);
virtual void OnInitializeDone();
bool IsPaused() {
return m_paused;
}
protected:
virtual void OnUpdate(sf::Time interval);
};
#endif //LD33_LEVEL_HPP