aboutsummaryrefslogtreecommitdiff
path: root/src/includes
diff options
context:
space:
mode:
authoraleksav013 <aleksav013@gmail.com>2021-06-05 19:11:51 +0200
committeraleksav013 <aleksav013@gmail.com>2021-06-05 19:11:51 +0200
commit36fdc5a7001f464b00f003f67fb6e886ed32c60b (patch)
tree43f7a74ecaaf2ed842a22d463ff6ebca4bd96438 /src/includes
parent2002db81a90af09ebc281b8f54f7f2544b92780b (diff)
Grouping assets; Moving krug to Player
Diffstat (limited to 'src/includes')
-rw-r--r--src/includes/Game.hpp8
-rw-r--r--src/includes/Player.hpp2
-rw-r--r--src/includes/State.hpp4
3 files changed, 7 insertions, 7 deletions
diff --git a/src/includes/Game.hpp b/src/includes/Game.hpp
index a85d384..5b935a4 100644
--- a/src/includes/Game.hpp
+++ b/src/includes/Game.hpp
@@ -10,8 +10,8 @@
class Game
{
private:
- sf::Font font;
- sf::Texture *healthtex,*neprijateljtex;
+ std::map<std::string,sf::Font*> font;
+ std::map<std::string,sf::Texture*> tex;
float dt;
sf::Clock sat,time;
@@ -24,7 +24,6 @@ class Game
int visina,sirina;
sf::RenderWindow *prozor;
- sf::CircleShape krug;
sf::RectangleShape health,healthblank,stomp,stompblank;
sf::Text healthtext,stomptext,fps,score;
@@ -44,8 +43,7 @@ class Game
void initent();
void updatewin();
public:
- Game() {}
- Game(sf::RenderWindow *glprozor,sf::Font font,sf::Texture *neprijateljtex,sf::Texture *healthtex);
+ 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();
diff --git a/src/includes/Player.hpp b/src/includes/Player.hpp
index 3a2a040..ff094e9 100644
--- a/src/includes/Player.hpp
+++ b/src/includes/Player.hpp
@@ -9,6 +9,8 @@ class Player:public Entity
int stomprad=270;
float stomptime;
+ sf::CircleShape krug;
+
Player():Entity() {}
Player(sf::Vector2f pozicija,sf::Vector2f velicina,sf::Color boja);
void updatest(float dt);
diff --git a/src/includes/State.hpp b/src/includes/State.hpp
index 453939f..bcfb365 100644
--- a/src/includes/State.hpp
+++ b/src/includes/State.hpp
@@ -9,8 +9,8 @@ class State
int visina,sirina;
bool ischanged=0,newgame=0,pause=0,kraj=0;
- sf::Font font;
- sf::Texture healthtex,neprijateljtex;
+ std::map<std::string,sf::Font*> font;
+ std::map<std::string,sf::Texture*> tex;
sf::RectangleShape podloga;
sf::Text pausetext,krajtext;