aboutsummaryrefslogtreecommitdiff
path: root/src/includes/Game.hpp
blob: b04b1c364856bdfc2c5e62040a981da6eb1ad57b (plain)
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
#ifndef GAME_H
#define GAME_H

#include"Player.hpp"
#include"Enemy1.hpp"
#include"Enemy2.hpp"
#include"Enemy3.hpp"
#include"Powerup.hpp"

class Game
{
    private:
	std::map<std::string,sf::Font*> font;
	std::map<std::string,sf::Texture*> tex;
	float dt;
	sf::Clock sat,time;

	Player igrac;
	std::vector<Enemy1> nep1;
	std::vector<Enemy2> nep2;
	std::vector<Enemy3> nep3;
	std::vector<Powerup> pow;

	int visina,sirina;
	sf::RenderWindow *prozor;
	
	sf::RectangleShape health,healthblank,stomp,stompblank;
	sf::Text healthtext,stomptext,fps,score;

	void keyboard();
	void run();
	void stompmain();

	void updateui();
	void updatedt();
	void respawn();
	void position();
	void checkcollision();

	void initshapes();
	void initui();
	void inittex();
	void pwptex();
	void initent();
	void updatewin();
    public:
	Game();
	Game(sf::RenderWindow *glprozor,std::map<std::string,sf::Font*> mainfont,std::map<std::string,sf::Texture*> maintex);
	void loop(bool ischanged,bool pause);
	void draw();
	bool gameover();
};

#endif