aboutsummaryrefslogtreecommitdiff
path: root/src/includes/Game.hpp
diff options
context:
space:
mode:
authoraleksav013 <aleksav013@gmail.com>2021-06-01 21:03:32 +0200
committeraleksav013 <aleksav013@gmail.com>2021-06-01 21:03:32 +0200
commitdbe41a2f77774ee716d3ff45db766d6400970f57 (patch)
treeec86f7305bcb2d3eec37bf8e123cb901f80a5a5d /src/includes/Game.hpp
parent82d49a6825af009d950b3a6c18d609da2ef8486c (diff)
Splitting code; Creating Makefile
Diffstat (limited to 'src/includes/Game.hpp')
-rw-r--r--src/includes/Game.hpp54
1 files changed, 54 insertions, 0 deletions
diff --git a/src/includes/Game.hpp b/src/includes/Game.hpp
new file mode 100644
index 0000000..4418ab3
--- /dev/null
+++ b/src/includes/Game.hpp
@@ -0,0 +1,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 draw();
+ void stompmain();
+
+ void updateui();
+ void updatedt();
+ bool gameover();
+ void respawn();
+ void position();
+ void checkcollision();
+
+ void initshapes();
+ void initui();
+ void inittex();
+ void initent();
+ void updatewin();
+ public:
+ Game() {}
+ Game(sf::RenderWindow *glprozor);
+ void loop(bool ischanged,bool pause);
+};
+
+#endif