aboutsummaryrefslogtreecommitdiff
path: root/src/includes/Game.hpp
blob: a85d38495ac27ca9701118e5619eef74fce0ac56 (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:
	sf::Font font;
	sf::Texture *healthtex,*neprijateljtex;
	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::CircleShape krug;
	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 initent();
	void updatewin();
    public:
	Game() {}
	Game(sf::RenderWindow *glprozor,sf::Font font,sf::Texture *neprijateljtex,sf::Texture *healthtex);
	void loop(bool ischanged,bool pause);
	void draw();
	bool gameover();
};

#endif