aboutsummaryrefslogtreecommitdiff
path: root/src/Enemy3.cpp
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/Enemy3.cpp
parent82d49a6825af009d950b3a6c18d609da2ef8486c (diff)
Splitting code; Creating Makefile
Diffstat (limited to 'src/Enemy3.cpp')
-rw-r--r--src/Enemy3.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/Enemy3.cpp b/src/Enemy3.cpp
new file mode 100644
index 0000000..0ed8726
--- /dev/null
+++ b/src/Enemy3.cpp
@@ -0,0 +1,17 @@
+#include"includes/Global.hpp"
+#include"includes/Enemy3.hpp"
+float Enemy3::time=10;
+Enemy3::Enemy3(sf::Vector2f pozicija,sf::Vector2f velicina,sf::Color boja):Entity(pozicija,velicina,boja)
+{
+ vx=vy=500.0;
+}
+void Enemy3::izracunajpoz(float dt)
+{
+ x+=vx*dt;
+ y+=vy*dt;
+}
+void Enemy3::izracunajbrzinu(int sirina,int visina)
+{
+ if(x<0||x>sirina) vx=-vx;
+ if(y<0||y>visina) vy=-vy;
+}