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/Entity.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 src/Entity.cpp (limited to 'src/Entity.cpp') diff --git a/src/Entity.cpp b/src/Entity.cpp new file mode 100644 index 0000000..cc9f418 --- /dev/null +++ b/src/Entity.cpp @@ -0,0 +1,19 @@ +#include"includes/Global.hpp" +#include"includes/Entity.hpp" +Entity::Entity(sf::Vector2f pozicija, sf::Vector2f velicina,sf::Color boja) +{ + telo.setSize(velicina); + telo.setFillColor(boja); + telo.setOrigin(sf::Vector2f(telo.getSize().x/2,telo.getSize().y/2)); + x=pozicija.x; + y=pozicija.y; +} +void Entity::respawn(int sirina,int visina) +{ + if(!ziv) + { + x=Global::rng()%sirina; + y=Global::rng()%visina; + ziv=1; + } +} -- cgit v1.2.3