aboutsummaryrefslogtreecommitdiffstats
path: root/src/entity.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/entity.cpp')
-rw-r--r--src/entity.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/entity.cpp b/src/entity.cpp
new file mode 100644
index 0000000..af93f36
--- /dev/null
+++ b/src/entity.cpp
@@ -0,0 +1,16 @@
+#include "enemy.hpp"
+
+Entity::Entity(void)
+{
+ posX = GetRandomValue(0, SCREENWIDTH);
+ posY = GetRandomValue(0, SCREENHEIGHT);
+ if (static_cast<int>(posX) & 1)
+ {
+ direction = (Vector2){posX / 100, -posY / 100};
+ } else {
+ direction = (Vector2){-posX / 100, posY / 100};
+ }
+
+}
+
+Entity::~Entity() {}