-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgame.hpp
More file actions
45 lines (40 loc) · 1.1 KB
/
game.hpp
File metadata and controls
45 lines (40 loc) · 1.1 KB
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
#pragma once
#include <kvf/time.hpp>
#include <le2d/drawable/shape.hpp>
#include <le2d/event.hpp>
#include <le2d/renderer.hpp>
#include <le2d/service_locator.hpp>
#include <cstddef>
#include "enemy.hpp"
#include "le2d/drawable/text.hpp"
#include "le2d/font.hpp"
#include "lighhouse.hpp"
#include "light.hpp"
namespace miracle {
class Game {
public:
explicit Game(gsl::not_null<le::ServiceLocator const*> services);
void on_cursor_pos(le::event::CursorPos const& cursor_pos);
void tick(kvf::Seconds dt);
void render(le::Renderer& renderer) const;
void update_score(int points);
void update_health_text();
void spawn_wave();
private:
gsl::not_null<le::ServiceLocator const*> m_services;
Lighthouse m_lighthouse;
Light m_light;
le::Font m_font{};
le::drawable::Text m_score_text{};
le::drawable::Text m_health_text{};
int m_score{};
std::string m_score_str;
std::string m_health_str;
glm::vec2 m_cursor_pos{};
std::size_t m_wave_count{};
bool m_running{true};
kvf::Seconds m_wave_interval{};
kvf::Seconds m_time_since_last_wave_spawn{};
std::vector<Enemy> m_enemies{};
};
} // namespace miracle