From dbe41a2f77774ee716d3ff45db766d6400970f57 Mon Sep 17 00:00:00 2001 From: aleksav013 Date: Tue, 1 Jun 2021 21:03:32 +0200 Subject: Splitting code; Creating Makefile --- src/includes/Game.hpp | 54 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 src/includes/Game.hpp (limited to 'src/includes/Game.hpp') 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 nep1; + std::vector nep2; + std::vector nep3; + std::vector 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 -- cgit v1.2.3